Browse Source

问题修改

zhs 2 years ago
parent
commit
c36166bc97

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

@@ -113,4 +113,6 @@ public interface AskGoodsMapper {
     List<Map<String, Object>> getGsRemoval(@Param("removalCode") String removalCode);
 
     AskGoods getWareInfo(AskGoods askGoods);
+
+    Inventory getInventoryWarehousing(AskGoods askGoods);
 }

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

@@ -114,4 +114,6 @@ public interface WarehousingMapper {
     void updateInventoryOther(Inventory inventory);
 
     void addReturnWarehousingOther(WarehousingVirtual warehousingVirtual);
+
+    void updateVitrualNum(Inventory inventory1);
 }

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

@@ -83,11 +83,11 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                 MaterialClass material = warehousingMapper.getMaterial(new Notice().setMaterialCode(askGoods.getWllbCode()));
                 Inventory inventory = new Inventory();
                 askGoods.setCompanyNumber(askGoods.getAccountSleeve());
-                if(material.getPartType().equals("原材料")){
+                if(material.getPartType().equals("原材料")) {
                     inventory = askGoodsMapper.getInventory(askGoods);
-                } else if(material.getPartType().equals("产成品")){
+                } else if(material.getPartType().equals("产成品")) {
                     inventory = deliveryMapper.getInventoryHalf(askGoods);
-                } else if(material.getPartType().equals("半成品")){
+                } else if(material.getPartType().equals("半成品")) {
                     inventory = askGoodsMapper.getInventoryInfo(askGoods).get(0);
                 }
                 if(inventory == null){
@@ -126,6 +126,13 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                 askGoodsMapper.addRemoval(askGoods);//插入出库流水
                 askGoodsMapper.deleteVirtual(askGoods.getId());//删除已出虚拟表库存
                 warehouseTransferMapper.updateOutNum(askGoods.getNum(), askGoodsId, materialId);//修改出库数量
+                if(askGoods.getStorageLocationCodeRk().indexOf("XNKW") != -1){
+                    Inventory inventory1 = new Inventory()
+                            .setNum(askGoods.getNum())
+                            .setMaterialId(materialId)
+                            .setStorageLocationCode(askGoods.getStorageLocationCodeRk());
+                    warehousingMapper.updateVitrualNum(inventory1);
+                }
                 WarehouseTransfer warehouseTransfer1 = new WarehouseTransfer()
                         .setWarehouseTransferId(warehouseTransfer.getWarehouseTransferId()) //移库单id
                         .setEntryNumber(warehouseTransfer.getEntryNumber())//分录号
@@ -143,7 +150,9 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                     .setWarehouseTransferType(warehouseTransferF.getWarehouseTransferType()); //移库类型
             warehouseTransferMapper.addReturnGsWarehouseTransferF(warehouseTransfer1);//新增返回gs数据父表信息
             warehousingMapper.addStorage(warehousing);//入库流水
-            warehousingMapper.addInventory(warehousing);//库存
+            if(list.get(0).getStorageLocationCodeRk().indexOf("XNKW") > 0){
+                warehousingMapper.addInventory(warehousing);//库存
+            }
             map.put("data", warehouseTransferCode);
             map.put("msg", "200");
         }catch (Exception e){
@@ -206,7 +215,7 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                         .setCompanyNumber(warehouseTransfer.getAccountSleeve());
                 Inventory inventory = new Inventory();
                 if(material.getPartType().equals("原材料")){
-                    inventory = askGoodsMapper.getInventory(askGoods);
+                    inventory = askGoodsMapper.getInventoryWarehousing(askGoods);
                 } else if(material.getPartType().equals("产成品")){
                     inventory = deliveryMapper.getInventoryHalf(askGoods);
                 } else if(material.getPartType().equals("半成品")){

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

@@ -113,7 +113,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             map.put("data", list);
             map.put("listString", listMap);//返回库位剩余数量
             map.put("msg", "200");
-        } catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             map.put("msg", "500");
             map.put("errMsg", "服务器请求异常,请稍后再试");

+ 22 - 0
src/main/resources/mapper/AskGoodsMapper.xml

@@ -127,6 +127,28 @@
            scrq
         from tld_inventory where supplier_id = #{supplierId} and serial = #{serial} and wllb_code = #{wllbCode} and produc_date = #{producDate} and account_sleeve = #{companyNumber} and wbs = #{wbs}
     </select>
+    <!-- 查询指定库存内容 -->
+    <select id="getInventoryWarehousing" resultType="com.tld.model.Inventory">
+        select
+            id,
+            storage_location_code,
+            wllb_class,
+            library_type,
+            material_id,
+            amount,
+            total,
+            totime,
+            hold,
+            amount_lock,
+            account_sleeve,
+            wbs,
+            supplier_id,
+            serial,
+            wllb_code,
+            produc_date,
+            scrq
+        from tld_inventory where supplier_id = #{supplierId} and wllb_code = #{wllbCode} and produc_date = #{producDate} and account_sleeve = #{companyNumber} and wbs = #{wbs}
+    </select>
     <!-- 查询库存是否充足 -->
     <select id="getAsk" resultType="com.tld.model.AskGoods">
         SELECT

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

@@ -676,6 +676,10 @@
     <update id="updateInventoryOther">
         update tld_inventory set amount = amount + #{num} where id = #{id}
     </update>
+    <!-- 移库虚拟库入库 -->
+    <update id="updateVitrualNum">
+        update tld_inventory set amount = amount + #{num} where material_id = #{materialId} and storage_location_code = #{storageLocationCode}
+    </update>
     <!-- 其他入库返回gs -->
     <insert id="addReturnWarehousingOther">
         insert into tld_return_gs_other_warehousing(storage_code,account_sleeve,storage_location_code,wbs,amount,material_id)