瀏覽代碼

杰生重构

home 2 年之前
父節點
當前提交
33798afd39
共有 21 個文件被更改,包括 243 次插入29 次删除
  1. 13 11
      hx-common/common-client-util/src/main/java/com/fjhx/utils/UserClientUtil.java
  2. 4 0
      hx-common/common-tool/src/main/java/com/fjhx/base/Condition.java
  3. 1 1
      hx-common/service-flow/src/main/java/com/fjhx/service/example/impl/ExampleInfoServiceImpl.java
  4. 9 0
      hx-service-api/blade-ex-api/src/main/java/com/fjhx/feign/IUserClient.java
  5. 1 1
      hx-service/basics/src/main/java/com/fjhx/service/impl/StockExServiceImpl.java
  6. 7 0
      hx-service/blade-ex/src/main/java/com/fjhx/feign/UserClient.java
  7. 2 0
      hx-service/blade-ex/src/main/java/com/fjhx/service/IUserService.java
  8. 12 0
      hx-service/blade-ex/src/main/java/com/fjhx/service/impl/UserServiceImpl.java
  9. 29 0
      hx-service/storage-restructure/src/main/java/com/fjhx/controller/water/WaterBackController.java
  10. 9 0
      hx-service/storage-restructure/src/main/java/com/fjhx/mapper/water/WaterBackMapper.java
  11. 23 0
      hx-service/storage-restructure/src/main/java/com/fjhx/mapper/water/WaterBackMapper.xml
  12. 1 1
      hx-service/storage-restructure/src/main/java/com/fjhx/service/apply/impl/ApplyPurchaseServiceImpl.java
  13. 1 1
      hx-service/storage-restructure/src/main/java/com/fjhx/service/contract/impl/ContractDetailsServiceImpl.java
  14. 1 1
      hx-service/storage-restructure/src/main/java/com/fjhx/service/quality/impl/QualityTestingServiceImpl.java
  15. 21 1
      hx-service/storage-restructure/src/main/java/com/fjhx/service/water/WaterBackService.java
  16. 96 1
      hx-service/storage-restructure/src/main/java/com/fjhx/service/water/impl/WaterBackServiceImpl.java
  17. 3 3
      hx-service/storage-restructure/src/main/java/com/fjhx/service/water/impl/WaterDetailServiceImpl.java
  18. 5 2
      hx-service/storage/src/main/java/com/fjhx/stock/service/impl/StockWaterServiceImpl.java
  19. 1 1
      hx-service/syringe-management/src/main/java/com/fjhx/service/bom/impl/BomServiceImpl.java
  20. 1 1
      hx-service/syringe-management/src/main/java/com/fjhx/service/production/impl/ProductionWorkshopServiceImpl.java
  21. 3 4
      hx-service/syringe-production/src/main/java/com/fjhx/service/tda/impl/TdaApplicationServiceImpl.java

+ 13 - 11
hx-common/common-client-util/src/main/java/com/fjhx/utils/UserClientUtil.java

@@ -1,5 +1,6 @@
 package com.fjhx.utils;
 
+import cn.hutool.core.convert.Convert;
 import cn.hutool.extra.spring.SpringUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.api.ResultCode;
@@ -18,8 +19,6 @@ public class UserClientUtil {
 
     /**
      * 懒汉式单例
-     *
-     * @Remarks 直接注入似乎有的问题。。
      */
     private synchronized static IUserSearchClient getUserSearchClient() {
         if (userSearchClient == null) {
@@ -53,10 +52,12 @@ public class UserClientUtil {
      * @param mapper Lambda方法
      * @return MAP<用户id, 用户名称>
      */
-    public static <T> Map<Long, String> getUserNameMapFunctionLong(List<T> list, Function<T, Long> mapper) {
+    public static <T> Map<Long, String> getUserNameMap(List<T> list, Function<T, Object> mapper) {
         List<Long> userIdList = list.stream().map(mapper)
-                .distinct().filter(Objects::nonNull)
+                .map(Convert::toLong)
+                .filter(Objects::nonNull).distinct()
                 .collect(Collectors.toList());
+
         return getUserNameMap(userIdList);
     }
 
@@ -71,16 +72,17 @@ public class UserClientUtil {
         return new HashMap<>();
     }
 
-    public static <T> Map<Long, Map<String, Object>> getNameFunctionLong(List<T> list, Function<T, Long> mapper) {
-        List<Long> userIdList = list.stream().map(mapper)
-                .distinct().filter(Objects::nonNull)
-                .collect(Collectors.toList());
-        return getNameByUserId(userIdList);
-    }
-
     public static Map<String, Object> getNameByUserId(Long userId) {
         Map<Long, Map<String, Object>> userNameAndPostMap = getNameByUserId(Collections.singletonList(userId));
         return userNameAndPostMap.get(userId);
     }
 
+    public static <T> Map<Long, Map<String, Object>> getNameByFunction(List<T> list, Function<T, Object> mapper) {
+        List<Long> userIdList = list.stream()
+                .map(mapper).map(Convert::toLong)
+                .filter(Objects::nonNull).distinct()
+                .collect(Collectors.toList());
+        return getNameByUserId(userIdList);
+    }
+
 }

+ 4 - 0
hx-common/common-tool/src/main/java/com/fjhx/base/Condition.java

@@ -174,4 +174,8 @@ public class Condition extends HashMap<String, Object> {
         return null;
 
     }
+
+    public Long getUserId() {
+        return getLong("userId");
+    }
 }

+ 1 - 1
hx-common/service-flow/src/main/java/com/fjhx/service/example/impl/ExampleInfoServiceImpl.java

@@ -104,7 +104,7 @@ public class ExampleInfoServiceImpl extends ServiceImpl<ExampleInfoMapper, Examp
         List<Map<String, Object>> records = waitingProcessingPage.getRecords();
 
         if (records.size() > 0) {
-            Map<Long, String> userNameMap = UserClientUtil.getUserNameMapFunctionLong(records, item -> (Long) item.get("createUser"));
+            Map<Long, String> userNameMap = UserClientUtil.getUserNameMap(records, item -> (Long) item.get("createUser"));
             for (Map<String, Object> record : records) {
                 record.put("userName", userNameMap.get((Long) record.get("createUser")));
             }

+ 9 - 0
hx-service-api/blade-ex-api/src/main/java/com/fjhx/feign/IUserClient.java

@@ -16,6 +16,7 @@ import java.util.List;
 public interface IUserClient {
 
     String GET_USER_LIST_BY_ROLE_ID_LIST = ClientConstant.API_PREFIX + "/getUserListByRoleIdList";
+    String GET_USER_LIST_BY_DEPT_ID_LIST = ClientConstant.API_PREFIX + "/getUserListByDeptIdList";
 
     /**
      * 根据角色id列表获取用户列表
@@ -25,4 +26,12 @@ public interface IUserClient {
     @PostMapping(GET_USER_LIST_BY_ROLE_ID_LIST)
     R<List<User>> getUserListByRoleIdList(@RequestBody List<Long> roleIdList);
 
+    /**
+     * 根据部门id列表获取用户列表
+     *
+     * @param deptIdList 部门id List
+     */
+    @PostMapping(GET_USER_LIST_BY_DEPT_ID_LIST)
+    R<List<User>> getUserListByDeptIdList(@RequestBody List<Long> deptIdList);
+
 }

+ 1 - 1
hx-service/basics/src/main/java/com/fjhx/service/impl/StockExServiceImpl.java

@@ -42,7 +42,7 @@ public class StockExServiceImpl implements StockExService {
         }
 
         // 赋值操作人
-        Map<Long, String> createUser = UserClientUtil.getUserNameMapFunctionLong(records, item -> (Long) item.get("createUser"));
+        Map<Long, String> createUser = UserClientUtil.getUserNameMap(records, item -> (Long) item.get("createUser"));
         records.forEach(item -> item.put("createUser", createUser.get((Long) item.get("createUser"))));
 
         return inOutPage;

+ 7 - 0
hx-service/blade-ex/src/main/java/com/fjhx/feign/UserClient.java

@@ -24,4 +24,11 @@ public class UserClient implements IUserClient {
         return R.success(result);
     }
 
+    @PostMapping(GET_USER_LIST_BY_DEPT_ID_LIST)
+    @Override
+    public R<List<User>> getUserListByDeptIdList(List<Long> deptIdList) {
+        List<User> result = userService.getUserListByDeptIdList(deptIdList);
+        return R.success(result);
+    }
+
 }

+ 2 - 0
hx-service/blade-ex/src/main/java/com/fjhx/service/IUserService.java

@@ -30,4 +30,6 @@ public interface IUserService extends BaseService<User> {
 
     List<User> getUserListByRoleIdList(List<Long> roleIdList);
 
+    List<User> getUserListByDeptIdList(List<Long> deptIdList);
+
 }

+ 12 - 0
hx-service/blade-ex/src/main/java/com/fjhx/service/impl/UserServiceImpl.java

@@ -48,4 +48,16 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 
         return list(wrapper);
     }
+
+    @Override
+    public List<User> getUserListByDeptIdList(List<Long> deptIdList) {
+
+        LambdaQueryWrapper<User> wrapper = Wrappers.lambdaQuery();
+
+        for (Long deptId : deptIdList) {
+            wrapper.like(User::getDeptId, deptId).or();
+        }
+
+        return list(wrapper);
+    }
 }

+ 29 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/controller/water/WaterBackController.java

@@ -1,5 +1,7 @@
 package com.fjhx.controller.water;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.base.Condition;
 import com.fjhx.entity.water.WaterBack;
 import com.fjhx.params.water.WaterBackAddVo;
 import com.fjhx.params.water.WaterBackVo;
@@ -74,5 +76,32 @@ public class WaterBackController {
         return R.success();
     }
 
+    /**
+     * 获取直喷打纸热传角色用户
+     */
+    @PostMapping("/getUserByAppointDept")
+    public R getUserByAppointDept() {
+        Map<String, Object> result = waterBackService.getUserByAppointDept();
+        return R.success(result);
+    }
+
+    /**
+     * 退仓看板统计
+     */
+    @PostMapping("/statistics")
+    public R statistics(@RequestBody Condition condition) {
+        Map<String, Object> result = waterBackService.statistics(condition);
+        return R.success(result);
+    }
+
+    /**
+     * 退仓看板分页
+     */
+    @PostMapping("/page")
+    public R page(@RequestBody Condition condition) {
+        Page<Map<String, Object>> result = waterBackService.getPage(condition);
+        return R.success(result);
+    }
+
 }
 

+ 9 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/mapper/water/WaterBackMapper.java

@@ -1,7 +1,12 @@
 package com.fjhx.mapper.water;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.entity.water.WaterBack;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +18,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface WaterBackMapper extends BaseMapper<WaterBack> {
 
+    Map<String, Object> getStatistics(@Param("ew") QueryWrapper<Object> wrapper);
+
+    Page<Map<String, Object>> getPage(@Param("page") Page<Object> page, @Param("ew") QueryWrapper<Object> wrapper);
+
 }

+ 23 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/mapper/water/WaterBackMapper.xml

@@ -2,4 +2,27 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.mapper.water.WaterBackMapper">
 
+    <select id="getStatistics" resultType="java.util.LinkedHashMap">
+        select count(0)                                                count,
+               ifnull(sum(wbd.quantity), 0)                            quantity,
+               ifnull(format(sum(wbd.quantity * m.width / 100), 2), 0) area,
+               ifnull(format(sum(wbd.quantity * m.price), 2), 0)       price
+        from water_back wb
+                 left join water_back_details wbd on wb.id = wbd.water_back_id
+                 left join material m on wbd.material_id = m.id
+            ${ew.customSqlSegment}
+    </select>
+
+    <select id="getPage" resultType="java.util.Map">
+        select wbd.rfid,
+               wbd.create_user,
+               wbd.create_time,
+               m.name                                             materialName,
+               wbd.quantity,
+               ifnull(format(wbd.quantity * m.width / 100, 2), 0) area
+        from water_back_details wbd
+                 left join material m on wbd.material_id = m.id
+            ${ew.customSqlSegment}
+    </select>
+
 </mapper>

+ 1 - 1
hx-service/storage-restructure/src/main/java/com/fjhx/service/apply/impl/ApplyPurchaseServiceImpl.java

@@ -231,7 +231,7 @@ public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, A
         }
 
         Map<Long, Map<String, Object>> createUser = UserClientUtil
-                .getNameFunctionLong(records, item -> Convert.toLong(item.get("createUser")));
+                .getNameByFunction(records, item -> Convert.toLong(item.get("createUser")));
 
         for (Map<String, Object> record : records) {
             Long createUserId = Convert.toLong(record.get("createUser"));

+ 1 - 1
hx-service/storage-restructure/src/main/java/com/fjhx/service/contract/impl/ContractDetailsServiceImpl.java

@@ -203,7 +203,7 @@ public class ContractDetailsServiceImpl extends ServiceImpl<ContractDetailsMappe
             return page;
         }
 
-        Map<Long, String> userNameMap = UserClientUtil.getUserNameMapFunctionLong(records, item -> Convert.toLong(item.get("operUserId")));
+        Map<Long, String> userNameMap = UserClientUtil.getUserNameMap(records, item -> Convert.toLong(item.get("operUserId")));
         for (Map<String, Object> record : records) {
             record.put("operUserName", userNameMap.get(Convert.toLong(record.get("operUserId"))));
         }

+ 1 - 1
hx-service/storage-restructure/src/main/java/com/fjhx/service/quality/impl/QualityTestingServiceImpl.java

@@ -340,7 +340,7 @@ public class QualityTestingServiceImpl extends ServiceImpl<QualityTestingMapper,
             return page;
         }
 
-        Map<Long, String> userMap = UserClientUtil.getUserNameMapFunctionLong(records,
+        Map<Long, String> userMap = UserClientUtil.getUserNameMap(records,
                 item -> Convert.toLong(item.get("checkUserId")));
 
 

+ 21 - 1
hx-service/storage-restructure/src/main/java/com/fjhx/service/water/WaterBackService.java

@@ -1,7 +1,7 @@
 package com.fjhx.service.water;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.base.BaseService;
+import com.fjhx.base.Condition;
 import com.fjhx.base.StorageBaseService;
 import com.fjhx.entity.water.WaterBack;
 import com.fjhx.params.water.WaterBackAddVo;
@@ -45,4 +45,24 @@ public interface WaterBackService extends StorageBaseService<WaterBack> {
      */
     void submit(WaterBackVo waterBackVo);
 
+    /**
+     * 获取直喷打纸热转部门用户
+     */
+    Map<String, Object> getUserByAppointDept();
+
+    /**
+     * 获取直喷打纸热转部门用户
+     */
+    List<Long> getUserIdByAppointDept();
+
+    /**
+     * 退仓看板统计
+     */
+    Map<String, Object> statistics(Condition condition);
+
+    /**
+     * 退仓看板分页
+     */
+    Page<Map<String, Object>> getPage(Condition condition);
+
 }

+ 96 - 1
hx-service/storage-restructure/src/main/java/com/fjhx/service/water/impl/WaterBackServiceImpl.java

@@ -2,21 +2,29 @@ package com.fjhx.service.water.impl;
 
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.base.Condition;
 import com.fjhx.base.StorageBaseEntity;
 import com.fjhx.constants.StatusConstant;
 import com.fjhx.entity.material.Material;
 import com.fjhx.entity.water.WaterBack;
 import com.fjhx.entity.water.WaterBackDetails;
+import com.fjhx.feign.IUserClient;
 import com.fjhx.mapper.water.WaterBackMapper;
 import com.fjhx.params.water.WaterBackAddVo;
 import com.fjhx.params.water.WaterBackVo;
 import com.fjhx.service.material.MaterialService;
 import com.fjhx.service.water.WaterBackDetailsService;
 import com.fjhx.service.water.WaterBackService;
+import com.fjhx.utils.Assert;
 import com.fjhx.utils.UserClientUtil;
+import org.springblade.core.mp.base.BaseEntity;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.system.user.entity.User;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +50,9 @@ public class WaterBackServiceImpl extends ServiceImpl<WaterBackMapper, WaterBack
     @Autowired
     private MaterialService materialService;
 
+    @Autowired
+    private IUserClient userClient;
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void add(List<WaterBackAddVo> waterBackAddVoList) {
@@ -79,7 +90,7 @@ public class WaterBackServiceImpl extends ServiceImpl<WaterBackMapper, WaterBack
         List<Map<String, Object>> list = listMaps(Wrappers.<WaterBack>lambdaQuery()
                 .eq(WaterBack::getStatus, StatusConstant.NO));
 
-        Map<Long, String> userNameMap = UserClientUtil.getUserNameMapFunctionLong(list,
+        Map<Long, String> userNameMap = UserClientUtil.getUserNameMap(list,
                 item -> Convert.toLong(item.get("createUser")));
 
         for (Map<String, Object> map : list) {
@@ -163,4 +174,88 @@ public class WaterBackServiceImpl extends ServiceImpl<WaterBackMapper, WaterBack
                 .notIn(StorageBaseEntity::getId, waterBackIdList));
     }
 
+    @Override
+    public Map<String, Object> getUserByAppointDept() {
+
+        List<Long> list = Arrays.asList(1552549406245404674L, 1552549638060392449L, 1552549107359301633L);
+        R<List<User>> userListByDeptIdListR = userClient.getUserListByDeptIdList(list);
+        List<User> userList = Assert.result(userListByDeptIdListR);
+
+        Map<Integer, Map<String, Object>> collect = userList.stream().collect(Collectors.toMap(
+                item -> 1,
+                item -> {
+                    Map<String, Object> map = new HashMap<>();
+                    if (item.getDeptId().contains("1552549406245404674")) {
+                        map.put("deptId", 1552549406245404674L);
+                        map.put("deptName", "直喷");
+                    } else if (item.getDeptId().contains("1552549638060392449")) {
+                        map.put("deptId", 1552549638060392449L);
+                        map.put("deptName", "打纸");
+                    } else {
+                        map.put("deptId", 1552549107359301633L);
+                        map.put("deptName", "热转");
+                    }
+
+                    map.put("list", Collections.singletonList(item));
+                    return map;
+                },
+                (v1, v2) -> {
+                    List<User> v1List = new ArrayList<>((List<User>) v1.get("list"));
+                    List<User> v2List = new ArrayList<>((List<User>) v2.get("list"));
+                    v1List.addAll(v2List);
+                    v1.put("list", v1List);
+                    return v1;
+                }
+        ));
+
+        return collect.get(1);
+    }
+
+    @Override
+    public List<Long> getUserIdByAppointDept() {
+        List<Long> list = Arrays.asList(1552549406245404674L, 1552549638060392449L, 1552549107359301633L);
+        R<List<User>> userListByDeptIdListR = userClient.getUserListByDeptIdList(list);
+        List<User> userList = Assert.result(userListByDeptIdListR);
+
+        return userList.stream().map(BaseEntity::getId).collect(Collectors.toList());
+    }
+
+    @Override
+    public Map<String, Object> statistics(Condition condition) {
+        QueryWrapper<Object> wrapper = getWrapper(condition);
+
+        return baseMapper.getStatistics(wrapper);
+    }
+
+    @Override
+    public Page<Map<String, Object>> getPage(Condition condition) {
+
+        QueryWrapper<Object> wrapper = getWrapper(condition);
+        Page<Map<String, Object>> page = baseMapper.getPage(condition.getPage(), wrapper);
+        List<Map<String, Object>> records = page.getRecords();
+        if (records.size() == 0) {
+            return page;
+        }
+
+        Map<Long, String> userNameMap = UserClientUtil.getUserNameMap(records, item -> item.get("createUser"));
+        for (Map<String, Object> record : records) {
+            record.put("createUserName", userNameMap.get(Convert.toLong(record.get("createUser"))));
+        }
+
+        return page;
+    }
+
+    private QueryWrapper<Object> getWrapper(Condition condition) {
+        QueryWrapper<Object> wrapper = Wrappers.query();
+
+        Date beginTime = condition.getBeginTime();
+        Date endTime = condition.getEndTime();
+        Long userId = condition.getUserId();
+
+        return wrapper
+                .eq("wbd.del_flag", StatusConstant.NOT_DELETED)
+                .eq(ObjectUtil.isNotEmpty(userId), "wb.create_user", userId)
+                .between(ObjectUtil.isAllNotEmpty(beginTime, endTime), "wb.create_time", beginTime, endTime);
+    }
+
 }

+ 3 - 3
hx-service/storage-restructure/src/main/java/com/fjhx/service/water/impl/WaterDetailServiceImpl.java

@@ -66,7 +66,7 @@ public class WaterDetailServiceImpl extends ServiceImpl<WaterDetailMapper, Water
         Long applyPurchaseDetailsId = condition.getLong("applyPurchaseDetailsId");
         List<Map<String, Object>> list = baseMapper.getInQuantityByApplyPurchaseDetailsId(applyPurchaseDetailsId);
 
-        Map<Long, String> userMap = UserClientUtil.getUserNameMapFunctionLong(list, item -> Convert.toLong(item.get("operUserId")));
+        Map<Long, String> userMap = UserClientUtil.getUserNameMap(list, item -> Convert.toLong(item.get("operUserId")));
 
         for (Map<String, Object> map : list) {
             map.put("operUserName", userMap.get(Convert.toLong(map.get("operUserId"))));
@@ -82,7 +82,7 @@ public class WaterDetailServiceImpl extends ServiceImpl<WaterDetailMapper, Water
 
         List<Map<String, Object>> pickingList = baseMapper.getPickingList(wrapper);
         if (pickingList.size() > 0) {
-            Map<Long, String> userMap = UserClientUtil.getUserNameMapFunctionLong(pickingList, item -> Convert.toLong(item.get("userId")));
+            Map<Long, String> userMap = UserClientUtil.getUserNameMap(pickingList, item -> Convert.toLong(item.get("userId")));
             for (Map<String, Object> map : pickingList) {
                 map.put("userName", userMap.get(Convert.toLong(map.get("userId"))));
             }
@@ -247,7 +247,7 @@ public class WaterDetailServiceImpl extends ServiceImpl<WaterDetailMapper, Water
         if (records.size() == 0) {
             return page;
         }
-        Map<Long, String> userMap = UserClientUtil.getUserNameMapFunctionLong(records, item -> Convert.toLong(item.get("operUserId")));
+        Map<Long, String> userMap = UserClientUtil.getUserNameMap(records, item -> Convert.toLong(item.get("operUserId")));
         for (Map<String, Object> map : records) {
             map.put("realName", userMap.get(Convert.toLong(map.get("operUserId"))));
         }

+ 5 - 2
hx-service/storage/src/main/java/com/fjhx/stock/service/impl/StockWaterServiceImpl.java

@@ -651,12 +651,15 @@ public class StockWaterServiceImpl extends ServiceImpl<StockWaterMapper, StockWa
                 .eq("m.CategoryCode", "categoryCode") // 物料分类
                 .getWrapper();
 
+        wrapper.eq("m.IsDelete", 0);
+
         // 01.
         // 03.008.
         wrapper.and(q -> q.likeRight("m.code", "01.").or().likeRight("m.code", "03.008."));
 
+
         String inventoryResults = condition.get("inventoryResults");
-        if ("0" .equals(inventoryResults)) {
+        if ("0".equals(inventoryResults)) {
             wrapper.eq("IF( a.CheckTagCount = a.TagQuantity AND a.CheckTagCount = a.HandTagCount, 1, 0)", inventoryResults);
         }
 
@@ -693,7 +696,7 @@ public class StockWaterServiceImpl extends ServiceImpl<StockWaterMapper, StockWa
             }
         }
 
-        wrapper.orderByAsc("m.Name");
+        wrapper.orderByDesc("sum(sd.Quantity)");
         return wrapper;
     }
 

+ 1 - 1
hx-service/syringe-management/src/main/java/com/fjhx/service/bom/impl/BomServiceImpl.java

@@ -60,7 +60,7 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
         List<BomEx> records = result.getRecords();
 
         // 赋值最后修改人
-        Map<Long, String> userNameMap = UserClientUtil.getUserNameMapFunctionLong(records, Bom::getUpdateUser);
+        Map<Long, String> userNameMap = UserClientUtil.getUserNameMap(records, Bom::getUpdateUser);
 
         // 文件信息
         Map<Long, FileInfo> fileInfoMap = FileClientUtil.getFileInfoMap(

+ 1 - 1
hx-service/syringe-management/src/main/java/com/fjhx/service/production/impl/ProductionWorkshopServiceImpl.java

@@ -48,7 +48,7 @@ public class ProductionWorkshopServiceImpl extends ServiceImpl<ProductionWorksho
 
         // 赋值车间负责人名称
         List<ProductionWorkshopEx> records = result.getRecords();
-        Map<Long, String> userNameMap = UserClientUtil.getUserNameMapFunctionLong(records, ProductionWorkshop::getResponsibleUserId);
+        Map<Long, String> userNameMap = UserClientUtil.getUserNameMap(records, ProductionWorkshop::getResponsibleUserId);
         records.forEach(item -> item.setResponsibleUserName(userNameMap.get(item.getResponsibleUserId())));
 
         return result;

+ 3 - 4
hx-service/syringe-production/src/main/java/com/fjhx/service/tda/impl/TdaApplicationServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fjhx.service.tda.impl;
 
-import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.convert.Convert;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -48,9 +48,8 @@ public class TdaApplicationServiceImpl extends ServiceImpl<TdaApplicationMapper,
         Page<Map<String, Object>> mapPage = pageMaps(condition, wrapper);
         List<Map<String, Object>> records = mapPage.getRecords();
 
-        Map<Long, String> createUser = UserClientUtil.getUserNameMapFunctionLong(records, item -> BeanUtil.toBean(item.get("createUser"), Long.class));
-
-        records.forEach(item -> item.put("createUserName", createUser.get(BeanUtil.toBean(item.get("createUser"), Long.class))));
+        Map<Long, String> createUser = UserClientUtil.getUserNameMap(records, item -> item.get("createUser"));
+        records.forEach(item -> item.put("createUserName", createUser.get(Convert.toLong(item.get("createUser")))));
 
         return mapPage;
     }