|
@@ -2,10 +2,13 @@ package com.malk.kuaikeli.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
import cn.hutool.core.util.NumberUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.malk.kuaikeli.service.KKLService;
|
|
import com.malk.kuaikeli.service.KKLService;
|
|
import com.malk.server.aliwork.YDConf;
|
|
import com.malk.server.aliwork.YDConf;
|
|
import com.malk.server.aliwork.YDParam;
|
|
import com.malk.server.aliwork.YDParam;
|
|
|
|
+import com.malk.server.common.McR;
|
|
|
|
+import com.malk.server.dingtalk.DDR_New;
|
|
import com.malk.service.aliwork.YDClient;
|
|
import com.malk.service.aliwork.YDClient;
|
|
import com.malk.service.aliwork.YDService;
|
|
import com.malk.service.aliwork.YDService;
|
|
import com.malk.utils.UtilMap;
|
|
import com.malk.utils.UtilMap;
|
|
@@ -14,6 +17,7 @@ import com.malk.utils.UtilNumber;
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
import lombok.Synchronized;
|
|
import lombok.Synchronized;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang3.StringEscapeUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -24,6 +28,11 @@ import java.util.stream.Collectors;
|
|
@Slf4j
|
|
@Slf4j
|
|
public class KKLImplService implements KKLService {
|
|
public class KKLImplService implements KKLService {
|
|
|
|
|
|
|
|
+ //供应商原材料档案表
|
|
|
|
+ private static final String SUPPLIER_MATERIALS = "FORM-12EB6BCE3C264630824721E7BBABCC03L8U9";
|
|
|
|
+ //定价单明细中间表
|
|
|
|
+ private static final String PRICE_DETAIL_MIDDLE = "FORM-E6766M811CKD2PIXEAKOM9S2DKBM2PBQU1MLL5";
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private YDService ydService;
|
|
private YDService ydService;
|
|
|
|
|
|
@@ -480,4 +489,309 @@ public class KKLImplService implements KKLService {
|
|
.build(), YDConf.FORM_OPERATION.update);
|
|
.build(), YDConf.FORM_OPERATION.update);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<Map<String, String>> getDiffMatchingSuppliers(String oldSupplierCode,String newSupplierCode) {
|
|
|
|
+ List<Map<String,String>> diffList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ //获取旧供应商原材料信息
|
|
|
|
+ List<Map> oldSupplierMaterials = getYdFormDataList(SUPPLIER_MATERIALS, JSON.toJSONString(UtilMap.map("textField_llzzbyj1", oldSupplierCode)), YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
+ List<Map<String,String>> oldSupplierMaterialsFormData = oldSupplierMaterials.stream()
|
|
|
|
+ .map(item -> {
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("textField_lywr2qcq", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd1")));//物品名称
|
|
|
|
+ map.put("textField_lyxr5c44", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd2")));//物品编号
|
|
|
|
+ map.put("textField_lyxr5c46", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd4")));//物品规格
|
|
|
|
+ return map;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ //按物品名称进行分组
|
|
|
|
+ Map<String, List<Map<String, String>>> groupOldSupplierMaterials = oldSupplierMaterialsFormData.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(map -> map.get("textField_lywr2qcq")));
|
|
|
|
+ //物品名称重复的物品
|
|
|
|
+ List<String> oldRepeatNames = new ArrayList<>();
|
|
|
|
+ //物品名称未重复的物品
|
|
|
|
+ List<String> oldNames = new ArrayList<>();
|
|
|
|
+ groupOldSupplierMaterials.forEach((name, value) -> {
|
|
|
|
+ if (value.size() > 1) {
|
|
|
|
+ diffList.addAll(value);
|
|
|
|
+ oldRepeatNames.add(name);
|
|
|
|
+ }else {
|
|
|
|
+ oldNames.add(name);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //待匹配的物品
|
|
|
|
+ oldSupplierMaterialsFormData = oldSupplierMaterialsFormData.stream().filter(item -> !oldRepeatNames.contains(item.get("name"))).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //获取新供应商原材料信息
|
|
|
|
+ List<Map> newSupplierMaterials = getYdFormDataList(SUPPLIER_MATERIALS, JSON.toJSONString(UtilMap.map("textField_llzzbyj1", newSupplierCode)), YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
+ List<Map<String,String>> newSupplierMaterialsFormData = newSupplierMaterials.stream()
|
|
|
|
+ .map(item -> {
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("textField_lywr2qcq", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd1")));//物品名称
|
|
|
|
+ map.put("textField_lyxr5c44", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd2")));//物品编号
|
|
|
|
+ map.put("textField_lyxr5c46", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd4")));//物品规格
|
|
|
|
+ return map;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ //按物品名称进行分组
|
|
|
|
+ Map<String, List<Map<String, String>>> groupNewSupplierMaterials = newSupplierMaterialsFormData.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(map -> map.get("textField_lywr2qcq")));
|
|
|
|
+ //物品名称重复的物品
|
|
|
|
+ List<String> newRepeatNames = new ArrayList<>();
|
|
|
|
+ //物品名称未重复的物品
|
|
|
|
+ List<String> newNames = new ArrayList<>();
|
|
|
|
+ groupNewSupplierMaterials.forEach((name, value) -> {
|
|
|
|
+ if (value.size() > 1) {
|
|
|
|
+// diffList.addAll(value);
|
|
|
|
+ newRepeatNames.add(name);
|
|
|
|
+ }else {
|
|
|
|
+ newNames.add(name);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //待匹配的物品
|
|
|
|
+// newSupplierMaterialsFormData = newSupplierMaterialsFormData.stream().filter(item -> !newRepeatNames.contains(item.get("name"))).collect(Collectors.toList());
|
|
|
|
+ List<String> matchNameList = new ArrayList<>();
|
|
|
|
+ matchNameList.addAll(oldNames);
|
|
|
|
+ matchNameList.retainAll(newNames);
|
|
|
|
+
|
|
|
|
+ List<String> diffNameList = new ArrayList<>();
|
|
|
|
+ diffNameList.addAll(oldNames);
|
|
|
|
+ diffNameList.removeAll(newNames);
|
|
|
|
+
|
|
|
|
+// oldNames.removeAll(newNames);
|
|
|
|
+
|
|
|
|
+ oldSupplierMaterialsFormData.forEach(item -> {
|
|
|
|
+ if (diffNameList.contains(item.get("textField_lywr2qcq"))){
|
|
|
|
+ diffList.add(item);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return diffList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<Map<String, String>> getDiffMatchingSuppliers2(String projectCode,String oldSupplierCode, String newSupplierCode) {
|
|
|
|
+ List<Map<String,String>> diffList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ //获取旧供应商定价单明细中间表
|
|
|
|
+ List<Map> oldSupplierMaterials = getYdFormDataList(PRICE_DETAIL_MIDDLE, JSON.toJSONString(UtilMap.map("textField_llzzbyj1, textField_llm1vtjm", oldSupplierCode,projectCode)), YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
+
|
|
|
|
+ List<Map<String,String>> oldSupplierMaterialsFormData = oldSupplierMaterials.stream()
|
|
|
|
+ .map(item -> {
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("textField_lywr2qcq", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd1")));//物品名称
|
|
|
|
+ map.put("textField_lyxr5c44", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd2")));//物品编号
|
|
|
|
+ map.put("textField_lyxr5c46", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd4")));//物品规格
|
|
|
|
+ return map;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ //按物品名称进行分组
|
|
|
|
+ Map<String, List<Map<String, String>>> groupOldSupplierMaterials = oldSupplierMaterialsFormData.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(map -> map.get("textField_lywr2qcq")));
|
|
|
|
+ //物品名称重复的物品
|
|
|
|
+ List<String> oldRepeatNames = new ArrayList<>();
|
|
|
|
+ //物品名称未重复的物品
|
|
|
|
+ List<String> oldNames = new ArrayList<>();
|
|
|
|
+ groupOldSupplierMaterials.forEach((name, value) -> {
|
|
|
|
+ if (value.size() > 1) {
|
|
|
|
+ diffList.addAll(value);
|
|
|
|
+ oldRepeatNames.add(name);
|
|
|
|
+ }else {
|
|
|
|
+ oldNames.add(name);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //待匹配的物品
|
|
|
|
+ oldSupplierMaterialsFormData = oldSupplierMaterialsFormData.stream().filter(item -> !oldRepeatNames.contains(item.get("name"))).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //获取新供应商原材料信息
|
|
|
|
+ List<Map> newSupplierMaterials = getYdFormDataList(SUPPLIER_MATERIALS, JSON.toJSONString(UtilMap.map("textField_llzzbyj1", newSupplierCode)), YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
+ List<Map<String,String>> newSupplierMaterialsFormData = newSupplierMaterials.stream()
|
|
|
|
+ .map(item -> {
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("textField_lywr2qcq", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd1")));//物品名称
|
|
|
|
+ map.put("textField_lyxr5c44", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd2")));//物品编号
|
|
|
|
+ map.put("textField_lyxr5c46", String.valueOf(((Map) item.get("formData")).get("textField_llkb7kd4")));//物品规格
|
|
|
|
+ return map;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ //按物品名称进行分组
|
|
|
|
+ Map<String, List<Map<String, String>>> groupNewSupplierMaterials = newSupplierMaterialsFormData.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(map -> map.get("textField_lywr2qcq")));
|
|
|
|
+ //物品名称重复的物品
|
|
|
|
+ List<String> newRepeatNames = new ArrayList<>();
|
|
|
|
+ //物品名称未重复的物品
|
|
|
|
+ List<String> newNames = new ArrayList<>();
|
|
|
|
+ groupNewSupplierMaterials.forEach((name, value) -> {
|
|
|
|
+ if (value.size() > 1) {
|
|
|
|
+// diffList.addAll(value);
|
|
|
|
+ newRepeatNames.add(name);
|
|
|
|
+ }else {
|
|
|
|
+ newNames.add(name);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //待匹配的物品
|
|
|
|
+// newSupplierMaterialsFormData = newSupplierMaterialsFormData.stream().filter(item -> !newRepeatNames.contains(item.get("name"))).collect(Collectors.toList());
|
|
|
|
+ List<String> matchNameList = new ArrayList<>();
|
|
|
|
+ matchNameList.addAll(oldNames);
|
|
|
|
+ matchNameList.retainAll(newNames);
|
|
|
|
+
|
|
|
|
+ List<String> diffNameList = new ArrayList<>();
|
|
|
|
+ diffNameList.addAll(oldNames);
|
|
|
|
+ diffNameList.removeAll(newNames);
|
|
|
|
+
|
|
|
|
+// oldNames.removeAll(newNames);
|
|
|
|
+
|
|
|
|
+ oldSupplierMaterialsFormData.forEach(item -> {
|
|
|
|
+ if (diffNameList.contains(item.get("textField_lywr2qcq"))){
|
|
|
|
+ diffList.add(item);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return diffList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private List<Map> getYdFormDataList(String formUuid, String searchCondition, YDConf.FORM_QUERY formQuery) {
|
|
|
|
+ List<Map> list = new ArrayList<>();
|
|
|
|
+ DDR_New ddrNew;
|
|
|
|
+ int pageNumber = 1;
|
|
|
|
+ int pageSize = 100;
|
|
|
|
+ do {
|
|
|
|
+ ddrNew = ydClient.queryData(YDParam.builder().formUuid(formUuid)
|
|
|
|
+ .searchCondition(searchCondition)
|
|
|
|
+ .pageNumber(pageNumber)
|
|
|
|
+ .pageSize(pageSize).build(), formQuery);
|
|
|
|
+
|
|
|
|
+ list.addAll((List<Map>) ddrNew.getData());
|
|
|
|
+ pageNumber++;
|
|
|
|
+ }while (ddrNew.getTotalCount() > ddrNew.getPageNumber() * pageSize);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public McR updateSuppliers(String formInstId) {
|
|
|
|
+ //查询定价单供应商变更实例
|
|
|
|
+ Map formData = ydClient.queryData(YDParam.builder()
|
|
|
|
+ .formInstanceId(formInstId).build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
|
+
|
|
|
|
+ String oldSupplierCode = String.valueOf(formData.get("textField_lv3w1k1l"));//旧供应商编号
|
|
|
|
+ String newSupplierCode = String.valueOf(formData.get("textField_llzzbai8"));//新供应商编号
|
|
|
|
+ String newSupplierName = String.valueOf(formData.get("textField_lmsli3bq"));//新供应商名称
|
|
|
|
+ String jsonString = formData.get("associationFormField_llkb7kct_id").toString();
|
|
|
|
+ String res = StringEscapeUtils.unescapeJava(jsonString.substring(1, jsonString.length() - 1));
|
|
|
|
+ List<Map> supplier =(List<Map>) JSONArray.parse(res);//供应商(关联表单)
|
|
|
|
+
|
|
|
|
+ String projectCode = String.valueOf(formData.get("textField_lllovku7"));//定价单编号
|
|
|
|
+ //新供应商差异原材料编号
|
|
|
|
+ List<String> newDiffSupplierMaterialCodes = new ArrayList<>();
|
|
|
|
+ //老供应商差异原材料编号
|
|
|
|
+ List<String> oldDiffSupplierMaterialCodes = new ArrayList<>();
|
|
|
|
+ //老供应商匹配原材料编号
|
|
|
|
+ List<String> oldMatchSupplierMaterialCodes = new ArrayList<>();
|
|
|
|
+ //新供应商匹配原材料编号
|
|
|
|
+ List<String> newMatchSupplierMaterialCodes = new ArrayList<>();
|
|
|
|
+ //新供应商匹配原材料名称
|
|
|
|
+ List<String> newMatchSupplierMaterialNames = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ //校验新供应商原材料是否存在
|
|
|
|
+ List<Map> newSupplierMaterials = getYdFormDataList(SUPPLIER_MATERIALS, JSON.toJSONString(UtilMap.map("textField_llzzbyj1", newSupplierCode)), YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
+ List<String> newSupplierMaterialCodes = newSupplierMaterials.stream()
|
|
|
|
+ .map(item -> String.valueOf(((Map)item.get("formData")).get("textField_llkb7kd2")))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<Map> diffList = (List<Map>) formData.get("tableField_lywr2qcp");
|
|
|
|
+
|
|
|
|
+ for (Map diff : diffList) {
|
|
|
|
+ String oldCode = String.valueOf(diff.get("textField_lyxr5c44"));//老供应商原材料编号
|
|
|
|
+ String newCode = String.valueOf(diff.get("textField_lywr2qcv"));//新供应商原材料编号
|
|
|
|
+ String newName = String.valueOf(diff.get("textField_lz70gmob"));//新供应商原材料名称
|
|
|
|
+ //选择新供应商原材料且新供应商原材料编号存在
|
|
|
|
+ if ((Objects.nonNull(diff.get("associationFormField_lywr2qcr_id")) && newSupplierMaterialCodes.contains(newCode))){
|
|
|
|
+ oldMatchSupplierMaterialCodes.add(oldCode);
|
|
|
|
+ newMatchSupplierMaterialCodes.add(newCode);
|
|
|
|
+ newMatchSupplierMaterialNames.add(newName);
|
|
|
|
+ }
|
|
|
|
+ //未选择老供应商原材料且新供应商原材料不存在
|
|
|
|
+ if ((Objects.isNull(diff.get("associationFormField_lywr2qcr_id")) && !newSupplierMaterialCodes.contains(newCode))){
|
|
|
|
+ oldDiffSupplierMaterialCodes.add(oldCode);
|
|
|
|
+ newDiffSupplierMaterialCodes.add(newCode);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //校验新供应商原材料编号是否重复
|
|
|
|
+ HashSet<String> set = new HashSet<>(newDiffSupplierMaterialCodes);
|
|
|
|
+ if (set.size() != newDiffSupplierMaterialCodes.size()){
|
|
|
|
+ return McR.errorUnknown("新供应商原材料编号存在重复!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (Map diff : diffList) {
|
|
|
|
+ String oldCode = String.valueOf(diff.get("textField_lyxr5c44"));//老供应商原材料编号
|
|
|
|
+ String newCode = String.valueOf(diff.get("textField_lywr2qcv"));//新供应商原材料编号
|
|
|
|
+ if (!newMatchSupplierMaterialCodes.contains(newCode)){
|
|
|
|
+ //查询旧供应商原材料信息
|
|
|
|
+ List<Map> data = (List<Map>) ydClient.queryData(YDParam.builder()
|
|
|
|
+ .formUuid(SUPPLIER_MATERIALS)
|
|
|
|
+ .searchCondition(JSON.toJSONString(UtilMap.map("textField_llkb7kd2, textField_llzzbyj1", oldCode, oldSupplierCode)))
|
|
|
|
+ .build(), YDConf.FORM_QUERY.retrieve_list).getData();
|
|
|
|
+ //复制旧供应商原材料信息到新供应商
|
|
|
|
+ if (Objects.nonNull(data) && !data.isEmpty()){
|
|
|
|
+ Map formData1 = (Map) data.get(0).get("formData");
|
|
|
|
+ formData1.put("associationFormField_lphya7cq",res);//供应商(关联表单)
|
|
|
|
+ formData1.put("textField_llzzbyj1", newSupplierCode);//供应商编号
|
|
|
|
+ formData1.put("textField_lmsli3bq", newSupplierName);//供应商名称
|
|
|
|
+ formData1.put("textField_llkb7kd2", newCode);//物品编号
|
|
|
|
+
|
|
|
|
+ ydClient.operateData(YDParam.builder().formUuid(SUPPLIER_MATERIALS)
|
|
|
|
+ .formDataJson(JSON.toJSONString(formData1)).build(), YDConf.FORM_OPERATION.create);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取旧供应商定价单明细中间表
|
|
|
|
+ List<Map> oldSupplierMaterials = getYdFormDataList(PRICE_DETAIL_MIDDLE, JSON.toJSONString(UtilMap.map("textField_llzzbyj1, textField_llm1vtjm", oldSupplierCode,projectCode)), YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
+ for (Map oldSupplierMaterial : oldSupplierMaterials) {
|
|
|
|
+ Map formData2 = (Map) oldSupplierMaterial.get("formData");
|
|
|
|
+ String code = String.valueOf(formData2.get("textField_llkb7kd2"));
|
|
|
|
+ String name = String.valueOf(formData2.get("textField_llkb7kd1"));
|
|
|
|
+ String formInstanceId = String.valueOf(oldSupplierMaterial.get("formInstanceId"));
|
|
|
|
+
|
|
|
|
+ //更新定价单明细中间表
|
|
|
|
+ formData2.put("textField_lmsli3bq", newSupplierName);//供应商名称
|
|
|
|
+ formData2.put("textField_llzzbyj1", newSupplierCode);//供应商编号
|
|
|
|
+ //未匹配上的原材料
|
|
|
|
+ int index1 = oldDiffSupplierMaterialCodes.indexOf(code);
|
|
|
|
+ if (index1 != -1){
|
|
|
|
+ formData2.put("textField_llkb7kd2", newDiffSupplierMaterialCodes.get(index1));//物品编号
|
|
|
|
+ ydClient.operateData(YDParam.builder().formUuid(PRICE_DETAIL_MIDDLE)
|
|
|
|
+ .formInstanceId(formInstanceId)
|
|
|
|
+ .updateFormDataJson(JSON.toJSONString(formData2)).build(), YDConf.FORM_OPERATION.update);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //手动匹配上的原材料
|
|
|
|
+ int index2 = oldMatchSupplierMaterialCodes.indexOf(code);
|
|
|
|
+ if (index2 != -1){
|
|
|
|
+ formData2.put("textField_llkb7kd2", newMatchSupplierMaterialCodes.get(index2));//物品编号
|
|
|
|
+ formData2.put("textField_llkb7kd1",newMatchSupplierMaterialNames.get(index2));//物品名称
|
|
|
|
+ ydClient.operateData(YDParam.builder().formUuid(PRICE_DETAIL_MIDDLE)
|
|
|
|
+ .formInstanceId(formInstanceId)
|
|
|
|
+ .updateFormDataJson(JSON.toJSONString(formData2)).build(), YDConf.FORM_OPERATION.update);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //自动匹配上的原材料
|
|
|
|
+ for (Map newSupplierMaterial : newSupplierMaterials) {
|
|
|
|
+ Map formData4 = (Map) newSupplierMaterial.get("formData");
|
|
|
|
+ if (String.valueOf(formData4.get("textField_llkb7kd1")).equals(name)){
|
|
|
|
+ formData2.put("textField_llkb7kd2", formData4.get("textField_llkb7kd2").toString());//物品编号
|
|
|
|
+ ydClient.operateData(YDParam.builder().formUuid(PRICE_DETAIL_MIDDLE)
|
|
|
|
+ .formInstanceId(formInstanceId)
|
|
|
|
+ .formDataJson(JSON.toJSONString(formData2)).build(), YDConf.FORM_OPERATION.update);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return McR.success();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|