|
@@ -1,7 +1,11 @@
|
|
|
package com.zjugis.business.flow.contractF.event;
|
|
|
|
|
|
+import com.zjugis.business.bean.entity.Contract;
|
|
|
+import com.zjugis.business.bean.entity.Project;
|
|
|
import com.zjugis.business.flow.contractF.entity.ContractFDO;
|
|
|
import com.zjugis.business.flow.contractF.service.ContractFService;
|
|
|
+import com.zjugis.business.service.ContractService;
|
|
|
+import com.zjugis.business.service.ProjectService;
|
|
|
import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
|
|
|
import com.zjugis.framework.workflow.exception.BusinessException;
|
|
|
import com.zjugis.framework.workflow.model.BaseController;
|
|
@@ -34,7 +38,8 @@ import static com.zjugis.business.constants.FlowStatusConstants.*;
|
|
|
public class ContractFEvent extends BaseController {
|
|
|
|
|
|
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private ProjectService projectService;
|
|
|
@Resource
|
|
|
private ContractFService contractFService;
|
|
|
|
|
@@ -183,23 +188,27 @@ public class ContractFEvent extends BaseController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 转到部门经理
|
|
|
+ * 转到项目经理和销售人员
|
|
|
*/
|
|
|
- @PostMapping("/to-dept-manager")
|
|
|
+ @PostMapping("/to-project-manager-sale")
|
|
|
public String toDeptManager(String flowInstanceId) {
|
|
|
try {
|
|
|
if (StringUtils.isNotBlank(flowInstanceId)) {
|
|
|
ContractFDO entity = contractFService.findByInstanceId(flowInstanceId);
|
|
|
List<Map<String, String>> userMaps = new ArrayList<>();
|
|
|
-// if (StringUtils.isNotBlank(entity.getDeptId())) {
|
|
|
-// CommonResult<DeptRespDTO> result = deptApi.getDept(entity.getDeptId());
|
|
|
-// DeptRespDTO dept = result.getCheckedData();
|
|
|
-// if (dept != null && StringUtils.isNotBlank(dept.getLeaderUserId())) {
|
|
|
-// HashMap<String, String> map = new HashMap<>();
|
|
|
-// map.put("id", dept.getLeaderUserId());
|
|
|
-// userMaps.add(map);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (StringUtils.isNotBlank(entity.getContractId())) {
|
|
|
+ Project project = projectService.selectById(entity.getContractId());
|
|
|
+ if(StringUtils.isNotBlank(project.getXmjlId())) {
|
|
|
+ HashMap<String,String> map = new HashMap<>();
|
|
|
+ map.put("id",project.getXmjlId());
|
|
|
+ userMaps.add(map);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(project.getXsryId())) {
|
|
|
+ HashMap<String,String> map = new HashMap<>();
|
|
|
+ map.put("id",project.getXsryId());
|
|
|
+ userMaps.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
return ok(userMaps);
|
|
|
} else {
|
|
|
throw new BusinessException("找不到流程id");
|