Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH
This commit is contained in:
+2
@@ -15,6 +15,8 @@ public enum CertificationFlowNodeEnum {
|
||||
ZRRJJRW ("zrrjjrw","责任人拒绝任务","The person in charge refused the assignment"),
|
||||
ZRRTJRW ("zrrtjrw","责任人提交任务","The responsible person submits the task"),
|
||||
RZGCSSC ("rzgcssc","认证工程师审查","Certified engineer review"),
|
||||
RZGCSSC_TG ("rzgcssc_tg","认证工程师审查-通过","Certified engineer review through"),
|
||||
RZGCSSC_TH ("rzgcssc_th","认证工程师审查-退回","Certified engineer review returned"),
|
||||
;
|
||||
|
||||
String key;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ public enum CertificationInventoryFlowStatusEnum {
|
||||
* 任务待确认 认证工程师发起责任人待确认
|
||||
* 责任人拒绝 责任人拒绝
|
||||
* 结果待提交 责任人接受后 未提交交付物
|
||||
* 工程师退回 责任人分发后被第二位责任人退回
|
||||
* 工程师退回 责任人分发后被第二位责任人退回 (没有该状态。)
|
||||
* 结果待审查 责任人提交后认证工程师未审查
|
||||
* 审查通过 责任人提交后认证工程师审查通过
|
||||
* 审查退回 责任人提交后认证工程师审查退回
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
* @param projectCertificationInventoryEOList
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
Result<?> saveBatch(JSONObject json);
|
||||
|
||||
+395
-37
@@ -301,17 +301,27 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
throw new JeroBootException("至少选择一条数据进行发布!");
|
||||
}
|
||||
String endTime = json.getString("endTime");
|
||||
String cut = json.getString("cut");
|
||||
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
List<String> flowStatusList = new ArrayList<>();
|
||||
flowStatusList.add(CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
|
||||
flowStatusList.add(CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue());
|
||||
|
||||
// 根据页面选择的认证清单数据id,查询出状态为’清单待发布‘的数据,进行发布处理
|
||||
QueryWrapper<ProjectCertificationInventoryEO> certificationQueryWrap = new QueryWrapper<>();
|
||||
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,idList);
|
||||
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
|
||||
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(certificationQueryWrap);
|
||||
|
||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||
throw new JeroBootException("无法获取要发布的数据,请重新选择!");
|
||||
if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
throw new JeroBootException("Select at least one data flow whose status is' List to be released or Certification returned '!");
|
||||
}else {
|
||||
throw new JeroBootException("至少选择一条数据流程状态为'清单待发布 或 认证退回'的数据!");
|
||||
}
|
||||
|
||||
}
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
|
||||
@@ -338,7 +348,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
processInfoDetailEO.setUserId(userId);
|
||||
processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSJSRW.getKey());
|
||||
processInfoDetailEO.setEndTime(DateUtils.str2Date(endTime,DateUtils.date_sdf.get()));
|
||||
processInfoDetailEO.setCreateTime(new Date());
|
||||
processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue());
|
||||
processInfoDetailEO.setProcessInfoId(projectLibraryId);
|
||||
@@ -373,7 +382,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
processInfoEO.setProjectLibraryId(projectLibraryId);
|
||||
processInfoEO.setActiProcInstId(projectLibraryId);
|
||||
processInfoEO.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||
processInfoEO.setStatus(TodoCenterStatusEnum.LIST_TO_CONFIRM.getValue());
|
||||
// processInfoEO.setStatus(TodoCenterStatusEnum.LIST_TO_CONFIRM.getValue());
|
||||
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
processInfoEO.setCreateBy(currentUser.getId());
|
||||
@@ -397,7 +406,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
detail.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||
detail.setTaskDefinitionKey(taskDefinitionKey);
|
||||
detail.setStatus(TaskStatusEnum.NOT_DONE.getValue());
|
||||
// detail.setEndTime(DateUtils.str2Date(endTime,DateUtils.date_sdf.get()));
|
||||
detail.setCreateTime(new Date());
|
||||
detail.setStatus(TaskStatusEnum.NOT_DONE.getValue());
|
||||
});
|
||||
@@ -406,6 +414,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
QueryWrapper<ProcessInfoDetailEO> removeWrap = new QueryWrapper<>();
|
||||
removeWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,processInfoId);
|
||||
removeWrap.lambda().in(ProcessInfoDetailEO::getUserId,userIdList);
|
||||
removeWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,taskDefinitionKey);
|
||||
// 删除用户在这个认证清单流程中其它的待办任务
|
||||
this.processInfoDetailEOService.remove(removeWrap);
|
||||
|
||||
@@ -680,14 +689,18 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
case RZGCSTHRW:
|
||||
return this.certificationReturnedStudioTask(json);
|
||||
case ZRRJSRW:
|
||||
|
||||
break;
|
||||
return this.dutyPersonAcceptTask(json);
|
||||
case ZRRJJRW:
|
||||
return this.dutyPersonRejectTask(json);
|
||||
case ZRRTJRW:
|
||||
|
||||
break;
|
||||
return this.dutyPersonSubmitTask(json);
|
||||
case RZGCSSC:
|
||||
|
||||
break;
|
||||
case RZGCSSC_TG:
|
||||
return this.certificationReviewThrough(json);
|
||||
case RZGCSSC_TH:
|
||||
return this.certificationReviewReturned(json);
|
||||
default:
|
||||
throw new JeroBootException(nodeKey + " 的操作节点传递有误,请联系管理员!");
|
||||
}
|
||||
@@ -695,6 +708,361 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
return Result.OK("提交任务成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 认证工程师审查退回
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
private Result<?> certificationReviewReturned(JSONObject json) {
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
String ids = json.getString("ids");
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
throw new JeroBootException("至少选择一条数据进行操作!");
|
||||
}
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
List<String> flowStatusList = new ArrayList<>();
|
||||
flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
|
||||
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList);
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrapper);
|
||||
|
||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||
throw new JeroBootException("至少选择一条数据流程状态为'结果待审查'的数据!");
|
||||
}
|
||||
|
||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
|
||||
}
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
|
||||
|
||||
try {
|
||||
// 更新数据状态为 审查退回
|
||||
this.updateBatchById(projectCertificationInventoryEOList);
|
||||
|
||||
List<String> flowStatus = new ArrayList<>();
|
||||
flowStatus.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
|
||||
|
||||
// 更新该项目认证流程中,认证工程师的任务状态。
|
||||
// 如果还有 结果待审查 的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办 flowStatus
|
||||
this.updateProcessInfoDetailStatus(projectLibraryBase,CertificationFlowNodeEnum.RZGCSSC.getKey(),flowStatus);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("认证工程师-审批退回失败:" + ex.getMessage());
|
||||
throw new JeroBootException("审批退回失败!");
|
||||
}
|
||||
|
||||
return Result.OK("审批退回成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 认证工程师审查通过
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
private Result<?> certificationReviewThrough(JSONObject json) {
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
String ids = json.getString("ids");
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
throw new JeroBootException("至少选择一条数据进行操作!");
|
||||
}
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
List<String> flowStatusList = new ArrayList<>();
|
||||
flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
|
||||
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList);
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrapper);
|
||||
|
||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||
throw new JeroBootException("至少选择一条数据流程状态为'结果待审查'的数据!");
|
||||
}
|
||||
|
||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
|
||||
}
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
|
||||
|
||||
try {
|
||||
// 更新数据状态为 审查通过
|
||||
this.updateBatchById(projectCertificationInventoryEOList);
|
||||
|
||||
List<String> flowStatus = new ArrayList<>();
|
||||
flowStatus.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
|
||||
|
||||
// 更新该项目认证流程中,认证工程师的任务状态。
|
||||
// 如果还有 结果待审查 的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办 flowStatus
|
||||
this.updateProcessInfoDetailStatus(projectLibraryBase,CertificationFlowNodeEnum.RZGCSSC.getKey(),flowStatus);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("认证工程师-审批通过失败:" + ex.getMessage());
|
||||
throw new JeroBootException("审批通过失败!");
|
||||
}
|
||||
|
||||
|
||||
return Result.OK("审批通过成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务状态为已办
|
||||
* @param projectLibraryBase
|
||||
*/
|
||||
private void updateProcessInfoDetailStatus(ProjectLibraryBase projectLibraryBase,String taskDefinitionKey,List<String> flowStatusList) {
|
||||
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryCountWrap = new QueryWrapper<>();
|
||||
queryCountWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId, projectLibraryBase.getId());
|
||||
queryCountWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
int notDoneCount = this.count(queryCountWrap);
|
||||
|
||||
if(notDoneCount == 0){
|
||||
QueryWrapper<ProcessInfoDetailEO> detailQueryWrapper = new QueryWrapper<>();
|
||||
detailQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId());
|
||||
detailQueryWrapper.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,taskDefinitionKey);
|
||||
List<ProcessInfoDetailEO> detailEOList = this.processInfoDetailEOService.list(detailQueryWrapper);
|
||||
|
||||
for (ProcessInfoDetailEO processInfoDetailEO : detailEOList) {
|
||||
processInfoDetailEO.setStatus(TaskStatusEnum.HAVE_DONE.getValue());
|
||||
}
|
||||
|
||||
this.processInfoDetailEOService.updateBatchById(detailEOList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 责任人提交任务
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
private Result<?> dutyPersonSubmitTask(JSONObject json) {
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
String ids = json.getString("ids");
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
throw new JeroBootException("至少选择一条数据进行操作!");
|
||||
}
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
List<String> flowStatusList = new ArrayList<>();
|
||||
flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
|
||||
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList);
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrapper);
|
||||
|
||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||
throw new JeroBootException("至少选择一条数据流程状态为'结果待提交'的数据!");
|
||||
}
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
|
||||
|
||||
// 给认证工程师分配待办中心的任务
|
||||
String certificationEngineer = projectLibraryBase.getCertificationEngineer();
|
||||
if(StringUtils.isEmpty(certificationEngineer)){
|
||||
throw new JeroBootException("该项目中认证工程师为空,请先维护认证工程师!");
|
||||
}
|
||||
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
List<String> certificationEngineerList = Arrays.asList(certificationEngineer.split(","));
|
||||
// 给认证工程师分配任务
|
||||
for (String userId : certificationEngineerList) {
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
processInfoDetailEO.setUserId(userId);
|
||||
processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSSC.getKey());
|
||||
processInfoDetailEO.setCreateTime(new Date());
|
||||
processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue());
|
||||
processInfoDetailEO.setProcessInfoId(projectLibraryBase.getId());
|
||||
processInfoDetailEO.setActiProcInstId(projectLibraryBase.getId());
|
||||
processInfoDetailEO.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||
processInfoDetailEOList.add(processInfoDetailEO);
|
||||
}
|
||||
// 数据更新为结果待审查
|
||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
|
||||
}
|
||||
try {
|
||||
this.updateBatchById(projectCertificationInventoryEOList);
|
||||
|
||||
List<String> certificationIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
// 将当前责任人的待办任务转为已办
|
||||
LambdaUpdateWrapper<ProcessInfoDetailEO> detailUpdateWrap = new LambdaUpdateWrapper<>();
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.ZRRTJRW.getKey());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getProjectLawsInventoryId,certificationIdList);
|
||||
detailUpdateWrap.set(ProcessInfoDetailEO::getStatus,TaskStatusEnum.HAVE_DONE.getValue());
|
||||
this.processInfoDetailEOService.update(detailUpdateWrap);
|
||||
|
||||
// 给认证工程师分配待办中心的任务 认证工程师审查
|
||||
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.RZGCSSC.getKey());
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("责任人-提交任务失败:" + ex.getMessage());
|
||||
throw new JeroBootException("提交任务失败!");
|
||||
}
|
||||
|
||||
return Result.OK("提交任务成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 责任人接受任务
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
private Result<?> dutyPersonAcceptTask(JSONObject json) {
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
String ids = json.getString("ids");
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
throw new JeroBootException("至少选择一条数据进行操作!");
|
||||
}
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
List<String> flowStatusList = new ArrayList<>();
|
||||
flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
|
||||
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList);
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrapper);
|
||||
|
||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||
throw new JeroBootException("至少选择一条数据流程状态为'任务待确认'的数据!");
|
||||
}
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
|
||||
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
|
||||
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
processInfoDetailEO.setUserId(projectCertificationInventoryEO.getDutyPerson());
|
||||
processInfoDetailEO.setEndTime(projectCertificationInventoryEO.getEndTime());
|
||||
processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId());
|
||||
processInfoDetailEOList.add(processInfoDetailEO);
|
||||
}
|
||||
|
||||
try {
|
||||
List<String> certificationIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
// 将当前责任人的待办任务转为已办
|
||||
LambdaUpdateWrapper<ProcessInfoDetailEO> detailUpdateWrap = new LambdaUpdateWrapper<>();
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.ZRRJSRW.getKey());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getProjectLawsInventoryId,certificationIdList);
|
||||
detailUpdateWrap.set(ProcessInfoDetailEO::getStatus,TaskStatusEnum.HAVE_DONE.getValue());
|
||||
this.processInfoDetailEOService.update(detailUpdateWrap);
|
||||
|
||||
// 给责任人分配待办中心的任务 (待提交)
|
||||
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.ZRRTJRW.getKey());
|
||||
|
||||
// 责任人接受任务,将数据的状态更新为 结果待提交。
|
||||
this.updateBatchById(projectCertificationInventoryEOList);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("责任人-接受任务失败:" + ex.getMessage());
|
||||
throw new JeroBootException("接受任务失败!");
|
||||
}
|
||||
|
||||
return Result.OK("接受任务成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 责任人拒绝任务
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
private Result<?> dutyPersonRejectTask(JSONObject json) {
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
String ids = json.getString("ids");
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
throw new JeroBootException("至少选择一条数据进行操作!");
|
||||
}
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
List<String> flowStatusList = new ArrayList<>();
|
||||
flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
|
||||
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList);
|
||||
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrapper);
|
||||
|
||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||
throw new JeroBootException("至少选择一条数据流程状态为'任务待确认'的数据!");
|
||||
}
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
|
||||
|
||||
// 给认证工程师分配待办中心的任务
|
||||
String certificationEngineer = projectLibraryBase.getCertificationEngineer();
|
||||
if(StringUtils.isEmpty(certificationEngineer)){
|
||||
throw new JeroBootException("该项目中认证工程师为空,请先维护认证工程师!");
|
||||
}
|
||||
|
||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue());
|
||||
}
|
||||
|
||||
try {
|
||||
// 将当前责任人的待办任务转为已办
|
||||
LambdaUpdateWrapper<ProcessInfoDetailEO> detailUpdateWrap = new LambdaUpdateWrapper<>();
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
|
||||
detailUpdateWrap.eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.ZRRJSRW.getKey());
|
||||
detailUpdateWrap.set(ProcessInfoDetailEO::getStatus,TaskStatusEnum.HAVE_DONE.getValue());
|
||||
this.processInfoDetailEOService.update(detailUpdateWrap);
|
||||
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
List<String> certificationEngineerList = Arrays.asList(certificationEngineer.split(","));
|
||||
// 给认证工程师分配任务
|
||||
for (String userId : certificationEngineerList) {
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
processInfoDetailEO.setUserId(userId);
|
||||
processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSJSRW.getKey());
|
||||
processInfoDetailEO.setCreateTime(new Date());
|
||||
processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue());
|
||||
processInfoDetailEO.setProcessInfoId(projectLibraryBase.getId());
|
||||
processInfoDetailEO.setActiProcInstId(projectLibraryBase.getId());
|
||||
processInfoDetailEO.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||
processInfoDetailEOList.add(processInfoDetailEO);
|
||||
}
|
||||
|
||||
// 删除该项目数据的待办任务,key为 认证工程师接受任务的数据
|
||||
QueryWrapper<ProcessInfoDetailEO> deleteDetailWrap = new QueryWrapper<>();
|
||||
deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
|
||||
deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSJSRW.getKey());
|
||||
deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||
this.processInfoDetailEOService.remove(deleteDetailWrap);
|
||||
this.processInfoDetailEOService.saveBatch(processInfoDetailEOList);
|
||||
|
||||
// 责任人接受任务,将数据的状态更新为 结果待提交。
|
||||
this.updateBatchById(projectCertificationInventoryEOList);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("责任人-拒绝任务失败:" + ex.getMessage());
|
||||
throw new JeroBootException("拒绝任务失败!");
|
||||
}
|
||||
return Result.OK("拒绝任务成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 认证工程师退回至studio任务
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
private Result<?> certificationReturnedStudioTask(JSONObject json) {
|
||||
String ids = json.getString("ids");
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
@@ -720,18 +1088,23 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
}
|
||||
|
||||
// 给studio分配待办中心任务
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
/*List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
processInfoDetailEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
processInfoDetailEOList.add(processInfoDetailEO);
|
||||
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.STUDIOFQ.getKey());
|
||||
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.STUDIOFQ.getKey());*/
|
||||
|
||||
try {
|
||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue());
|
||||
}
|
||||
// 认证工程师发起任务,将数据的状态更新为 任务待确认。
|
||||
|
||||
// 认证工程师退回任务到studio,将数据的状态更新为 认证退回
|
||||
this.updateBatchById(projectCertificationInventoryEOList);
|
||||
|
||||
// 更新该项目认证流程中,认证工程师的任务状态。
|
||||
// 如果还有 清单待校核、责任人拒绝 状态的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办
|
||||
this.updateProcessInfoDetailStatus(projectLibraryBase,CertificationFlowNodeEnum.RZGCSJSRW.getKey(),flowStatusList);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("认证工程师-退回认证清单任务失败:" + ex.getMessage());
|
||||
@@ -773,41 +1146,26 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
}
|
||||
|
||||
try {
|
||||
// 给责任人分配待办中心的任务
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
|
||||
}
|
||||
|
||||
// 给责任人分配待办中心的任务
|
||||
List<String> dutyPersonList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList());
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
for (String dutyPerson : dutyPersonList) {
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
processInfoDetailEO.setUserId(dutyPerson);
|
||||
processInfoDetailEO.setUserId(projectCertificationInventoryEO.getDutyPerson());
|
||||
processInfoDetailEO.setEndTime(projectCertificationInventoryEO.getEndTime());
|
||||
processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId());
|
||||
processInfoDetailEOList.add(processInfoDetailEO);
|
||||
}
|
||||
|
||||
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.ZRRJSRW.getKey());
|
||||
|
||||
// 更新该项目认证流程中,认证工程师的任务状态。
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryCountWrap = new QueryWrapper<>();
|
||||
queryCountWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryBase.getId());
|
||||
queryCountWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
|
||||
int notDoneCount = this.count(queryCountWrap);
|
||||
// 如果还有 清单待校核、责任人拒绝 状态的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办
|
||||
if(notDoneCount == 0){
|
||||
QueryWrapper<ProcessInfoDetailEO> detailQueryWrapper = new QueryWrapper<>();
|
||||
detailQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
|
||||
detailQueryWrapper.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSJSRW.getKey());
|
||||
List<ProcessInfoDetailEO> detailEOList = this.processInfoDetailEOService.list(detailQueryWrapper);
|
||||
|
||||
for (ProcessInfoDetailEO processInfoDetailEO : detailEOList) {
|
||||
processInfoDetailEO.setStatus(TaskStatusEnum.HAVE_DONE.getValue());
|
||||
}
|
||||
|
||||
this.processInfoDetailEOService.updateBatchById(detailEOList);
|
||||
}
|
||||
|
||||
// 认证工程师发起任务,将数据的状态更新为 任务待确认。
|
||||
this.updateBatchById(projectCertificationInventoryEOList);
|
||||
|
||||
// 更新该项目认证流程中,认证工程师的任务状态。
|
||||
// 如果还有 清单待校核、责任人拒绝 状态的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办
|
||||
this.updateProcessInfoDetailStatus(projectLibraryBase,CertificationFlowNodeEnum.RZGCSJSRW.getKey(),flowStatusList);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("认证工程师-发起认证清单任务失败:" + ex.getMessage());
|
||||
|
||||
+28
@@ -179,6 +179,34 @@
|
||||
process_info_detail pid
|
||||
where pid.process_info_id = pi.id and pid.STATUS = 'NotDone' order by pid.end_time asc limit 1
|
||||
) as end_time,
|
||||
<!--(
|
||||
case when flow_type = '21' then
|
||||
(
|
||||
SELECT
|
||||
pci.end_time
|
||||
FROM
|
||||
project_certification_inventory pci
|
||||
WHERE
|
||||
pci.project_library_id = pi.id
|
||||
AND ( pci.flow_status = 'List to be checked' OR pci.flow_status = 'Refusal of responsible person' )
|
||||
ORDER BY
|
||||
pci.end_time ASC
|
||||
LIMIT 1
|
||||
)
|
||||
when flow_type = '10' then
|
||||
(
|
||||
SELECT
|
||||
pid.end_time
|
||||
FROM
|
||||
process_info_detail pid
|
||||
WHERE
|
||||
pid.process_info_id = pi.id
|
||||
AND pid.STATUS = 'NotDone'
|
||||
ORDER BY
|
||||
pid.end_time ASC
|
||||
LIMIT 1
|
||||
) end
|
||||
)AS end_time,-->
|
||||
pi.STATUS,
|
||||
pi.prc_num,
|
||||
pi.prc_name,
|
||||
|
||||
Reference in New Issue
Block a user