zhs 2 anni fa
parent
commit
e755dfcf7d

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

@@ -113,7 +113,7 @@ public interface WarehousingMapper {
 
     void updateInventoryOther(Inventory inventory);
 
-    void addReturnWarehousingOther(WarehousingVirtual warehousingVirtual);
+    void addReturnWarehousingOther(Notice notice);
 
     void updateVitrualNum(Inventory inventory1);
 
@@ -124,4 +124,6 @@ public interface WarehousingMapper {
     Map<String, Object> getWarehouseTransferVirtual(WarehousingVirtual warehousingVirtual);
 
     void updateWarehousingType(@Param("storageCode")String storageCode, @Param("type")int type);
+
+    Notice getNotices(Inventory inventory);
 }

+ 4 - 0
src/main/java/com/tld/model/Inventory.java

@@ -144,6 +144,10 @@ public class Inventory implements Serializable {
      * 物料类别
      */
     private String partType;
+    /**
+     * 分录号
+     */
+    private String entryNumber;
     /**
      * 页数
      */

+ 20 - 0
src/main/java/com/tld/model/Notice.java

@@ -176,5 +176,25 @@ public class Notice implements Serializable {
      * 公司名称
      */
     private String accountName;
+    /**
+     * 字表id
+     */
+    private String wmsItemId;
+    /**
+     * 父表id
+     */
+    private String wmsId;
+    /**
+     * wbs code
+     */
+    private String code;
+    /**
+     * wbs名称
+     */
+    private String name;
+    /**
+     * 仓库
+     */
+    private String warehouseWhere;
 
 }

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

@@ -667,10 +667,11 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                     .setNum(askGoods.getNum())
                     .setStorageLocationCode(inventory.get(0).getStorageLocationCode())
                     .setRemovalCode(removalCode)
-                    .setSourceType("0")
-                    .setMoveType("209")
-                    .setDocumentId(removalCode)
-                    .setDocumentPointsId(removalCode);
+                    .setSourceType(askGoods.getSourceType())
+                    .setMoveType(askGoods.getMoveType())
+                    .setDocumentId(askGoods.getAskGoodsId())
+                    .setEntryNumber(askGoods.getEntryNumber())
+                    .setDocumentPointsId(askGoods.getId());
             askGoodsMapper.addReturnGsRemovalF(returRemoval);//新增返回gs数据父表信息
             askGoodsMapper.addReturnGsRemoval(returRemoval);//新增返回gs数据子表信息
             map.put("data", removalCode);

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

@@ -848,7 +848,16 @@ public class WarehousingServiceImpl implements WarehousingService {
                 warehousingMapper.addInventoryOther(inventory);
             }
             List<WarehousingVirtual> list = new LinkedList<>();
+
             String storageCode = codeGenerateRk();//入库单
+            Notice notice = warehousingMapper.getNotices(inventory); //查询其他入库返回GS信息
+            notice.setStorageCode(storageCode)//入库单编号
+                  .setCompanyNumber(inventory.getAccountSleeve())//所属公司
+                  .setStorageLocationCode(inventory.getStorageLocationCode())//库位编号
+                  .setNum(inventory.getNum()) //数量
+                  .setWarehouseWhere(dictionaryMapper.getWarehouse(inventory.getStorageLocationCode()))//仓库ID
+                  .setMaterialId(materialClass.getTldId());//物料ID
+            //流水
             WarehousingVirtual warehousingVirtual = new WarehousingVirtual()
                     .setNoticeId(inventory.getNoticeId())//通知单id
                     .setStorageCode(storageCode)
@@ -876,7 +885,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             } else {
                 warehousingMapper.addHalf(warehousingVirtual);//入库流水 产成品
             }
-            warehousingMapper.addReturnWarehousingOther(warehousingVirtual);//其他入库返回信息
+            warehousingMapper.addReturnWarehousingOther(notice);//其他入库返回信息
             map.put("data", storageCode);
             map.put("msg", "200");
         } catch (Exception e) {

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

@@ -1076,13 +1076,13 @@
         from tld_return_warehouse_transfer_z
         where warehouse_transfer_id = #{warehouseTransferTd}
     </delete>
-    <!--删除移库父表-->
+    <!--删除生产收货父表-->
     <delete id="delNoticeParent">
         delete
         from tld_notice_f
         where notice_id = #{orderNumber}
     </delete>
-    <!--删除移库子表-->
+    <!--删除生产收货子表-->
     <delete id="delNoticeSubtabulation">
         delete
         from tld_notice

+ 3 - 3
src/main/resources/mapper/InviteMapper.xml

@@ -422,13 +422,13 @@
     </insert>
     <!--补领料申请-->
     <insert id="sStoresRequisition">
-        insert into tld_enquirys_f (ask_goods_id, ask_goods_code, company_number, sqrq, department, request_type_number,request_type_name,source_type,move_type,if_commodity,product_code)
+        insert into tld_enquiry_f (ask_goods_id, ask_goods_code, company_number, sqrq, department, request_type_number,request_type_name,source_type,move_type,if_commodity,product_code)
         values
         <foreach collection="list" index="index" item="item" separator=",">
             (#{item.requestOrderId},#{item.requestOrderNo},#{item.companyNo},#{item.applicationDate},#{item.useDepartment},#{item.requestTypeNumber},#{item.requestTypeName},#{item.sourceType},#{item.moveType},#{item.ifCommodity},#{item.productCode})
         </foreach>
         ;
-        insert into tld_enquirys ( ask_goods_id, entry_number,production_code, material_id, wbs, measurement_id, num, out_num, ask_goods_type )
+        insert into tld_enquiry ( ask_goods_id, entry_number,production_code, material_id, wbs, measurement_id, num, out_num, type )
         values
         <foreach collection="list" index="index" item="item" separator=",">
             <foreach collection="item.datalist" index="index" item="items" separator=",">
@@ -436,7 +436,7 @@
             </foreach>
         </foreach>
         ;
-        insert into tld_enquirys_log (ask_goods_id, ask_goods_code, company_number, sqrq, department, request_type_number,request_type_name,source_type,move_type,if_commodity, entry_number, material_id, wbs, measurement_id, num, out_num, ask_goods_type,product_code,production_code)
+        insert into tld_enquiry_log (ask_goods_id, ask_goods_code, company_number, sqrq, department, request_type_number,request_type_name,source_type,move_type,if_commodity, entry_number, material_id, wbs, measurement_id, num, out_num, type,product_code,production_code)
         values
         <foreach collection="list" index="index" item="item" separator=",">
             <foreach collection="item.datalist" index="index" item="items" separator=",">

+ 15 - 14
src/main/resources/mapper/QueryListMappeer.xml

@@ -962,11 +962,12 @@
             a.id,
             a.notice_id,
             a.entry_number,
-            a.production_code,
             a.material_id,
             a.wbs,
             a.measurement_id,
             a.num,
+            a.entry_number,
+            a.warehousing_num,
             b.notice_code,
             b.company_number,
             b.notice_time,
@@ -982,15 +983,18 @@
         join tld_material c on a.material_id = c.tld_id
         join tld_company k on b.company_number = k.code
         <trim prefix="WHERE" prefixOverrides="and |or">
-            <if test="type != null and type != ''">
-                and a.type = #{type}
-            </if>
             <if test="materialCode != null and materialCode != ''">
                 and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
             </if>
             <if test="materialName != null and materialName != ''">
                 and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
             </if>
+            <if test="materialId != null and materialId != ''">
+                and c.tld_id like CONCAT(CONCAT('%', #{materialId}), '%')
+            </if>
+            <if test="partType != null and partType != ''">
+                and c.part_type = #{partType}
+            </if>
             <if test="startTime != null and startTime != ''">
                 and b.notice_time <![CDATA[>=]]> #{startTime}
             </if>
@@ -1000,9 +1004,6 @@
             <if test="companyNumber != null and companyNumber != ''">
                 and b.company_number = #{companyNumber}
             </if>
-            <if test="entryNumber != null and entryNumber != ''">
-                and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
-            </if>
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
@@ -1019,11 +1020,11 @@
         select
             a.id,
             a.ask_goods_id,
-            a.entry_number,
             a.material_id,
             a.wbs,
             a.measurement_id,
             a.num,
+            a.out_num,
             b.ask_goods_code,
             b.company_number,
             b.sqrq,
@@ -1041,15 +1042,18 @@
         join tld_material c on a.material_id = c.tld_id
         join tld_company k on b.company_number = k.code
         <trim prefix="WHERE" prefixOverrides="and |or">
-            <if test="askGoodsType != null and askGoodsType != ''">
-                and a.ask_goods_type = #{askGoodsType}
-            </if>
             <if test="materialCode != null and materialCode != ''">
                 and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
             </if>
             <if test="materialName != null and materialName != ''">
                 and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
             </if>
+            <if test="materialId != null and materialId != ''">
+                and c.tld_id like CONCAT(CONCAT('%', #{materialId}), '%')
+            </if>
+            <if test="partType != null and partType != ''">
+                and c.part_type = #{partType}
+            </if>
             <if test="startTime != null and startTime != ''">
                 and b.sqrq <![CDATA[>=]]> #{startTime}
             </if>
@@ -1059,9 +1063,6 @@
             <if test="companyNumber != null and companyNumber != ''">
                 and b.company_number = #{companyNumber}
             </if>
-            <if test="entryNumber != null and entryNumber != ''">
-                and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
-            </if>
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>

+ 26 - 3
src/main/resources/mapper/WarehousingMapper.xml

@@ -1006,9 +1006,12 @@
     </update>
     <!-- 其他入库返回gs -->
     <insert id="addReturnWarehousingOther">
-        insert into tld_return_gs_other_warehousing(storage_code, account_sleeve, storage_location_code, wbs, amount,
-                                                    material_id,notice_id)
-            value (#{storageCode},#{accountSleeve},#{storageLocationCode},#{wbs},#{num},#{materialId},#{noticeId})
+        insert into tld_return_gs_other_warehousing
+            (storage_code, account_sleeve, storage_location_code, notice_id, notice_code,
+             amount,wbs,wbs_code,wbs_name,notice_time,warehouse_where,source_type,move_type,entry_number,wms_item_id,material_id,wms_id)
+            value
+            (#{storageCode},#{companyNumber},#{storageLocationCode},#{noticeId},#{noticeCode},#{num},#{wbs},#{code},#{name},
+            now(),#{warehouseWhere},#{sourceType},#{moveType},#{entryNumber},#{wmsItemId},#{materialId},#{wmsId})
     </insert>
     <!-- 其他入库 -->
     <insert id="addInventoryOther">
@@ -1035,4 +1038,24 @@
     <update id="updateWarehousingType">
         update tld_storage set transmission_type = #{type} where storage_code = #{storageCode}
     </update>
+    <!-- 查询其他入库 -->
+    <select id="getNotices" resultType="com.tld.model.Notice">
+        select
+            b.notice_code,
+            b.notice_id,
+            b.company_number,
+            b.source_type,
+            b.move_type,
+            b.entry_number,
+            a.id as wmsItemId,
+            b.id as wmsId,
+            a.wbs,
+            c.code,
+            c.name,
+            a.entry_number
+        from tld_notices a
+        join tld_notices_f b on a.notice_id = b.notice_id
+        left join tld_wbs c on a.wbs = c.tld_id
+        where a.notice_id = #{noticeId} and a.entry_number = #{entryNumber} and a.material_id = #{materialId}
+    </select>
 </mapper>