Browse Source

订单筛选

liangpeile 1 năm trước cách đây
mục cha
commit
aab983412c

+ 22 - 8
crmeb-front/src/main/java/com/zbkj/front/controller/NewFrontApi.java

@@ -6,6 +6,7 @@ import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.pagehelper.PageInfo;
@@ -256,7 +257,6 @@ public class NewFrontApi {
         LambdaQueryWrapper<UserBypassAccount> queryWrapper2 = new LambdaQueryWrapper<>();
         //获取登录账号信息
         User user = userService.getInfo();
-        Integer enterpriseId1 = 0;
         if (null != user.getIsAllOrders()) {
             if (3 == user.getIsEnterpriseUser() && 1 == user.getIsAllOrders()) {
                 LambdaQueryWrapper<UserBypassAccount> queryWrapper3 = new LambdaQueryWrapper<>();
@@ -264,10 +264,6 @@ public class NewFrontApi {
                 UserBypassAccount one = userBypassAccountService.getOne(queryWrapper3);
                 Integer enterpriseId = one.getEnterpriseId();
                 id = String.valueOf(enterpriseId);
-
-                UserEnterprise userEnterprise = userEnterpriseService.getById(id);
-                enterpriseId1 = userEnterprise.getUserId();
-
             }
         }
 
@@ -286,9 +282,27 @@ public class NewFrontApi {
         List<Integer> ids = list.stream()
                 .map(UserBypassAccount::getUserId)
                 .collect(Collectors.toList());
-        ids.add(enterpriseId1);
-
 
+        LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        enterpriseLambdaQueryWrapper.in(UserEnterprise::getRealName, name.split(","));
+        enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete, 0);
+        List<UserEnterprise> list1 = userEnterpriseService.list(enterpriseLambdaQueryWrapper);
+        if (null != list1 && list1.size() > 0){
+            for (UserEnterprise userEnterprise : list1) {
+                ids.add(userEnterprise.getUserId());
+            }
+        }
+        if (StringUtils.isBlank(name)){
+            LambdaQueryWrapper<UserEnterprise> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.in(UserEnterprise::getId, id);
+            queryWrapper.eq(UserEnterprise::getIsDelete, 0);
+            List<UserEnterprise> list2 = userEnterpriseService.list(queryWrapper);
+            if (null != list2 && list2.size() > 0){
+                for (UserEnterprise userEnterprise : list2) {
+                    ids.add(userEnterprise.getUserId());
+                }
+            }
+        }
         return CommonResult.success(CommonPage.restPage(frontOrderService.list2(isRemit, status, pageRequest, ids,
                 Integer.valueOf(id), department
                 , name)));
@@ -539,7 +553,7 @@ public class NewFrontApi {
     public CommonResult<?> departUser(@RequestParam(name = "departmentId", required = false) String departmentId,
                                       @RequestParam(name = "organizationId", required = false) String organizationId) {
 
-        return organizationDepartmentService.departUser(departmentId,organizationId);
+        return organizationDepartmentService.departUser(departmentId, organizationId);
 
     }
 

+ 1 - 1
crmeb-service/src/main/java/com/zbkj/service/service/impl/OrderDetailServiceImpl.java

@@ -63,7 +63,7 @@ public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailDao, OrderDet
      */
     @Override
     public PageInfo<OrderDetail> getReplyList(Integer userId, Boolean isReply, PageParamRequest pageRequest) {
-        User user = userService.getById(58);
+        User user = userService.getInfo();
         Integer isEnterpriseUser = user.getIsEnterpriseUser();
         Integer enterpriseId=0;
         if (3==isEnterpriseUser){

+ 1 - 4
crmeb-service/src/main/java/com/zbkj/service/service/impl/OrderServiceImpl.java

@@ -953,8 +953,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
      */
     @Override
     public Integer getCountByStatusAndUid(Integer status, Integer userId) {
-        User user = userService.getById(58);
-        userId=58;
+        User user = userService.getInfo();
 
         if (status < 0) {
             return 0;
@@ -968,7 +967,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         } else {
             lqw.eq(Order::getIsEnterpriseUser, 1);
         }
-        Integer integer = dao.selectCount(lqw);
 
         Integer enterpriseId = 0;
         if (3 == user.getIsEnterpriseUser()) {
@@ -978,7 +976,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
             enterpriseId = one.getEnterpriseId();
             lqw.eq(Order::getEnterpriseId, enterpriseId);
         }
-        Integer integer1 = dao.selectCount(lqw);
         lqw.eq(Order::getIsDel, false);
         lqw.and(i -> i.ne(Order::getIsIntegral, 1).or().isNull(Order::getIsIntegral));
         if (OrderConstants.ORDER_STATUS_WAIT_SHIPPING.equals(status)) {