Browse Source

问题修改

zhs 2 years ago
parent
commit
4e51328bd4

+ 2 - 0
src/main/java/com/tld/mapper/WarehousingMapper.java

@@ -122,4 +122,6 @@ public interface WarehousingMapper {
     Map<String, Object> getSumWarehousingVirtual(WarehousingVirtual warehousingVirtual);
 
     Map<String, Object> getWarehouseTransferVirtual(WarehousingVirtual warehousingVirtual);
+
+    void updateWarehousingType(@Param("storageCode")String storageCode, @Param("type")int type);
 }

+ 4 - 0
src/main/java/com/tld/model/Storage.java

@@ -132,4 +132,8 @@ public class Storage implements Serializable {
      * 采购数量
      */
     private String purchaseNum;
+    /**
+     * 传输状态
+     */
+    private String transmissionType;
 }

+ 3 - 0
src/main/java/com/tld/service/impl/AskGoodsServiceImpl.java

@@ -316,12 +316,14 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             Map<String, Object> result = httpClientUtil1.doPost("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock", returnData);
             System.out.println("result:"+result);
             Error error = new Error();
+            int type = 0;
             if(Integer.parseInt(result.get("msg").toString()) != 200){
                 //如果失败存入报错信息跟数据
                 error.setErrorInfo(result.get("data").toString());
                 error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
                 error.setDataVal(returnData.toJSONString());
                 errorMapper.addError(error);
+                type = 1;
             }else {
                 JSONObject jsonObject = (JSONObject) JSONObject.parse(result.get("data").toString());
                 JSONObject jsonObject1 = (JSONObject) JSONObject.parse(jsonObject.get("result").toString());
@@ -331,6 +333,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                     error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
                     error.setDataVal(returnData.toJSONString());
                     errorMapper.addError(error);
+                    type = 1;
                 }else {
                     List<JSONObject>  data1 = (List<JSONObject>) JSONObject.parse(jsonObject1.get("data").toString());
                     for (JSONObject map : data1) {

+ 7 - 3
src/main/java/com/tld/service/impl/WarehousingServiceImpl.java

@@ -251,13 +251,14 @@ public class WarehousingServiceImpl implements WarehousingService {
                 HttpClientUtil httpClientUtil1 = new HttpClientUtil();
                 Map<String, Object> result = httpClientUtil1.doPost("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock", returnData);
                 Error error = new Error();
-
+                int type = 0;
                 if (Integer.parseInt(result.get("msg").toString()) != 200) {
                     //如果失败存入报错信息跟数据
                     error.setErrorInfo(result.get("data").toString());
                     error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
                     error.setDataVal(returnData.toJSONString());
                     errorMapper.addError(error);
+                    type = 1;
                 } else {
                     JSONObject jsonObject = JSONObject.parseObject(JSON.parseObject((String) result.get("data")).get("result").toString());
                     if (jsonObject.get("State").toString().equals("0")) {
@@ -266,6 +267,7 @@ public class WarehousingServiceImpl implements WarehousingService {
                         error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
                         error.setDataVal(returnData.toJSONString());
                         errorMapper.addError(error);
+                        type = 1;
                     }
                 }
                 //删除父子表信息
@@ -275,6 +277,8 @@ public class WarehousingServiceImpl implements WarehousingService {
                 String accessType = "1";
                 String returnGsRemoval = returnData.toString();
                 askGoodsMapper.addAccess(names, returnGsRemoval, accessType);
+                //增加流水传输状态
+                warehousingMapper.updateWarehousingType(returnWarehousing.getStorageCode(), type);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -436,9 +440,9 @@ public class WarehousingServiceImpl implements WarehousingService {
                 map.put("errMsg", "订单已出库");
                 return map;
             }
-            if (Double.doubleToLongBits(Double.parseDouble(askGoods.getNum())) < Double.doubleToLongBits(Double.parseDouble(notice.getWarehousingNum()))) {
+            if (Double.doubleToLongBits(Double.parseDouble(askGoods.getNum())) < Double.doubleToLongBits(Double.parseDouble(notice.getWarehousingNum()) + Double.parseDouble(askGoods.getOutNum()))) {
                 map.put("msg", "500");
-                map.put("errMsg", "出库数量大于要货单数量");
+                map.put("errMsg", "出库数量大于剩余要货单数量");
                 return map;
             }
             if (inventory == null) {

+ 6 - 1
src/main/resources/mapper/WarehousingMapper.xml

@@ -225,7 +225,8 @@
             a.order_code as orderCode,
             a.account_sleeve,
             f.name as accountName,
-            a.purchase_num
+            a.purchase_num,
+            a.transmission_type
         from tld_storage a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
@@ -1030,4 +1031,8 @@
             (select (num + 0) - ifnull((out_num + 0), 0) from tld_warehouse_transfer where warehouse_transfer_id = #{warehouseTransferId} and material_id = #{materialId}) as num
         from dual
     </select>
+    <!-- 流水增加传输状态 -->
+    <update id="updateWarehousingType">
+        update tld_storage set transmission_type = #{type} where storage_code = #{storageCode}
+    </update>
 </mapper>