From d7a5c71a1e0fdc33501be1f5da77ac978c024dc1 Mon Sep 17 00:00:00 2001
From: yiwenpeng <ywp303@163.com>
Date: Wed, 7 Dec 2022 16:42:23 +0800
Subject: [PATCH] 成品入库回传ERP单据后显示错误信息

---
 src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java                              |  1 +
 src/main/java/com/huaheng/pc/barcode/barcodeHeader/domain/BarCodeHeader.java                      |  8 +++++++-
 src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java |  2 +-
 src/main/resources/templates/barcode/barCodeHeader/barCodeHeader.html                             | 12 ++++++++++++
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java b/src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java
index f912144..48f20f8 100644
--- a/src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java
+++ b/src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java
@@ -276,6 +276,7 @@ public class TaskReturnServiceImpl implements TaskReturnService {
         Integer pushErrorCount = barCodeHeader.getPushErrorCount() == null ? 0 : barCodeHeader.getPushErrorCount();
         barCodeHeader.setPushErrorCount(pushErrorCount + 1);
         barCodeHeader.setLocked(4);//回传失败
+        barCodeHeader.setErpErrorMsg(erpAjaxResult.getMsg() + erpAjaxResult.getErrorMsg());
         barCodeHeaderService.updateById(barCodeHeader);
         return AjaxResult.error(erpAjaxResult.getMsg() + erpAjaxResult.getErrorMsg());
     }
diff --git a/src/main/java/com/huaheng/pc/barcode/barcodeHeader/domain/BarCodeHeader.java b/src/main/java/com/huaheng/pc/barcode/barcodeHeader/domain/BarCodeHeader.java
index 9206ec3..4e85f80 100644
--- a/src/main/java/com/huaheng/pc/barcode/barcodeHeader/domain/BarCodeHeader.java
+++ b/src/main/java/com/huaheng/pc/barcode/barcodeHeader/domain/BarCodeHeader.java
@@ -296,4 +296,10 @@ public class BarCodeHeader implements Serializable {
     @ApiModelProperty(value = "物料单位")
     private String materialUnit;
 
-}
\ No newline at end of file
+    /**
+     * erp错误消息
+     */
+    @TableField(value = "erpErrorMsg")
+    @ApiModelProperty(value="erp错误消息")
+    public String erpErrorMsg;
+}
diff --git a/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java b/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
index 3dbc285..5c33994 100644
--- a/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
+++ b/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
@@ -109,7 +109,7 @@ public class ShippingCombinationService {
         materialTypelam.eq(MaterialType::getCode,material.getType()).eq(MaterialType::getWarehouseCode,shipmentDetail.getWarehouseCode());
         MaterialType materialType=materialTypeService.getOne(materialTypelam);
         if(materialType==null){
-            throw new ServiceException(material.getType()+"物料种类不存在");
+            throw new ServiceException(material.getType()+"物料类别不存在,可以到物料管理选择该物料的物料类别");
         }
         if(StringUtils.isNotEmpty(materialType.getAllocationRule())){
             filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,materialType.getAllocationRule());
diff --git a/src/main/resources/templates/barcode/barCodeHeader/barCodeHeader.html b/src/main/resources/templates/barcode/barCodeHeader/barCodeHeader.html
index aca50cd..4f77bcf 100644
--- a/src/main/resources/templates/barcode/barCodeHeader/barCodeHeader.html
+++ b/src/main/resources/templates/barcode/barCodeHeader/barCodeHeader.html
@@ -316,6 +316,18 @@
                     title : '-1回传重量',
                 },
                 {
+                    field: 'erpErrorMsg',
+                    title: 'ERP回传错误信息',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        if(value == undefined || value == '')
+                            value = " "
+                        else
+                            actions.push('<pre style="max-height:50px; white-space: pre-wrap; width:500px">'+value+ '</pre>')
+                        return actions.join(" ")
+                    }
+                },
+                {
                     field : 'firstStatus',
                     title : '头状态',
                     align: 'center',
--
libgit2 0.22.2