|
@@ -1282,4 +1282,48 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
}
|
|
|
return scopeEnum;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据sop单号查询sop计划时间
|
|
|
+ *
|
|
|
+ * @param sopNo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SopPlanTimeResult querySopPlanTime(String sopNo) {
|
|
|
+ TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
|
|
|
+ new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getCode, sopNo));
|
|
|
+ Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
+
|
|
|
+ TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
+ Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
|
+
|
|
|
+ Long scanStartTime = null, scanEndTime = null, markStartTime = null, markEndTime = null;
|
|
|
+ FlowTaskResult flowTaskResult = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
|
|
|
+ List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
|
|
|
+ for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
|
+ if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey()) && Objects.nonNull(f.getValue())
|
|
|
+ && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ scanStartTime = Long.parseLong(value);
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ scanEndTime = Long.parseLong(value);
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ markStartTime = Long.parseLong(value);
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ markEndTime = Long.parseLong(value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new SopPlanTimeResult(tfCustomFlow.getType(), scanStartTime, scanEndTime, markStartTime, markEndTime);
|
|
|
+ }
|
|
|
}
|