Selaa lähdekoodia

1.下级销售列表返回新增是否存在转移申请字段
2.申请列表返回新增头像
3.标签列表去重

Long 2 kuukautta sitten
vanhempi
commit
5e3f4d5b0f

+ 6 - 0
fs-company-app/src/main/java/com/fs/app/controller/CompanyUserController.java

@@ -93,6 +93,12 @@ public class CompanyUserController extends AppBaseController {
             BigDecimal amount = courseRedPacketLogService.getSumByCompanyUserIdId(u.getUserId());
             vo.setTodayRedPacketAmount(amount);
 
+            // 是否存在会员转移申请
+            Wrapper<CompanyUserChangeApply> applyWrapper = Wrappers.<CompanyUserChangeApply>lambdaQuery()
+                    .eq(CompanyUserChangeApply::getFrom, u.getUserId())
+                    .eq(CompanyUserChangeApply::getStatus, 0);
+            vo.setHasApply(companyUserChangeApplyService.count(applyWrapper) > 0);
+
             return vo;
         }).collect(Collectors.toList());
 

+ 15 - 0
fs-company-app/src/main/java/com/fs/app/exception/FSExceptionHandler.java

@@ -2,8 +2,11 @@ package com.fs.app.exception;
 
 
 
+import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.dao.DuplicateKeyException;
@@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 import org.springframework.web.servlet.NoHandlerFoundException;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 
@@ -86,4 +90,15 @@ public class FSExceptionHandler {
 
 		return R.error(e.getMessage());
 	}
+
+	/**
+	 * 业务异常
+	 */
+	@ExceptionHandler(ServiceException.class)
+	public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request)
+	{
+		logger.error(e.getMessage(), e);
+		Integer code = e.getCode();
+		return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage());
+	}
 }

+ 4 - 0
fs-company-app/src/main/java/com/fs/app/vo/CompanySubUserVO.java

@@ -25,4 +25,8 @@ public class CompanySubUserVO extends CompanyUser {
      * 今日红包金额
      */
     private BigDecimal todayRedPacketAmount;
+    /**
+     * 是否存在待审核转移申请
+     */
+    private Boolean hasApply;
 }

+ 4 - 0
fs-service-system/src/main/java/com/fs/company/vo/CompanyUserChangeApplyUserVO.java

@@ -12,4 +12,8 @@ public class CompanyUserChangeApplyUserVO {
      * 用户名称
      */
     private String userName;
+    /**
+     * 用户头像
+     */
+    private String avatar;
 }

+ 8 - 0
fs-service-system/src/main/java/com/fs/company/vo/CompanyUserChangeApplyVO.java

@@ -16,6 +16,10 @@ public class CompanyUserChangeApplyVO {
      * 原销售
      */
     private Long from;
+    /**
+     * 原销售头像
+     */
+    private String fromAvatar;
     /**
      * 原销售名称
      */
@@ -24,6 +28,10 @@ public class CompanyUserChangeApplyVO {
      * 申请更换销售
      */
     private Long to;
+    /**
+     * 申请更换销售头像
+     */
+    private String toAvatar;
     /**
      * 申请更换销售名称
      */

+ 1 - 1
fs-service-system/src/main/resources/mapper/company/CompanyTagUserMapper.xml

@@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <select id="getTagList" resultType="CompanyUserTagListVO">
-        SELECT
+        SELECT distinct
         company_tag.tag as tagName,
         company_tag.tag_id
         FROM

+ 2 - 0
fs-service-system/src/main/resources/mapper/company/CompanyUserChangeApplyMapper.xml

@@ -10,7 +10,9 @@
     <sql id="applySQL">
         select
             cuca.*,
+            fu.avatar    fromAvatar,
             fu.user_name fromName,
+            tu.avatar    toAvatar,
             tu.user_name toName
         from company_user_change_apply cuca
         left join company_user fu on fu.user_id = cuca.`from`

+ 2 - 1
fs-service-system/src/main/resources/mapper/company/CompanyUserChangeApplyUserMapper.xml

@@ -8,7 +8,8 @@
     <select id="getApplyUsers" resultType="com.fs.company.vo.CompanyUserChangeApplyUserVO">
         select
             fu.user_id,
-            fu.nickname as userName
+            fu.nickname as userName,
+            fu.avatar
         from company_user_change_apply_user cucau
         inner join fs_user fu on fu.user_id = cucau.user_id
         where cucau.apply_id = #{applyId}