Bläddra i källkod

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 10 månader sedan
förälder
incheckning
88abba9fe0

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/listvo/UserVO.java

@@ -45,7 +45,7 @@ public class UserVO     {
     @ApiModelProperty("师傅编号")
     private String workerNumber;
 
-    @ApiModelProperty("用户昵称")
+    @ApiModelProperty("师傅名称")
     private String nickName;
 
     @ApiModelProperty("联系电话")

+ 2 - 1
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/workorder/IncreMapper.java

@@ -17,7 +17,8 @@ public interface IncreMapper {
     IPage<IncreVO> list(IPage page, @Param("ex") ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
-    IPage<DispatchVO> listDispatch(Page page, @Param("ex") ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds);
+    IPage<DispatchVO> listDispatch(Page page, @Param("ex") ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds,
+                                   @Param("codeList") List<String> codeList);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
     IPage<WebsitDispatchVO> listDispatchWebsit(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("adminCompanyIds") List<String> adminCompanyIds);

+ 2 - 1
mall-server-api/src/main/java/com/gree/mall/manager/controller/admin/AdminUserController.java

@@ -149,11 +149,12 @@ public class AdminUserController {
             @ApiParam(value = "角色id",required = false) @RequestParam(required = false) String roleId,
             @ApiParam(value = "状态 true:正常 false:冻结",required = false) @RequestParam(required = false) Boolean status,
             @ApiParam(value = "用户名",required = false) @RequestParam(required = false) String userName,
+            @ApiParam(value = "网点id",required = false) @RequestParam(required = false) String websitId,
             @ApiParam(value = "页号",required = true) @RequestParam(required = true) Integer pageNum,
             @ApiParam(value = "页大小",required = true) @RequestParam(required = true) Integer pageSize,
             HttpServletRequest request
     ) throws RemoteServiceException {
-        IPage<AdminUser> page = adminUserLogic.list(companyWechatId,companyWechatName,roleId,status,userName,pageNum, pageSize);
+        IPage<AdminUser> page = adminUserLogic.list(companyWechatId,companyWechatName,roleId,status,userName,pageNum, pageSize,websitId);
         return ResponseHelper.success(page);
     }
 

+ 18 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/admin/AdminUserLogic.java

@@ -578,7 +578,7 @@ public class AdminUserLogic {
      *
      * @return
      */
-    public IPage<AdminUser> list(String companyWechatId, String companyWechatName, String roleId, Boolean status, String userName, Integer pageNum, Integer pageSize) {
+    public IPage<AdminUser> list(String companyWechatId, String companyWechatName, String roleId, Boolean status, String userName, Integer pageNum, Integer pageSize,String websitId) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
         if (adminUser.getType() != 2) {
@@ -588,6 +588,23 @@ public class AdminUserLogic {
             // 网点主账号能看到账号
         }
 
+        List<String> adminUserIds = new ArrayList<>();
+        if (!StringUtil.isEmpty(websitId)) {
+            List<String> adminUserIdList = adminUserWebsitRelaService.lambdaQuery().eq(AdminUserWebsitRela::getAdminWebsitId, websitId).select(AdminUserWebsitRela::getAdminUserId)
+                    .list().stream().map(AdminUserWebsitRela::getAdminUserId).collect(Collectors.toList());
+            adminUserIds.addAll(adminUserIdList);
+
+            List<String> depts = adminDeptWebsitService.lambdaQuery().eq(AdminDeptWebsit::getWebsitId, websitId).select(AdminDeptWebsit::getAdminDeptId).list().stream()
+                    .map(AdminDeptWebsit::getAdminDeptId).collect(Collectors.toList());
+            List<String> userIds = adminUserDeptRelaService.lambdaQuery().in(AdminUserDeptRela::getAdminDeptId, depts).select(AdminUserDeptRela::getAdminUserId).list().stream()
+                    .map(AdminUserDeptRela::getAdminUserId).collect(Collectors.toList());
+            adminUserIds.addAll(userIds);
+
+            if (CollectionUtils.isEmpty(adminUserIdList))
+                return new Page<>();
+
+        }
+
         IPage<AdminUser> page = adminUserService.lambdaQuery()
                 .eq(StringUtils.isNotBlank(companyWechatId), AdminUser::getCompanyWechatId, companyWechatId)
                 .like(StringUtils.isNotBlank(companyWechatName), AdminUser::getCompanyName, companyWechatName)

+ 12 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/ChangeOrderLogic.java

@@ -274,7 +274,18 @@ public class ChangeOrderLogic {
         //1.组装查询条件
         zfireParam = FieldUtils.supplyParam(zfireParam, DispatchVO.class);
 
-        IPage<DispatchVO> dispatchVOIPage = increMapper.listDispatch(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam,adminCompanyIds);
+        List<WebsitDispatch> websitDispatches = websitDispatchService.lambdaQuery().eq(WebsitDispatch::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .select(WebsitDispatch::getStreetCode, WebsitDispatch::getDictCode, WebsitDispatch::getOrderSmallId,
+                        WebsitDispatch::getCategoryId, WebsitDispatch::getOrderSourceId)
+                .list();
+
+        List<String> codeList = new ArrayList<>();
+        for (WebsitDispatch websitDispatch : websitDispatches) {
+            codeList.add(websitDispatch.getStreetCode()+websitDispatch.getDictCode()+websitDispatch.getOrderSmallId()
+            +websitDispatch.getCategoryId()+websitDispatch.getOrderSourceId());
+        }
+
+        IPage<DispatchVO> dispatchVOIPage = increMapper.listDispatch(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam,adminCompanyIds,codeList);
 
         return dispatchVOIPage;
 

+ 8 - 11
mall-server-api/src/main/resources/mapper/workorder/IncreMapper.xml

@@ -39,7 +39,9 @@
         e.dict_code as order_source_id
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0     and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -67,19 +69,14 @@
                 #{item}
             </foreach>
         </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND f.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+        ${ex.query}
+
+        <if test="codeList != null and codeList.size > 0">
+            AND CONCAT(a.id,b.dict_code,c.id,d.category_id,e.dict_code) not In
+            <foreach item="item" index="index" collection="codeList" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
-        ${ex.query}
-        and
-        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
-        AND a.`level` = 4
-        and f.id is null
-
 
     </select>
     <select id="listDispatchWebsit" resultType="com.gree.mall.manager.bean.workorder.WebsitDispatchVO">