|
@@ -681,16 +681,26 @@ public class DjpdSqServiceImpl implements IDjpdSqService
|
|
|
String cityAreaCode = getCityArea();
|
|
|
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
|
|
|
.orderByProcessDefinitionId().orderByProcessDefinitionVersion().desc();
|
|
|
- processDefinitionQuery.processDefinitionKey(WorkFlowStatus.DJPD.getCode() + "_" + cityAreaCode);
|
|
|
+ processDefinitionQuery.processDefinitionKey(WorkFlowStatus.DJPD.getCode() + "_" + SecurityUtils.getAreaCode());
|
|
|
if (processDefinitionQuery.count() > 0) {
|
|
|
ProcessInstance processInstance = runtimeService
|
|
|
- .startProcessInstanceByKey(WorkFlowStatus.DJPD.getCode() + "_" + cityAreaCode, id);
|
|
|
+ .startProcessInstanceByKey(WorkFlowStatus.DJPD.getCode() + "_" + SecurityUtils.getAreaCode(), id);
|
|
|
djpdSq.setInstanceId(processInstance.getId());
|
|
|
- djpdSq.setSqzt(ApplicationStatus.APPLY.getCode());
|
|
|
+ djpdSq.setSqzt(definitionService.getDjpdSqztByInstanceId(processInstance.getId()));
|
|
|
} else {
|
|
|
- ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(WorkFlowStatus.DJPD.getCode(), id);
|
|
|
- djpdSq.setInstanceId(processInstance.getId());
|
|
|
- djpdSq.setSqzt(ApplicationStatus.APPLY.getCode());
|
|
|
+ ProcessDefinitionQuery processDefinitionQueryCity = repositoryService.createProcessDefinitionQuery()
|
|
|
+ .orderByProcessDefinitionId().orderByProcessDefinitionVersion().desc();
|
|
|
+ processDefinitionQueryCity.processDefinitionKey(WorkFlowStatus.DJPD.getCode() + "_" + cityAreaCode);
|
|
|
+ if (processDefinitionQueryCity.count() > 0) {
|
|
|
+ ProcessInstance processInstance = runtimeService
|
|
|
+ .startProcessInstanceByKey(WorkFlowStatus.DJPD.getCode() + "_" + cityAreaCode, id);
|
|
|
+ djpdSq.setInstanceId(processInstance.getId());
|
|
|
+ djpdSq.setSqzt(definitionService.getDjpdSqztByInstanceId(processInstance.getId()));
|
|
|
+ } else {
|
|
|
+ ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(WorkFlowStatus.DJPD.getCode(), id);
|
|
|
+ djpdSq.setInstanceId(processInstance.getId());
|
|
|
+ djpdSq.setSqzt(definitionService.getDjpdSqztByInstanceId(processInstance.getId()));
|
|
|
+ }
|
|
|
}
|
|
|
return djpdSqMapper.updateById(djpdSq);
|
|
|
}
|