Browse Source

问题修改

zhs 2 years ago
parent
commit
2edddd7e1f

+ 1 - 1
src/main/java/com/tld/service/impl/InviteServiceImpl.java

@@ -87,7 +87,7 @@ public class InviteServiceImpl implements InviteService {
             for(Inventory inventory : inviteMapper.getMaterialCk(askGoods)){
                 AskGoods askGoods1 = inviteMapper.getAsk(inventory);
                 if(askGoods1 != null){
-                    if( Double.doubleToLongBits(Double.parseDouble(askGoods1.getNum()))  != Double.doubleToLongBits(Double.parseDouble(inventory.getAmount())) ){
+                    if( Double.doubleToLongBits(Double.parseDouble(askGoods1.getNum())) != Double.doubleToLongBits(Double.parseDouble(inventory.getAmount())) ){
                         list.add(inventory);
                     }
                 } else {

+ 5 - 5
src/main/resources/mapper/AskGoodsMapper.xml

@@ -114,8 +114,8 @@
                a.scrq,
                b.storage_location_name               as storageLocationName
         from tld_inventory a
-         join tld_storage_location b on a.storage_location_code = b.storage_location_code
-         join tld_warehouse c on b.warehouse_where = c.tld_id
+        join tld_storage_location b on a.storage_location_code = b.storage_location_code
+        join tld_warehouse c on b.warehouse_where = c.tld_id
         where a.material_id = #{materialId}
           and a.account_sleeve = #{companyNumber}
           and a.hold = '0'
@@ -192,16 +192,16 @@
         FROM tld_ask_goods_vitrual a
                  join tld_material b on a.wllb_code = b.code and b.tld_id = #{materialId}
         where a.storage_location_code = #{storageLocationCode}
-          and a.serial = #{serial} and wbs = #{wbs} and account_sleeve = #{companyNumber}
+          and a.serial = #{serial} and wbs = #{wbs} and account_sleeve = #{accountSleeve}
     </select>
     <!-- 查询是否扫描 -->
     <select id="getScanIsNot" resultType="java.util.Map">
-        select (select ifnull(amount, 0)
+        select (select ifnull(max(amount), 0)
                 from tld_inventory
                 where supplier_id = #{supplierId}
                   and serial = #{serial}
                   and wllb_code = #{wllbCode}
-                  and produc_batch = #{producDate}) as inventoryNum,
+                  and produc_date = #{producDate}) as inventoryNum,
                (select ifnull(sum(num), 0)
                 from tld_ask_goods_vitrual
                 where supplier_id = #{supplierId}

+ 13 - 8
src/main/resources/mapper/InviteMapper.xml

@@ -109,7 +109,13 @@
             b.storage_location_name as storageLocationName
         from tld_inventory a
         join tld_storage_location b on a.storage_location_code = b.storage_location_code
-        where a.material_id = #{materialId} and a.account_sleeve = #{companyNumber} and a.hold = '0' and b.warehouse_where != '5000' order by a.produc_batch
+        join tld_warehouse c on b.warehouse_where = c.tld_id
+        where a.material_id = #{materialId}
+          and a.account_sleeve = #{companyNumber}
+          and a.hold = '0'
+          and (c.warehouse_type = '0' or c.warehouse_type = '1' or c.warehouse_type = '2')
+          and a.wbs = #{wbs}
+        order by a.produc_batch
     </select>
     <!-- 新增出库虚拟表 -->
     <insert id="addAskGoodsVitrual">
@@ -152,21 +158,20 @@
     </select>
     <!-- 查询库存是否充足 -->
     <select id="getAsk" resultType="com.tld.model.AskGoods">
-        SELECT
-            ifnull(sum(a.num),0) as num
-        FROM
-            tld_ask_goods_vitrual a
-            join tld_material b on a.wllb_code = b.code and b.tld_id = #{materialId}
+        SELECT ifnull(sum(a.num), 0) as num
+        FROM tld_ask_goods_vitrual a
+                 join tld_material b on a.wllb_code = b.code and b.tld_id = #{materialId}
         where a.storage_location_code = #{storageLocationCode}
+          and a.serial = #{serial} and wbs = #{wbs} and account_sleeve = #{accountSleeve}
     </select>
     <!-- 查询是否扫描 -->
     <select id="getScanIsNot" resultType="java.util.Map">
-        select (select ifnull(amount, 0)
+        select (select ifnull(max(amount), 0)
                 from tld_inventory
                 where supplier_id = #{supplierId}
                   and serial = #{serial}
                   and wllb_code = #{wllbCode}
-                  and produc_batch = #{producDate}) as inventoryNum,
+                  and produc_date = #{producDate}) as inventoryNum,
                (select ifnull(sum(num), 0)
                 from tld_ask_goods_vitrual
                 where supplier_id = #{supplierId}