增加手机端pre-homo流程历史记录

This commit is contained in:
高嵩
2023-07-21 09:53:03 +08:00
parent 15bfef302b
commit c72b6eb515
5 changed files with 102 additions and 3 deletions
@@ -25,10 +25,12 @@ public enum CertificationFlowNodeEnum {
* 任务办理 -> 责任人接受之后,等待提交交付物
* 任务审查 -> 责任人提交交付物之后,认证工程师审查。
*/
LIST_CONFIRMATION("List Release","清单校核","List Release"),
CHECKLIST_VERIFICATION ("Task initiation","任务发起","Task Initiation"),
TASK_RESPONSIBILITY_CONFIRMATION ("Task responsibility confirmation","任务责任确认","Responsibilty Confirmation"),
TASK_HANDLING ("Task handling","任务办理","Task Handling"),
TASK_REVIEW ("Task Review","任务审查","Task Review"),
TASK_SS("Supplementary Submission","补充提交","Supplementary Submission"), // 责任人补充提交发起
;
String key;
@@ -66,6 +66,7 @@ import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
import com.jero.modules.wkflow.service.IProcessHistoryEOService;
import lombok.SneakyThrows;
import org.apache.commons.io.FileUtils;
import org.apache.poi.hssf.usermodel.*;
@@ -177,6 +178,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
private SysUserMapper sysUserMapper;
@Autowired
private IProjectLibraryRoleRelEOService projectLibraryRoleRelEOService;
@Autowired
private IProcessHistoryEOService processHistoryEOService;
/**
* 保存
@@ -845,6 +848,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
public Result<?> updateStatusBatch(JSONObject json) {
String ids = json.getString("ids");
String flowStatus = json.getString("flowStatus");
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(StringUtils.isNotEmpty(ids)){
QueryWrapper<ProjectCertificationInventoryEO> pciQueryWrap = new QueryWrapper<>();
pciQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(",")));
@@ -852,6 +856,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(CollectionUtils.isNotEmpty(pciEoList)){
pciEoList.forEach(pciEo -> {
pciEo.setFlowStatus(flowStatus);
processHistoryEOService.add(pciEo.getId(),CertificationFlowNodeEnum.TASK_SS.getKey(),currentUser.getId(),null,null,null);
});
this.updateBatchById(pciEoList);
@@ -1149,11 +1154,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
// 将数据的状态更新为清单待校核更新截止时间等待认证工程师进行操作
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
projectCertificationInventoryEO.setInventoryVerifyEndTime(inventoryVerifyEndTime);
processHistoryEOService.add(projectCertificationInventoryEO.getId(),CertificationFlowNodeEnum.LIST_CONFIRMATION.getKey(),currentUser.getId(),null,null,null);
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_STUDIO_ISSUE.getValue());
@@ -1900,6 +1906,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
projectCertificationInventoryEO.setReasonForReturn(reasonForReturn);
processHistoryEOService.add(projectCertificationInventoryEO.getId(),CertificationFlowNodeEnum.TASK_REVIEW.getKey(),currentUser.getId(),ReviewResultEnum.RETURNED.getValue(),reasonForReturn,null);
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_REVIEW_RETURNED.getValue());
@@ -1986,6 +1993,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
processHistoryEOService.add(projectCertificationInventoryEO.getId(),CertificationFlowNodeEnum.TASK_REVIEW.getKey(),currentUser.getId(),null,null,null);
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_REVIEW_THROUGH.getValue());
@@ -2172,6 +2181,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// 数据更新为结果待审查
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
processHistoryEOService.add(projectCertificationInventoryEO.getId(),CertificationFlowNodeEnum.TASK_HANDLING.getKey(),currentUser.getId(),null,null,projectCertificationInventoryEO.getDeliveryResult());
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_DUTY_PERSON_SUBMIT_TASK.getValue());
@@ -2254,6 +2265,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
processInfoDetailEO.setEndTime(projectCertificationInventoryEO.getEndTime());
processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId());
processInfoDetailEOList.add(processInfoDetailEO);
processHistoryEOService.add(projectCertificationInventoryEO.getId(),CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey(),currentUser.getId(),ReviewResultEnum.ACCEPTED.getValue(),null,null);
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_DUTY_PERSON_ACCEPT_TASK.getValue());
@@ -2374,6 +2387,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue());
projectCertificationInventoryEO.setReasonForReturn(reasonForReturn);
processHistoryEOService.add(projectCertificationInventoryEO.getId(),CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey(),currentUser.getId(),ReviewResultEnum.REJECTED.getValue(),reasonForReturn,null);
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_DUTY_PERSON_REJECT_TASK.getValue());
@@ -2542,6 +2557,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
for (ProjectCertificationInventoryEO pciEo : projectCertificationInventoryEOList) {
pciEo.setReasonForReturn(reasonForReturn);
processHistoryEOService.add(pciEo.getId(),CertificationFlowNodeEnum.CHECKLIST_VERIFICATION.getKey(),currentUser.getId(),ReviewResultEnum.RETURNED.getValue(),reasonForReturn,null);
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_RETURNED_STUDIO_TASK.getValue());
@@ -2665,6 +2682,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
processInfoDetailEO.setEndTime(taskConfirmEndTime);
processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId());
processInfoDetailEOList.add(processInfoDetailEO);
processHistoryEOService.add(projectCertificationInventoryEO.getId(),CertificationFlowNodeEnum.CHECKLIST_VERIFICATION.getKey(),currentUser.getId(),null,null,null);
}
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,OperatorTypeEnum.CERTIFICATION_INVENTORY_INITIATING_TASK.getValue());
@@ -3205,7 +3225,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
updateWrap.eq(ProjectCertificationInventoryEO::getId,projectCertificationInventoryEO.getId());
this.update(updateWrap);
}
processHistoryEOService.deleteByPId(ids);
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,operatorType);
// 处理待办中心相关数据
@@ -3333,6 +3353,11 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
projectCertificationInventoryLogEO.setContentEn(contentEn);
projectCertificationInventoryLogEO.setOperatorType(OperatorTypeEnum.CERTIFICATION_INVENTORY_DUTY_PERSON_TRANSFER_TASK.getValue());
projectCertificationInventoryLogEOList.add(projectCertificationInventoryLogEO);
if(certificationInventory.getFlowStatus().equals(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){
processHistoryEOService.add(certificationInventory.getId(),CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey(),currentUser.getId(),ReviewResultEnum.TRANSFER.getValue(),null,null);
}else{
processHistoryEOService.add(certificationInventory.getId(),CertificationFlowNodeEnum.TASK_HANDLING.getKey(),currentUser.getId(),ReviewResultEnum.TRANSFER.getValue(),null,null);
}
});
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
@@ -31,7 +31,7 @@ import java.util.Map;
* @Date: 2022-05-18
* @Version: V1.0
*/
@Api(tags="流程历史表")
@Api(tags="phone流程历史表")
@RestController
@RequestMapping("/phone/wkflow/processHistoryEO")
@Slf4j
@@ -195,4 +195,17 @@ public class PhoneProcessHistoryEOController extends JeroController<ProcessHisto
return Result.OK(list);
}
/**
* 认证清单历史列表查询
*
* @return
*/
@AutoLog(value = "流程历史表-认证清单-列表查询")
@ApiOperation(value="流程历史表-认证清单-列表查询", notes="流程历史表-认证清单列表查询")
@GetMapping(value = "/queryCertificationProcessHistoryList")
public Result<List<ProcessHistoryEO>> queryCertificationProcessHistoryList(@RequestParam String id,@RequestParam String cut) {
List<ProcessHistoryEO> list = processHistoryEOService.queryCertificationProcessHistoryList(id,cut);
return Result.OK(list);
}
}
@@ -23,6 +23,18 @@ public interface IProcessHistoryEOService extends IService<ProcessHistoryEO> {
*/
void add(ProcessHistoryEO processHistoryEO);
/**
* 添加历史记录
* @param pid 流程实例ID
* @param tdKey 操作节点
* @param opPersonId 操作人
* @param opResult 操作结果
* @param opinion 意见
* @param file 附件id,多个之间使用英文逗号分隔
*/
void add(String pid, String tdKey, String opPersonId, String opResult, String opinion, String file);
/**
* 更新
*
@@ -39,6 +51,8 @@ public interface IProcessHistoryEOService extends IService<ProcessHistoryEO> {
*/
void deleteById(String id);
void deleteByPId(String pids);
/**
* 批量删除
*
@@ -77,4 +91,6 @@ public interface IProcessHistoryEOService extends IService<ProcessHistoryEO> {
* @return
*/
List<ProcessHistoryEO> queryComplianceProcessHistoryList(Map<String, Object> params);
List<ProcessHistoryEO> queryCertificationProcessHistoryList(String id,String cut);
}
@@ -63,6 +63,27 @@ public class ProcessHistoryEOServiceImpl extends ServiceImpl<ProcessHistoryEOMap
processHistoryEO.setUpdateTime(now);
save(processHistoryEO);
}
/**
* 添加历史记录
* @param pid 流程实例ID
* @param tdKey 操作节点
* @param opPersonId 操作人
* @param opResult 操作结果
* @param opinion 意见
* @param file 附件id,多个之间使用英文逗号分隔
*/
@Override
public void add(String pid, String tdKey, String opPersonId, String opResult, String opinion, String file) {
ProcessHistoryEO ph = new ProcessHistoryEO();
ph.setActiProcInstId(pid);
ph.setTaskDefinitionKey(tdKey);
ph.setOperatorPersonId(opPersonId);
ph.setOperatorResult(opResult);
ph.setApprovalOpinion(opinion);
ph.setApprovalFile(file);
this.add(ph);
}
/**
* 更新
@@ -88,6 +109,15 @@ public class ProcessHistoryEOServiceImpl extends ServiceImpl<ProcessHistoryEOMap
removeById(id);
}
@Override
public void deleteByPId(String pids) {
if(StringUtils.isNotEmpty(pids)){
QueryWrapper<ProcessHistoryEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(ProcessHistoryEO::getActiProcInstId,pids.split(","));
this.baseMapper.delete(queryWrapper);
}
}
/**
* 批量删除
*
@@ -283,4 +313,17 @@ public class ProcessHistoryEOServiceImpl extends ServiceImpl<ProcessHistoryEOMap
}
return processHistoryEOList;
}
public List<ProcessHistoryEO> queryCertificationProcessHistoryList(String id,String cut) {
List<ProcessHistoryEO> processHistoryEOList = null;
if(StringUtils.isNotEmpty(id)){
QueryWrapper<ProcessHistoryEO> queryWrapper = new QueryWrapper<>();
queryWrapper.orderByAsc("create_time");
queryWrapper.lambda().in(ProcessHistoryEO::getActiProcInstId, id);
processHistoryEOList = this.baseMapper.selectList(queryWrapper);
this.disposeData(processHistoryEOList, cut);
}
return processHistoryEOList;
}
}