Bläddra i källkod

华高看板同步调整

wzy 1 vecka sedan
förälder
incheckning
9071e0abd9

+ 18 - 8
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdHuaGaoServiceImpl.java

@@ -94,7 +94,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
             List<List<String>> formInstanceIdListList = new ArrayList<>();//实例id集合,每100条
 
             DDR_New ddrNew = new DDR_New();
-            int pageSize = 100;
+            int pageSize = 50;
             int pageNumber = 0;
             do {
                 pageNumber++;
@@ -298,7 +298,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
             //更新看板更新记录
             ydClient.operateData(YDParam.builder()
                     .formInstId(formInstId)
-                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t", "异常", System.currentTimeMillis())))
+                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t, textareaField_mir0zmpo", "异常", System.currentTimeMillis(),e.getMessage())))
                     .build(), YDConf.FORM_OPERATION.update);
 
             throw new RuntimeException(e);
@@ -332,7 +332,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
             List<List<String>> formInstanceIdListList = new ArrayList<>();//实例id集合,每100条
 
             DDR_New ddrNew = new DDR_New();
-            int pageSize = 100;
+            int pageSize = 50;
             int pageNumber = 0;
             do {
                 pageNumber++;
@@ -369,7 +369,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
 
             billQuery.setLimit(limit);
             billQuery.setFormId("STK_Inventory");
-            billQuery.setFieldKeys("FMaterialID.FNumber,FMaterialID.FName,FMaterialID.FSpecification,FMaterialID.F_QUXZ_Assistant,FMaterialID.FSTOREURNOM,FMaterialID.FSTOREURNUM,FStockId,FStockId.FName,FLot,FLot.FName,FStockUnitId,FStockUnitId.FName,FBaseQty,FStockStatusId.FName");
+            billQuery.setFieldKeys("FMaterialID.FNumber,FMaterialID.FName,FMaterialID.FSpecification,FMaterialID.F_QUXZ_Assistant,FMaterialID.FSTOREURNOM,FMaterialID.FSTOREURNUM,FMaterialID.FZJ,FStockId,FStockId.FName,FLot,FLot.FName,FStockUnitId,FStockUnitId.FName,FBaseQty,FStockStatusId.FName");
             List<Map> filterString = new ArrayList<>();
             //仓库等于成品仓或组装半成品仓
             filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FStockName","338","成品仓,组装半成品仓","","","0"));//仓库名称 IN XX
@@ -398,6 +398,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
                 String FMaterialName = UtilMap.getString(map,"FMaterialID.FName");//物料名称
                 String FMaterialSpecification = UtilMap.getString(map,"FMaterialID.FSpecification");//物料规格
                 String FQUXZAssistant = Objects.nonNull(map.get("FMaterialID.F_QUXZ_Assistant")) ? UtilMap.getString(map,"FMaterialID.F_QUXZ_Assistant") : "--";//所属系列
+                String Fzj = UtilMap.getString(map,"FMaterialID.FZJ");//组件
                 String FStockName = UtilMap.getString(map,"FStockId.FName");//仓库名称
                 String FLotName = UtilMap.getString(map,"FLot.FName");//批号
                 String FStockUnitName = UtilMap.getString(map,"FStockUnitId.FName");//库存主单位
@@ -407,12 +408,21 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
                 Double FSTOREURNOM = UtilMap.getDouble(map, "FMaterialID.FSTOREURNOM");
                 Double FSTOREURNUM = UtilMap.getDouble(map, "FMaterialID.FSTOREURNUM");
 
+                if ("组装半成品仓".equals(FStockName)){
+                    if (FMaterialName.contains("组件") && !FMaterialName.contains("面板") && !FMaterialName.contains("包装")){
+
+                    }else {
+                        continue;
+                    }
+                }
+
                 Double FQty = FBaseQty * FSTOREURNOM / FSTOREURNUM;//库存量(主单位)
 
                 formData.put("textField_mfarr0ei",FMaterialNumber);
                 formData.put("textField_mfarr0en",FMaterialName);
                 formData.put("textField_mfarr0eo",FMaterialSpecification);
                 formData.put("textField_mflwgj61", FQUXZAssistant);
+                formData.put("textField_mipr1qrc", Fzj);
                 formData.put("textField_mfarr0et",FStockName);
                 formData.put("textField_mfarr0eu",FLotName);
                 formData.put("textField_mfarr0ev",FStockUnitName);
@@ -519,7 +529,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
             //更新看板更新记录
             ydClient.operateData(YDParam.builder()
                     .formInstId(formInstId)
-                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t", "异常", System.currentTimeMillis())))
+                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t, textareaField_mir0zmpo", "异常", System.currentTimeMillis(),e.getMessage())))
                     .build(), YDConf.FORM_OPERATION.update);
 
             throw new RuntimeException(e);
@@ -627,7 +637,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
             //更新看板更新记录
             ydClient.operateData(YDParam.builder()
                     .formInstId(formInstId)
-                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t", "异常", System.currentTimeMillis())))
+                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t, textareaField_mir0zmpo", "异常", System.currentTimeMillis(),e.getMessage())))
                     .build(), YDConf.FORM_OPERATION.update);
 
             throw new RuntimeException(e);
@@ -775,7 +785,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
     public void syncDLVNotice(String userId) {
         MDC.put("MDC_KEY_PID","1002");
 
-        log.info("开始同步生产退料明细");
+        log.info("开始同步发货通知单");
 
         //创建看板更新记录
         if (Strings.isBlank(userId)){
@@ -900,7 +910,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
             //更新看板更新记录
             ydClient.operateData(YDParam.builder()
                     .formInstId(formInstId)
-                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t", "异常", System.currentTimeMillis())))
+                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t, textareaField_mir0zmpo", "异常", System.currentTimeMillis(),e.getMessage())))
                     .build(), YDConf.FORM_OPERATION.update);
 
             throw new RuntimeException(e);