luobang il y a 2 ans
Parent
commit
f1217063d3

+ 10 - 0
src/main/java/com/steerinfo/dil/controller/WmspGridMaterialController.java

@@ -366,6 +366,16 @@ public class WmspGridMaterialController extends BaseRESTfulController {
     }
 
 
+    @PostMapping("/deleteInboundMaterial")
+    public  RESTfulResult deleteInboundMaterial(String warehouseId, String materialCode,String materialSpecification, String materialModel, Integer quantity
+    ){
+        int result = wmspGridMaterialService.deleteInboundMaterial(warehouseId,materialCode,materialSpecification,materialModel,quantity);
+//        判断当前的result是否大于0
+        if (result<1){
+            return failed(-1);
+        }
+        return success(result);
+    }
 
 }
 

+ 2 - 0
src/main/java/com/steerinfo/dil/service/IWmspGridMaterialService.java

@@ -80,4 +80,6 @@ public interface IWmspGridMaterialService  {
                                     String materialModel,
                                     Integer status,
                                     Integer num);
+
+    int deleteInboundMaterial(String warehouseId, String materialCode, String materialSpecification, String materialModel, Integer quantity);
 }

+ 39 - 1
src/main/java/com/steerinfo/dil/service/impl/WmspGridMaterialServiceImpl.java

@@ -392,6 +392,8 @@ public class WmspGridMaterialServiceImpl  implements IWmspGridMaterialService {
             int count = 0;
         //遍历materialList
             //创建金蝶报文
+            //防止前台没请求到
+            materialTheWeight = getTheoreticalByInfo(warehouseId,materialCode,materialSpecification,materialModel,status,quantity).toString();
             BigDecimal inboundEasId = wmspInboundEasMapper.inboundEasId();
             Map<String, Object> head = new HashMap<>();
             head.put("number",inboundEasId);
@@ -443,7 +445,11 @@ public class WmspGridMaterialServiceImpl  implements IWmspGridMaterialService {
             wmspInboundEas.setInsertTime(new Date());
             wmspInboundEas.setMaterialActuallyWeight(new BigDecimal(actuallyWeight));
             wmspInboundEas.setMaterialNum(new BigDecimal(quantity));
-            wmspInboundEas.setMaterialTheroticalWeight(new BigDecimal(materialTheWeight));
+            if(DataChange.dataToBigDecimal(warehouseId).intValue() == 3){
+                wmspInboundEas.setMaterialTheroticalWeight(new BigDecimal(actuallyWeight));
+            }else{
+                wmspInboundEas.setMaterialTheroticalWeight(new BigDecimal(materialTheWeight));
+            }
             wmspInboundEas.setInsertUsername(remark);
             wmspInboundEas.setInsertUpdateRemark(json.toString());
             wmspInboundEas.setUpdateUsername(resultMap);
@@ -604,4 +610,36 @@ public class WmspGridMaterialServiceImpl  implements IWmspGridMaterialService {
     }
 
 
+    @Override
+    public int deleteInboundMaterial(String warehouseId, String materialCode, String materialSpecification, String materialModel, Integer quantity) {
+        //        设置状态为预留转入库
+        Integer status = 1;
+//        根据前端传过来的物资型号,物资规格查询当前实时库存中的物资id
+        List<Map<String,Object>> materialIdList=wmspGridMaterialMapper.getMaterialIdes(warehouseId,materialCode,materialSpecification,materialModel,status);
+        for (Map<String,Object> map:materialIdList){}
+        //        当数量小于零的时候
+        if (quantity<=0){
+            return 0;
+        }else if (quantity>materialIdList.size()){
+            //        当数量大于查询到的数量
+            return -1;
+        }else{
+            int count = 0;
+            //遍历materialList
+            //创建金蝶报文
+            //防止前台没请求到
+            for (int i =0;i<quantity;i++){
+                Map<String,Object> map =materialIdList.get(i);
+                BigDecimal inboundId=(BigDecimal) map.get("inboundId");
+//            创建入库实体类
+                WmspInboundResult wmspInboundResult = new WmspInboundResult();
+                wmspInboundResult.setInboundId(inboundId);
+                wmspInboundResult.setInboundIscomplete(new BigDecimal(2));
+                wmspInboundResult.setIsupload(new BigDecimal(1));
+//            修改入库实绩
+                count += wmspInboundResultMapper.updateByPrimaryKeySelective(wmspInboundResult);
+            }
+            return count;
+        }
+    }
 }

+ 1 - 0
src/main/java/com/steerinfo/dil/service/impl/WmspOutboundResultServiceImpl.java

@@ -390,6 +390,7 @@ public class WmspOutboundResultServiceImpl  implements IWmspOutboundResultServic
         //插入扫描实绩
         return scanResultInsert(wmspOutboundScanResult);
     }
+
     public int deleteGridMaterial(String materialOnlyCode) {
             int i=0;
             String[] tag1 = materialOnlyCode.split("\\-");

+ 1 - 1
src/main/resources/application-prod.yml

@@ -10,7 +10,7 @@ spring:
 #feign设置
 openfeign:
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
   Im:
     url: ${IMFEIGN_URL:172.16.33.166:8055}
   TmsTruckFeign: