Commit 54a96804 authored by lisong's avatar lisong

调整监察值守逻辑

parent 9091d1b2
......@@ -12,6 +12,7 @@ import java.text.ParseException;
import com.alibaba.fastjson.JSONObject;
import feign.Response;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration =
{ CommonMultipartSupportConfig.class })
......@@ -214,4 +215,11 @@ public interface WorkflowFeignService {
*/
@RequestMapping(value = "/activitiHistory/getTaskListForTaskName/{taskName}/{definitionKey}",method = RequestMethod.GET)
JSONObject getTaskListForTaskName(@PathVariable String taskName,@PathVariable String definitionKey) throws Exception ;
@RequestMapping("/task/attributes")
JSONObject getRoleId(@RequestParam String taskId);
@RequestMapping("/task/getTaskNoAuth/{processInstanceId}")
JSONObject getTaskId(@PathVariable String processInstanceId);
}
......@@ -70,6 +70,12 @@ public interface IdxFeignService {
@RequestMapping(value = "/report/form/getFirstFormByTaskId/{taskId}", method = RequestMethod.GET)
FeignClientResult<JSONObject> getFirstTask(@PathVariable("taskId")String taskId);
/**
*查询工作流task
*/
@RequestMapping(value = "/task-ins/{taskId}", method = RequestMethod.GET)
FeignClientResult<Map<String, Object>> getTaskId(@PathVariable("taskId")String taskId);
/**
*通用表单提交 数据填报
......
......@@ -10,9 +10,11 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.tzs.api.common.CommonException;
import com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo;
......@@ -122,6 +124,8 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired
IdxFeignService idxFeignService;
@Autowired
WorkflowFeignService workflowFeignService;
/**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232
*/
......@@ -706,12 +710,31 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Override
public String submit(Long pageId, String taskId, String planInstanceId, String topic, String tableName, Map<String, Object> objectMap) throws Exception {
// 企业下所有用户(上送工作流)
String roleId = "";
// 根据指标taskId查询
FeignClientResult<Map<String, Object>> taskMessage = idxFeignService.getTaskId(taskId);
if ("200".equals(String.valueOf(taskMessage.getStatus())) && !ObjectUtils.isEmpty(taskMessage)) {
Object id = taskMessage.getResult().get("processInstanceId");
// 根据processInstanceId查询workFlow服务对应的taskId
JSONObject flowTask = workflowFeignService.getTaskId(String.valueOf(id));
if (!ObjectUtils.isEmpty(flowTask) && !ObjectUtils.isEmpty(flowTask.get("data"))) {
JSONObject data = JSON.parseObject(JSON.toJSONString(flowTask.get("data")));
Object id1 = data.get("id");
// 根据taskId查询流程节点绑定角色id
JSONObject result = workflowFeignService.getRoleId(String.valueOf(id1));
if (!ObjectUtils.isEmpty(result) && !ObjectUtils.isEmpty(result.get("result"))) {
JSONObject result1 = JSON.parseObject(JSON.toJSONString(result.get("result")));
roleId = String.valueOf(result1.get("roleId"));
}
}
}
// 企业下所有用户(上送工作流企业整改用户参数)
ArrayList<String> flow = new ArrayList<>();
// 企业下所有用户(更新任务)
ArrayList<String> task = new ArrayList<>();
// 查询第一个填报信息获取企业
String companyName = "";
// 查询流程第一个节点所选择的执行企业信息
FeignClientResult<JSONObject> firstTask = idxFeignService.getFirstTask(taskId);
if (!ObjectUtils.isEmpty(firstTask)) {
companyName = String.valueOf(firstTask.getResult().get("CHECKED_COMPANY"));
......@@ -719,13 +742,23 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
if (!ObjectUtils.isEmpty(objectMap)) {
FeignClientResult<CompanyModel> companyModelFeignClientResult = Privilege.companyClient.queryByCompanyName(companyName);
if (!ObjectUtils.isEmpty(companyModelFeignClientResult.getResult()) && !ObjectUtils.isEmpty(companyModelFeignClientResult.getResult().getOrgCode())) {
FeignClientResult<Set<AgencyUserModel>> setFeignClientResult = Privilege.agencyUserClient.queryByOrgCode(companyModelFeignClientResult.getResult().getOrgCode(), null);
if (!ObjectUtils.isEmpty(setFeignClientResult)) {
setFeignClientResult.getResult().forEach(item -> {
//FeignClientResult<Set<AgencyUserModel>> setFeignClientResult = Privilege.agencyUserClient.queryByOrgCode(companyModelFeignClientResult.getResult().getOrgCode(), null);
Long sequenceNbr = companyModelFeignClientResult.getResult().getSequenceNbr();
// 查询企业对应角色下的用户
FeignClientResult<List<AgencyUserModel>> listFeignClientResult = Privilege.agencyUserClient.queryByCompanyRoles(sequenceNbr, roleId, null, null);
if (!ObjectUtils.isEmpty(listFeignClientResult)){
listFeignClientResult.getResult().forEach(item ->{
flow.add(item.getUserName());
task.add(item.getUserId());
});
}
// if (!ObjectUtils.isEmpty(setFeignClientResult)) {
// setFeignClientResult.getResult().forEach(item -> {
// flow.add(item.getUserName());
// task.add(item.getUserId());
// });
// }
}
}
String userIds = String.join(",", flow);
......
......@@ -32,7 +32,7 @@
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId>
<version>1.7.14-SNAPSHOT</version>
<version>1.8.5</version>
</dependency>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment