Browse Source

问题修改

xiaochen 2 years ago
parent
commit
cbc74c218c
25 changed files with 404 additions and 143 deletions
  1. 11 0
      src/main/java/com/tld/controller/DictionaryController.java
  2. 1 1
      src/main/java/com/tld/controller/GsAccessController.java
  3. 1 1
      src/main/java/com/tld/controller/InventoryController.java
  4. 11 0
      src/main/java/com/tld/controller/MaterialClassController.java
  5. 4 0
      src/main/java/com/tld/mapper/DictionaryMapper.java
  6. 2 0
      src/main/java/com/tld/mapper/MaterialClassMapper.java
  7. 2 2
      src/main/java/com/tld/model/Dictionary.java
  8. 3 0
      src/main/java/com/tld/service/DictionaryService.java
  9. 3 0
      src/main/java/com/tld/service/MaterialClassService.java
  10. 50 10
      src/main/java/com/tld/service/impl/DictionaryServiceImpl.java
  11. 16 13
      src/main/java/com/tld/service/impl/InventoryServiceImpl.java
  12. 33 3
      src/main/java/com/tld/service/impl/MaterialClassServiceImpl.java
  13. 1 1
      src/main/java/com/tld/service/impl/RoleServiceImpl.java
  14. 0 1
      src/main/java/com/tld/service/impl/StorageLocationServiceImpl.java
  15. 1 1
      src/main/java/com/tld/service/impl/UserServiceImpl.java
  16. 2 2
      src/main/resources/mapper/DepartmentMapper.xml
  17. 141 42
      src/main/resources/mapper/DictionaryMapper.xml
  18. 8 8
      src/main/resources/mapper/GoodsMapper.xml
  19. 30 13
      src/main/resources/mapper/InventoryMapper.xml
  20. 46 11
      src/main/resources/mapper/MaterialClassMapper.xml
  21. 1 1
      src/main/resources/mapper/ReceiveGoodsMapper.xml
  22. 1 4
      src/main/resources/mapper/RoleMapper.xml
  23. 22 21
      src/main/resources/mapper/StorageLocationMapper.xml
  24. 4 7
      src/main/resources/mapper/UserMapper.xml
  25. 10 1
      src/main/resources/mapper/UserMaterialMapper.xml

+ 11 - 0
src/main/java/com/tld/controller/DictionaryController.java

@@ -1,11 +1,13 @@
 package com.tld.controller;
 
 import com.tld.model.Dictionary;
+import com.tld.model.Goods;
 import com.tld.service.DictionaryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
 /**
@@ -66,4 +68,13 @@ public class DictionaryController {
     public Map<String, Object> deleteDictionary(Dictionary dictionary, HttpServletRequest request){
         return dictionaryService.deleteDictionary(dictionary, request);
     }
+
+    /**
+     * 物料字典导出
+     * @param dictionary 参数
+     */
+    @GetMapping("export")
+    public void userExport(Dictionary dictionary, HttpServletResponse response){
+        dictionaryService.export(dictionary, response);
+    }
 }

+ 1 - 1
src/main/java/com/tld/controller/GsAccessController.java

@@ -51,7 +51,7 @@ public class GsAccessController {
     }
 
     /**
-     * 采购到料信息大屏
+     * 采购到料信息大屏/采购订单接口
      * @param jsonData 参数
      * @return 返回结果
      */

+ 1 - 1
src/main/java/com/tld/controller/InventoryController.java

@@ -62,7 +62,7 @@ public class InventoryController {
     }
 
     /**
-     * 生成盘点信息(盘点子表信息)
+     * 生成盘点信息(盘点子表信息)//
      * @param makeInventory 参数
      * @return 返回结果
      */

+ 11 - 0
src/main/java/com/tld/controller/MaterialClassController.java

@@ -1,11 +1,13 @@
 package com.tld.controller;
 
 import com.tld.model.MaterialClass;
+import com.tld.model.User;
 import com.tld.service.MaterialClassService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
 /**
@@ -67,4 +69,13 @@ public class MaterialClassController {
     public Map<String, Object> updateMaterial(@RequestBody MaterialClass materialClass, HttpServletRequest request){
         return materialClassService.updateMaterial(materialClass, request);
     }
+
+    /**
+     * 物料类别导出
+     * @param response
+     */
+    @GetMapping("Export")
+    public void Export(MaterialClass materialClass, HttpServletResponse response){
+        materialClassService.Export(materialClass, response);
+    }
 }

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

@@ -45,4 +45,8 @@ public interface DictionaryMapper {
 
     void addStorageLocation(@Param("storageLocationCode") String storageLocationCode, @Param("warehouseWhere") String warehouseWhere, @Param("storageLocationName") String storageLocationName);
 
+    List<Map<String, Object>> export(Dictionary dictionary);
+
+    List<Dictionary> getDictionaryPageMaterial(Dictionary dictionary);
+
 }

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

@@ -4,6 +4,7 @@ import com.tld.model.MaterialClass;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface MaterialClassMapper {
@@ -21,4 +22,5 @@ public interface MaterialClassMapper {
 
     int getMaterialClassStorageLocationMaterial(String wllbCode);
 
+    List<Map<String, Object>> Export(MaterialClass materialClass);
 }

+ 2 - 2
src/main/java/com/tld/model/Dictionary.java

@@ -56,11 +56,11 @@ public class Dictionary  implements Serializable {
      */
     private String size;
     /**
-     * 物料类
+     * 物料类
      */
     private String materialType;
     /**
-     * 物料类型
+     * 物料类型/编号
      */
     private String wllbClass;
     /**

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

@@ -3,6 +3,7 @@ package com.tld.service;
 import com.tld.model.Dictionary;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.Map;
 
@@ -18,4 +19,6 @@ public interface DictionaryService {
     Map<String, Object> deleteDictionary(Dictionary dictionary, HttpServletRequest request);
 
     Map<String, Object> addDiction(Dictionary dictionary, HttpServletRequest request);
+
+    void export(Dictionary dictionary, HttpServletResponse response);
 }

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

@@ -3,6 +3,7 @@ package com.tld.service;
 import com.tld.model.MaterialClass;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
 public interface MaterialClassService {
@@ -15,4 +16,6 @@ public interface MaterialClassService {
     Map<String, Object> updateMaterialClass(MaterialClass materialClass, HttpServletRequest request);
 
     Map<String, Object> updateMaterial(MaterialClass materialClass, HttpServletRequest request);
+
+    void Export(MaterialClass materialClass, HttpServletResponse response);
 }

+ 50 - 10
src/main/java/com/tld/service/impl/DictionaryServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.tld.excel.ExcelUtils;
 import com.tld.mapper.DictionaryMapper;
 import com.tld.model.Access;
 import com.tld.model.Goods;
@@ -11,6 +12,7 @@ import com.tld.model.LogData;
 import com.tld.service.DictionaryService;
 import com.tld.util.RedisUtil;
 import com.tld.util.SnowflakeUtil;
+import org.apache.ibatis.jdbc.Null;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -21,6 +23,8 @@ import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
@@ -130,18 +134,24 @@ public class DictionaryServiceImpl implements DictionaryService {
             Map<String, Object> amountMap = new HashMap<>();
             String tableName = dictionaryMapper.getTableName(dictionary.getType());
             dictionary.setTableName(tableName);
-            PageHelper.startPage(dictionary.getPage(), dictionary.getLimit());
-            PageInfo<Dictionary> list = null;
-            if(dictionary.getType().equals("物料字典")){
-                list = new PageInfo<>(dictionaryMapper.getDictionaryMaterialPage(dictionary));
-                for(Dictionary dictionary1 : list.getList()){
-                    int amount = dictionaryMapper.getInventorySumAmount(dictionary1);
-                    amountMap.put(dictionary1.getTldId(), amount);
-                }
-                map.put("amount", amountMap);
-            } else {
+            PageInfo<Dictionary> list = null ;
+            if (tableName.equals("tld_material")){//物料字典
+                PageHelper.startPage(dictionary.getPage(),dictionary.getLimit());
+                list = new PageInfo<>(dictionaryMapper.getDictionaryPageMaterial(dictionary));
+            }else {
+                PageHelper.startPage(dictionary.getPage(), dictionary.getLimit());
                 list = new PageInfo<>(dictionaryMapper.getDictionaryPage(dictionary));
             }
+//            if(dictionary.getType().equals("物料字典")){
+//                list = new PageInfo<>(dictionaryMapper.getDictionaryMaterialPage(dictionary));
+//                for(Dictionary dictionary1 : list.getList()){
+//                    int amount = dictionaryMapper.getInventorySumAmount(dictionary1);
+//                    amountMap.put(dictionary1.getTldId(), amount);
+//                }
+//                map.put("amount", amountMap);
+//            } else {
+//                list = new PageInfo<>(dictionaryMapper.getDictionaryPage(dictionary));
+//            }
             map.put("msg", "200");
             map.put("data", list);
         }  catch (Exception e){
@@ -252,4 +262,34 @@ public class DictionaryServiceImpl implements DictionaryService {
         }
         return map;
     }
+
+    /**
+     * 物料字典导出
+     * */
+    @Override
+    public void export(Dictionary dictionary, HttpServletResponse response) {
+        try{
+            //导出数据汇总
+            List<List<Object>> sheetDataList = new ArrayList<>();
+            //表头数据
+            List<Object> head =
+                    Arrays.asList("物料编号", "物料名称", "物料类别","物料类型","存储容量","最大存储容量","最小存储容量","是否混合存储","是否推荐库位");
+            //查询数据
+            List<Map<String,Object>> list = dictionaryMapper.export(dictionary);
+            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();
+        }
+    }
 }

+ 16 - 13
src/main/java/com/tld/service/impl/InventoryServiceImpl.java

@@ -61,7 +61,7 @@ public class InventoryServiceImpl implements InventoryService {
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
             List<Object> head =
-                    Arrays.asList("物料id", "物料编号", "物料名称","系统物料数量","gs物料数量","uuid","物料id");
+                    Arrays.asList("id","物料id", "物料编号", "物料名称","系统物料数量","gs物料数量","记录数量","uuid");
             //查询数据
             PageHelper.startPage(makeInventory.getPage(), makeInventory.getLimit());
             PageInfo<Map<String, Object>> list = new PageInfo<>(inventoryMapper.export(makeInventory));
@@ -110,7 +110,20 @@ public class InventoryServiceImpl implements InventoryService {
         try {
             makeInventory.setModifyUser(request.getHeader("userId"));
             makeInventory.setUuid(snowflakeUtil.nextId()+"");
+            //生成主表
             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);
+            }
             map.put("msg", "200");
         } catch (Exception e) {
             e.printStackTrace();
@@ -121,23 +134,13 @@ public class InventoryServiceImpl implements InventoryService {
     }
 
     /**
-     * 查询盘点子表信息
+     * 生成盘点信息(盘点子表信息)
      * */
     @Override
     public Map<String, Object> getInventoryPlate(MakeInventory makeInventory) {
         Map<String, Object> map = new HashMap<>();
         try {
-            //查询系统库存gs库存的数据
-            List<MakeInventory> list = inventoryMapper.getInventoryPlate(makeInventory);
-            for (MakeInventory inventory : list) {
-                inventory.setPlateId(makeInventory.getPlateId());
-                inventory.setUuid(makeInventory.getUuid());
-                MakeInventory makeInventory1 = inventoryMapper.getInventoryPlates(inventory);
-                if (makeInventory1 == null){
-                    //添加子表信息
-                    inventoryMapper.addInventoryPlates(inventory);
-                }
-            }
+
             map.put("msg", "200");
         }catch (Exception e){
             e.printStackTrace();

+ 33 - 3
src/main/java/com/tld/service/impl/MaterialClassServiceImpl.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.MaterialClassMapper;
 import com.tld.model.MaterialClass;
 import com.tld.service.MaterialClassService;
@@ -10,9 +11,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
 public class MaterialClassServiceImpl implements MaterialClassService {
@@ -127,4 +128,33 @@ public class MaterialClassServiceImpl implements MaterialClassService {
         }
         return map;
     }
+
+    /**
+     * 导出物料类别
+     * */
+    @Override
+    public void Export(MaterialClass materialClass, HttpServletResponse response) {
+        try{
+            //导出数据汇总
+            List<List<Object>> sheetDataList = new ArrayList<>();
+            //表头数据
+            List<Object> head = Arrays.asList("物料编号", "库位编号", "物料名称");
+            //查询数据
+            List<Map<String, Object>> list = materialClassMapper.Export(materialClass);
+            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/RoleServiceImpl.java

@@ -93,7 +93,7 @@ public class RoleServiceImpl implements RoleService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("角色编号", "角色名", "创建时间","备注","修改时间","修改人");
+            List<Object> head = Arrays.asList("角色编号", "角色名", "创建时间","备注");
             //查询数据
             List<Map<String, Object>> list = roleMapper.export(role);
             sheetDataList.add(head);

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

@@ -98,7 +98,6 @@ public class StorageLocationServiceImpl implements StorageLocationService {
             //表头数据
             List<Object> head = Arrays.asList("库位编号", "库位名称", "所在仓库","库位类型","库位容量","是否混合库位","创建时间");
             //查询数据
-            PageHelper.startPage(storageLocation.getPage(), storageLocation.getLimit());
             List<Map<String, Object>> list = storageLocationMapper.export(storageLocation);
             sheetDataList.add(head);
             for(Map<String, Object> userMap : list){

+ 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);

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

@@ -35,10 +35,10 @@
         update tld_department
         <set>
             <trim suffixOverrides=",">
-                <if test="code != null and code != ''">
+                <if test="code != null">
                     code = #{code},
                 </if>
-                <if test="name != null and name != ''">
+                <if test="name != null">
                     name = #{name},
                 </if>
             </trim>

+ 141 - 42
src/main/resources/mapper/DictionaryMapper.xml

@@ -4,17 +4,21 @@
 <mapper namespace="com.tld.mapper.DictionaryMapper">
     <!-- 查询字典表明 -->
     <select id="getTableName" resultType="String">
-        select table_name from tld_dictionary_pulic where name = #{type}
+        select table_name
+        from tld_dictionary_pulic
+        where name = #{type}
     </select>
     <!-- 物料字典新增 -->
     <insert id="addMaterial">
-        insert into tld_material(code,name,tld_id,specification_and_model,unit_of_measurement,size,is_not_disable,is_recommend,min_num,max_num,type,company_number)
-        values(#{code},#{name},#{tldId},#{specificationAndModel},#{unitOfMeasurement},'0','0','0',"0","0",#{typeVal},'0')
+        insert into tld_material(code, name, tld_id, specification_and_model, unit_of_measurement, size, is_not_disable,
+                                 is_recommend, min_num, max_num, type, company_number)
+        values (#{code}, #{name}, #{tldId}, #{specificationAndModel}, #{unitOfMeasurement}, '0', '0', '0', "0", "0",
+                #{typeVal}, '0')
     </insert>
     <!-- 字典新增 -->
     <insert id="addDictionary">
-        insert into ${tableName}(code,name,tld_id,type)
-        values(#{code},#{name},#{tldId},#{typeVal})
+        insert into ${tableName}(code, name, tld_id, type)
+        values (#{code}, #{name}, #{tldId}, #{typeVal})
     </insert>
     <!-- 查询字典内容 -->
     <select id="getDictionary" resultType="com.tld.model.Dictionary">
@@ -37,14 +41,26 @@
     <!-- 查询字典内容分页 -->
     <select id="getDictionaryPage" resultType="com.tld.model.Dictionary">
         select
-               *
+        *
         from ${tableName}
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="name != null and name != ''">
-                and name = #{name}
+                and name like CONCAT(CONCAT('%', #{name}), '%')
             </if>
             <if test="code != null and code != ''">
-                and code = #{code}
+                and code like CONCAT(CONCAT('%', #{code}), '%')
+            </if>
+            <if test="wllbClass != null and wllbClass != ''">
+                and wllb_class like CONCAT(CONCAT('%', #{wllbClass}), '%')
+            </if>
+            <if test="materialType != null and materialType != ''">
+                and part_type like CONCAT(CONCAT('%', #{materialType}), '%')
+            </if>
+            <if test="isNotDisable != null and isNotDisable != ''">
+                and is_not_disable = #{isNotDisable}
+            </if>
+            <if test="isRecommend != null and isRecommend != ''">
+                and is_recommend = #{isRecommend}
             </if>
             <if test="tldId != null and tldId != ''">
                 and tld_id = #{tldId}
@@ -57,25 +73,31 @@
     </select>
     <!-- 库账对存字典新增 -->
     <insert id="addTreasuryAccount">
-        insert into tld_treasury_account(material_id,code,name,num,type)
-        values(#{materialId},#{code},#{name},#{num},#{typeVal})
+        insert into tld_treasury_account(material_id, code, name, num, type)
+        values (#{materialId}, #{code}, #{name}, #{num}, #{typeVal})
     </insert>
     <!-- 查询仓库id -->
     <select id="getWarehouse" resultType="String">
-        select warehouse_where from tld_storage_location where storage_location_code = #{storageLocationCode}
+        select warehouse_where
+        from tld_storage_location
+        where storage_location_code = #{storageLocationCode}
     </select>
     <!-- 查询仓库字典 -->
     <select id="getWarehouseInfo" resultType="com.tld.model.Dictionary">
-        select code,name,tld_id from tld_warehouse where tld_id = #{askGoodsWarehouseId}
+        select code, name, tld_id
+        from tld_warehouse
+        where tld_id = #{askGoodsWarehouseId}
     </select>
     <!-- 查询物料库存内容 -->
     <select id="getInventorySumAmount" resultType="int">
-        select ifnull(sum(amount), 0) from tld_inventory where material_id = #{tldId}
+        select ifnull(sum(amount), 0)
+        from tld_inventory
+        where material_id = #{tldId}
     </select>
     <!-- 查询字典内容分页 -->
     <select id="getDictionaryMaterialPage" resultType="com.tld.model.Dictionary">
         select
-            a.*,b.name as materialType,c.user_name as modifyUser
+        a.*,b.name as materialType,c.user_name as modifyUser
         from ${tableName} a
         left join tld_material_type b on a.wllb_class = b.tld_id
         left join tld_user c on a.modify_user = c.id
@@ -96,90 +118,165 @@
     </select>
     <!--判断是否是重复数据-->
     <select id="getTableNameList" resultType="com.tld.model.Dictionary">
-        select * from ${tableName} where code = #{code}
+        select *
+        from ${tableName}
+        where code = #{code}
+    </select>
+    <!--物料字典导出-->
+    <select id="export" resultType="java.util.LinkedHashMap">
+        select
+        code,
+        name,
+        if(part_type = '', null , part_type),
+        if(wllb_class = '', null , wllb_class),
+        if(size = '', null , size),
+        if(max_num = '', null , max_num),
+        if(min_num = '', null , min_num),
+        if(is_not_disable = '1', '是' , '否'),
+        if(is_recommend = '1', '是' , '否' )
+        from tld_material
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="name != null and name != ''">
+                and name like CONCAT(CONCAT('%', #{name}), '%')
+            </if>
+            <if test="code != null and code != ''">
+                and code like CONCAT(CONCAT('%', #{code}), '%')
+            </if>
+            <if test="wllbClass != null and wllbClass != ''">
+                and wllb_class like CONCAT(CONCAT('%', #{wllbClass}), '%')
+            </if>
+            <if test="materialType != null and materialType != ''">
+                and part_type like CONCAT(CONCAT('%', #{materialType}), '%')
+            </if>
+            <if test="isNotDisable != null and isNotDisable != ''">
+                and is_not_disable = #{isNotDisable}
+            </if>
+            <if test="isRecommend != null and isRecommend != ''">
+                and is_recommend = #{isRecommend}
+            </if>
+            <if test="tldId != null and tldId != ''">
+                and tld_id = #{tldId}
+            </if>
+        </trim>
+        order by id desc
+    </select>
+    <!--查询物料字典内容分页-->
+    <select id="getDictionaryPageMaterial" resultType="com.tld.model.Dictionary">
+        select
+        a.*,
+        f.user_name as modifyUser
+        from tld_material a
+        left join tld_user f on a.modify_user = f.id
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="name != null and name != ''">
+                and a.name like CONCAT(CONCAT('%', #{name}), '%')
+            </if>
+            <if test="code != null and code != ''">
+                and a.code like CONCAT(CONCAT('%', #{code}), '%')
+            </if>
+            <if test="wllbClass != null and wllbClass != ''">
+                and a.wllb_class like CONCAT(CONCAT('%', #{wllbClass}), '%')
+            </if>
+            <if test="materialType != null and materialType != ''">
+                and a.part_type like CONCAT(CONCAT('%', #{materialType}), '%')
+            </if>
+            <if test="isNotDisable != null and isNotDisable != ''">
+                and a.is_not_disable = #{isNotDisable}
+            </if>
+            <if test="isRecommend != null and isRecommend != ''">
+                and a.is_recommend = #{isRecommend}
+            </if>
+            <if test="tldId != null and tldId != ''">
+                and a.tld_id = #{tldId}
+            </if>
+            <if test="typeVal != null and typeVal != ''">
+                and a.type = #{typeVal}
+            </if>
+        </trim>
+        order by a.id desc
     </select>
     <!-- 修改物料字典内容 -->
     <update id="updateMaterial">
         update tld_material
         <set>
             <trim suffixOverrides=",">
-                <if test="code != null and code != ''">
+                <if test="code != null">
                     code = #{code},
                 </if>
-                <if test="name != null and name != ''">
+                <if test="name != null">
                     name = #{name},
                 </if>
-                <if test="tldId != null and tldId != ''">
+                <if test="tldId != null">
                     tld_id = #{tldId},
                 </if>
-                <if test="specificationAndModel != null and specificationAndModel != ''">
+                <if test="specificationAndModel != null">
                     specification_and_model = #{specificationAndModel},
                 </if>
-                <if test="unitOfMeasurement != null and unitOfMeasurement != ''">
+                <if test="unitOfMeasurement != null">
                     unit_of_measurement = #{unitOfMeasurement},
                 </if>
-                <if test="size != null and size != ''">
+                <if test="size != null">
                     size = #{size},
                 </if>
-                <if test="wllbClass != null and wllbClass != ''">
+                <if test="wllbClass != null">
                     wllb_class = #{wllbClass},
                 </if>
-                <if test="isNotDisable != null and isNotDisable != ''">
+                <if test="isNotDisable != null">
                     is_not_disable = #{isNotDisable},
                 </if>
-                <if test="isRecommend != null and isRecommend != ''">
+                <if test="isRecommend != null">
                     is_recommend = #{isRecommend},
                 </if>
-                <if test="partType != null and partType != ''">
+                <if test="partType != null">
                     part_type = #{partType},
                 </if>
-                <if test="minNum != null and minNum != ''">
+                <if test="minNum != null">
                     min_num = #{minNum},
                 </if>
-                <if test="maxNum != null and maxNum != ''">
+                <if test="maxNum != null">
                     max_num = #{maxNum},
                 </if>
-                <if test="companyNumber != null and companyNumber != ''">
+                <if test="companyNumber != null">
                     company_number = #{companyNumber},
                 </if>
                 modify_user = #{modifyUser},modify_time=now(),
             </trim>
         </set>
-            where id = #{id}
+        where id = #{id}
     </update>
     <!-- 库存对账 -->
     <update id="updateTreasuryAccount">
         update tld_material
         <set>
-            <if test="materialId != null and materialId != ''">
+            <if test="materialId != null">
                 material_id = #{materialId},
             </if>
-            <if test="code != null and code != ''">
+            <if test="code != null">
                 code = #{code},
             </if>
-            <if test="name != null and name != ''">
+            <if test="name != null">
                 name = #{name},
             </if>
-            <if test="tldId != null and tldId != ''">
+            <if test="tldId != null">
                 tld_id = #{tldId},
             </if>
         </set>
-            where id = #{id}
+        where id = #{id}
     </update>
     <!-- 修改字典内容 -->
     <update id="updateDictionary">
         update ${tableName}
         <set>
-            <if test="materialId != null and materialId != ''">
+            <if test="materialId != null">
                 material_id = #{materialId},
             </if>
-            <if test="code != null and code != ''">
+            <if test="code != null">
                 code = #{code},
             </if>
-            <if test="name != null and name != ''">
+            <if test="name != null">
                 name = #{name},
             </if>
-            <if test="tldId != null and tldId != ''">
+            <if test="tldId != null">
                 tld_id = #{tldId},
             </if>
         </set>
@@ -187,18 +284,20 @@
     </update>
     <!-- 删除字典内容 -->
     <delete id="deleteDictionary">
-        delete from ${tableName} where id = #{id}
+        delete
+        from ${tableName}
+        where id = #{id}
     </delete>
     <!-- 新增日志 -->
     <insert id="addAccess">
-        insert into tld_access(type,data,scrq) value(#{type},#{data},now())
+        insert into tld_access(type, data, scrq) value (#{type},#{data},now())
     </insert>
     <!-- 新增操作日志 -->
     <insert id="addLogdata">
-        insert into tld_log_data(user_id,scrq,data,type,document_type) value(#{userId},now(),#{data},#{type},#{documentType})
+        insert into tld_log_data(user_id, scrq, data, type, document_type) value (#{userId},now(),#{data},#{type},#{documentType})
     </insert>
     <!-- 增加仓库的时候新增库位信息-->
     <insert id="addStorageLocation">
-        insert into tld_storage_location(storage_location_code,storage_location_name,warehouse_where) value(#{storageLocationCode},#{storageLocationName},#{warehouseWhere})
+        insert into tld_storage_location(storage_location_code, storage_location_name, warehouse_where) value (#{storageLocationCode},#{storageLocationName},#{warehouseWhere})
     </insert>
 </mapper>

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

@@ -53,28 +53,28 @@
         update tld_goods
         <set>
             <trim suffixOverrides=",">
-                <if test="itemNumber != null and itemNumber != ''">
+                <if test="itemNumber != null">
                     item_number = #{itemNumber},
                 </if>
-                <if test="type != null and type != ''">
+                <if test="type != null">
                     type = #{type},
                 </if>
-                <if test="minAccommodate != null and minAccommodate != ''">
+                <if test="minAccommodate != null">
                     min_accommodate = #{minAccommodate},
                 </if>
-                <if test="accommodateNum != null and accommodateNum != ''">
+                <if test="accommodateNum != null">
                     accommodate_num = #{accommodateNum},
                 </if>
-                <if test="maxAccommodate != null and maxAccommodate != ''">
+                <if test="maxAccommodate != null">
                     max_accommodate = #{maxAccommodate},
                 </if>
-                <if test="supplier != null and supplier != ''">
+                <if test="supplier != null">
                     supplier = #{supplier},
                 </if>
-                <if test="storageLocation != null and storageLocation != ''">
+                <if test="storageLocation != null">
                     storage_location = #{storageLocation},
                 </if>
-                <if test="inputType != null and inputType != ''">
+                <if test="inputType != null">
                     input_type = #{inputType},
                 </if>
                 <if test="userDepartment != null and userDepartment != ''">

+ 30 - 13
src/main/resources/mapper/InventoryMapper.xml

@@ -16,8 +16,8 @@
     </insert>
     <!--添加盘点子表信息-->
     <insert id="addInventoryPlates">
-        insert into tld_plate_z(plate_id, material_id, wllb_code, name, amount, gs_amount)
-        values (#{plateId}, #{materialId}, #{wllbCode}, #{name}, #{amount}, #{gsAmount})
+        insert into tld_plate_z( material_id, wllb_code, name, amount, gs_amount,uuid)
+        values (#{materialId}, #{wllbCode}, #{name}, #{amount}, #{gsAmount},#{uuid})
     </insert>
     <!--修改录入信息为主表id为空的添加主表uuid进行关联-->
     <update id="updateInventoryPlate">
@@ -34,14 +34,30 @@
     </delete>
     <!--导出盘点数据-->
     <select id="export" resultType="java.util.LinkedHashMap">
-        SELECT storage_location_code,
-               amount,
-               account_sleeve,
-               wllb_code,
-               supplier_id,
-               produc_batch,
-               material_id
-        FROM tld_inventory
+        select
+        id,
+        material_id,
+        wllb_code,
+        name,
+        amount,
+        gs_amount,
+        if(plate_amount = '', null , plate_amount),
+        uuid
+        from tld_plate_z
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="materialId != null and materialId != ''">
+                and material_id = #{materialId}
+            </if>
+            <if test="wllbCode != null and wllbCode != ''">
+                and wllb_code = #{wllbCode}
+            </if>
+            <if test="uuid != null and uuid != ''">
+                and uuid = #{uuid}
+            </if>
+            <if test="name != null and name != ''">
+                and name like CONCAT(CONCAT('%', #{name}), '%')
+            </if>
+        </trim>
     </select>
     <!--查询录入盘点信息-->
     <select id="getInventory" resultType="com.tld.model.MakeInventory">
@@ -197,9 +213,7 @@
     <select id="getInventoryPlates" resultType="com.tld.model.MakeInventory">
         select *
         from tld_plate_z
-        where material_id = #{materialId}
-          and plate_id = #{plateId}
-          and uuid = #{uuid}
+        where uuid = #{uuid}
     </select>
     <!--查询盘点子表信息-->
     <select id="getInventoryPlatesList" resultType="com.tld.model.MakeInventory">
@@ -224,6 +238,9 @@
             <if test="uuid != null and uuid != ''">
                 and uuid = #{uuid}
             </if>
+            <if test="name != null and name != ''">
+                and name like CONCAT(CONCAT('%', #{name}), '%')
+            </if>
         </trim>
     </select>
 </mapper>

+ 46 - 11
src/main/resources/mapper/MaterialClassMapper.xml

@@ -19,13 +19,19 @@
        left join tld_user f on a.modify_user = f.id
        <trim prefix="WHERE" prefixOverrides="and |or">
            <if test="storageLocationCode != null and storageLocationCode != ''">
-               and a.storage_location_code = #{storageLocationCode}
+               and a.storage_location_code like CONCAT(CONCAT('%', #{storageLocationCode}), '%')
+           </if>
+           <if test="storageLocationName != null and storageLocationName != ''">
+               and b.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
+           </if>
+           <if test="wllbName != null and wllbName != ''">
+               and c.name like CONCAT(CONCAT('%', #{wllbName}), '%')
            </if>
            <if test="id != null and id != ''">
                and a.id = #{id}
            </if>
            <if test="wllbCode != null and wllbCode != ''">
-               and a.wllb_code = #{wllbCode}
+               and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
            </if>
        </trim>
         order by a.id desc
@@ -43,10 +49,10 @@
         update tld_material_class
         <set>
             <trim suffixOverrides=",">
-                <if test="storageLocationCode != null and storageLocationCode != ''">
+                <if test="storageLocationCode != null">
                     storage_location_code = #{storageLocationCode},
                 </if>
-                <if test="wllbCode != null and wllbCode != ''">
+                <if test="wllbCode != null">
                     wllb_code = #{wllbCode},
                 </if>
                 modify_user = #{modifyUser},modify_time=now(),
@@ -59,25 +65,25 @@
         update tld_material
         <set>
             <trim suffixOverrides=",">
-                <if test="size != null and size != ''">
+                <if test="size != null">
                     size = #{size},
                 </if>
-                <if test="materialType != null and materialType != ''">
+                <if test="materialType != null">
                     wllb_class = #{materialType},
                 </if>
-                <if test="isNotDisable != null and isNotDisable != ''">
+                <if test="isNotDisable != null">
                     is_not_disable = #{isNotDisable},
                 </if>
-                <if test="isRecommend != null and isRecommend != ''">
+                <if test="isRecommend != null">
                     is_recommend = #{isRecommend},
                 </if>
-                <if test="partType != null and partType != ''">
+                <if test="partType != null">
                     part_type = #{partType},
                 </if>
-                <if test="minNum != null and minNum != ''">
+                <if test="minNum != null">
                     min_num = #{minNum},
                 </if>
-                <if test="maxNum != null and maxNum != ''">
+                <if test="maxNum != null">
                     max_num = #{maxNum},
                 </if>
                 modify_user = #{modifyUser},modify_time=now(),
@@ -92,4 +98,33 @@
     <select id="getMaterialClassStorageLocationMaterial" resultType="int">
         select COUNT(*) from tld_material where code = #{wllbCode}
     </select>
+    <!--导出-->
+    <select id="Export" resultType="java.util.LinkedHashMap">
+        select
+        DISTINCT
+        a.wllb_code,
+        b.storage_location_name as storageLocationName,
+        c.name as wllbName
+        from tld_material_class a
+        left join tld_storage_location b on a.storage_location_code = b.storage_location_code
+        left join tld_material c on a.wllb_code = c.code
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="storageLocationCode != null and storageLocationCode != ''">
+                and a.storage_location_code like CONCAT(CONCAT('%', #{storageLocationCode}), '%')
+            </if>
+            <if test="storageLocationName != null and storageLocationName != ''">
+                and b.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
+            </if>
+            <if test="wllbName != null and wllbName != ''">
+                and c.name like CONCAT(CONCAT('%', #{wllbName}), '%')
+            </if>
+            <if test="id != null and id != ''">
+                and a.id = #{id}
+            </if>
+            <if test="wllbCode != null and wllbCode != ''">
+                and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
+            </if>
+        </trim>
+        order by a.id desc
+    </select>
 </mapper>

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

@@ -79,7 +79,7 @@
         update tld_receive_goods
         <set>
             <trim suffixOverrides=",">
-                <if test="arrivalNum != null and arrivalNum != ''">
+                <if test="arrivalNum != null">
                     arrival_num = #{arrivalNum},
                 </if>
                 <if test="qualifiedNum != null and qualifiedNum != ''">

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

@@ -80,11 +80,8 @@
         a.role_code,
         a.role_name,
         a.create_time,
-        if(a.remarks = '', '暂无', a.remarks) as remarks,
-        a.modify_time as modifyTime,
-        f.user_name as modifyUser
+        if(a.remarks = '', null , a.remarks) as remarks,
         from tld_role a
-        left join tld_user f on a.modify_user = f.id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="roleCode != null and roleCode != ''">
                 and role_code like CONCAT(CONCAT('%', #{roleCode}), '%')

+ 22 - 21
src/main/resources/mapper/StorageLocationMapper.xml

@@ -66,25 +66,25 @@
         update tld_storage_location
         <set>
             <trim suffixOverrides=",">
-                <if test="storageLocationCode != null and">
+                <if test="storageLocationCode != null">
                     storage_location_code = #{storageLocationCode},
                 </if>
-                <if test="storageLocationName != null and">
+                <if test="storageLocationName != null">
                     storage_location_name = #{storageLocationName},
                 </if>
-                <if test="warehouseWhere != null and warehouseWhere != ''">
+                <if test="warehouseWhere != null">
                     warehouse_where = #{warehouseWhere},
                 </if>
-                <if test="storageLocationType != null and">
+                <if test="storageLocationType != null">
                     storage_location_type = #{storageLocationType},
                 </if>
-                <if test="storageLocationCapacity != null and">
+                <if test="storageLocationCapacity != null">
                     storage_location_capacity = #{storageLocationCapacity},
                 </if>
-                <if test="isNotDisable != null and">
+                <if test="isNotDisable != null">
                     is_not_disable = #{isNotDisable},
                 </if>
-                <if test="isProduct != null and">
+                <if test="isProduct != null">
                     is_product = #{isProduct},
                 </if>
                 modify_user = #{modifyUser},modify_time=now(),
@@ -95,35 +95,36 @@
     <!-- 导出数据查询 -->
     <select id="export" resultType="java.util.LinkedHashMap">
         select
-               storage_location_code,
-               storage_location_name,
-               warehouse_where,
-               if(storage_location_type = '', '暂无' , storage_location_type) as storageLocationType,
-               storage_location_capacity,
-               case is_not_disable when '1' then '是' when '0' then '不是' END as isNotDisable,
-               create_time
-        from tld_storage_location
+        a.storage_location_code,
+        a.storage_location_name,
+        b.name,
+        if(a.storage_location_type = '', null , a.storage_location_type) as storageLocationType,
+        a.storage_location_capacity,
+        if(a.is_not_disable = '1', '是' , '否') as isNotDisable,
+        a.create_time
+        from tld_storage_location a
+        left join tld_warehouse b on a.warehouse_where = b.tld_id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="storageLocationCode != null and storageLocationCode != ''">
-                and storage_location_code like CONCAT(CONCAT('%', #
+                and a.storage_location_code like CONCAT(CONCAT('%', #{storageLocationCode}), '%')
             </if>
             <if test="storageLocationName != null and storageLocationName != ''">
-                and storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
+                and a.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
             </if>
             <if test="storageLocationType != null and storageLocationType != ''">
-                and storage_location_type like CONCAT(CONCAT('%', #{storageLocationType}), '%')
+                and a.storage_location_type like CONCAT(CONCAT('%', #{storageLocationType}), '%')
             </if>
             <if test="isNotDisable != null and isNotDisable != ''">
-                and is_not_disable = #{isNotDisable}
+                and a.is_not_disable = #{isNotDisable}
             </if>
             <if test="warehouseWhere != null and warehouseWhere != ''">
                 and a.warehouse_where = #{warehouseWhere}
             </if>
             <if test="id != null and id != ''">
-                and id = #{id}
+                and a.id = #{id}
             </if>
         </trim>
-        order by id desc
+        order by a.id desc
     </select>
     <!-- 查询编号是否存在 -->
     <select id="getStorageCount" resultType="int">

+ 4 - 7
src/main/resources/mapper/UserMapper.xml

@@ -135,19 +135,16 @@
         select
         a.code,
         a.user_name,
-        if(a.real_name = '', '暂无', a.real_name) as real_name,
-        if(a.email = '', '暂无', a.email) as email,
-        if(a.landline = '', '暂无', a.landline) as landline,
-        if(a.phone = '', '暂无', a.phone) as phone,
+        if(a.real_name = '', null , a.real_name) as real_name,
+        if(a.email = '', null , a.email) as email,
+        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,
-        a.modify_time as modifyTime,
-        f.user_name as modifyUser
         from tld_user a
         left join tld_role b on a.role = b.id
         left join tld_department c on a.department = c.code
-        left join tld_user f on a.modify_user = f.id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="code != null and code != ''">
                 and a.code like CONCAT(CONCAT('%', #{code}), '%')

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

@@ -24,6 +24,15 @@
             <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>
@@ -31,7 +40,7 @@
                 and a.id = #{id}
             </if>
         </trim>
-        order by a.scrq desc
+        order by a.id desc
     </select>
     <!-- 新增用户绑定物料信息 -->
     <insert id="addUserMaterial">