工作流的质量和安全添加数据bug修复
This commit is contained in:
parent
4524ef8b51
commit
5b56c51e03
@ -972,12 +972,17 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
|
||||
Map<String, Object> formData = processService.getInstanceProgress(null, instanceId).getFormData();
|
||||
formData.putAll(map);
|
||||
ProcessProgressVo.ProgressNode node = flowSeviceUtil.getNextTodoApproval(instanceId, FlowUtil.getString(map, "dfNodeId"));
|
||||
WorkerInfo info = null;
|
||||
if (node != null) {
|
||||
OrgUser user = node.getUser();
|
||||
SystemUser user1 = systemUserService.getById(user.getId());
|
||||
info = workerInfoService.getById(user1.getWorkerId());
|
||||
XzSecurityQualityInspectionRecord record = new XzSecurityQualityInspectionRecord();
|
||||
if (Objects.equals(MapUtils.getInteger(map, "status"), 2)) {
|
||||
ProcessProgressVo.ProgressNode node = flowSeviceUtil.getNextTodoApproval(instanceId, FlowUtil.getString(map, "dfNodeId"));
|
||||
record.setNodeId(node != null ? node.getNodeId() : null);
|
||||
WorkerInfo info = null;
|
||||
if (node != null) {
|
||||
OrgUser user = node.getUser();
|
||||
SystemUser user1 = systemUserService.getById(user.getId());
|
||||
info = workerInfoService.getById(user1.getWorkerId());
|
||||
}
|
||||
record.setEnterpriseId(Optional.ofNullable(info).map(WorkerInfo::getEnterpriseId).orElse(null));
|
||||
}
|
||||
Long creatorId = FlowUtil.getPullDownLong(formData, "creatorId");
|
||||
Long changeId = FlowUtil.getPullDownLong(formData, "changeId");
|
||||
@ -1013,13 +1018,11 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
|
||||
String contractModel = FlowUtil.getString(formData, "field8292884914312");
|
||||
List<String> classifys = StrUtil.split(FlowUtil.getString(formData, "field9069961325117"), "-");
|
||||
Long itemId = Long.valueOf(classifys.get(2));
|
||||
XzSecurityQualityInspectionRecord record = new XzSecurityQualityInspectionRecord();
|
||||
record.setInstanceId(instanceId);
|
||||
record.setRegionName(regionName);
|
||||
record.setRemark(remark);
|
||||
record.setDangerDesc(dangerDesc);
|
||||
record.setDangerItemId(itemId);
|
||||
record.setEnterpriseId(Optional.ofNullable(info).map(WorkerInfo::getEnterpriseId).orElse(null));
|
||||
XzSecurityDangerItemRecord dangerItemRecord = dangerItemRecordMapper.selectById(itemId);
|
||||
XzSecurityDangerTypeRecord t2 = dangerTypeRecordMapper.selectById(classifys.get(1));
|
||||
XzSecurityDangerTypeRecord t1 = dangerTypeRecordMapper.selectById(classifys.get(0));
|
||||
@ -1055,7 +1058,6 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
|
||||
record.setConstructionContractorId(constructionContractorId);
|
||||
record.setSecurityType(Objects.equals(contractModel, "检查问题") ? 1 : 2);
|
||||
record.setSecurityRiskStatement(securityRiskStatement);
|
||||
record.setNodeId(node != null ? node.getNodeId() : null);
|
||||
|
||||
record.setConstructionContractorSafetyManager(FlowUtil.getPullDownLong(formData, "field3666003596745"));
|
||||
record.setConstructionContractorProjectManager(FlowUtil.getPullDownLong(formData, "field4955203598080"));
|
||||
|
||||
@ -34,18 +34,20 @@ import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressContentMapper;
|
||||
import com.zhgd.xmgl.modules.xz.special.service.CountApiService;
|
||||
import com.zhgd.xmgl.util.*;
|
||||
import com.zhgd.xmgl.util.FlowSeviceUtil;
|
||||
import com.zhgd.xmgl.util.FlowUtil;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.flowable.task.api.Task;
|
||||
|
||||
/**
|
||||
* @Description: 工程质量问题整改
|
||||
* @author: pds
|
||||
@ -204,6 +206,10 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
Map<String, Object> formData = processService.getInstanceProgress(null, instanceId).getFormData();
|
||||
ProcessProgressVo.ProgressNode node = flowSeviceUtil.getNextTodoApproval(instanceId,FlowUtil.getString(map, "dfNodeId"));
|
||||
OrgUser user = node.getUser();
|
||||
SystemUser user1 = systemUserService.getById(user.getId());
|
||||
WorkerInfo info = workerInfoService.getById(user1.getWorkerId());
|
||||
QualityProblem record = new QualityProblem();
|
||||
record.setEnterpriseId(Optional.ofNullable(info).map(WorkerInfo::getEnterpriseId).orElse(null));
|
||||
String projectSn = processInstance.getTenantId();
|
||||
Long deviceId = FlowUtil.getPullDownLong(formData, "field4601922872642");
|
||||
Long projectGroupId = FlowUtil.getPullDownLong(formData, "field2588022909627");
|
||||
@ -217,8 +223,6 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
Long issuer = FlowUtil.getPullDownLong(formData, "field8051417365627");
|
||||
Long copy = FlowUtil.getPullDownLong(formData, "field3329317399411");
|
||||
Long compiler = FlowUtil.getPullDownLong(formData, "field6351717408729");
|
||||
SystemUser user1 = systemUserService.getById(user.getId());
|
||||
WorkerInfo info = workerInfoService.getById(user1.getWorkerId());
|
||||
String qualityStatement = FlowUtil.getString(formData, "field8130923005511");
|
||||
String qualityRequire = FlowUtil.getString(formData, "field9251523012459");
|
||||
String picUrl = FlowUtil.getJSONString(formData, "field6081631595560");
|
||||
@ -226,7 +230,6 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
String deliveryLevel = FlowUtil.getString(formData, "field1119531519328");
|
||||
Date inspectTime = FlowUtil.getDate(formData, "field7006700270795");
|
||||
Date changeLimitTime = FlowUtil.getDate(formData, "field1956800274157");
|
||||
QualityProblem record = new QualityProblem();
|
||||
record.setContractModel(Objects.equals(FlowUtil.getString(formData, "field1145031520759"), "EPC") ? 1 : 2);
|
||||
record.setDeliveryLevel(deliveryLevel);
|
||||
record.setDeviceId(deviceId);
|
||||
@ -260,7 +263,6 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
record.setStatus(2);
|
||||
record.setInspectTime(inspectTime);
|
||||
record.setChangeLimitTime(changeLimitTime);
|
||||
record.setEnterpriseId(Optional.ofNullable(info).map(WorkerInfo::getEnterpriseId).orElse(null));
|
||||
record.setNodeId(node.getNodeId());
|
||||
baseMapper.insert(record);
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ public class FlowSeviceUtil {
|
||||
if (StrUtil.isNotBlank(dfNodeId)) {
|
||||
nodeMap = nodeCatchService.reloadProcessByStr(modelHistory.getProcess());
|
||||
}
|
||||
ProcessNode nextValue = getNextValue(nodeMap, dfNodeId);
|
||||
ProcessNode nextValue = getNextApprovalValue(nodeMap, dfNodeId);
|
||||
ApprovalProps props = (ApprovalProps) nextValue.getProps();
|
||||
List<String> users = processTaskService.getApprovalUsers(instance.getId(), nextValue.getId(), props, modelHistory.getTenantId());
|
||||
Map<String, OrgUser> userMaps = userDeptOrLeaderService.getUserMapByIds(users);
|
||||
@ -190,17 +190,26 @@ public class FlowSeviceUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一个节点
|
||||
* 获取下一个审批节点
|
||||
*
|
||||
* @param map
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public ProcessNode getNextValue(Map<String, ProcessNode<?>> map, String key) {
|
||||
List<Map.Entry<String, ProcessNode<?>>> entries = new ArrayList<>(map.entrySet());
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
if (entries.get(i).getKey().equals(key) && i < entries.size() - 1) {
|
||||
return entries.get(i + 1).getValue();
|
||||
public ProcessNode getNextApprovalValue(Map<String, ProcessNode<?>> map, String key) {
|
||||
Iterator<ProcessNode<?>> iterator = map.values().iterator();
|
||||
// 先找到目标key的位置
|
||||
while (iterator.hasNext()) {
|
||||
if (iterator.next() == map.get(key)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 继续查找下一个审批节点
|
||||
while (iterator.hasNext()) {
|
||||
ProcessNode<?> node = iterator.next();
|
||||
if (node.getType() == NodeTypeEnum.APPROVAL) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="true">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue="logs"/>
|
||||
<property name="log.path" value="logs/${spring.application.name}"/>
|
||||
<property name="log.path" value="logs/logs"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user