|
@@ -16,6 +16,7 @@ import com.zjugis.business.flow.usemoney.service.UseMoneyDetailService;
|
|
|
import com.zjugis.business.flow.usemoney.service.UseMoneyService;
|
|
|
import com.zjugis.business.service.ProjectService;
|
|
|
import com.zjugis.framework.common.pojo.CommonResult;
|
|
|
+import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
|
|
|
import com.zjugis.framework.workflow.exception.BusinessException;
|
|
|
import com.zjugis.framework.workflow.model.BaseController;
|
|
|
import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
|
|
@@ -102,8 +103,8 @@ public class UseMoneyEvent extends BaseController {
|
|
|
if (!Strings.isNullOrEmpty(entity.getUserNickname())) {
|
|
|
flowDesc += "/" + entity.getUserNickname();
|
|
|
}
|
|
|
- if (entity.getApplyTime()!=null) {
|
|
|
- flowDesc += "/" + entity.getApplyTime();
|
|
|
+ if (entity.getCreateTime()!=null) {
|
|
|
+ flowDesc += "/" + LocalDateTimeUtils.format(entity.getCreateTime(), null);
|
|
|
}
|
|
|
if (entity.getTotalAmount()!=null) {
|
|
|
flowDesc += "/" + entity.getTotalAmount();
|
|
@@ -761,4 +762,40 @@ public class UseMoneyEvent extends BaseController {
|
|
|
throw new BusinessException("执行事件出错,请联系管理员!");
|
|
|
}
|
|
|
}
|
|
|
+ @PostMapping("/toCTO")
|
|
|
+ public String toCTO(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ UseMoneyDO entity = useMoneyService.findByInstanceId(flowInstanceId);
|
|
|
+ List<PostRespDTO> postList = postApi.getPostByUser(entity.getUserId()).getCheckedData();
|
|
|
+ Set<String> postCodes = convertSet(postList, PostRespDTO::getCode);
|
|
|
+ if (entity != null && CollectionUtil.contains(postCodes, "jszj")) {
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @PostMapping("/toNotLeaderProject")
|
|
|
+ public String toNotLeaderProject(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ UseMoneyDO entity = useMoneyService.findByInstanceId(flowInstanceId);
|
|
|
+ Project project = projectService.selectById(entity.getProjectId());
|
|
|
+ String xmjlId = project.getXmjlId();
|
|
|
+ String userId = entity.getUserId();
|
|
|
+ List<PostRespDTO> postList = postApi.getPostByUser(userId).getCheckedData();
|
|
|
+ Set<String> postCodes = convertSet(postList, PostRespDTO::getCode);
|
|
|
+ List<DeptRespDTO> deptChildList = deptApi.getChildDeptList(entity.getDeptId()).getCheckedData();
|
|
|
+ Set<String> depts = convertSet(deptChildList, DeptRespDTO::getId);
|
|
|
+ depts.add(entity.getDeptId());
|
|
|
+ if (entity != null && CollectionUtil.contains(postCodes, "fgslz") && userId.equals(xmjlId) && !CollectionUtil.contains(depts, project.getZrbmId())) {
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|