소스 검색

问题修改

zhs 2 년 전
부모
커밋
ab01bed8dc

+ 4 - 2
src/main/java/com/tld/controller/GsAccessController.java

@@ -60,7 +60,7 @@ public class GsAccessController {
      */
     @PostMapping("addReceiveGoodsConfirm")
     @PassToken
-    public Map<String, Object>addReceiveGoodsConfirm(ReceiveGoods receiveGoods){
+    public Map<String, Object> addReceiveGoodsConfirm(ReceiveGoods receiveGoods){
         return receiveGoodsSerivce.addReceiveGoodsConfirm(receiveGoods);
     }
 
@@ -71,7 +71,9 @@ public class GsAccessController {
      */
     @PostMapping("addAskGoods")
     @PassToken
-    public Map<String, Object>addAskGoods(AskGoods askGoods){
+    public Map<String, Object>  addAskGoods(AskGoods askGoods){
         return askGoodsService.addAskGoods(askGoods);
     }
+
+
 }

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

@@ -54,4 +54,6 @@ public interface WarehousingMapper {
     Map<String, Object> getScanIsNot(@Param("wllbCode")String wllbCode, @Param("suppId")String suppId, @Param("unique")String unique, @Param("producDate")String producDate);
 
     int getMateriaIsExist(String wllbCode);
+
+    int getInventoryProduc(@Param("wllbCode")String wllbCode, @Param("producDate")String producDate, @Param("storageLocationCode")String storageLocationCode);
 }

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

@@ -57,9 +57,13 @@ public class WarehousingServiceImpl implements WarehousingService {
             for(int i = 0; i < listMaterialClass.size(); i++) {
                 Map<String, Object> map1 = warehousingMapper.getScanNum(listMaterialClass.get(i).getStorageLocationCode(), num);
                 if(Double.parseDouble(String.valueOf(map1.get("scanNum"))) < Double.parseDouble(String.valueOf(map1.get("storageLocationCapacity")))){
-                    stringBuffer.append(listMaterialClass.get(i).getStorageLocationCode() + ",");
-                    int surplusNum = (int) (Double.parseDouble(String.valueOf(map1.get("storageLocationCapacity"))) - Double.parseDouble(String.valueOf(map1.get("scanNum"))) + Double.parseDouble(num));
-                    listString.add(surplusNum);
+                    //查询库存是否同物料同批次存在
+                    int countProduc = warehousingMapper.getInventoryProduc(listMaterialClass.get(i).getWllbCode(), producDate, listMaterialClass.get(i).getStorageLocationCode());
+                    if(countProduc == 0){
+                        stringBuffer.append(listMaterialClass.get(i).getStorageLocationCode() + ",");
+                        int surplusNum = (int) (Double.parseDouble(String.valueOf(map1.get("storageLocationCapacity"))) - Double.parseDouble(String.valueOf(map1.get("scanNum"))) + Double.parseDouble(num));
+                        listString.add(surplusNum);
+                    }
                 }
             }
             List<StorageLocation> list = warehousingMapper.recommend(stringBuffer.toString());

+ 9 - 0
src/main/resources/mapper/WarehousingMapper.xml

@@ -203,4 +203,13 @@
     <select id="getMateriaIsExist" resultType="int">
         select count(0) from tld_material where code = #{wllbCode}
     </select>
+    <!-- 查询库存是否同物料同批次存在 -->
+    <select id="getInventoryProduc" resultType="int">
+        SELECT
+            count(0)
+        FROM
+            tld_inventory a
+            JOIN tld_material b ON a.material_id = b.tld_id
+        WHERE a.produc_date = #{producDate} AND b.code = #{wllbCode} and a.storage_location_code = #{storageLocationCode}
+    </select>
 </mapper>