Browse Source

问题修改

xiaochen 2 năm trước cách đây
mục cha
commit
715e9f271c

+ 13 - 0
src/main/java/com/tld/controller/UserMaterialController.java

@@ -1,11 +1,13 @@
 package com.tld.controller;
 
+import com.tld.model.User;
 import com.tld.model.UserMaterial;
 import com.tld.service.UserMaterialService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
 /**
@@ -66,4 +68,15 @@ public class UserMaterialController {
     public Map<String, Object> getUser(){
         return userMaterialService.getUser();
     }
+
+
+    /**
+     * 查询用户绑定物料信息导出
+     * @param response 参数
+     */
+    @GetMapping("Export")
+    public void Export(UserMaterial userMaterial, HttpServletResponse response){
+        userMaterialService.Export(userMaterial, response);
+    }
+
 }

+ 1 - 0
src/main/java/com/tld/mapper/DictionaryMapper.java

@@ -49,4 +49,5 @@ public interface DictionaryMapper {
 
     List<Dictionary> getDictionaryPageMaterial(Dictionary dictionary);
 
+    void deleteRepertory(Dictionary dictionary);
 }

+ 6 - 1
src/main/java/com/tld/mapper/InventoryMapper.java

@@ -31,7 +31,12 @@ public interface InventoryMapper {
 
     MakeInventory getInventoryPlates(MakeInventory inventory);
 
-    void addInventoryPlates(MakeInventory inventory);
+    void addInventoryPlates(List<Map<String,Object>> inventory);
 
     List<MakeInventory> getInventoryPlatesList(MakeInventory makeInventory);
+
+    List<Map<String, Object>> getInventoryLocality(MakeInventory makeInventory);
+
+    List<Map<String, Object>> getInventoryLocalityGs(List<Map<String, Object>> list);
+
 }

+ 2 - 0
src/main/java/com/tld/mapper/UserMaterialMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface UserMaterialMapper {
@@ -21,4 +22,5 @@ public interface UserMaterialMapper {
 
     int getMaterial(@Param("wllbCode") String wllbCode);
 
+    List<Map<String, Object>> Export(UserMaterial userMaterial);
 }

+ 16 - 4
src/main/java/com/tld/model/MakeInventory.java

@@ -19,6 +19,14 @@ public class MakeInventory implements Serializable {
      * 库位编号
      */
     private String storageLocationCode;
+    /**
+     * 所属公司
+     */
+    private String accountSleeve;
+    /**
+     * 库位名称
+     */
+    private String storageLocationName;
     /**
      * 实际数量
      */
@@ -55,10 +63,6 @@ public class MakeInventory implements Serializable {
      * 盘点主表id
      */
     private String plateId;
-    /**
-     * 所属公司
-     */
-    private String accountSleeve;
     /**
      * 供应商id
      */
@@ -95,6 +99,10 @@ public class MakeInventory implements Serializable {
      * 所属公司查询条件
      */
     private String accountSleeves;
+    /**
+     * 公司名称
+     */
+    private String accountName;
     /**
      * 开始时间
      */
@@ -107,6 +115,10 @@ public class MakeInventory implements Serializable {
      * 操作人
      */
     private String userId;
+    /**
+     * 用户名
+     */
+    private String userName;
 
     /**
      * 页数

+ 3 - 0
src/main/java/com/tld/service/UserMaterialService.java

@@ -3,6 +3,7 @@ package com.tld.service;
 import com.tld.model.UserMaterial;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
 public interface UserMaterialService {
@@ -15,4 +16,6 @@ public interface UserMaterialService {
     Map<String, Object> delUserMaterial(String id);
 
     Map<String, Object> getUser();
+
+    void Export(UserMaterial userMaterial, HttpServletResponse response);
 }

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

@@ -43,17 +43,18 @@ public class DictionaryServiceImpl implements DictionaryService {
     @Transactional(rollbackFor = Exception.class)
     public Map<String, Object> addDictionary(List<Dictionary> dictionarys) {
         Map<String, Object> map = new HashMap<>();
+        boolean flg = false ;
         try{
             for(Dictionary dictionary : dictionarys) {
                 if(dictionary.getType().equals("") || dictionary.getType() == null){
-                    map.put("msg", "500");
-                    map.put("errMsg", "类型不存在请检查");
+                    map.put("status", "0002");
+                    map.put("msg", "类型不存在请检查");
                     return map;
                 }
                 String tableName = dictionaryMapper.getTableName(dictionary.getType());
                 if ("null".equals(tableName)) {
-                    map.put("msg", "500");
-                    map.put("errMsg", "失败,请联系是否存在此字典");
+                    map.put("status", "0002");
+                    map.put("msg", "失败,请联系是否存在此字典");
                     return map;
                 }
                 dictionary.setTableName(tableName);
@@ -64,6 +65,10 @@ public class DictionaryServiceImpl implements DictionaryService {
                     if (dictionary.getType().equals("物料字典")) {
                         dictionaryMapper.addMaterial(dictionary);
                     } else if (dictionary.getType().equals("库账对存")) {
+                        if (!flg){
+                            flg = true ;
+                            dictionaryMapper.deleteRepertory(dictionary);
+                        }
                         dictionaryMapper.addTreasuryAccount(dictionary);
                     }else if (dictionary.getType().equals("仓库")){
                         //添加库位信息

+ 11 - 14
src/main/java/com/tld/service/impl/InventoryServiceImpl.java

@@ -61,12 +61,11 @@ public class InventoryServiceImpl implements InventoryService {
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
             List<Object> head =
-                    Arrays.asList("id","物料id", "物料编号", "物料名称","系统物料数量","gs物料数量","记录数量","uuid");
+                    Arrays.asList("物料ID", "物料编号", "物料名称","系统物料数量","GS物料数量","记录数量","所属公司");
             //查询数据
-            PageHelper.startPage(makeInventory.getPage(), makeInventory.getLimit());
-            PageInfo<Map<String, Object>> list = new PageInfo<>(inventoryMapper.export(makeInventory));
+            List<Map<String, Object>> list = new ArrayList<>(inventoryMapper.export(makeInventory));
             sheetDataList.add(head);
-            for(Map<String, Object> userMap : list.getList()){
+            for(Map<String, Object> userMap : list){
                 List<Object> listSheet = new ArrayList<>();
                 for(String key: userMap.keySet()){
                     listSheet.add(userMap.get(key));
@@ -113,17 +112,15 @@ public class InventoryServiceImpl implements InventoryService {
             //生成主表
             inventoryMapper.addInventoryPlate(makeInventory);
             //生成子表信息
-            //查询系统库存gs库存的数据
-            List<MakeInventory> list = inventoryMapper.getInventoryPlate(makeInventory);
-            for (MakeInventory inventory : list) {
-                inventory.setUuid(makeInventory.getUuid());
-//                MakeInventory makeInventory1 = inventoryMapper.getInventoryPlates(inventory);
-//                if (makeInventory1 == null){
-//
-//                }
-                //添加子表信息
-                inventoryMapper.addInventoryPlates(inventory);
+            //查询WMS库存数量
+            List<Map<String,Object>> mapList =  inventoryMapper.getInventoryLocality(makeInventory);
+            //查询系统库存gs库存的数量
+            List<Map<String,Object>> mapList1 = inventoryMapper.getInventoryLocalityGs(mapList);
+            for (Map<String,Object> map1 : mapList1) {
+                map1.put("uuid",makeInventory.getUuid());
+                mapList.add(map1);
             }
+            inventoryMapper.addInventoryPlates(mapList);
             map.put("msg", "200");
         } catch (Exception e) {
             e.printStackTrace();

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

@@ -133,11 +133,12 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
         try{
             receiveGoods.setType("1");
             receiveGoodsMapper.updateReceiveGoods(receiveGoods);
-            map.put("msg", "200");
+            map.put("status", "0000");
+            map.put("msg","成功");
         } catch (Exception e) {
             e.printStackTrace();
-            map.put("msg", "500");
-            map.put("errMsg", "服务器请求异常,请稍后再试");
+            map.put("status", "0009");
+            map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
     }

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

@@ -2,6 +2,7 @@ package com.tld.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.tld.excel.ExcelUtils;
 import com.tld.mapper.UserMaterialMapper;
 import com.tld.model.Role;
 import com.tld.model.User;
@@ -12,9 +13,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 @Service
 @RequiredArgsConstructor
@@ -113,4 +114,33 @@ public class UserMaterialServiceImpl implements UserMaterialService {
         }
         return map;
     }
+
+    /**
+     * 查询用户绑定物料信息导出
+     * */
+    @Override
+    public void Export(UserMaterial userMaterial, HttpServletResponse response) {
+        try{
+            //导出数据汇总
+            List<List<Object>> sheetDataList = new ArrayList<>();
+            //表头数据
+            List<Object> head = Arrays.asList("物料编号", "物料名称", "用户名称");
+            //查询数据
+            List<Map<String, Object>> list = userMaterialMapper.Export(userMaterial);
+            sheetDataList.add(head);
+            for(Map<String, Object> userMap : list){
+                List<Object> listSheet = new ArrayList<>();
+                for(String key: userMap.keySet()){
+                    listSheet.add(userMap.get(key));
+                }
+                sheetDataList.add(listSheet);
+            }
+            //当前时间
+            Date time = new Date();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMddHHmmss");
+            ExcelUtils.export(response, "查询用户绑定物料信息导出" + sdf.format(time), sheetDataList);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
 }

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

@@ -162,7 +162,7 @@ public class UserServiceImpl implements UserService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("用户编号", "用户名", "真实姓名","邮箱","电话", "手机", "部门", "角色", "创建时间");
+            List<Object> head = Arrays.asList("用户编号", "用户名", "真实姓名","邮箱","电话", "手机", "部门", "角色");
             //查询数据
             PageHelper.startPage(1, 10);
             List<Map<String, Object>> list = userMapper.getUserExportData(user);

+ 7 - 2
src/main/resources/mapper/DictionaryMapper.xml

@@ -73,8 +73,8 @@
     </select>
     <!-- 库账对存字典新增 -->
     <insert id="addTreasuryAccount">
-        insert into tld_treasury_account(material_id, code, name, num, type)
-        values (#{materialId}, #{code}, #{name}, #{num}, #{typeVal})
+        insert into tld_inventory_gs(material_id, amount, account_sleeve)
+        values (#{materialId}, #{num}, #{typeVal})
     </insert>
     <!-- 查询仓库id -->
     <select id="getWarehouse" resultType="String">
@@ -288,6 +288,11 @@
         from ${tableName}
         where id = #{id}
     </delete>
+    <!--删除所有gs库存-->
+    <delete id="deleteRepertory">
+        delete
+        from tld_inventory_gs
+    </delete>
     <!-- 新增日志 -->
     <insert id="addAccess">
         insert into tld_access(type, data, scrq) value (#{type},#{data},now())

+ 7 - 7
src/main/resources/mapper/GoodsMapper.xml

@@ -77,25 +77,25 @@
                 <if test="inputType != null">
                     input_type = #{inputType},
                 </if>
-                <if test="userDepartment != null and userDepartment != ''">
+                <if test="userDepartment != null">
                     user_department = #{userDepartment},
                 </if>
-                <if test="lowReserves != null and lowReserves != ''">
+                <if test="lowReserves != null">
                     low_reserves = #{lowReserves},
                 </if>
-                <if test="highReserves != null and highReserves != ''">
+                <if test="highReserves != null">
                     high_reserves = #{highReserves},
                 </if>
-                <if test="grade != null and grade != ''">
+                <if test="grade != null">
                     grade = #{grade},
                 </if>
-                <if test="packingType != null and packingType != ''">
+                <if test="packingType != null">
                     packing_type = #{packingType},
                 </if>
-                <if test="unit != null and unit != ''">
+                <if test="unit != null">
                     unit = #{unit},
                 </if>
-                <if test="name != null and name != ''">
+                <if test="name != null">
                     name = #{name},
                 </if>
             </trim>

+ 143 - 72
src/main/resources/mapper/InventoryMapper.xml

@@ -16,8 +16,11 @@
     </insert>
     <!--添加盘点子表信息-->
     <insert id="addInventoryPlates">
-        insert into tld_plate_z( material_id, wllb_code, name, amount, gs_amount,uuid)
-        values (#{materialId}, #{wllbCode}, #{name}, #{amount}, #{gsAmount},#{uuid})
+        insert into tld_plate_z(material_id, wllb_code, name, amount, gs_amount, uuid, account_sleeve)
+        values
+        <foreach collection="inventory" index="index" item="item" separator=",">
+            (#{item.materialId}, #{item.wllbCode}, #{item.name}, #{item.amount}, #{item.gsAmount}, #{item.uuid},#{item.accountSleeve})
+        </foreach>
     </insert>
     <!--修改录入信息为主表id为空的添加主表uuid进行关联-->
     <update id="updateInventoryPlate">
@@ -35,126 +38,148 @@
     <!--导出盘点数据-->
     <select id="export" resultType="java.util.LinkedHashMap">
         select
-        id,
-        material_id,
-        wllb_code,
-        name,
-        amount,
-        gs_amount,
-        if(plate_amount = '', null , plate_amount),
-        uuid
-        from tld_plate_z
+            a.material_id,
+            a.wllb_code,
+            a.name,
+            a.amount,
+            a.gs_amount,
+            c.plateAmount,
+            b.name as accountName
+        from tld_plate_z a
+        left join tld_company b on a.account_sleeve = b.code
+        left join (select sum(amount) as plateAmount,material_id,uuid from tld_plate GROUP BY material_id,uuid) c on a.material_id = c.material_id and a.uuid = c.uuid
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="materialId != null and materialId != ''">
-                and material_id = #{materialId}
+                and a.material_id = #{materialId}
             </if>
             <if test="wllbCode != null and wllbCode != ''">
-                and wllb_code = #{wllbCode}
+                and a.wllb_code = #{wllbCode}
             </if>
             <if test="uuid != null and uuid != ''">
-                and uuid = #{uuid}
+                and a.uuid = #{uuid}
             </if>
             <if test="name != null and name != ''">
-                and name like CONCAT(CONCAT('%', #{name}), '%')
+                and a.name like CONCAT(CONCAT('%', #{name}), '%')
+            </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
             </if>
         </trim>
     </select>
     <!--查询录入盘点信息-->
     <select id="getInventory" resultType="com.tld.model.MakeInventory">
         select
-        id,
-        storage_location_code,
-        amount,
-        total,
-        wllb_code,
-        scrq,
-        material_id,
-        plate_id,
-        account_sleeve,
-        supplier_id,
-        serial,
-        attribute,
-        uuid
-        from tld_plate
+        a.id,
+        a.storage_location_code,
+        a.amount,
+        a.total,
+        a.wllb_code,
+        a.scrq,
+        a.material_id,
+        a.plate_id,
+        a.account_sleeve,
+        a.supplier_id,
+        a.serial,
+        a.attribute,
+        a.uuid,
+        b.name as name ,
+        c.storage_location_name as storageLocationName
+        from tld_plate a
+        left join tld_material b on a.wllb_code = b.code
+        left join tld_storage_location c on a.storage_location_code = c.storage_location_code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="wllbCodes != null and wllbCodes != ''">
-                and wllb_code = #{wllbCodes}
+                and a.wllb_code  like CONCAT(CONCAT('%', #{wllbCodes}), '%')
+            </if>
+            <if test="name != null and name != ''">
+                and b.name  like CONCAT(CONCAT('%', #{name}), '%')
+            </if>
+            <if test="storageLocationName != null and storageLocationName != ''">
+                and c.storageLocationName  like CONCAT(CONCAT('%', #{storageLocationName}), '%')
+            </if>
+            <if test="wllbCodes != null and wllbCodes != ''">
+                and a.wllb_code  like CONCAT(CONCAT('%', #{wllbCodes}), '%')
             </if>
             <if test="materialId != null and materialId != ''">
-                and material_id = #{materialId}
+                and a.material_id = #{materialId}
             </if>
             <if test="amount != null and amount != ''">
-                and amount = #{amount}
+                and a.amount = #{amount}
             </if>
             <if test="total != null and total != ''">
-                and total = #{total}
+                and a.total = #{total}
             </if>
             <if test="storageLocationCodes != null and storageLocationCodes != ''">
-                and storage_location_code = #{storageLocationCodes}
+                and a.storage_location_code like CONCAT(CONCAT('%', #{storageLocationCodes}), '%')
             </if>
             <if test="plateId != null and plateId != ''">
-                and plate_id = #{plateId}
+                and a.plate_id = #{plateId}
             </if>
             <if test="accountSleeve != null and accountSleeve != ''">
-                and account_sleeve = #{accountSleeve}
+                and a.account_sleeve = #{accountSleeve}
             </if>
             <if test="supplierId != null and supplierId != ''">
-                and supplier_id = #{supplierId}
+                and a.supplier_id = #{supplierId}
             </if>
             <if test="serial != null and serial != ''">
-                and serial = #{serial}
+                and a.serial = #{serial}
             </if>
             <if test="attribute != null and attribute != ''">
-                and attribute = #{attribute}
+                and a.attribute = #{attribute}
             </if>
             <if test="uuid != null and uuid != ''">
-                and uuid = #{uuid}
+                and a.uuid = #{uuid}
             </if>
             <if test="scrq != null and scrq != ''">
-                and scrq like CONCAT(CONCAT('%', #{scrq}), '%')
+                and a.scrq like CONCAT(CONCAT('%', #{scrq}), '%')
             </if>
             <if test="startTime != null and startTime != ''">
-                and sqrq <![CDATA[>=]]> #{startTime}
+                and a.sqrq <![CDATA[>=]]> #{startTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                and sqrq <![CDATA[<=]]> #{endTime}
+                and a.sqrq <![CDATA[<=]]> #{endTime}
             </if>
         </trim>
-        order by scrq desc
+        order by a.scrq desc
     </select>
     <!--查询盘点主表信息-->
     <select id="getInventoryDataList" resultType="com.tld.model.MakeInventory">
         select
-        id,
-        user_id,
-        scrq,
-        uuid,
-        title
-        from tld_plate_f
+        a.id,
+        a.user_id,
+        a.scrq,
+        a.uuid,
+        a.title,
+        b.user_name as userName
+        from tld_plate_f a
+        left join tld_user b on a.user_id = b.id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="userId != null and userId != ''">
-                and user_id = #{userId}
+                and a.user_id = #{userId}
             </if>
             <if test="uuid != null and uuid != ''">
-                and uuid = #{uuid}
+                and a.uuid = #{uuid}
             </if>
             <if test="scrq != null and scrq != ''">
-                and scrq like CONCAT(CONCAT('%', #{scrq}), '%')
+                and a.scrq like CONCAT(CONCAT('%', #{scrq}), '%')
+            </if>
+            <if test="userName != null and userName != ''">
+                and b.user_name like CONCAT(CONCAT('%', #{userName}), '%')
             </if>
             <if test="title != null and title != ''">
-                and title like CONCAT(CONCAT('%', #{title}), '%')
+                and a.title like CONCAT(CONCAT('%', #{title}), '%')
             </if>
             <if test="plateId != null and plateId != ''">
-                and id = #{plateId}
+                and a.id = #{plateId}
             </if>
             <if test="startTime != null and startTime != ''">
-                and sqrq <![CDATA[>=]]> #{startTime}
+                and a.scrq <![CDATA[>=]]> #{startTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                and sqrq <![CDATA[<=]]> #{endTime}
+                and a.scrq <![CDATA[<=]]> #{endTime}
             </if>
         </trim>
-        order by scrq desc
+        order by a.scrq desc
     </select>
     <!--查询盘点录入信息是否重复-->
     <select id="getInventoryRepetition" resultType="com.tld.model.MakeInventory">
@@ -218,29 +243,75 @@
     <!--查询盘点子表信息-->
     <select id="getInventoryPlatesList" resultType="com.tld.model.MakeInventory">
         select
-        id,
-        plate_id,
-        material_id,
-        wllb_code,
-        name,
-        amount,
-        gs_amount,
-        plate_amount,
-        uuid
-        from tld_plate_z
+        a.id,
+        a.plate_id,
+        a.material_id,
+        a.wllb_code,
+        a.amount,
+        a.gs_amount,
+        e.plateAmount,
+        a.uuid,
+        b.name as name,
+        a.account_sleeve,
+        c.name as accountName
+        from tld_plate_z a
+        left join tld_material b on a.wllb_code = b.code
+        left join tld_company c on a.account_sleeve = c.code
+        left join (select sum(amount) as plateAmount,material_id,uuid from tld_plate GROUP BY material_id,uuid) e on a.material_id = e.material_id and a.uuid = e.uuid
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="materialId != null and materialId != ''">
-                and material_id = #{materialId}
+                and a.material_id = #{materialId}
             </if>
             <if test="wllbCode != null and wllbCode != ''">
-                and wllb_code = #{wllbCode}
+                and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
             </if>
             <if test="uuid != null and uuid != ''">
-                and uuid = #{uuid}
+                and a.uuid = #{uuid}
             </if>
             <if test="name != null and name != ''">
-                and name like CONCAT(CONCAT('%', #{name}), '%')
+                and b.name like CONCAT(CONCAT('%', #{name}), '%')
+            </if>
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
+            </if>
+        </trim>
+    </select>
+    <!--查询本地库存.gs库存.录入库存 数量-->
+    <select id="getInventoryLocality" resultType="java.util.Map">
+        SELECT a.wllb_code   AS wllbCode,
+               a.material_id AS materialId,
+               b.amount      AS gsAmount,
+               SUM(a.amount) AS amount,
+               b.material_id AS bId,
+               c.NAME AS name,
+               a.account_sleeve as accountSleeve,
+               ${uuid} AS uuid
+        FROM tld_inventory a
+        LEFT JOIN tld_inventory_gs b ON a.material_id = b.material_id
+        LEFT JOIN tld_material c ON a.wllb_code = c.CODE
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="accountSleeve != null and accountSleeve != ''">
+                and a.account_sleeve = #{accountSleeve}
             </if>
         </trim>
+        GROUP BY a.material_id
+    </select>
+    <!--查询本地库存.gs库存.录入库存 数量 中 没有连接到的gs的数据-->
+    <select id="getInventoryLocalityGs" resultType="java.util.Map">
+        select
+        c.code AS wllbCode,
+        a.material_id AS materialId,
+        a.amount AS gsAmount,
+        0 AS amount,
+        c.NAME AS name,
+        a.account_sleeve as accountSleeve
+        from tld_inventory_gs a
+        LEFT JOIN tld_material c ON a.material_id = c.tld_id
+        where material_id not in
+        <foreach collection="list" index="index" item="item" separator="," close=")" open="(">
+              <if test="item.bId != null and item.bId != ''">
+                  #{item.bId}
+              </if>
+        </foreach>
     </select>
 </mapper>

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

@@ -82,16 +82,16 @@
                 <if test="arrivalNum != null">
                     arrival_num = #{arrivalNum},
                 </if>
-                <if test="qualifiedNum != null and qualifiedNum != ''">
+                <if test="qualifiedNum != null">
                     qualified_num = #{qualifiedNum},
                 </if>
-                <if test="disqualificationNum != null and disqualificationNum != ''">
+                <if test="disqualificationNum != null">
                     disqualification_num = #{disqualificationNum},
                 </if>
-                <if test="arrivalTime != null and arrivalTime != ''">
+                <if test="arrivalTime != null">
                     arrival_time = #{arrivalTime},
                 </if>
-                <if test="type != null and type != ''">
+                <if test="type != null">
                     type = #{type},
                 </if>
             </trim>
@@ -183,7 +183,7 @@
         left join tld_material b on a.material_id = b.tld_id
         left join tld_customer c on a.supplier_id = c.code
         where
-            a.arrival_time <![CDATA[<]]> CURDATE() and type = '0'
+            a.arrival_time <![CDATA[<]]> CURDATE() and a.type = '0'
         <if test="orderCode != null and orderCode != ''">
             and a.order_code = #{orderCode}
         </if>

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

@@ -140,8 +140,7 @@
         if(a.landline = '', null , a.landline) as landline,
         if(a.phone = '', null , a.phone) as phone,
         c.name as department,
-        b.role_name as role,
-        a.create_time,
+        b.role_name as role
         from tld_user a
         left join tld_role b on a.role = b.id
         left join tld_department c on a.department = c.code

+ 32 - 0
src/main/resources/mapper/UserMaterialMapper.xml

@@ -86,5 +86,37 @@
     <select id="getMaterial" resultType="java.lang.Integer">
         select COUNT(*) from tld_material where code = #{wllbCode}
     </select>
+    <!--查询用户绑定物料信息导出-->
+    <select id="Export" resultType="java.util.LinkedHashMap">
+        SELECT DISTINCT
+        b.CODE AS wllbCode,
+        b.NAME AS materialName,
+        c.user_name AS userName
+        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
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="materialId != null and materialId != ''">
+                and a.material_id = #{materialId}
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and b.name like CONCAT(CONCAT('%', #{materialName}), '%')
+            </if>
+            <if test="wllbCode != null and wllbCode != ''">
+                and b.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
+            </if>
+            <if test="userName != null and userName != ''">
+                and c.user_name like CONCAT(CONCAT('%', #{userName}), '%')
+            </if>
+            <if test="userId != null and userId != ''">
+                and a.user_id = #{userId}
+            </if>
+            <if test="id != null and id != ''">
+                and a.id = #{id}
+            </if>
+        </trim>
+        order by a.id desc
+    </select>
 
 </mapper>