zhs 2 lat temu
rodzic
commit
7b2648288f

+ 2 - 2
src/main/java/com/tld/controller/WarehouseTransferController.java

@@ -55,8 +55,8 @@ public class WarehouseTransferController {
      * @return 返回结果
      */
     @GetMapping("warehousing")
-    public Map<String, Object> warehousing(String uniqueCode, String type){
-        return warehouseTransferService.warehousing(uniqueCode, type);
+    public Map<String, Object> warehousing(String uniqueCode, String type, String askGoodsId){
+        return warehouseTransferService.warehousing(uniqueCode, type, askGoodsId);
     }
 
     /**

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

@@ -25,7 +25,7 @@ public interface WarehousingMapper {
 
     void delWarehousingVirtual(WarehousingVirtual warehousingVirtual);
 
-    List<WarehousingVirtual> getVirtual(@Param("uniqueCode")String uniqueCode, @Param("type")String type);
+    List<WarehousingVirtual> getVirtual(@Param("uniqueCode")String uniqueCode, @Param("type")String type, @Param("warehouseTransferId")String askGoodsId);
 
     List<ReceiveGoods> getReceiveGoods(WarehousingVirtual warehousingVirtual);
 

+ 1 - 1
src/main/java/com/tld/service/WarehouseTransferService.java

@@ -12,7 +12,7 @@ public interface WarehouseTransferService {
 
     Map<String, Object> OutOfLibrary(String uniqueCode, String type, String askGoodsId);
 
-    Map<String, Object> warehousing(String uniqueCode, String type);
+    Map<String, Object> warehousing(String uniqueCode, String type, String askGoodsId);
 
     Map<String, Object> delWarehouseTransfer(String id, HttpServletRequest request);
 

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

@@ -576,7 +576,8 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                         .setAskGoodsId("")
                         .setDepartment(askGoods.getDepartment())
                         .setWbs(askGoods.getWbs())
-                        .setStorageCode(removalCode);//新增出库流水
+                        .setStorageCode(removalCode)
+                        .setStorageLocationCode(askGoods.getStorageLocationCode());//新增出库流水
                 warehousingMapper.addRemovalHalfProduct(askGoods1);
             } else if(material.getPartType().equals("产成品")){
                 //产成品销售流水

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

@@ -168,7 +168,7 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
             if(list.get(0).getStorageLocationCodeRk().indexOf("XNKW") > 0){
                 warehousingMapper.addInventory(warehousing);//库存
             }
-            map.put("data", warehouseTransferCode);
+            map.put("data", askGoodsId);
             map.put("msg", "200");
         }catch (Exception e){
             e.printStackTrace();
@@ -185,12 +185,12 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
     }
 
     @Override
-    public Map<String, Object> warehousing(String uniqueCode, String type) {
+    public Map<String, Object> warehousing(String uniqueCode, String type, String askGoodsId) {
         Map<String, Object> map = new HashMap<>();
         try{
             //入库信息
             List<WarehousingVirtual> list = new LinkedList<>();
-            List<WarehousingVirtual> warehousingVirtualList = warehousingMapper.getVirtual(uniqueCode, type);
+            List<WarehousingVirtual> warehousingVirtualList = warehousingMapper.getVirtual(uniqueCode, type, askGoodsId);
             String warehouseTransferCode = codeGenerateYK(); //移库单
             //查询入库所需要的信息
             for(WarehousingVirtual warehousingVirtual : warehousingVirtualList) {
@@ -269,7 +269,7 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                     .setAskGoodsWarehouseId(warehouseTransferF.getAskGoodsWarehouseId()) //要货仓库id
                     .setWarehouseTransferType(warehouseTransferF.getWarehouseTransferType()); //移库类型
             warehouseTransferMapper.addReturnGsWarehouseTransferF(warehouseTransfer1);//新增返回gs数据父表信息
-            map.put("data", warehouseTransferCode);
+            map.put("data", askGoodsId);
             map.put("msg", "200");
         } catch (Exception e){
             e.printStackTrace();

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

@@ -159,7 +159,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             //入库信息
             List<WarehousingVirtual> list = new LinkedList<>();
             //查询入库所需要的信息
-            for(WarehousingVirtual warehousingVirtual : warehousingMapper.getVirtual(uniqueCode, type)){
+            for(WarehousingVirtual warehousingVirtual : warehousingMapper.getVirtual(uniqueCode, type, null)){
                 //查询采购单信息
                 List<ReceiveGoods> receiveGoods = warehousingMapper.getReceiveGoods(warehousingVirtual);
                 if(receiveGoods.size() != 0) {
@@ -185,7 +185,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             //返回采购单id
             StringBuilder stringBuilder = new StringBuilder();
             //入质检入库数量
-            for(WarehousingVirtual warehousingVirtual1 : warehousingMapper.getVirtual(uniqueCode, type)) {
+            for(WarehousingVirtual warehousingVirtual1 : warehousingMapper.getVirtual(uniqueCode, type, null)) {
                 //查询采购单信息
                 List<ReceiveGoods> receiveGoods = warehousingMapper.getReceiveGoods(warehousingVirtual1);
                 for(ReceiveGoods receiveGoods1 : receiveGoods) {

+ 4 - 1
src/main/resources/mapper/AskGoodsMapper.xml

@@ -656,7 +656,7 @@
             scrq,
             produc_batch,
             attribute
-        from tld_inventory where material_id = #{materialId} and account_sleeve = #{accountSleeve}
+        from tld_inventory where material_id = #{materialId}
         <if test="wbs != '' and wbs != null">
             and wbs = #{wbs}
         </if>
@@ -678,6 +678,9 @@
         <if test="storageLocationCode != '' and storageLocationCode != null">
             and storage_location_code = #{storageLocationCode}
         </if>
+        <if test="accountSleeve != '' and accountSleeve != null">
+            and account_sleeve = #{accountSleeve}
+        </if>
     </select>
     <!-- 查询仓库 -->
     <select id="getWarehouseWhere" resultType="String">

+ 5 - 2
src/main/resources/mapper/WarehousingMapper.xml

@@ -100,6 +100,9 @@
         from tld_warehousing_virtual a
         left join tld_user b on a.user_id = b.id
         where a.unique_code = #{uniqueCode} and a.type = #{type}
+        <if test="warehouseTransferId != null and warehouseTransferId != ''">
+            and a.warehouse_transfer_id = #{warehouseTransferId}
+        </if>
     </select>
     <!-- 查询采购单信息 -->
     <select id="getReceiveGoods" resultType="com.tld.model.ReceiveGoods">
@@ -382,7 +385,7 @@
     </select>
     <!-- 增加半成品/产成品虚拟库位数量 -->
     <update id="updateInventoryNotice">
-        update tld_inventory set amoun0t = amount + #{warehousingNum},totime = now() where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and wbs = #{wbs} and produc_batch = #{producBatch};
+        update tld_inventory set amount = amount + #{warehousingNum},totime = now() where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and wbs = #{wbs};
         update tld_notice set warehousing_num = #{warehousingNum},type = '1' where notice_id = #{noticeId} and material_id = #{materialId}
     </update>
     <!-- 半成品出库库存查询 -->
@@ -483,7 +486,7 @@
     </select>
     <!-- 修改要货单出库数量 -->
     <update id="updateAskGoodsHalf">
-        update tld_ask_goods set ifnull(out_num, 0) = out_num + #{warehousingNum},type = '1' where id = #{id}
+        update tld_ask_goods set out_num = ifnull(out_num, 0) + #{warehousingNum},type = '1' where id = #{id}
     </update>
     <!-- 新增半成品流水 -->
     <insert id="addRemovalHalfProduct">