提交代码
parent
e6cc6dbf52
commit
41f8cfcd35
|
@ -290,7 +290,8 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
|
|||
@GetMapping("/fileSign/{id}")
|
||||
public AjaxResult fileSign(@PathVariable("id") Long id)
|
||||
{
|
||||
return toAjax(proProjectInfoSubdeptsUsersService.fileSign(id));
|
||||
proProjectInfoSubdeptsUsersService.fileSign(id);
|
||||
return success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -172,4 +172,5 @@ public interface IProProjectInfoSubdeptsUsersService
|
|||
|
||||
Boolean findUserGroSign(Long id);
|
||||
|
||||
void fileSign(Long id);
|
||||
}
|
||||
|
|
|
@ -1243,4 +1243,85 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
return res+1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileSign(Long id){
|
||||
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(id);
|
||||
String filePath = proProjectInfoSubdeptsUsers.getEduFilePath().replace(ProfileConfig.profile, ProfileConfig.profilePath).replace("-g","").replace("-p","").replace("-c","");
|
||||
if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.LWGR.getCode()) || Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.TSGZ.getCode())){
|
||||
// 查询班组长签名
|
||||
if(proProjectInfoSubdeptsUsers.getSubDeptGroup()!=null){
|
||||
ProProjectInfoSubdeptsGroup group = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(proProjectInfoSubdeptsUsers.getSubDeptGroup());
|
||||
if(group!=null && StringUtils.isNotEmpty(group.getGroupLeaderPhone())){
|
||||
ProProjectInfoSubdeptsUsers userQuery = new ProProjectInfoSubdeptsUsers();
|
||||
userQuery.setUserPhone(group.getGroupLeaderPhone());
|
||||
userQuery.setProjectId(group.getProjectId());
|
||||
List<ProProjectInfoSubdeptsUsers> users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userQuery);
|
||||
if(StringUtils.isNotEmpty(users)){
|
||||
BasSignet query = new BasSignet();
|
||||
query.setProjectId(users.get(0).getProjectId());
|
||||
query.setUserId(users.get(0).getUserId());
|
||||
List<BasSignet> signets = basSignetMapper.selectBasSignetList(query);
|
||||
if(StringUtils.isNotEmpty(signets)){
|
||||
String newFilePath = filePath.replace(".pdf","-g.pdf");
|
||||
String signPath = signets.get(0).getSignetPath().replace(ProfileConfig.profile, ProfileConfig.profilePath);
|
||||
PdfImageSignetUtil.imageWaterMark(filePath, newFilePath, signPath, SignetKeyEnums.GROUP_SIGN.getCode());
|
||||
filePath = newFilePath;
|
||||
}else{
|
||||
throw new ServiceException("未查询到班组长签名信息...");
|
||||
}
|
||||
}else{
|
||||
throw new ServiceException("未查询到班组长签名信息...");
|
||||
}
|
||||
}else{
|
||||
throw new ServiceException("未查询到班组长签名信息...");
|
||||
}
|
||||
}else{
|
||||
throw new ServiceException("未查询到班组长签名信息...");
|
||||
}
|
||||
}
|
||||
|
||||
ProProjectInfoSubdeptsUsers userQuery = new ProProjectInfoSubdeptsUsers();
|
||||
userQuery.setWorkType(18L);
|
||||
userQuery.setProjectId(proProjectInfoSubdeptsUsers.getProjectId());
|
||||
List<ProProjectInfoSubdeptsUsers> users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userQuery);
|
||||
if(StringUtils.isNotEmpty(users)){
|
||||
BasSignet query = new BasSignet();
|
||||
query.setProjectId(users.get(0).getProjectId());
|
||||
query.setUserId(users.get(0).getUserId());
|
||||
List<BasSignet> signets = basSignetMapper.selectBasSignetList(query);
|
||||
if(StringUtils.isNotEmpty(signets)){
|
||||
String newFilePath = filePath.replace(".pdf","-p.pdf");
|
||||
String signPath = signets.get(0).getSignetPath().replace(ProfileConfig.profile, ProfileConfig.profilePath);
|
||||
PdfImageSignetUtil.imageWaterMark(filePath, newFilePath, signPath,SignetKeyEnums.PROJECT_SIGN.getCode());
|
||||
filePath = newFilePath;
|
||||
}else{
|
||||
throw new ServiceException("未查询安质部部长签名信息...");
|
||||
}
|
||||
}else {
|
||||
throw new ServiceException("未查询安质部部长签名信息...");
|
||||
}
|
||||
|
||||
ProProjectInfoSubdeptsUsers comUserQuery = new ProProjectInfoSubdeptsUsers();
|
||||
comUserQuery.setWorkType(101L);
|
||||
comUserQuery.setProjectId(proProjectInfoSubdeptsUsers.getProjectId());
|
||||
List<ProProjectInfoSubdeptsUsers> comUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(comUserQuery);
|
||||
if(StringUtils.isNotEmpty(comUsers)){
|
||||
BasSignet query = new BasSignet();
|
||||
query.setProjectId(comUsers.get(0).getProjectId());
|
||||
query.setUserId(comUsers.get(0).getUserId());
|
||||
List<BasSignet> signets = basSignetMapper.selectBasSignetList(query);
|
||||
if(StringUtils.isNotEmpty(signets)){
|
||||
String newFilePath = filePath.replace(".pdf","-c.pdf");
|
||||
String signPath = signets.get(0).getSignetPath().replace(ProfileConfig.profile, ProfileConfig.profilePath);
|
||||
PdfImageSignetUtil.imageWaterMark(filePath, newFilePath, signPath, SignetKeyEnums.COMPANY_SIGN.getCode());
|
||||
proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath.replace(ProfileConfig.profilePath,ProfileConfig.profile));
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}else{
|
||||
throw new ServiceException("未查询三级安全教育主管签名信息...");
|
||||
}
|
||||
}else{
|
||||
throw new ServiceException("未查询三级安全教育主管签名信息...");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue