|
@@ -19,6 +19,7 @@ import com.qmth.sop.business.service.*;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.enums.*;
|
|
import com.qmth.sop.common.enums.*;
|
|
import com.qmth.sop.common.lock.MemoryLock;
|
|
import com.qmth.sop.common.lock.MemoryLock;
|
|
|
|
+import com.qmth.sop.common.util.GsonUtil;
|
|
import com.qmth.sop.common.util.JacksonUtil;
|
|
import com.qmth.sop.common.util.JacksonUtil;
|
|
import com.qmth.sop.common.util.ResultUtil;
|
|
import com.qmth.sop.common.util.ResultUtil;
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
@@ -331,36 +332,44 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
if (flowFormWidgetResultMap.containsKey(f.getId())) {
|
|
if (flowFormWidgetResultMap.containsKey(f.getId())) {
|
|
f.setValue(flowFormWidgetResultMap.get(f.getId()).getValue());
|
|
f.setValue(flowFormWidgetResultMap.get(f.getId()).getValue());
|
|
} else if (Objects.nonNull(tbCrmDetail.getContacts()) && f.getFormId()
|
|
} else if (Objects.nonNull(tbCrmDetail.getContacts()) && f.getFormId()
|
|
- .contains(ProcessLimitedEnum.CONTACTS.getKey())) {
|
|
|
|
|
|
+ .contains(ProcessLimitedEnum.CONTACTS.getKey()) && Objects.nonNull(f.getValue())
|
|
|
|
+ && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getContacts());
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getContacts());
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
} else if (Objects.nonNull(tbCrmDetail.getMobileNumber()) && f.getFormId()
|
|
} else if (Objects.nonNull(tbCrmDetail.getMobileNumber()) && f.getFormId()
|
|
- .contains(ProcessLimitedEnum.MOBILE_NUMBER.getKey())) {
|
|
|
|
|
|
+ .contains(ProcessLimitedEnum.MOBILE_NUMBER.getKey()) && Objects.nonNull(f.getValue())
|
|
|
|
+ && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getMobileNumber());
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getMobileNumber());
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.SERVICE_SCOPE_RADIO.getKey())) {
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.SERVICE_SCOPE_RADIO.getKey())
|
|
|
|
+ && Objects.nonNull(f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getServiceScope());
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getServiceScope());
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey())) {
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey())
|
|
|
|
+ && Objects.nonNull(f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getScanStartTime());
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getScanStartTime());
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey())) {
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
|
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getScanEndTime());
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getScanEndTime());
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey())) {
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey())
|
|
|
|
+ && Objects.nonNull(f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getMarkPaperStartTime());
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getMarkPaperStartTime());
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey())) {
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
|
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getMarkPaperEndTime());
|
|
jsonObject.put(SystemConstant.VALUE, tbCrmDetail.getMarkPaperEndTime());
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey())) {
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey())
|
|
|
|
+ && Objects.nonNull(f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
List<String> list = new ArrayList<>(crmProjectResult.getEngineerList().size());
|
|
List<String> list = new ArrayList<>(crmProjectResult.getEngineerList().size());
|
|
crmProjectResult.getEngineerList().stream().peek(s -> list.add(s.getUserId().toString()))
|
|
crmProjectResult.getEngineerList().stream().peek(s -> list.add(s.getUserId().toString()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -1298,32 +1307,45 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
|
|
|
|
- Long scanStartTime = null, scanEndTime = null, markStartTime = null, markEndTime = null;
|
|
|
|
|
|
+ Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(tfCustomFlowEntity.getFlowId()))
|
|
|
|
+ .singleResult();
|
|
|
|
+
|
|
|
|
+ FlowTaskResult currFlowTaskResult = null;
|
|
|
|
+ if (Objects.nonNull(task)) {
|
|
|
|
+ FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
|
+ LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
|
|
+ currFlowTaskResult = GsonUtil.fromJson(GsonUtil.toJson(setupMap.get(task.getTaskDefinitionKey())),
|
|
|
|
+ FlowTaskResult.class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Long beginTime = null, endTime = null;
|
|
FlowTaskResult flowTaskResult = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
|
|
FlowTaskResult flowTaskResult = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
|
|
List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
|
|
List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
|
|
for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey()) && Objects.nonNull(f.getValue())
|
|
if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey()) && Objects.nonNull(f.getValue())
|
|
- && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
|
|
|
+ && !Objects.equals(f.getValue(), "{\"value\":null}") && Objects.nonNull(currFlowTaskResult)
|
|
|
|
+ && currFlowTaskResult.getSetup().intValue() <= 3) {
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
- scanStartTime = Long.parseLong(value);
|
|
|
|
|
|
+ beginTime = Long.parseLong(value);
|
|
} else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
|
|
} else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
|
|
- f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}") && Objects.nonNull(
|
|
|
|
+ currFlowTaskResult) && currFlowTaskResult.getSetup().intValue() <= 3) {
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
- scanEndTime = Long.parseLong(value);
|
|
|
|
|
|
+ endTime = Long.parseLong(value);
|
|
} else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
|
|
} else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
|
|
f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
- markStartTime = Long.parseLong(value);
|
|
|
|
|
|
+ beginTime = Long.parseLong(value);
|
|
} else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
|
|
} else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
|
|
f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
String value = jsonObject.getString(SystemConstant.VALUE);
|
|
- markEndTime = Long.parseLong(value);
|
|
|
|
|
|
+ endTime = Long.parseLong(value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return new SopPlanTimeResult(tfCustomFlow.getType(), scanStartTime, scanEndTime, markStartTime, markEndTime);
|
|
|
|
|
|
+ return new SopPlanTimeResult(tfCustomFlow.getType(), beginTime, endTime);
|
|
}
|
|
}
|
|
}
|
|
}
|