Browse Source

问题修改

zhs 2 years ago
parent
commit
c4c364fe7a

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

@@ -228,4 +228,8 @@ public class AskGoods implements Serializable {
      * 移库入库库位
      */
     private String storageLocationCodeRk;
+    /**
+     * 公司名称
+     */
+    private String accountName;
 }

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

@@ -172,5 +172,9 @@ public class Notice implements Serializable {
      * 数量
      */
     private String capacity;
+    /**
+     * 公司名称
+     */
+    private String accountName;
 
 }

+ 12 - 0
src/main/java/com/tld/model/Storage.java

@@ -120,4 +120,16 @@ public class Storage implements Serializable {
      * wbs
      */
     private String wbs;
+    /**
+     * 公司编号
+     */
+    private String accountSleeve;
+    /**
+     * 公司名称
+     */
+    private String accountName;
+    /**
+     * 采购数量
+     */
+    private String purchaseNum;
 }

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

@@ -156,5 +156,9 @@ public class WarehousingVirtual implements Serializable {
      * 质检单ID
      */
     private String receiveGoodsId;
+    /**
+     * 采购数量
+     */
+    private String purchaseNum;
 
 }

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

@@ -384,7 +384,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料名称", "供应商名称", "连番号", "类型", "出库用户", "领用部门", "库位名称", "出库日期", "出库数量","要货单ID","真实姓名");
+            List<Object> head = Arrays.asList("物料名称", "供应商名称", "连番号", "类型", "出库用户", "领用部门", "库位名称", "出库日期", "出库数量","要货单ID","真实姓名","公司名称");
             //查询数据
             List<Map<String, Object>> list = askGoodsMapper.export(askGoods);
             sheetDataList.add(head);

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

@@ -91,7 +91,11 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
                    //子表
                    rg.setEntryNumber((String) element.get("entryNumber"));
                    rg.setMaterialId((String) element.get("materialId"));
-                   rg.setWbs((String) element.get("WBS"));
+                   String wbs = (String) element.get("WBS");
+                   if(wbs == null){
+                       wbs = "";
+                   }
+                   rg.setWbs(wbs);
                    rg.setMeasurementId((String) element.get("measUnitId"));
 
                    rg.setPurchaseNum(element.get("purchaseCount").toString().split("\\.")[0]);

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

@@ -165,6 +165,8 @@ public class WarehousingServiceImpl implements WarehousingService {
             StringBuilder stringBuilder = new StringBuilder();
             //查询入库所需要的信息
             for(WarehousingVirtual warehousingVirtual : warehousingMapper.getVirtual(uniqueCode, type, warehouseTransferId)){
+                //查询采购单信息
+                ReceiveGoods receiveGoods1 = receiveGoodsMapper.getReceiveGoodsCode(warehousingVirtual.getReceiveGoodsId());
                 //存入给gs的返回数据
                 String code = codeGenerateRk();
                 warehousingVirtual.setStorageCode(code);
@@ -175,9 +177,9 @@ public class WarehousingServiceImpl implements WarehousingService {
                 WarehousingVirtual warehousingVirtual1 = warehousingMapper.getWlClass(warehousingVirtual);
                 warehousingVirtual.setWllbClass(warehousingVirtual1.getWllbClass());
                 warehousingVirtual.setMaterialId(warehousingVirtual1.getMaterialId());
+                warehousingVirtual.setPurchaseNum(receiveGoods1.getPurchaseNum());
                 list.add(warehousingVirtual);
-                //查询采购单信息
-                ReceiveGoods receiveGoods1 = receiveGoodsMapper.getReceiveGoodsCode(warehousingVirtual.getReceiveGoodsId());
+
                 if(Integer.parseInt(warehousingVirtual.getNum()) <= 0){
                     break;
                 }
@@ -316,7 +318,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料名称", "物料编号", "供应商名称", "连番号", "生产日期", "生产批次", "容量", "序列号", "类型", "用户名称", "部门", "库位名称", "入库日期", "采购单号", "WBS","真实姓名","采购订单号");
+            List<Object> head = Arrays.asList("物料名称", "物料编号", "供应商名称", "连番号", "生产日期", "生产批次", "容量", "序列号", "类型", "用户名称", "部门", "库位名称", "入库日期", "采购单号", "WBS","真实姓名","采购订单号", "公司名称", "采购数量");
             //查询数据
             List<Map<String, Object>> list = new ArrayList<>(warehousingMapper.export(storage));
             sheetDataList.add(head);
@@ -392,7 +394,8 @@ public class WarehousingServiceImpl implements WarehousingService {
                     .setNum(notice.getWarehousingNum())
                     .setStorageCode(storageCode)
                     .setWbs(notice.getWbs())
-                    .setProductionCode(notice1.getProductionCode());
+                    .setProductionCode(notice1.getProductionCode())
+                    .setAccountSleeve(notice.getCompanyNumber());
             warehousingMapper.addProduct(warehousingVirtual);//入库流水 半成品
 
             ReturnWarehousing returnWarehousing = new ReturnWarehousing()
@@ -518,7 +521,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料名称", "物料编号", "生产时间", "数量", "用户名称", "入库时间", "入库单编号", "WBS","真实姓名","生产订单号");
+            List<Object> head = Arrays.asList("物料名称", "物料编号", "生产时间", "数量", "用户名称", "入库时间", "入库单编号", "WBS","真实姓名","生产订单号","公司名称");
             //查询数据
             List<Map<String, Object>> list = warehousingMapper.productExcel(notice);
             sheetDataList.add(head);
@@ -701,7 +704,8 @@ public class WarehousingServiceImpl implements WarehousingService {
                         .setAttribute(warehousingVirtual.getAttribute())
                         .setStorageCode(storageCode)
                         .setWbs(notice1.getWbs())
-                        .setProductionCode(notice1.getProductionCode());;
+                        .setProductionCode(notice1.getProductionCode())
+                        .setAccountSleeve(warehousingVirtual.getAccountSleeve());
                 warehousingMapper.addHalf(warehousingVirtual1);//入库流水 产成品
                 //存入给gs的返回数据
                 ReturnWarehousing returnWarehousing = new ReturnWarehousing()
@@ -752,7 +756,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料名称", "物料编号", "生产批次", "数量", "用户名称", "库位编号", "入库时间", "连番号", "序列号", "属性", "入库单编号", "WBS","真实姓名","生产订单号");
+            List<Object> head = Arrays.asList("物料名称", "物料编号", "生产批次", "数量", "用户名称", "库位编号", "入库时间", "连番号", "序列号", "属性", "入库单编号", "WBS","真实姓名","生产订单号","公司名称");
             //查询数据
             List<Map<String, Object>> list = warehousingMapper.getHalfExcel(notice);
             sheetDataList.add(head);

+ 101 - 84
src/main/resources/mapper/AskGoodsMapper.xml

@@ -153,12 +153,9 @@
           and wllb_code = #{wllbCode}
           and produc_date = #{producDate}
           and account_sleeve = #{companyNumber}
-        <if test="wbs != '' and wbs != null">
+        <if test="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">
@@ -302,9 +299,9 @@
     <!-- 插入出库流水 -->
     <insert id="addRemoval">
         insert into tld_removal(wllb_code, supplier_id, serial, num, type, user_id, storage_location_code, scrq,
-                                process, ask_goods_id, produc_date, department, storage_code, wbs)
+                                process, ask_goods_id, produc_date, department, storage_code, wbs, account_sleeve)
         values (#{wllbCode}, #{supplierId}, #{serial}, #{num}, #{type}, #{userId}, #{storageLocationCode}, now(),
-                #{process}, #{askGoodsId}, #{producDate}, #{department}, #{storageCode}, #{wbs})
+                #{process}, #{askGoodsId}, #{producDate}, #{department}, #{storageCode}, #{wbs}, #{companyNumber})
     </insert>
     <!-- 查询指定物料类型的id -->
     <select id="getMaterialId" resultType="String">
@@ -394,27 +391,30 @@
     <!-- 查询出库流水 -->
     <select id="getRemoval" resultType="com.tld.model.AskGoods">
         select
-        a.id,
-        b.name as materialName,
-        a.wllb_code,
-        h.name as supplierName,
-        a.serial,
-        a.type,
-        c.user_name as userName,
-        e.name as department,
-        g.storage_location_name as storageLocationName,
-        a.scrq,
-        a.num,
-        a.storage_code,
-        a.wbs,
-        a.ask_goods_id,
-        c.real_name as realName
+            a.id,
+            b.name as materialName,
+            a.wllb_code,
+            h.name as supplierName,
+            a.serial,
+            a.type,
+            c.user_name as userName,
+            e.name as department,
+            g.storage_location_name as storageLocationName,
+            a.scrq,
+            a.num,
+            a.storage_code,
+            a.wbs,
+            a.ask_goods_id,
+            c.real_name as realName,
+            a.account_sleeve,
+            f.name as accountName
         from tld_removal a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
         left join tld_department e on a.department = e.code
         left join tld_storage_location g on a.storage_location_code = g.storage_location_code
         left join tld_customer h on a.supplier_id = h.code
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="startTime != null and startTime != ''">
                 and a.scrq <![CDATA[>=]]> #{startTime}
@@ -452,29 +452,35 @@
             <if test="askGoodsId != null and askGoodsId != ''">
                 and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
             </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
+            </if>
         </trim>
         order by a.id desc
     </select>
     <!-- 导出 -->
     <select id="export" resultType="java.util.LinkedHashMap">
         select
-        b.name as materialName,
-        if(h.name = '',null,h.name) as supplierName,
-        if(a.serial = '',null,a.serial) as serial,
-        a.type,
-        c.user_name as userName,
-        e.name as department,
-        g.storage_location_name as storageLocationName,
-        a.scrq,
-        a.num,
-        a.ask_goods_id,
-        c.real_name
+            b.name as materialName,
+            if(h.name = '',null,h.name) as supplierName,
+            if(a.serial = '',null,a.serial) as serial,
+            a.type,
+            c.user_name as userName,
+            e.name as department,
+            g.storage_location_name as storageLocationName,
+            a.scrq,
+            a.num,
+            a.ask_goods_id,
+            c.real_name,
+            a.account_sleeve,
+            f.name as accountName
         from tld_removal a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
         left join tld_department e on a.department = e.code
         left join tld_storage_location g on a.storage_location_code = g.storage_location_code
         left join tld_customer h on a.supplier_id = h.code
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="startTime != null and startTime != ''">
                 and a.scrq <![CDATA[>=]]> #{startTime}
@@ -512,6 +518,9 @@
             <if test="askGoodsId != null and askGoodsId != ''">
                 and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
             </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
+            </if>
         </trim>
         order by a.id desc
     </select>
@@ -649,23 +658,26 @@
     <!-- 查询半成品出库流水 -->
     <select id="getRemovalHalfProduct" resultType="com.tld.model.AskGoods">
         select
-        a.id,
-        a.wllb_code,
-        a.num,
-        a.user_id,
-        a.scrq,
-        a.ask_goods_id,
-        c.name as department,
-        b.name as materialName,
-        e.user_name as userName,
-        b.code as materialCode,
-        a.storage_code,
-        a.wbs,
-        e.real_name as realName
+            a.id,
+            a.wllb_code,
+            a.num,
+            a.user_id,
+            a.scrq,
+            a.ask_goods_id,
+            c.name as department,
+            b.name as materialName,
+            e.user_name as userName,
+            b.code as materialCode,
+            a.storage_code,
+            a.wbs,
+            e.real_name as realName,
+            a.account_sleeve,
+            f.name as accountName
         from tld_removal_half_product a
         left join tld_material b on a.wllb_code = b.code
         left join tld_department c on a.department = c.code
         left join tld_user e on a.user_id = e.id
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="wllbCode != null and wllbCode != ''">
                 and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
@@ -697,26 +709,31 @@
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
+            </if>
         </trim>
         order by a.scrq desc
     </select>
     <!-- 查询半成品出库流水导出 -->
     <select id="getRemovalHalfProductExcel" resultType="java.util.LinkedHashMap">
         select
-        if(a.ask_goods_id = '' , null , a.ask_goods_id ) as askGoodsId,
-        a.storage_code as storageCode,
-        a.wllb_code as wllbCode,
-        b.name as materialName,
-        a.num,
-        e.user_name as userName,
-        c.name as department,
-        a.wbs,
-        a.scrq,
-        e.real_name as realName
+            if(a.ask_goods_id = '' , null , a.ask_goods_id ) as askGoodsId,
+            a.storage_code as storageCode,
+            a.wllb_code as wllbCode,
+            b.name as materialName,
+            a.num,
+            e.user_name as userName,
+            c.name as department,
+            a.wbs,
+            a.scrq,
+            e.real_name as realName,
+            f.name as accountName
         from tld_removal_half_product a
         left join tld_material b on a.wllb_code = b.code
         left join tld_department c on a.department = c.code
         left join tld_user e on a.user_id = e.id
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="wllbCode != null and wllbCode != ''">
                 and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
@@ -748,28 +765,31 @@
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
+            </if>
         </trim>
         order by a.scrq desc
     </select>
     <!-- 产成品出库流水 -->
     <select id="getRemovalHalf" resultType="com.tld.model.AskGoods">
         select
-        a.id,
-        a.wllb_code,
-        a.num,
-        a.user_id,
-        a.scrq,
-        a.delivery_id,
-        a.company_number,
-        a.customer_code,
-        b.name as materialName,
-        c.user_name as userName,
-        e.name as customerName,
-        f.name as companyName,
-        b.code as materialCode,
-        a.storage_code,
-        a.wbs,
-        c.real_name as realName
+            a.id,
+            a.wllb_code,
+            a.num,
+            a.user_id,
+            a.scrq,
+            a.delivery_id,
+            a.company_number,
+            a.customer_code,
+            b.name as materialName,
+            c.user_name as userName,
+            e.name as customerName,
+            f.name as companyName,
+            b.code as materialCode,
+            a.storage_code,
+            a.wbs,
+            c.real_name as realName,
         from tld_removal_half a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
@@ -815,15 +835,15 @@
     <!-- 产成品导出出库流水 -->
     <select id="getRemovalHalfExcel" resultType="java.util.LinkedHashMap">
         select
-        b.name as materialName,
-        a.num,
-        c.user_name as userName,
-        a.scrq,
-        f.name as companyName,
-        e.name,
-        a.storage_code,
-        a.wbs,
-        c.real_name as realName
+            b.name as materialName,
+            a.num,
+            c.user_name as userName,
+            a.scrq,
+            f.name as companyName,
+            e.name,
+            a.storage_code,
+            a.wbs,
+            c.real_name as realName
         from tld_removal_half a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
@@ -890,15 +910,12 @@
         attribute
         from tld_inventory where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and
         account_sleeve = #{accountSleeve} and amount <![CDATA[>=]]> #{num}
-        <if test="wbs != '' and wbs != null">
+        <if test="wbs != null">
             and wbs = #{wbs}
         </if>
         <if test="storageLocationCode != '' and storageLocationCode != null">
             and storage_location_code = #{storageLocationCode}
         </if>
-        <if test="wbs == ''.toString() or wbs == null ">
-            and wbs is null
-        </if>
         <if test="serial != '' and serial != null">
             and serial = #{serial}
         </if>

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

@@ -112,8 +112,8 @@
     </update>
     <!-- 产成品出库流水 -->
     <insert id="addRemovalHalf">
-        insert into tld_removal_half(wllb_code,num,user_id,scrq,delivery_id,company_number,customer_code,storage_code,wbs)
-        value(#{materialCode},#{outNum},#{userId},now(),#{deliveryId},#{companyNumber},#{customerCode},#{storageCode},#{wbs})
+        insert into tld_removal_half(wllb_code,num,user_id,scrq,delivery_id,company_number,customer_code,storage_code,wbs,account_sleeve)
+        value(#{materialCode},#{outNum},#{userId},now(),#{deliveryId},#{companyNumber},#{customerCode},#{storageCode},#{wbs},#{accountSleeve})
     </insert>
     <!-- 查询销售单父级信息 -->
     <select id="getDeliveryF" resultType="com.tld.model.Delivery">

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

@@ -144,12 +144,9 @@
         and wllb_code = #{wllbCode}
         and produc_date = #{producDate}
         and account_sleeve = #{companyNumber}
-        <if test="wbs != '' and wbs != null">
+        <if test="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">

+ 1 - 2
src/main/resources/mapper/UserMaterialMapper.xml

@@ -15,8 +15,7 @@
             b.code as wllbCode,
             c.real_name,
             a.modify_time,
-            f.user_name as modifyUser,
-            f.real_name as realName
+            f.user_name as modifyUser
         from tld_user_material a
         left join tld_material b on a.material_id = b.code
         left join tld_user c on a.user_id = c.id

+ 137 - 101
src/main/resources/mapper/WarehousingMapper.xml

@@ -156,10 +156,10 @@
     <!-- 插入入库流水 -->
     <insert id="addStorage">
         insert into
-        tld_storage(wllb_code,supplier_id,serial,produc_date,produc_batch,capacity,seq,type,user_id,department_id,storage_location_code,scrq,storage_code,wbs,order_code)
+        tld_storage(wllb_code,supplier_id,serial,produc_date,produc_batch,capacity,seq,type,user_id,department_id,storage_location_code,scrq,storage_code,wbs,order_code,account_sleeve,purchase_num)
         values
         <foreach collection="list" index="index" item="item" separator=",">
-            (#{item.wllbCode},#{item.suppId},#{item.serial},#{item.producDate},#{item.producDate},#{item.num},#{item.seq},#{item.type},#{item.userId},#{item.departmentId},#{item.storageLocationCode},now(),#{item.storageCode},#{item.wbs},#{item.warehouseTransferId})
+            (#{item.wllbCode},#{item.suppId},#{item.serial},#{item.producDate},#{item.producDate},#{item.num},#{item.seq},#{item.type},#{item.userId},#{item.departmentId},#{item.storageLocationCode},now(),#{item.storageCode},#{item.wbs},#{item.warehouseTransferId},#{item.accountSleeve},#{item.purchaseNum})
         </foreach>
     </insert>
     <!-- 插入库存 -->
@@ -205,30 +205,34 @@
     <!-- 查询入库流水 -->
     <select id="warehousingFlowing" resultType="com.tld.model.Storage">
         select
-        a.id,
-        b.name as materialName,
-        a.wllb_code,
-        h.name as supplierName,
-        a.serial,
-        a.produc_date,
-        a.produc_batch,
-        a.capacity,
-        a.seq,
-        a.type,
-        c.user_name as userName,
-        e.name as departmentName,
-        g.storage_location_name as storageLocationName,
-        a.scrq,
-        a.storage_code,
-        a.wbs,
-        c.real_name as realName,
-        a.order_code as orderCode
+            a.id,
+            b.name as materialName,
+            a.wllb_code,
+            h.name as supplierName,
+            a.serial,
+            a.produc_date,
+            a.produc_batch,
+            a.capacity,
+            a.seq,
+            a.type,
+            c.user_name as userName,
+            e.name as departmentName,
+            g.storage_location_name as storageLocationName,
+            a.scrq,
+            a.storage_code,
+            a.wbs,
+            c.real_name as realName,
+            a.order_code as orderCode,
+            a.account_sleeve,
+            f.name as accountName,
+            a.purchase_num
         from tld_storage a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
         left join tld_department e on a.department_id = e.code
         left join tld_storage_location g on a.storage_location_code = g.storage_location_code
         left join tld_customer h on a.supplier_id = h.code
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="storageCode != null and storageCode != ''">
                 and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
@@ -263,6 +267,9 @@
             <if test="endTime != null and endTime != ''">
                 and a.scrq <![CDATA[<=]]> #{endTime}
             </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
+            </if>
         </trim>
         order by scrq desc
     </select>
@@ -292,29 +299,32 @@
     <!-- 查询导出内容 -->
     <select id="export" resultType="java.util.LinkedHashMap">
         select
-        b.name as materialName,
-        a.wllb_code as wllbCode,
-        h.name as supplierName,
-        if(a.serial = '', null ,a.serial) as serial,
-        if(a.produc_date = '', null ,a.produc_date) as producDate,
-        if(a.produc_batch = '', null ,a.produc_batch) as producbatch,
-        a.capacity,
-        a.seq,
-        a.type,
-        c.user_name as userName,
-        e.name as departmentName,
-        g.storage_location_name as storageLocationName,
-        a.scrq,
-        a.storage_code,
-        a.wbs,
-        c.real_name as realName,
-        a.order_code as orderCode
+            b.name as materialName,
+            a.wllb_code as wllbCode,
+            h.name as supplierName,
+            if(a.serial = '', null ,a.serial) as serial,
+            if(a.produc_date = '', null ,a.produc_date) as producDate,
+            if(a.produc_batch = '', null ,a.produc_batch) as producbatch,
+            a.capacity,
+            a.seq,
+            a.type,
+            c.user_name as userName,
+            e.name as departmentName,
+            g.storage_location_name as storageLocationName,
+            a.scrq,
+            a.storage_code,
+            a.wbs,
+            c.real_name as realName,
+            a.order_code as orderCode,
+            f.name as accountName,
+            if(a.purchase_num = '', null, a.purchase_num) as purchaseNum
         from tld_storage a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
         left join tld_department e on a.department_id = e.code
         left join tld_storage_location g on a.storage_location_code = g.storage_location_code
         left join tld_customer h on a.supplier_id = h.code
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="storageCode != null and storageCode != ''">
                 and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
@@ -349,6 +359,9 @@
             <if test="endTime != null and endTime != ''">
                 and a.scrq <![CDATA[<=]]> #{endTime}
             </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
+            </if>
         </trim>
         order by a.scrq desc
     </select>
@@ -542,31 +555,34 @@
     <!-- 新增半成品入库流水 -->
     <insert id="addProduct">
         insert into tld_half_product(wllb_code, produc_date, produc_batch, capacity, user_id, storage_location_code,
-                                     scrq, storage_code, wbs, production_code)
-            value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{storageCode},#{wbs}, #{productionCode})
+                                     scrq, storage_code, wbs, production_code,account_sleeve)
+            value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{storageCode},#{wbs}, #{productionCode},#{companyNumber})
     </insert>
     <!-- 查询半成品入库流水-->
     <select id="getProduct" resultType="com.tld.model.Notice">
         select
-        a.id,
-        a.wllb_code,
-        a.produc_date,
-        a.produc_batch,
-        a.capacity as warehousingNum,
-        a.user_id,
-        c.user_name,
-        a.storage_location_code,
-        a.scrq,
-        b.name as materialName,
-        b.code as materialCode,
-        a.storage_code,
-        a.wbs,
-        a.production_code,
-        c.real_name as realName,
-        a.production_code as productionCode
+            a.id,
+            a.wllb_code,
+            a.produc_date,
+            a.produc_batch,
+            a.capacity as warehousingNum,
+            a.user_id,
+            c.user_name,
+            a.storage_location_code,
+            a.scrq,
+            b.name as materialName,
+            b.code as materialCode,
+            a.storage_code,
+            a.wbs,
+            a.production_code,
+            c.real_name as realName,
+            a.production_code as productionCode,
+            a.account_sleeve as companyNumber,
+            e.name as accountName
         from tld_half_product a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
+        left join tld_company e on a.account_sleeve = e.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="startTime != null and startTime != ''">
                 and a.scrq <![CDATA[>=]]> #{startTime}
@@ -601,25 +617,30 @@
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
+            <if test="companyNumber != null and companyNumber != ''">
+                and a.account_sleeve = #{companyNumber}
+            </if>
         </trim>
         order by a.scrq desc
     </select>
     <!-- 查询半成品入库流水导出-->
     <select id="productExcel" resultType="java.util.LinkedHashMap">
         select
-        b.name,
-        a.wllb_code,
-        a.produc_date,
-        a.capacity,
-        c.user_name,
-        a.scrq,
-        a.storage_code,
-        a.wbs,
-        c.real_name as realName,
-        a.production_code as productionCode
+            b.name,
+            a.wllb_code,
+            a.produc_date,
+            a.capacity,
+            c.user_name,
+            a.scrq,
+            a.storage_code,
+            a.wbs,
+            c.real_name as realName,
+            a.production_code as productionCode,
+            e.name as accountName
         from tld_half_product a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
+        left join tld_company e on a.account_sleeve = e.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="startTime != null and startTime != ''">
                 and a.scrq <![CDATA[>=]]> #{startTime}
@@ -651,6 +672,9 @@
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
+            <if test="companyNumber != null and companyNumber != ''">
+                and a.account_sleeve = #{companyNumber}
+            </if>
         </trim>
         order by a.scrq desc
     </select>
@@ -736,8 +760,8 @@
     <!-- 产成品入库 -->
     <insert id="addHalf">
         insert into tld_half(wllb_code, produc_date, produc_batch, capacity, user_id, storage_location_code, scrq,
-                             serial, seq, attribute, storage_code, wbs, production_code)
-            value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{serial},#{seq},#{attribute},#{storageCode},#{wbs},#{productionCode})
+                             serial, seq, attribute, storage_code, wbs, production_code,account_sleeve)
+            value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{serial},#{seq},#{attribute},#{storageCode},#{wbs},#{productionCode},#{accountSleeve})
     </insert>
     <!-- 查询虚拟表数据进行入库 -->
     <select id="getVirtualNotice" resultType="com.tld.model.WarehousingVirtual">
@@ -755,7 +779,8 @@
                a.user_id,
                a.attribute,
                a.storage_location_name,
-               b.user_name
+               b.user_name,
+               a.account_sleeve
         from tld_warehousing_virtual a
                  left join tld_user b on a.user_id = b.id
         where a.unique_code = #{uniqueCode}
@@ -765,29 +790,32 @@
     <!-- 产成品入库流水 -->
     <select id="getHalf" resultType="com.tld.model.Notice">
         select
-        a.id,
-        a.wllb_code,
-        a.produc_date,
-        a.produc_batch,
-        a.capacity,
-        a.user_id,
-        a.storage_location_code,
-        e.storage_location_name as storageLocationName,
-        a.scrq,
-        a.serial,
-        a.seq,
-        a.attribute,
-        b.name as materialName,
-        c.user_name as userName,
-        b.code as materialCode,
-        a.storage_code,
-        a.wbs,
-        c.real_name as realName,
-        a.production_code as productionCode
+            a.id,
+            a.wllb_code,
+            a.produc_date,
+            a.produc_batch,
+            a.capacity,
+            a.user_id,
+            a.storage_location_code,
+            e.storage_location_name as storageLocationName,
+            a.scrq,
+            a.serial,
+            a.seq,
+            a.attribute,
+            b.name as materialName,
+            c.user_name as userName,
+            b.code as materialCode,
+            a.storage_code,
+            a.wbs,
+            c.real_name as realName,
+            a.production_code as productionCod,
+            a.account_sleeve as companyNumber,
+            f.name as accountName
         from tld_half a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
         left join tld_storage_location e on a.storage_location_code = e.storage_location_code
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="startTime != null and startTime != ''">
                 and a.scrq <![CDATA[>=]]> #{startTime}
@@ -819,29 +847,34 @@
             <if test="storageLocationName != null and storageLocationName != ''">
                 and e.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
             </if>
+            <if test="companyNumber != null and companyNumber != ''">
+                and a.account_sleeve = #{companyNumber}
+            </if>
         </trim>
         order by a.scrq desc
     </select>
     <!-- 产成品导出 -->
     <select id="getHalfExcel" resultType="java.util.LinkedHashMap">
         select
-        b.name as materialName,
-        a.wllb_code,
-        if(a.produc_batch = '' , null , a.produc_batch) as producBatch,
-        a.capacity,
-        c.user_name as userName,
-        a.storage_location_code,
-        a.scrq,
-        a.serial,
-        if(a.seq = '' , null , a.seq) as seq,
-        if(a.attribute = '' , null , a.attribute) as attribute,
-        a.storage_code,
-        if(a.wbs = '' , null , a.wbs) as wbs,
-        c.real_name as realName,
-        a.production_code as productionCode
+            b.name as materialName,
+            a.wllb_code,
+            if(a.produc_batch = '' , null , a.produc_batch) as producBatch,
+            a.capacity,
+            c.user_name as userName,
+            a.storage_location_code,
+            a.scrq,
+            a.serial,
+            if(a.seq = '' , null , a.seq) as seq,
+            if(a.attribute = '' , null , a.attribute) as attribute,
+            a.storage_code,
+            if(a.wbs = '' , null , a.wbs) as wbs,
+            c.real_name as realName,
+            a.production_code as productionCode,
+            f.name as accountName
         from tld_half a
         left join tld_material b on a.wllb_code = b.code
         left join tld_user c on a.user_id = c.id
+        left join tld_company f on a.account_sleeve = f.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="startTime != null and startTime != ''">
                 and a.scrq <![CDATA[>=]]> #{startTime}
@@ -879,6 +912,9 @@
             <if test="productionCode != null and productionCode != ''">
                 and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
             </if>
+            <if test="companyNumber != null and companyNumber != ''">
+                and a.account_sleeve = #{companyNumber}
+            </if>
         </trim>
         order by a.scrq desc
     </select>

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

@@ -9,6 +9,6 @@
     <!-- 新增信息 -->
     <insert id="addPrint">
         insert into tld_print(material_code,supplier_id,produc_date,num,serial,scrq,user_id,type)
-        value(#{materialCode},#{supplierId},#{producDate},#{num},#{serial},now(),#{userId},#{type},#{attribute})
+        value(#{materialCode},#{supplierId},#{producDate},#{num},#{serial},now(),#{userId},#{type})
     </insert>
 </mapper>