Browse Source

问题修改

zhs 2 years ago
parent
commit
1f5a4f87f4

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

@@ -52,4 +52,6 @@ public interface WarehousingMapper {
     List<Map<String, Object>> export(Storage storage);
 
     Map<String, Object> getScanIsNot(@Param("wllbCode")String wllbCode, @Param("suppId")String suppId, @Param("unique")String unique, @Param("producDate")String producDate);
+
+    int getMateriaIsExist(String wllbCode);
 }

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

@@ -27,6 +27,13 @@ public class WarehousingServiceImpl implements WarehousingService {
     public Map<String, Object> getRecommend(String wllbCode, String suppId, String num, String unique, String producDate) {
         Map<String, Object> map = new HashMap<>();
         try{
+            //判断物料是否录入
+            int count = warehousingMapper.getMateriaIsExist(wllbCode);
+            if(count == 0){
+                map.put("msg", "500");
+                map.put("errMsg", "物料信息未录入,请联系管理员");
+                return map;
+            }
             Map<String, Object> mapVal = warehousingMapper.getScanIsNot(wllbCode, suppId, unique, producDate);
             if(Integer.parseInt(mapVal.get("inventoryCount").toString()) != 0 || Integer.parseInt(mapVal.get("virtualCount").toString()) != 0){
                 map.put("msg", "500");

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

@@ -199,4 +199,8 @@
                (select count(*) from tld_warehousing_virtual where supp_id = #{suppId} and serial = #{unique} and wllb_code = #{wllbCode} and produc_date = #{producDate}) as virtualCount
         from dual
     </select>
+    <!-- 查询物料是否存在 -->
+    <select id="getMateriaIsExist" resultType="int">
+        select count(0) from tld_material where code = #{wllbCode}
+    </select>
 </mapper>