认证清单-流程操作增加操作历史。

This commit is contained in:
wangzhijiang
2023-03-14 15:43:40 +08:00
parent f24e0db421
commit b7884dd28e
2 changed files with 139 additions and 8 deletions
@@ -59,6 +59,14 @@ public enum OperatorTypeEnum {
CERTIFICATION_INVENTORY_ADD("认证清单-添加","certificationInventoryAdd"),
CERTIFICATION_INVENTORY_CALL("认证清单-调取","certificationInventoryCall"),
CERTIFICATION_INVENTORY_STUDIO_ISSUE("认证清单-studio发布","certificationInventoryStudioIssue"),
CERTIFICATION_INVENTORY_INITIATING_TASK("认证清单-认证工程师发起任务","certificationInventoryInitiatingTask"),
CERTIFICATION_INVENTORY_RETURNED_STUDIO_TASK("认证清单-认证工程师退回至studio任务","certificationInventoryReturnedStudioTask"),
CERTIFICATION_INVENTORY_DUTY_PERSON_ACCEPT_TASK("认证清单-责任人接受任务","certificationInventoryDutyPersonAcceptTask"),
CERTIFICATION_INVENTORY_DUTY_PERSON_REJECT_TASK("认证清单-责任人拒绝任务","certificationInventoryDutyPersonRejectTask"),
CERTIFICATION_INVENTORY_DUTY_PERSON_TRANSFER_TASK("认证清单-责任人转办任务","certificationInventoryDutyPersonTransferTask"),
CERTIFICATION_INVENTORY_DUTY_PERSON_SUBMIT_TASK("认证清单-责任人提交任务","certificationInventoryDutyPersonSubmitTask"),
CERTIFICATION_INVENTORY_REVIEW_THROUGH("认证清单-认证工程师审核通过","certificationInventoryReviewThrough"),
CERTIFICATION_INVENTORY_REVIEW_RETURNED("认证清单-认证工程师审核退回","certificationInventoryReviewReturned"),
;
String name;
@@ -1101,9 +1101,22 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
throw new JeroBootException("至少选择一条数据流程状态为'结果待审查'的数据!");
}
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
String contentCn = "\"" + currentUser.getUsername() + "\"" +"审核退回";
String contentEn = "\"" + currentUser.getUsername() + "\"" +" review and returned";
ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO = new ProjectCertificationInventoryLogEO();
projectCertificationInventoryLogEO.setProjectCertificationInventoryId(projectCertificationInventoryEO.getId());
projectCertificationInventoryLogEO.setContentCn(contentCn);
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_REVIEW_RETURNED.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
}
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
@@ -1153,8 +1166,23 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
throw new JeroBootException("至少选择一条数据流程状态为'结果待审查'的数据!");
}
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
String contentCn = "\"" + currentUser.getUsername() + "\"" +"审核通过";
String contentEn = "\"" + currentUser.getUsername() + "\"" +" pass the audit";
ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO = new ProjectCertificationInventoryLogEO();
projectCertificationInventoryLogEO.setProjectCertificationInventoryId(projectCertificationInventoryEO.getId());
projectCertificationInventoryLogEO.setContentCn(contentCn);
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_REVIEW_THROUGH.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
}
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
@@ -1311,6 +1339,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
@@ -1320,6 +1349,19 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
processInfoDetailEO.setEndTime(projectCertificationInventoryEO.getEndTime());
processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId());
processInfoDetailEOList.add(processInfoDetailEO);
String contentCn = "\"" + currentUser.getUsername() + "\"" +"接受了任务信息";
String contentEn = "\"" + currentUser.getUsername() + "\"" +" accepts the task information";
ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO = new ProjectCertificationInventoryLogEO();
projectCertificationInventoryLogEO.setProjectCertificationInventoryId(projectCertificationInventoryEO.getId());
projectCertificationInventoryLogEO.setContentCn(contentCn);
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_DUTY_PERSON_ACCEPT_TASK.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
}
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
try {
@@ -1381,8 +1423,23 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
throw new JeroBootException("该项目中认证工程师为空,请先维护认证工程师!");
}
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue());
String contentCn = "\"" + currentUser.getUsername() + "\"" +"退回了任务信息";
String contentEn = "\"" + currentUser.getUsername() + "\"" +" returned the task information";
ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO = new ProjectCertificationInventoryLogEO();
projectCertificationInventoryLogEO.setProjectCertificationInventoryId(projectCertificationInventoryEO.getId());
projectCertificationInventoryLogEO.setContentCn(contentCn);
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_DUTY_PERSON_REJECT_TASK.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
}
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
try {
@@ -1479,12 +1536,28 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Collections.sort(projectCertificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
return p1.getEndTime().compareTo(p2.getEndTime());
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue());
String contentCn = "\"" + currentUser.getUsername() + "\"" +"拒绝,流程退回至" + "\"" +studioEngineerUserInfo.get(0).getUsername()+"\"";
String contentEn = "\"" + currentUser.getUsername() + "\"" +" refuses, and the process returns to " + "\"" +studioEngineerUserInfo.get(0).getUsername()+"\"";
ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO = new ProjectCertificationInventoryLogEO();
projectCertificationInventoryLogEO.setProjectCertificationInventoryId(projectCertificationInventoryEO.getId());
projectCertificationInventoryLogEO.setContentCn(contentCn);
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_RETURNED_STUDIO_TASK.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
}
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
Map<String, Object> standNameAndItemName = this.getStandNameAndItemName(projectCertificationInventoryEOList);
@@ -1507,7 +1580,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Collections.sort(projectCertificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
return p1.getEndTime().compareTo(p2.getEndTime());
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
Date endTime = projectCertificationInventoryEOList.get(0).getEndTime();
@@ -1553,6 +1629,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.isEmpty(ids)){
throw new JeroBootException("至少选择一条数据进行操作!");
}
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> idList = Arrays.asList(ids.split(","));
List<String> flowStatusList = new ArrayList<>();
@@ -1574,6 +1651,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
try {
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
// 给责任人分配待办中心的任务
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
@@ -1584,6 +1662,19 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
processInfoDetailEO.setEndTime(projectCertificationInventoryEO.getEndTime());
processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId());
processInfoDetailEOList.add(processInfoDetailEO);
String contentCn = "\"" + currentUser.getUsername() + "\"" +"发起了Pre-Homo流程";
String contentEn = "The \"" + currentUser.getUsername() + "\"" +" initiates the Pre-Homo process";
ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO = new ProjectCertificationInventoryLogEO();
projectCertificationInventoryLogEO.setProjectCertificationInventoryId(projectCertificationInventoryEO.getId());
projectCertificationInventoryLogEO.setContentCn(contentCn);
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_INITIATING_TASK.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
}
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.ZRRJSRW.getKey());
@@ -1659,7 +1750,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Collections.sort(projectCertificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
return p1.getEndTime().compareTo(p2.getEndTime());
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
@@ -1729,7 +1823,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Collections.sort(projectCertificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
return p1.getEndTime().compareTo(p2.getEndTime());
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
Date endTime = projectCertificationInventoryEOList.get(0).getEndTime();
@@ -1778,6 +1875,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
String projectLibraryId = json.getString("projectLibraryId");
String transferUserId = json.getString("transferUserId");
SysUser transferUserInfo = this.sysUserService.getById(transferUserId);
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId);
if(ObjectUtils.isEmpty(projectLibraryBase)){
throw new JeroBootException("无法获取项目库信息,项目库id为:" + projectLibraryId + " 请联系管理员!");
@@ -1804,15 +1903,33 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
throw new JeroBootException("至少选择一条数据流程状态为'任务待确认 或 结果待提交 或 审查退回'的数据进行转办操作!");
}
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
projectCertificationInventoryEOList.forEach(certificationInventory -> {
certificationInventory.setDutyPerson(transferUserId);
String contentCn = "\"" + currentUser.getUsername() + "\"" +"将流程发送至" +"\""+ transferUserInfo.getUsername() + "\"办理" ;
String contentEn = "\"" + currentUser.getUsername() + "\"" +" sends the process to "+"\""+ transferUserInfo.getUsername() + "\" for handling" ;
ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO = new ProjectCertificationInventoryLogEO();
projectCertificationInventoryLogEO.setProjectCertificationInventoryId(certificationInventory.getId());
projectCertificationInventoryLogEO.setContentCn(contentCn);
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_DUTY_PERSON_TRANSFER_TASK.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
});
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
this.updateBatchById(projectCertificationInventoryEOList);
Collections.sort(projectCertificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
return p1.getEndTime().compareTo(p2.getEndTime());
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
@@ -1917,7 +2034,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Collections.sort(certificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
return p1.getEndTime().compareTo(p2.getEndTime());
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
Date endTime = certificationInventoryEOList.get(0).getEndTime();
@@ -1979,7 +2099,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Collections.sort(value, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
return p1.getEndTime().compareTo(p2.getEndTime());
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
Map<String, Object> standNameAndItemName = this.getStandNameAndItemName(value);