xiaochen 2 лет назад
Родитель
Сommit
804e60f6b2

+ 18 - 0
src/main/java/com/tld/controller/AskGoodsController.java

@@ -387,4 +387,22 @@ public class AskGoodsController {
         askGoodsService.parkingReturnError();
     }
 
+    /**
+     * 移库跑数据
+     * */
+    @GetMapping("shiftingParkingReturn")
+    @PassToken
+    public void shiftingParkingReturn(){
+        askGoodsService.shiftingParkingReturn();
+    }
+
+    /**
+     * 其它入库错误信息回调
+     * */
+    @GetMapping("otherWarehousingReturnError")
+    @PassToken
+    public void otherWarehousingReturnError(){
+        askGoodsService.otherWarehousingReturnError();
+    }
+
 }

+ 7 - 0
src/main/java/com/tld/controller/InviteController.java

@@ -2,6 +2,7 @@ package com.tld.controller;
 
 import com.tld.model.AskGoods;
 import com.tld.service.InviteService;
+import com.tld.util.PassToken;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -59,6 +60,12 @@ public class InviteController {
         return inviteService.addAskGoodsVitrual(askGoods);
     }
 
+    @GetMapping("testTwo")
+    @PassToken
+    public void testTwo(){
+        inviteService.testTwo();
+    }
+
     /**
      * 出库
      */

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

@@ -218,5 +218,11 @@ public interface AskGoodsMapper {
 
     List<Error> parkingReturnError();
 
+    List<WarehouseTransfer> shiftingParkingReturn();
+
+    List<AskGoods> getAskGoodsMaterialNot(AskGoods askGoods);
+
     List<AskGoods> getAskGoodsMaterialTest(AskGoods askGoods);
+
+    List<Error> otherWarehousingReturnError();
 }

+ 8 - 0
src/main/java/com/tld/model/ReceiveGoods.java

@@ -131,4 +131,12 @@ public class ReceiveGoods implements Serializable {
      * 物料类型
      */
     private String wllbClass;
+    /**
+     * 来源ID
+     */
+    private String sourceId;
+    /**
+     * 分录ID
+     */
+    private String entryNumberId;
 }

+ 4 - 0
src/main/java/com/tld/service/AskGoodsService.java

@@ -91,4 +91,8 @@ public interface AskGoodsService {
     void storageReturnError();
 
     void parkingReturnError();
+
+    void shiftingParkingReturn();
+
+    void otherWarehousingReturnError();
 }

+ 2 - 0
src/main/java/com/tld/service/InviteService.java

@@ -33,4 +33,6 @@ public interface InviteService {
     Map<String, Object> otherShipments(List<Map<String, Object>> mapList);
 
     Map<String, Object> sStoresRequisition(List<Map<String, Object>> mapList);
+
+    void testTwo();
 }

+ 27 - 3
src/main/java/com/tld/service/impl/AskGoodsServiceImpl.java

@@ -1822,6 +1822,30 @@ public class AskGoodsServiceImpl implements AskGoodsService {
         }
     }
 
+
+    /**
+     * 移库跑数据
+     * */
+    @Override
+    public void shiftingParkingReturn() {
+        //查询单据id
+        List<WarehouseTransfer> list = askGoodsMapper.shiftingParkingReturn();
+        for (WarehouseTransfer returRemoval : list) {
+            CreateGMReqOutStock(returRemoval.getWarehouseTransferCode(),"李兆峰");
+        }
+    }
+
+    /**
+     * 其它入库错误信息回调
+     * */
+    @Override
+    public void otherWarehousingReturnError() {
+        List<Error> list = askGoodsMapper.otherWarehousingReturnError();
+        for (Error error : list) {
+            queryListService.anew(error);
+        }
+    }
+
     @Override
     public void test() {
         AskGoods askGoods = new AskGoods();
@@ -1851,7 +1875,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                     .setWllbCode(list1.get(0).get("code").toString())
                     .setProducDate("20230514")
                     .setAskGoodsId(askGoods1.getAskGoodsId())
-                    .setType("计划出库")
+                    .setType("非生产领料")
                     .setStorageLocationCode(list1.get(0).get("storageLocationCode").toString())
                     .setNum(askGoods1.getNum())
                     .setUserId("27")
@@ -1867,13 +1891,13 @@ public class AskGoodsServiceImpl implements AskGoodsService {
     public void testTwo() {
         List<Map<String, Object>> list1 = queryListMapper.getTestTwo();
         for(Map<String, Object> map : list1){
-            Map<String, Object> map1 = OutOfLibrary("1111", "计划出库", map.get("ask_goods_id").toString());
+            Map<String, Object> map1 = OutOfLibrary("1111", "非生产领料", map.get("ask_goods_id").toString());
 //            System.out.println(map1.get("data"));
             if(map1.get("data") != null){
 //            System.out.println("-------------------------------------");
 //            System.out.println("测试");
 //            System.out.println("-------------------------------------");
-                plugOutRemoval(map1.get("data").toString(), "王孝苗");
+//                plugOutRemoval(map1.get("data").toString(), "王孝苗");
             }
         }
     }

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

@@ -153,7 +153,8 @@ public class InviteServiceImpl implements InviteService {
                 askGoods.setCompanyNumber(askGoods.getAccountSleeve());
                 Inventory inventory = inviteMapper.getInventory(askGoods);
                 if(inventory == null){
-                    throw new Exception("库存不存在");
+//                    throw new Exception("库存不存在");
+                    continue;
                 }
                 //如果出库库存等于虚拟表库存则删除此库存
                 if( Double.doubleToLongBits(Double.parseDouble(askGoods.getNum()))  == Double.doubleToLongBits(Double.parseDouble(inventory.getAmount())) ){
@@ -235,7 +236,7 @@ public class InviteServiceImpl implements InviteService {
             for (Map<String, Object> list : mapList) {
                 //operationType=1删除并修改
                 //父表deliveryOrderId是唯一的子表
-                if (list.get("operationType").toString().equals("1")){
+                if (list.get("operationType").toString().equals("1")){//修改
                     //查询子表数据是否有已经出库的
                     int count =  inviteMapper.getCountDelivery(list.get("deliveryOrderId").toString());
                     //是否存在   没有可以改
@@ -257,7 +258,7 @@ public class InviteServiceImpl implements InviteService {
                             inviteMapper.updStatus(stringObjectMap.get("deliveryOrderId").toString(),stringObjectMap.get("entryNumber").toString(),stringObjectMap.get("materialId").toString(),status);
                         }
                     }
-                } else {
+                } else {//添加
                     //添加
                     inviteMapper.addDeliverys(list);
                 }
@@ -401,6 +402,20 @@ public class InviteServiceImpl implements InviteService {
         return map;
     }
 
+    @Override
+    public void testTwo() {
+        List<Map<String, Object>> list1 = queryListMapper.getTestTwo();
+        for(Map<String, Object> map : list1){
+            Map<String, Object> map1 = OutOfLibrary("1111", "非生产领料", map.get("ask_goods_id").toString());
+//            System.out.println(map1.get("data"));
+            if(map1.get("data") != null){
+//            System.out.println("-------------------------------------");
+//            System.out.println("测试");
+//            System.out.println("-------------------------------------");
+//                plugOutRemoval(map1.get("data").toString(), "王孝苗");
+            }
+        }    }
+
     /**
      * 出库单生成
      * @return

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

@@ -68,6 +68,11 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
         return map;
     }
 
+    /**
+     * gs存入采购信息/新增质检单
+     * @param jsonData 参数
+     * @return 返回结果
+     */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Map<String, Object> addReceiveGoods( List<Map<String,Object>> jsonData) {
@@ -99,12 +104,12 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
                    }
                    rg.setWbs(wbs);
                    rg.setMeasurementId((String) element.get("measUnitId"));
-
                    rg.setPurchaseNum(element.get("purchaseCount").toString());
                    rg.setArrivalNum((element.get("receiveCount").toString()));
                    rg.setQualifiedNum(element.get("curOkCount").toString());
                    rg.setDisqualificationNum(element.get("curNgCount").toString());
-
+                   rg.setSourceId(element.get("sourceId").toString());//来源ID
+                   rg.setEntryNumberId(element.get("entryNumberId").toString());//分录ID
 
                    receiveGoodsList.add(rg);
                }
@@ -119,9 +124,9 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
 //                       receiveGoodsMapper.updateReceiveGoods(receiveGoods);
 //                   } else {
                 if (receiveGoodsMapper.getReceiveGoodsf(receiveGoods1) == 0) {
-                    receiveGoodsMapper.addReceiveGoodsf(receiveGoods);
+                    receiveGoodsMapper.addReceiveGoodsf(receiveGoods);//添加父表
                 }
-                receiveGoodsMapper.addReceiveGoods(receiveGoods);
+                receiveGoodsMapper.addReceiveGoods(receiveGoods);//添加子表
 //                   }
                 receiveGoodsMapper.updatePurchaseType(receiveGoods);
                 //采购单日志

+ 41 - 3
src/main/resources/mapper/AskGoodsMapper.xml

@@ -118,8 +118,8 @@
                a.entry_number,
                e.wllb_class,
                b.sqrq
-        FROM tld_ask_goods a
-                 JOIN tld_ask_goods_f b ON a.ask_goods_id = b.ask_goods_id
+        FROM tld_invite a
+                 JOIN tld_invite_f b ON a.ask_goods_id = b.ask_goods_id
                  LEFT JOIN tld_department c ON b.department = c.code
                  JOIN tld_material e ON a.material_id = e.tld_id
         WHERE (a.num + 0) <![CDATA[>]]> (
@@ -1472,7 +1472,7 @@
     <!--出库错误信息回调-->
     <select id="getOutgoingReturnError" resultType="com.tld.model.Error">
         select id,url,error_info,data_val,scrq,type,transmission_type from tld_error
-        where transmission_type = '3'
+        where transmission_type = '1'
         and type = '出库回传'
     </select>
     <!--查询销售出库导入数据-->
@@ -1540,6 +1540,44 @@
         where transmission_type = '1'
         and type = '移库'
     </select>
+    <!--移库跑数据-->
+    <select id="shiftingParkingReturn" resultType="com.tld.model.WarehouseTransfer">
+        select id,warehouse_transfer_id,warehouse_transfer_code,ask_goods_warehouse_id,warehouse_transfer_type,scrq from tld_return_warehouse_transfer
+    </select>
+    <!--查询非生产领料-->
+    <select id="getAskGoodsMaterialNot" resultType="com.tld.model.AskGoods">
+        SELECT a.ask_goods_id,
+               a.material_id,
+               a.num,
+               IFNULL(a.out_num, 0) AS out_num,
+               e.NAME               AS materialName,
+               e.CODE               AS materialCode,
+               e.part_type as partType,
+               b.ask_goods_code,
+               b.company_number,
+               b.sqrq,
+               c.name,
+               c.code,
+               c.id                 AS departmentId,
+               a.production_code,
+               a.wbs,
+               a.entry_number,
+               e.wllb_class
+        FROM tld_invite a
+                 JOIN tld_invite_f b ON a.ask_goods_id = b.ask_goods_id
+                 LEFT JOIN tld_department c ON b.department = c.code
+                 JOIN tld_material e ON a.material_id = e.tld_id
+        WHERE (a.num + 0) <![CDATA[>]]> (
+            IFNULL(a.out_num, 0) + 0)
+          and e.part_type != '半成品' and e.part_type != '产成品'
+          and a.ask_goods_id = #{askGoodsId} and e.code in (select material_id from tld_user_material where user_id = #{userId})
+    </select>
+    <!--其它入库错误信息回调-->
+    <select id="otherWarehousingReturnError" resultType="com.tld.model.Error">
+        select id,url,error_info,data_val,scrq,type,transmission_type from tld_error
+        where transmission_type = '1'
+        and type = '其它入库'
+    </select>
     <!-- 修改数据传输状态 -->
     <update id="updateRemoval">
         update tld_removal set transmission_type = "1" where storage_code = #{removalCode}

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

@@ -1451,7 +1451,7 @@
     </select>
 
     <select id="getTestTwo" resultType="java.util.Map">
-        select DISTINCT ask_goods_id from tld_ask_goods_vitrual where unique_code = "1111"
+        select DISTINCT ask_goods_id from tld_ask_goods_vitrual where unique_code = "1111" and type = "非生产领料"
     </select>
     <!--查询领料日期计划出库-->
     <select id="getPlannedDelivery" resultType="java.lang.String">

+ 2 - 2
src/main/resources/mapper/ReceiveGoodsMapper.xml

@@ -93,9 +93,9 @@
     <insert id="addReceiveGoods">
         insert into tld_receive_goods(order_code, material_id, purchase_num, arrival_num, type, qualified_num,
                                       disqualification_num, wbs, arrival_time, measurement_id, supplier_id,
-                                      entry_number, warehousing_num)
+                                      entry_number, warehousing_num,source_id,entry_number_id)
         values (#{orderCode}, #{materialId}, #{purchaseNum}, #{arrivalNum}, #{type}, 0+CAST(#{qualifiedNum} as char),
-                #{disqualificationNum}, #{wbs}, #{arrivalTime}, #{measurementId}, #{supplierId}, #{entryNumber}, '0');
+                #{disqualificationNum}, #{wbs}, #{arrivalTime}, #{measurementId}, #{supplierId}, #{entryNumber}, '0',#{sourceId},#{entryNumberId});
     </insert>
     <!-- 新增采购单信息 -->
     <insert id="addReceiveGoodsf">