Browse Source

问题修改

xiaochen 2 years ago
parent
commit
5ca8eff151

+ 1 - 3
src/main/java/com/tld/controller/DictionaryController.java

@@ -93,10 +93,8 @@ public class DictionaryController {
      * @param dictionary 参数
      * @return 返回结果
      */
-    @PostMapping("getMaterial")
-    @PassToken
+    @GetMapping("getMaterial")
     public Map<String, Object> getMaterial(Dictionary dictionary){
         return dictionaryService.getMaterial(dictionary);
     }
-
 }

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

@@ -35,6 +35,10 @@ public class AskGoods implements Serializable {
      * 用户名称
      */
     private String userName;
+    /**
+     * 真实姓名
+     */
+    private String realName;
     /**
      * 物料id
      */

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

@@ -108,6 +108,10 @@ public class Inventory implements Serializable {
      * 出货仓库
      */
     private String warehouseWhere;
+    /**
+     * 仓库Id
+     */
+    private String warehouseId;
     /**
      * 申请部门id
      */

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

@@ -148,6 +148,10 @@ public class Notice implements Serializable {
      * 用户名称
      */
     private String userName;
+    /**
+     * 真实姓名
+     */
+    private String realName;
     /**
      * 入库时间
      */

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

@@ -76,6 +76,10 @@ public class Storage implements Serializable {
      * 用户名称
      */
     private String userName;
+    /**
+     * 用户名称
+     */
+    private String realName;
     /**
      * 部门名称
      */

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

@@ -142,7 +142,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             for(Inventory inventory : askGoodsMapper.getMaterialCk(askGoods)){
                 AskGoods askGoods1 = askGoodsMapper.getAsk(inventory);
                 if(askGoods1 != null){
-                    if(Double.parseDouble(askGoods1.getNum()) != Double.parseDouble(inventory.getAmount())){
+                    if(  Double.doubleToLongBits(Double.parseDouble(askGoods1.getNum()))  != Double.doubleToLongBits(Double.parseDouble(inventory.getAmount())) ){
                         list.add(inventory);
                     }
                 } else {
@@ -384,7 +384,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料名称", "供应商名称", "连番号", "类型", "出库用户", "领用部门", "库位名称", "出库日期", "出库数量");
+            List<Object> head = Arrays.asList("物料名称", "供应商名称", "连番号", "类型", "出库用户", "领用部门", "库位名称", "出库日期", "出库数量","要货单ID","真实姓名");
             //查询数据
             List<Map<String, Object>> list = askGoodsMapper.export(askGoods);
             sheetDataList.add(head);
@@ -474,7 +474,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("要货单", "出库编号","物料编号","物料名称", "出库数量", "出库人", "领用部门", "WBS编号", "出库时间");
+            List<Object> head = Arrays.asList("要货单", "出库编号","物料编号","物料名称", "出库数量", "出库人", "领用部门", "WBS编号", "出库时间","真实姓名");
             //查询数据
             List<Map<String, Object>> list = askGoodsMapper.getRemovalHalfProductExcel(askGoods);
             sheetDataList.add(head);
@@ -517,7 +517,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料名称", "出库数量", "用户名称", "出库时间", "公司名称", "客户名称", "出库单编号", "WBS");
+            List<Object> head = Arrays.asList("物料名称", "出库数量", "用户名称", "出库时间", "公司名称", "客户名称", "出库单编号", "WBS","真实姓名");
             //查询数据
             List<Map<String, Object>> list = askGoodsMapper.getRemovalHalfExcel(askGoods);
             sheetDataList.add(head);

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

@@ -94,7 +94,7 @@ public class DeliveryServiceImpl implements DeliveryService {
                 for(Inventory inventory : deliveryMapper.getMaterialCk(askGoods)){
                     AskGoods askGoods1 = askGoodsMapper.getAsk(inventory);
                     if(askGoods1 != null){
-                        if(Double.parseDouble(askGoods1.getNum()) != Double.parseDouble(inventory.getAmount())){
+                        if( Double.doubleToLongBits(Double.parseDouble(askGoods1.getNum()))  != Double.doubleToLongBits(Double.parseDouble(inventory.getAmount())) ){
                             list.add(inventory);
                             map.put("data", list);
                             map.put("msg", "200");

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

@@ -71,7 +71,7 @@ public class InviteServiceImpl implements InviteService {
             for(Inventory inventory : inviteMapper.getMaterialCk(askGoods)){
                 AskGoods askGoods1 = inviteMapper.getAsk(inventory);
                 if(askGoods1 != null){
-                    if(Double.parseDouble(askGoods1.getNum()) != Double.parseDouble(inventory.getAmount())){
+                    if( Double.doubleToLongBits(Double.parseDouble(askGoods1.getNum()))  != Double.doubleToLongBits(Double.parseDouble(inventory.getAmount())) ){
                         list.add(inventory);
                     }
                 } else {
@@ -140,7 +140,7 @@ public class InviteServiceImpl implements InviteService {
                     throw new Exception("库存不存在");
                 }
                 //如果出库库存等于虚拟表库存则删除此库存
-                if(Double.parseDouble(askGoods.getNum()) == Double.parseDouble(inventory.getAmount())){
+                if( Double.doubleToLongBits(Double.parseDouble(askGoods.getNum()))  == Double.doubleToLongBits(Double.parseDouble(inventory.getAmount())) ){
                     inviteMapper.deleteInventory(inventory);
                 } else {
                     inventory.setAmount(askGoods.getNum());
@@ -247,7 +247,7 @@ public class InviteServiceImpl implements InviteService {
 
     /**
      * 移库通知单
-     * @return
+     * @return 是否成功
      */
     @Override
     public Map<String, Object> transferNotice(List<Map<String, Object>> mapList) {

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

@@ -53,8 +53,8 @@ public class QueryListServiceImpl implements QueryListService {
                 Map<String, Object> map1 = queryListMapper.reserveWarning(data);
                 map1.put("materialName", data.get("name"));
                 map1.put("wllbCode", data.get("code"));
-                if(Double.parseDouble(map1.get("minNum").toString()) > Double.parseDouble(map1.get("amount").toString())
-                || Double.parseDouble(map1.get("maxNum").toString()) < Double.parseDouble(map1.get("amount").toString())
+                if( Double.doubleToLongBits(Double.parseDouble(map1.get("minNum").toString()))  > Double.doubleToLongBits(Double.parseDouble(map1.get("amount").toString()))
+                || Double.doubleToLongBits(Double.parseDouble(map1.get("maxNum").toString()))  <  Double.doubleToLongBits(Double.parseDouble(map1.get("amount").toString()))
                 ){
                     mapList.add(map1);
                 }
@@ -93,9 +93,8 @@ public class QueryListServiceImpl implements QueryListService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料编号", "物料名称", "数量","库位名称","所属公司","供应商","WBS编号");
+            List<Object> head = Arrays.asList("物料编号", "物料名称", "数量","库位名称","所属公司","供应商","WBS编号","仓库名称");
             //查询数据
-            PageHelper.startPage(inventory.getPage(), inventory.getLimit());
             List<Map<String, Object>> list = queryListMapper.getStorageLocation(inventory);
             sheetDataList.add(head);
             for(Map<String, Object> userMap : list){

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

@@ -124,7 +124,7 @@ public class UserMaterialServiceImpl implements UserMaterialService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("物料编号", "物料名称", "用户名称");
+            List<Object> head = Arrays.asList("物料编号", "物料名称", "用户名称","真实姓名");
             //查询数据
             List<Map<String, Object>> list = userMaterialMapper.Export(userMaterial);
             sheetDataList.add(head);

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

@@ -339,7 +339,7 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
             for(Inventory inventory : warehouseTransferMapper.getMaterialWarehouseTransfer(askGoods)){
                 AskGoods askGoods1 = warehouseTransferMapper.getAsk(inventory);
                 if(askGoods1 != null){
-                    if(Double.parseDouble(askGoods1.getNum()) != Double.parseDouble(inventory.getAmount())){
+                    if( Double.doubleToLongBits(Double.parseDouble(askGoods1.getNum()))  != Double.doubleToLongBits( Double.parseDouble(inventory.getAmount())) ){
                         list.add(inventory);
                     }
                 } else {

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

@@ -96,7 +96,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             Map<String, Object> listMap = new HashMap<>();
             for (int i = 0; i < listMaterialClass.size(); i++) {
                 Map<String, Object> map1 = warehousingMapper.getScanNum(listMaterialClass.get(i).getStorageLocationCode(), num);
-                if (Double.parseDouble(String.valueOf(map1.get("scanNum"))) <= Double.parseDouble(String.valueOf(materialClass.getSize()))) {
+                if ( Double.doubleToLongBits(Double.parseDouble(String.valueOf(map1.get("scanNum"))))  <= Double.doubleToLongBits(Double.parseDouble(String.valueOf(materialClass.getSize()))) ) {
                     //查询库存是否同物料同批次存在
                     List<String> countProduc = warehousingMapper.getInventoryProduc(listMaterialClass.get(i).getWllbCode(), producDate, listMaterialClass.get(i).getStorageLocationCode());
                     if (countProduc.size() == 0) {
@@ -316,7 +316,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);
@@ -517,7 +517,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);
@@ -751,7 +751,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);
@@ -859,6 +859,8 @@ public class WarehousingServiceImpl implements WarehousingService {
             if(materialClass.getPartType().equals("原材料")){
                 warehousingMapper.addStorage(list);//入库流水
             } else if(materialClass.getPartType().equals("半成品")){
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                warehousingVirtual.setProducDate(simpleDateFormat.format(new Date()).toString());
                 warehousingMapper.addProduct(warehousingVirtual);//入库流水 半成品
             } else {
                 warehousingMapper.addHalf(warehousingVirtual);//入库流水 产成品
@@ -868,8 +870,8 @@ public class WarehousingServiceImpl implements WarehousingService {
             map.put("msg", "200");
         } catch (Exception e) {
             e.printStackTrace();
-            map.put("status", "500");
-            map.put("msg", "服务器请求异常,请稍后再试");
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
         }
         return map;
     }

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

@@ -401,7 +401,9 @@
         a.scrq,
         a.num,
         a.storage_code,
-        a.wbs
+        a.wbs,
+        a.ask_goods_id,
+        c.real_name as realName
         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
@@ -439,6 +441,12 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
+            <if test="askGoodsId != null and askGoodsId != ''">
+                and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
+            </if>
         </trim>
         order by a.id desc
     </select>
@@ -446,14 +454,16 @@
     <select id="export" resultType="java.util.LinkedHashMap">
         select
         b.name as materialName,
-        h.name as supplierName,
-        a.serial,
+        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.num,
+        a.ask_goods_id,
+        c.real_name
         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
@@ -491,6 +501,12 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
+            <if test="askGoodsId != null and askGoodsId != ''">
+                and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
+            </if>
         </trim>
         order by a.id desc
     </select>
@@ -635,7 +651,8 @@
         e.user_name as userName,
         b.code as materialCode,
         a.storage_code,
-        a.wbs
+        a.wbs,
+        e.real_name as realName
         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
@@ -659,6 +676,9 @@
             <if test="userName != null and userName != ''">
                 and e.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and e.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="askGoodsId != null and askGoodsId != ''">
                 and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
             </if>
@@ -682,7 +702,8 @@
         e.user_name as userName,
         c.name as department,
         a.wbs,
-        a.scrq
+        a.scrq,
+        e.real_name as realName
         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
@@ -706,6 +727,9 @@
             <if test="userName != null and userName != ''">
                 and e.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and e.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="askGoodsId != null and askGoodsId != ''">
                 and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
             </if>
@@ -735,7 +759,8 @@
         f.name as companyName,
         b.code as materialCode,
         a.storage_code,
-        a.wbs
+        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
@@ -751,6 +776,9 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="deliveryId != null and deliveryId != ''">
                 and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
             </if>
@@ -785,7 +813,8 @@
         f.name as companyName,
         e.name,
         a.storage_code,
-        a.wbs
+        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
@@ -793,7 +822,31 @@
         left join tld_company f on a.company_number = f.tld_id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="wllbCode != null and wllbCode != ''">
-                and a.wllb_code = #{wllbCode}
+                and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and b.name like CONCAT(CONCAT('%', #{materialName}), '%')
+            </if>
+            <if test="userName != null and userName != ''">
+                and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
+            </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
+            <if test="deliveryId != null and deliveryId != ''">
+                and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
+            </if>
+            <if test="companyCode != null and companyCode != ''">
+                and a.company_number = #{companyCode}
+            </if>
+            <if test="customerCode != null and customerCode != ''">
+                and a.customer_code = #{customerCode}
+            </if>
+            <if test="storageCode != null and storageCode != ''">
+                and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
+            </if>
+            <if test="wbs != null and wbs != ''">
+                and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
             <if test="startTime != null and startTime != ''">
                 and a.scrq <![CDATA[>=]]> #{startTime}
@@ -828,26 +881,6 @@
         attribute
         from tld_inventory where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and
         account_sleeve = #{accountSleeve} and amount <![CDATA[>=]]> #{num}
-            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,
-            produc_batch,
-            attribute
-        from tld_inventory where material_id = #{materialId} and account_sleeve = #{accountSleeve} and amount <![CDATA[>=]]> #{num}
         <if test="wbs != '' and wbs != null">
             and wbs = #{wbs}
         </if>
@@ -873,28 +906,28 @@
     <!-- 其他入库查询库存是否存在 -->
     <select id="getInventoryInfoOther" resultType="com.tld.model.Inventory">
         select
-            a.id,
-            a.storage_location_code,
-            a.wllb_class,
-            a.library_type,
-            a.material_id,
-            a.amount,
-            a.total,
-            a.totime,
-            a.hold,
-            a.amount_lock,
-            a.account_sleeve,
-            a.wbs,
-            a.supplier_id,
-            a.serial,
-            a.wllb_code,
-            a.produc_date,
-            a.scrq,
-            a.produc_batch,
-            a.attribute,
-            b.name as accountName,
-            c.storage_location_name as storageLocationName,
-            c.warehouse_where as warehouseWhere
+        a.id,
+        a.storage_location_code,
+        a.wllb_class,
+        a.library_type,
+        a.material_id,
+        a.amount,
+        a.total,
+        a.totime,
+        a.hold,
+        a.amount_lock,
+        a.account_sleeve,
+        a.wbs,
+        a.supplier_id,
+        a.serial,
+        a.wllb_code,
+        a.produc_date,
+        a.scrq,
+        a.produc_batch,
+        a.attribute,
+        b.name as accountName,
+        c.storage_location_name as storageLocationName,
+        c.warehouse_where as warehouseWhere
         from tld_inventory a
         left join tld_company b on a.account_sleeve = b.code
         left join tld_storage_location c on a.storage_location_code = c.storage_location_code

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

@@ -75,6 +75,7 @@
     <!-- 查询库位信息 -->
     <select id="storageLocation" resultType="java.util.Map">
         SELECT
+        a.id,
         a.storage_location_code as storageLocationCode,
         a.material_id as materialId,
         sum( a.amount ) AS sum,
@@ -126,6 +127,9 @@
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
+            <if test="warehouseId != null and warehouseId != ''">
+                and f.tld_id = #{warehouseId}
+            </if>
         </trim>
         GROUP BY
         a.storage_location_code,
@@ -164,6 +168,7 @@
             </if>
         </trim>
     </select>
+    <!--导出-->
     <select id="getStorageLocation" resultType="java.util.LinkedHashMap">
         SELECT
         c.code as code,
@@ -172,7 +177,8 @@
         b.storage_location_name as storageLocationName ,
         p.name as companyName,
         e.name as supplierName,
-        a.wbs as wbs
+        a.wbs as wbs,
+        f.name as warehouseName,
         FROM
         tld_inventory a
         LEFT JOIN tld_storage_location b ON a.storage_location_code = b.storage_location_code
@@ -205,6 +211,9 @@
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
+            <if test="warehouseId != null and warehouseId != ''">
+                and f.tld_id =  #{warehouseId}
+            </if>
         </trim>
         GROUP BY
         a.storage_location_code,

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

@@ -15,7 +15,8 @@
             b.code as wllbCode,
             c.real_name,
             a.modify_time,
-            f.user_name as modifyUser
+            f.user_name as modifyUser,
+            f.real_name as realName
         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
@@ -33,6 +34,9 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and f.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="userId != null and userId != ''">
                 and a.user_id = #{userId}
             </if>
@@ -91,11 +95,13 @@
         SELECT DISTINCT
         b.CODE AS wllbCode,
         b.NAME AS materialName,
-        c.user_name AS userName
+        c.user_name AS userName,
+        f.real_name AS real_name
         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
+        left join tld_user f on a.modify_user = f.id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="materialId != null and materialId != ''">
                 and a.material_id = #{materialId}
@@ -112,6 +118,9 @@
             <if test="userId != null and userId != ''">
                 and a.user_id = #{userId}
             </if>
+            <if test="realName != null and realName != ''">
+                and f.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="id != null and id != ''">
                 and a.id = #{id}
             </if>

+ 51 - 11
src/main/resources/mapper/WarehousingMapper.xml

@@ -220,7 +220,8 @@
         g.storage_location_name as storageLocationName,
         a.scrq,
         a.storage_code,
-        a.wbs
+        a.wbs,
+        c.real_name as realName
         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
@@ -240,6 +241,9 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="storageLocationName != null and storageLocationName != ''">
                 and g.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
             </if>
@@ -298,7 +302,8 @@
         g.storage_location_name as storageLocationName,
         a.scrq,
         a.storage_code,
-        a.wbs
+        a.wbs,
+        c.real_name as realName
         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
@@ -318,6 +323,9 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="storageLocationName != null and storageLocationName != ''">
                 and g.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
             </if>
@@ -544,7 +552,9 @@
         b.code as materialCode,
         a.storage_code,
         a.wbs,
-        a.production_code
+        a.production_code,
+        c.real_name as realName,
+        a.production_code as productionCode
         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
@@ -567,6 +577,12 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
+            <if test="productionCode != null and productionCode != ''">
+                and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
+            </if>
             <if test="storageCode != null and storageCode != ''">
                 and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
             </if>
@@ -579,7 +595,7 @@
         </trim>
         order by a.scrq desc
     </select>
-    <!-- 查询半成品入库流水-->
+    <!-- 查询半成品入库流水导出-->
     <select id="productExcel" resultType="java.util.LinkedHashMap">
         select
         b.name,
@@ -589,7 +605,9 @@
         c.user_name,
         a.scrq,
         a.storage_code,
-        a.wbs
+        a.wbs,
+        c.real_name as realName,
+        a.production_code as productionCode
         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
@@ -612,6 +630,12 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
+            <if test="productionCode != null and productionCode != ''">
+                and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
+            </if>
             <if test="storageCode != null and storageCode != ''">
                 and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
             </if>
@@ -748,7 +772,9 @@
         c.user_name as userName,
         b.code as materialCode,
         a.storage_code,
-        a.wbs
+        a.wbs,
+        c.real_name as realName,
+        a.production_code as productionCode
         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
@@ -769,6 +795,9 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="attribute != null and attribute != ''">
                 and a.attribute like CONCAT(CONCAT('%', #{attribute}), '%')
             </if>
@@ -789,16 +818,18 @@
         select
         b.name as materialName,
         a.wllb_code,
-        a.produc_batch,
+        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,
-        a.seq,
-        a.attribute,
+        if(a.seq = '' , null , a.seq) as seq,
+        if(a.attribute = '' , null , a.attribute) as attribute,
         a.storage_code,
-        a.wbs
+        if(a.wbs = '' , null , a.wbs) as wbs,
+        c.real_name as realName,
+        a.production_code as productionCode
         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
@@ -818,6 +849,9 @@
             <if test="userName != null and userName != ''">
                 and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
+            <if test="realName != null and realName != ''">
+                and c.real_name like CONCAT(CONCAT('%', #{realName}), '%')
+            </if>
             <if test="attribute != null and attribute != ''">
                 and a.attribute like CONCAT(CONCAT('%', #{attribute}), '%')
             </if>
@@ -827,9 +861,15 @@
             <if test="wbs != null and wbs != ''">
                 and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
             </if>
+            <if test="productionCode != null and productionCode != ''">
+                and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
+            </if>
             <if test="storageLocationName != null and storageLocationName != ''">
                 and e.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
             </if>
+            <if test="productionCode != null and productionCode != ''">
+                and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
+            </if>
         </trim>
         order by a.scrq desc
     </select>
@@ -920,7 +960,7 @@
     <insert id="addReturnWarehousingOther">
         insert into tld_return_gs_other_warehousing(storage_code, account_sleeve, storage_location_code, wbs, amount,
                                                     material_id)
-            value (#{storageCode},#{accountSleeve},#{storageLocationCode},#{wbs},#{amount},#{materialId})
+            value (#{storageCode},#{accountSleeve},#{storageLocationCode},#{wbs},#{num},#{materialId})
     </insert>
     <!-- 其他入库 -->
     <insert id="addInventoryOther">