|
@@ -1,5 +1,6 @@
|
|
|
package com.qmth.sop.business.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -21,11 +22,9 @@ import com.qmth.sop.business.service.TFCustomFlowEntityService;
|
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
|
import com.qmth.sop.common.enums.*;
|
|
|
import com.qmth.sop.common.util.GsonUtil;
|
|
|
-import com.qmth.sop.common.util.JacksonUtil;
|
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
|
import org.activiti.engine.TaskService;
|
|
|
import org.activiti.engine.task.Task;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -189,13 +188,25 @@ public class TBQualityProblemApplyServiceImpl extends ServiceImpl<TBQualityProbl
|
|
|
public List<String> getApproveUserIds(FlowTaskResult flowTaskResult, Integer setup, List<String> approveUserIds) {
|
|
|
List<FlowFormWidgetResult> formProperty = flowTaskResult.getFormProperty();
|
|
|
for (FlowFormWidgetResult f : formProperty) {
|
|
|
- if (setup.intValue() == 2 && f.getFormId().contains(SystemConstant.APPROVE_CHECK_USERS) && Objects.nonNull(f.getValue())) {//获取甲方复核人员
|
|
|
- String string = f.getValue().replaceAll("\\[", "").replaceAll("\\]", "");
|
|
|
- approveUserIds = Arrays.asList(StringUtils.split(string, ","));
|
|
|
+ if (setup.intValue() == 2 && f.getFormId().contains(SystemConstant.APPROVE_CHECK_USERS) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//获取甲方复核人员
|
|
|
+// String string = f.getValue().replaceAll("\\[", "").replaceAll("\\]", "");
|
|
|
+// approveUserIds = Arrays.asList(StringUtils.split(string, ","));
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
|
|
|
+ StringJoiner stringJoiner = new StringJoiner(",");
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ approveUserIds.add(jsonArray.getString(i));
|
|
|
+ }
|
|
|
break;
|
|
|
- } else if (setup.intValue() == 3 && f.getFormId().contains(SystemConstant.APPROVE_CHECK_THIRD_USERS) && Objects.nonNull(f.getValue())) {//获取已方复核人员
|
|
|
- String string = f.getValue().replaceAll("\\[", "").replaceAll("\\]", "");
|
|
|
- approveUserIds = Arrays.asList(StringUtils.split(string, ","));
|
|
|
+ } else if (setup.intValue() == 3 && f.getFormId().contains(SystemConstant.APPROVE_CHECK_THIRD_USERS) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//获取已方复核人员
|
|
|
+// String string = f.getValue().replaceAll("\\[", "").replaceAll("\\]", "");
|
|
|
+// approveUserIds = Arrays.asList(StringUtils.split(string, ","));
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
|
|
|
+ StringJoiner stringJoiner = new StringJoiner(",");
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ approveUserIds.add(jsonArray.getString(i));
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -218,28 +229,48 @@ public class TBQualityProblemApplyServiceImpl extends ServiceImpl<TBQualityProbl
|
|
|
List<FlowFormWidgetResult> formWidgetResultList = currFlowTaskResult.getFormProperty();
|
|
|
if (!CollectionUtils.isEmpty(formWidgetResultList)) {//更新字段
|
|
|
for (FlowFormWidgetResult f : formWidgetResultList) {
|
|
|
- if (f.getFormId().contains(SystemConstant.PROBLEM_POINT)) {//问题简要
|
|
|
- tbQualityProblemApply.setSummary(f.getValue());
|
|
|
+ if (f.getFormId().contains(SystemConstant.PROBLEM_POINT) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//问题简要
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbQualityProblemApply.setSummary(value);
|
|
|
}
|
|
|
- if (f.getFormId().contains(SystemConstant.PROBLEM_REMARK)) {//问题情况说明
|
|
|
- tbQualityProblemApply.setRemark(f.getValue());
|
|
|
+ if (f.getFormId().contains(SystemConstant.PROBLEM_REMARK) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//问题情况说明
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbQualityProblemApply.setRemark(value);
|
|
|
}
|
|
|
- if (f.getFormId().contains(SystemConstant.ATTACHMENT_INFO)) {//附件id数组
|
|
|
- String string = f.getValue().replaceAll("\\[", "").replaceAll("\\]", "");
|
|
|
- tbQualityProblemApply.setAttachmentIds(StringUtils.join(Arrays.asList(string), SystemConstant.LIST_JOIN_SPLIT));
|
|
|
+ if (f.getFormId().contains(SystemConstant.ATTACHMENT_INFO) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//附件id数组
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
|
|
|
+ StringJoiner stringJoiner = new StringJoiner(",");
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ stringJoiner.add(jsonArray.getString(i));
|
|
|
+ }
|
|
|
+ tbQualityProblemApply.setAttachmentIds(stringJoiner.toString());
|
|
|
}
|
|
|
- if (f.getFormId().contains(SystemConstant.PROBLEM_TYPE)) {//质量问题类型
|
|
|
- tbQualityProblemApply.setType(QualityProblemTypeEnum.valueOf(f.getValue()));
|
|
|
+ if (f.getFormId().contains(SystemConstant.PROBLEM_TYPE) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//质量问题类型
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbQualityProblemApply.setType(QualityProblemTypeEnum.valueOf(value));
|
|
|
}
|
|
|
- if (f.getFormId().contains(SystemConstant.PROBLEM_REASON_RADIO)) {//问题归因
|
|
|
- tbQualityProblemApply.setReason(QualityProblemReasonEnum.valueOf(f.getValue()));
|
|
|
+ if (f.getFormId().contains(SystemConstant.PROBLEM_REASON_RADIO) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//问题归因
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbQualityProblemApply.setReason(QualityProblemReasonEnum.valueOf(value));
|
|
|
}
|
|
|
- if (f.getFormId().contains(SystemConstant.PROBLEM_DEGREE_RADIO)) {//问题影响度
|
|
|
- tbQualityProblemApply.setInfluenceDegree(InfluenceDegreeEnum.valueOf(f.getValue()));
|
|
|
+ if (f.getFormId().contains(SystemConstant.PROBLEM_DEGREE_RADIO) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//问题影响度
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbQualityProblemApply.setInfluenceDegree(InfluenceDegreeEnum.valueOf(value));
|
|
|
}
|
|
|
- if (f.getFormId().contains(SystemConstant.PROBLEM_USERS)) {//责任人
|
|
|
- String string = f.getValue().replaceAll("\\[", "").replaceAll("\\]", "");
|
|
|
- tbQualityProblemApply.setUserIds(StringUtils.join(Arrays.asList(string), SystemConstant.LIST_JOIN_SPLIT));
|
|
|
+ if (f.getFormId().contains(SystemConstant.PROBLEM_USERS) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {//责任人
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
|
|
|
+ StringJoiner stringJoiner = new StringJoiner(",");
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ stringJoiner.add(jsonArray.getString(i));
|
|
|
+ }
|
|
|
+ tbQualityProblemApply.setUserIds(stringJoiner.toString());
|
|
|
}
|
|
|
}
|
|
|
}
|