Jelajahi Sumber

问题修改

zhs 2 tahun lalu
induk
melakukan
1afb5c08c8

+ 1 - 1
src/main/java/com/tld/mapper/WarehouseTransferMapper.java

@@ -19,7 +19,7 @@ public interface WarehouseTransferMapper {
 
     WarehouseTransfer getWarehouseTransferDetailed(String askGoodsId, String materialId);
 
-    void updateOutNum(String num, String askGoodsId, String materialId);
+    void updateOutNum(@Param("num")String num, @Param("askGoodsId")String askGoodsId, @Param("materialId")String materialId, @Param("typeVal")String typeVal);
 
     int getReturnWarehouseTransferCount();
 

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

@@ -148,10 +148,10 @@ public class DeliveryServiceImpl implements DeliveryService {
                 }
                 //判断物料是否录入
                 MaterialClass materialClass = warehousingMapper.getMateriaIsExist(askGoods.getWllbCode());
-                deliveryMapper.updateDelivery(materialClass.getTldId(), askGoods.getNum(), deliveryId); //修改销售单出库数量
                 //查询销售单部分信息
                 Delivery delivery = new Delivery().setDeliveryId(deliveryId).setMaterialId(materialClass.getTldId());
                 List<Delivery> list = deliveryMapper.getDelivery(delivery);
+                deliveryMapper.updateDelivery(materialClass.getTldId(), askGoods.getNum(), deliveryId); //修改销售单出库数量
                 if(materialClass.getPartType().equals("产成品")){
                     //产成品销售流水
                     Delivery delivery1 = new Delivery()

+ 14 - 4
src/main/java/com/tld/service/impl/WarehouseTransferServiceImpl.java

@@ -101,7 +101,7 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                     return map;
                 }
                 //如果出库库存等于虚拟表库存则删除此库存
-                if(Integer.parseInt(askGoods.getNum()) == Integer.parseInt(inventory.getAmount())){
+                if(Double.doubleToLongBits(Double.parseDouble(askGoods.getNum())) == Double.doubleToLongBits(Double.parseDouble(inventory.getAmount()))){
                     askGoodsMapper.deleteInventory(inventory);
                 } else {
                     inventory.setAmount(askGoods.getNum());
@@ -130,7 +130,12 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                 askGoods.setStorageLocationCode(askGoods.getStorageLocationCode());
                 askGoodsMapper.addRemoval(askGoods);//插入出库流水
                 askGoodsMapper.deleteVirtual(askGoods.getId());//删除已出虚拟表库存
-                warehouseTransferMapper.updateOutNum(askGoods.getNum(), askGoodsId, materialId);//修改出库数量
+                Double scanNum = Double.parseDouble(warehouseTransfer.getOutNum()) + Double.parseDouble(askGoods.getNum());
+                String typeVal = "0";
+                if(Double.doubleToLongBits(scanNum) == Double.doubleToLongBits(Double.parseDouble(warehouseTransfer.getNum()))){
+                    typeVal = "1";
+                }
+                warehouseTransferMapper.updateOutNum(askGoods.getNum(), askGoodsId, materialId, typeVal);//修改出库数量
                 if(askGoods.getStorageLocationCodeRk().indexOf("XNKW") != -1){
                     Inventory inventory2 = warehouseTransferMapper.getInventoryVitrual(askGoods);
                     if(inventory2 != null ){
@@ -215,7 +220,12 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                 warehousingVirtual.setMaterialId(warehousingVirtual1.getMaterialId());
                 warehousingVirtual.setStorageCode(warehouseTransferCode);
                 list.add(warehousingVirtual);
-                warehouseTransferMapper.updateOutNum(warehousingVirtual.getNum(), warehousingVirtual.getWarehouseTransferId(), materialId);//修改出库数量
+                Double scanNum = Double.parseDouble(warehouseTransfer.getOutNum()) + Double.parseDouble(warehousingVirtual.getNum());
+                String typeVal = "0";
+                if(Double.doubleToLongBits(scanNum) == Double.doubleToLongBits(Double.parseDouble(warehouseTransfer.getNum()))){
+                    typeVal = "1";
+                }
+                warehouseTransferMapper.updateOutNum(warehousingVirtual.getNum(), warehousingVirtual.getWarehouseTransferId(), materialId, typeVal);//修改出库数量
 
                 AskGoods askGoods = new AskGoods()
                         .setStorageLocationCode(warehousingVirtual.getStorageLocationCodeCk())
@@ -240,7 +250,7 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                     inventory = askGoodsMapper.getInventoryWarehousing(askGoods);
                 }
                 //如果出库库存等于虚拟表库存则删除此库存
-                if(Integer.parseInt(askGoods.getNum()) == Integer.parseInt(inventory.getAmount())){
+                if(Double.doubleToLongBits(Double.parseDouble(askGoods.getNum())) == Double.doubleToLongBits(Double.parseDouble(inventory.getAmount()))){
                     askGoodsMapper.deleteInventory(inventory);
                 } else {
                     inventory.setAmount(askGoods.getNum());

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

@@ -31,7 +31,7 @@ public class WarehousingServiceImpl implements WarehousingService {
     //入库
     @Autowired
     private WarehousingMapper warehousingMapper;
-    //用户
+    //用户`
     @Autowired
     private UserMapper userMapper;
     //错误日志表

+ 30 - 24
src/main/resources/mapper/AskGoodsMapper.xml

@@ -153,7 +153,12 @@
           and wllb_code = #{wllbCode}
           and produc_date = #{producDate}
           and account_sleeve = #{companyNumber}
-          and wbs = #{wbs}
+        <if test="wbs != '' and wbs != null">
+            and wbs = #{wbs}
+        </if>
+        <if test="wbs == ''.toString() or wbs == null ">
+            and wbs is null
+        </if>
     </select>
     <!-- 查询指定库存内容 -->
     <select id="getInventoryWarehousing" resultType="com.tld.model.Inventory">
@@ -574,31 +579,32 @@
     <!-- 查询半成品出库数据 -->
     <select id="getGoodsHalf" resultType="com.tld.model.AskGoods">
         SELECT
-        a.id,
-        a.material_id,
-        a.num,
-        a.production_code,
-        b.name as materialName,
-        b.code as materialCode,
-        a.out_num,
-        a.ask_goods_id,
-        c.company_number,
-        e.name as department,
-        a.type,
-        a.wbs,
-        a.entry_number,
-        g.name as companyName,
-        c.source_type,
-        c.move_type,
-        c.sqrq
+            a.id,
+            a.material_id,
+            a.num,
+            a.production_code,
+            b.name as materialName,
+            b.code as materialCode,
+            a.out_num,
+            a.ask_goods_id,
+            c.company_number,
+            e.name as department,
+            a.type,
+            a.wbs,
+            a.entry_number,
+            g.name as companyName,
+            c.source_type,
+            c.move_type,
+            c.sqrq
         FROM
-        tld_ask_goods a
-        join tld_material b on a.material_id = b.tld_id
-        join tld_ask_goods_f c on a.ask_goods_id = c.ask_goods_id
-        left join tld_department e on c.department = e.code
-        left join tld_company g on b.company_number = g.code
+            tld_ask_goods a
+            join tld_material b on a.material_id = b.tld_id
+            join tld_ask_goods_f c on a.ask_goods_id = c.ask_goods_id
+            left join tld_department e on c.department = e.code
+            left join tld_company g on b.company_number = g.code
         WHERE
-        (a.num + 0) <![CDATA[>]]> (a.out_num + 0) and b.part_type = #{partType}
+--         (a.num + 0) <![CDATA[>]]> (a.out_num + 0)
+          b.part_type = #{partType}
         <if test="productionCode != null and productionCode != ''">
             and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
         </if>

+ 33 - 17
src/main/resources/mapper/InviteMapper.xml

@@ -111,8 +111,12 @@
     </select>
     <!-- 新增出库虚拟表 -->
     <insert id="addAskGoodsVitrual">
-        insert into tld_ask_goods_vitrual(unique_code,supplier_id,serial,wllb_code,produc_date,ask_goods_id,type,storage_location_code,num,user_id,department)
-        values(#{uniqueCode},#{supplierId},#{serial},#{wllbCode},#{producDate},#{askGoodsId},#{type},#{storageLocationCode},#{num},#{userId},#{department})
+        insert into tld_ask_goods_vitrual(unique_code, supplier_id, serial, wllb_code, produc_date, ask_goods_id, type,
+                                          storage_location_code, num, user_id, department, attribute, account_sleeve,
+                                          storage_location_code_rk, wbs)
+        values (#{uniqueCode}, #{supplierId}, #{serial}, #{wllbCode}, #{producDate}, #{askGoodsId}, #{type},
+                #{storageLocationCode}, #{num}, #{userId}, #{department}, #{attribute}, #{companyNumber},
+                #{storageLocationCodeRk}, #{wbs})
     </insert>
     <!-- 查询指定库存内容 -->
     <select id="getInventory" resultType="com.tld.model.Inventory">
@@ -134,7 +138,18 @@
             wllb_code,
             produc_date,
             scrq
-        from tld_inventory where supplier_id = #{supplierId} and serial = #{serial} and wllb_code = #{wllbCode} and produc_date = #{producDate}
+        from tld_inventory
+        where supplier_id = #{supplierId}
+        and serial = #{serial}
+        and wllb_code = #{wllbCode}
+        and produc_date = #{producDate}
+        and account_sleeve = #{companyNumber}
+        <if test="wbs != '' and wbs != null">
+            and wbs = #{wbs}
+        </if>
+        <if test="wbs == ''.toString() or wbs == null ">
+            and wbs is null
+        </if>
     </select>
     <!-- 查询库存是否充足 -->
     <select id="getAsk" resultType="com.tld.model.AskGoods">
@@ -179,20 +194,21 @@
     </select>
     <!-- 查询虚拟表指定pda跟状态的的数据 -->
     <select id="getVirtualUniqueCode" resultType="com.tld.model.AskGoods">
-        select
-            id,
-            unique_code,
-            supplier_id,
-            serial,
-            wllb_code,
-            produc_date,
-            ask_goods_id,
-            type,
-            storage_location_code,
-            num,
-            user_id,
-            department,
-            account_sleeve
+        select id,
+               unique_code,
+               supplier_id,
+               serial,
+               wllb_code,
+               produc_date,
+               ask_goods_id,
+               type,
+               storage_location_code,
+               num,
+               user_id,
+               department,
+               account_sleeve,
+               wbs,
+               storage_location_code_rk
         from tld_ask_goods_vitrual where unique_code = #{uniqueCode} and type = #{type} and ask_goods_id = #{askGoodsId}
     </select>
     <!-- 删除库存 -->

+ 1 - 1
src/main/resources/mapper/WarehouseTransferMapper.xml

@@ -106,7 +106,7 @@
     <!-- 修改出库数量 -->
     <update id="updateOutNum">
         update tld_warehouse_transfer
-        set out_num = ifnull(out_num, 0) + #{num} where material_id = #{materialId} and warehouse_transfer_id = #{askGoodsId}
+        set out_num = ifnull(out_num, 0) + #{num},type = #{typeVal} where material_id = #{materialId} and warehouse_transfer_id = #{askGoodsId}
     </update>
     <!-- 查询当天移库单条数 -->
     <select id="getReturnWarehouseTransferCount" resultType="int">

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

@@ -679,7 +679,7 @@
     <update id="updateAskGoodsHalf">
         update tld_ask_goods
         set out_num = ifnull(out_num, 0) + #{warehousingNum},
-            type    = '1'
+            type = '1'
         where id = #{id}
     </update>
     <!-- 新增半成品流水 -->