Commit 263a2354 authored by zhangyingbin's avatar zhangyingbin

修改流程bug

parent 30576b9f
...@@ -215,9 +215,8 @@ public class ProjectController extends BaseController { ...@@ -215,9 +215,8 @@ public class ProjectController extends BaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "项目审核", notes = "项目审核") @ApiOperation(httpMethod = "GET", value = "项目审核", notes = "项目审核")
@PostMapping(value = "/processProject") @GetMapping(value = "/processProject")
public ResponseModel<String> processProject(String sequenceNbr,@RequestBody JSONObject json){ public ResponseModel<String> processProject(String sequenceNbr,String option){
String option = json.getString(XJConstant.PROCESS_PROJECT_STATE);
Project project = projectServiceImpl.getById(sequenceNbr); Project project = projectServiceImpl.getById(sequenceNbr);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(project)); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(project));
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"审核不通过"); jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"审核不通过");
......
...@@ -177,7 +177,7 @@ public class OrgServiceImpl { ...@@ -177,7 +177,7 @@ public class OrgServiceImpl {
if(ValidationUtil.isEmpty(code)){ if(ValidationUtil.isEmpty(code)){
c = 0001; c = 0001;
}else{ }else{
c = Integer.parseInt(code)+1; c = Integer.parseInt(code.substring(code.indexOf("-"),code.length() - 1))+1;
} }
String welderCode = OrgEnum.焊工.getKey() +"-"+ c; String welderCode = OrgEnum.焊工.getKey() +"-"+ c;
...@@ -290,11 +290,10 @@ public class OrgServiceImpl { ...@@ -290,11 +290,10 @@ public class OrgServiceImpl {
* 查询当前登录单位下的人员列表 * 查询当前登录单位下的人员列表
* @return * @return
*/ */
@BusinessIdentify
public List<OrgUsr> getCharge(){ public List<OrgUsr> getCharge(){
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()));
LambdaQueryWrapper<OrgUsr> personWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> personWrapper = new LambdaQueryWrapper<>();
personWrapper.eq(OrgUsr::getParentId,orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()) personWrapper.eq(OrgUsr::getParentId,String.valueOf(getReginParams().getBusinessInfo().getCompanySequenceNbr()))
.eq(OrgUsr :: getBizOrgType,OrgEnum.普通人员.getKey()); .eq(OrgUsr :: getBizOrgType,OrgEnum.普通人员.getKey());
return orgUsrServiceImpl.list(personWrapper); return orgUsrServiceImpl.list(personWrapper);
} }
......
...@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
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.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
...@@ -60,9 +59,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -60,9 +59,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
WorkflowExcuteServiceImpl workflowExcuteService; WorkflowExcuteServiceImpl workflowExcuteService;
@Autowired @Autowired
WorkflowFeignService workflowFeignService;
@Autowired
InstallNoticeMsgServiceImpl installNoticeMsgService; InstallNoticeMsgServiceImpl installNoticeMsgService;
@Autowired @Autowired
...@@ -122,18 +118,15 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -122,18 +118,15 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Override @Override
public void execute(String instanceId,Object objectd, String option){ public void execute(String instanceId,Object objectd, String option){
JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectd)); JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectd));
JSONObject jsonObject = workflowFeignService.getTask(instanceId); AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
ProjectInitiation projectInitiation = new ProjectInitiation(); ProjectInitiation projectInitiation = new ProjectInitiation();
projectInitiation.setInstanceId(instanceId); projectInitiation.setInstanceId(instanceId);
projectInitiation.setContext(JSON.toJSONString(objectd)); projectInitiation.setContext(JSON.toJSONString(objectd));
JSONObject dataObject = jsonObject.getJSONObject("data");
projectInitiation.setTaskId(dataObject.getString("id")); projectInitiation.setTaskId(dataObject.getString("id"));
projectInitiation.setTaskName(dataObject.getString("name")); projectInitiation.setTaskName(dataObject.getString("name"));
if (ProjectInitiationEnum.平台审核.getName().equals(dataObject.getString("name"))) { if (ProjectInitiationEnum.平台审核.getName().equals(dataObject.getString("name"))) {
if (true) {
option = "1";
}
} }
if(ProjectInitiationEnum.监检员审核.getName().equals(dataObject.getString("name"))){ if(ProjectInitiationEnum.监检员审核.getName().equals(dataObject.getString("name"))){
...@@ -189,10 +182,11 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -189,10 +182,11 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
* @return * @return
*/ */
public String getFlowTaskName(String instanceId){ public String getFlowTaskName(String instanceId){
JSONObject jsonObject = workflowFeignService.getTask(instanceId); AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskName = "流程结束!"; String taskName = "流程结束!";
try { try {
taskName=jsonObject.getJSONObject("data").getString("name"); taskName=jsonObject.getString("name");
}catch (Exception e) {} }catch (Exception e) {}
return taskName; return taskName;
} }
...@@ -201,7 +195,8 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -201,7 +195,8 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Project::getInstanceId,instanceId); wrapper.eq(Project::getInstanceId,instanceId);
Project project = projectService.getOne(wrapper); Project project = projectService.getOne(wrapper);
project.setStatus(ProjectInitiationEnum.getCodeByNameMap.get(getFlowTaskName(instanceId))); // project.setStatus(ProjectInitiationEnum.getCodeByNameMap.get(getFlowTaskName(instanceId)));
project.setStatus(getFlowTaskName(instanceId));
projectService.updateById(project); projectService.updateById(project);
} }
......
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