|
@@ -98,10 +98,46 @@ public class FlowProjectService {
|
|
|
map.put("hyName", result.getData().getLabel());
|
|
|
}
|
|
|
}
|
|
|
+ CommonResult<DictDataRespDTO> projectStatus = dictDataApi.getDictData("project_status", String.valueOf(entity.getXmzt()));
|
|
|
+ if (projectStatus.isSuccess()) {
|
|
|
+ map.put("projectStatus", projectStatus.getData().getLabel());
|
|
|
+ }
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
public int updateById(Project project) {
|
|
|
return projectMapper.updateById(project);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目验收表单生成
|
|
|
+ *
|
|
|
+ * @param flowInstanceId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> projectAccept(String flowInstanceId) {
|
|
|
+ String userId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
+ CommonResult<IFlowInstance> flowResult = workflowClient.flowInstance(flowInstanceId);
|
|
|
+ if(flowResult.isSuccess()){
|
|
|
+ IFlowInstance flowInstance = flowResult.getData();
|
|
|
+ Project entity = projectService.selectByInstanceId(flowInstanceId);
|
|
|
+ if(Objects.isNull(entity)){
|
|
|
+ entity = new Project();
|
|
|
+ entity.setInstanceId(flowInstanceId);
|
|
|
+ entity.setLxsj(LocalDate.now());
|
|
|
+ entity.setIsSign(1);
|
|
|
+ entity.setWorkerId(userId);
|
|
|
+ entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
|
|
|
+ entity.setXmzt(XmztConstants.STATUS_APPLY);
|
|
|
+ CommonResult<AdminUserRespDTO> result = adminUserApi.getUser(userId);
|
|
|
+ AdminUserRespDTO user = result.getCheckedData();
|
|
|
+ entity.setApplyWorkerName(user.getNickname());
|
|
|
+ entity.setApplyWorkerDeptId(user.getDeptId());
|
|
|
+ entity.setApplyWorkerDept(StringUtils.isBlank(user.getDeptName())?deptApi.getDept(user.getDeptId()).getCheckedData().getName():user.getDeptName());
|
|
|
+ projectService.insert(entity);
|
|
|
+ }
|
|
|
+ return createMap(flowInstanceId, entity, userId);
|
|
|
+ }
|
|
|
+ return createModelMap();
|
|
|
+ }
|
|
|
}
|