认证清单-责任人转办接口开发。

This commit is contained in:
wangzhijiang
2023-03-09 15:00:44 +08:00
parent 38db040697
commit af589d2149
3 changed files with 67 additions and 0 deletions
@@ -227,4 +227,11 @@ public class ProjectCertificationInventoryEOController extends JeroController<Pr
public Result<?> resetFlow(@RequestBody JSONObject json) {
return this.projectCertificationInventoryEOService.resetFlow(json);
}
@AutoLog(value = "项目库-认证清单表-转办")
@ApiOperation(value="项目库-认证清单表-转办", notes="项目库-认证清单表-转办")
@PostMapping(value = "/transferTask")
public Result<?> transferTask(@RequestBody JSONObject json) {
return this.projectCertificationInventoryEOService.transferTask(json);
}
}
@@ -142,4 +142,11 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
* @return
*/
Result<?> resetFlow(JSONObject json);
/**
* 转办任务
* @param json
* @return
*/
Result<?> transferTask(JSONObject json);
}
@@ -1257,4 +1257,57 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return Result.OK("流程重置成功!");
}
@Override
public Result<?> transferTask(JSONObject json) {
String ids = json.getString("ids");
if(StringUtils.isEmpty(ids)){
throw new JeroBootException("至少选择一条数据进行操作!");
}
String projectLibraryId = json.getString("projectLibraryId");
String transferUserId = json.getString("transferUserId");
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.getBaseMapper().selectById(projectLibraryId);
if(ObjectUtils.isEmpty(projectLibraryBase)){
throw new JeroBootException("无法获取项目库信息,项目库id为:" + projectLibraryId + " 请联系管理员!");
}
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> idList = Arrays.asList(ids.split(","));
// 流程状态为 任务待确认、待提交、 审查退回 。 能转办
List<String> flowStatusList = new ArrayList<>();
flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
flowStatusList.add(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList);
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getDutyPerson,currentUser.getId());
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrapper);
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
throw new JeroBootException("至少选择一条数据流程状态为'任务待确认 或 结果待提交 或 审查退回'的数据进行转办操作!");
}
projectCertificationInventoryEOList.forEach(certificationInventory -> {
certificationInventory.setDutyPerson(transferUserId);
});
this.updateBatchById(projectCertificationInventoryEOList);
QueryWrapper<ProcessInfoDetailEO> detailQueryWrap = new QueryWrapper<>();
detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryId);
detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
detailQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId,idList);
List<ProcessInfoDetailEO> processInfoDetailEOList = this.processInfoDetailEOService.list(detailQueryWrap);
if(CollectionUtils.isNotEmpty(processInfoDetailEOList)){
processInfoDetailEOList.forEach(detail -> {
detail.setUserId(transferUserId);
});
this.processInfoDetailEOService.updateBatchById(processInfoDetailEOList);
}
return Result.OK("转办成功!");
}
}