Просмотр исходного кода

新增线索客户列表修改

anderx 1 год назад
Родитель
Сommit
1c77b3a8ee

+ 2 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -69,6 +69,8 @@ public class AFTConstants {
 	public static final String  FINANCE_MANAGER						= "997";
 	/** 营销经理 */
 	public static final String  SALESMAN_MANAGER                    = "996";
+	/** 营销经理 */
+	public static final String  CLUE_MANAGER                    = "986";
 	/** 客服营销员 */
 	public static final String  CUSTOMER_SERVICE_SALESMAN     		= "960";
 	/**	技术员 */

+ 30 - 5
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1525,17 +1525,42 @@
         a.clue_process clueProcess,a.clue_time clueTime
         from `user` a left join organization_identity b on a.id =b.uid
         left join admin c on a.aid=c.id
-        where a.clue_status =1 and a.clue_process in (0,2)
-        <if test="aid !=null">
-            and a.aid= #{aid}
-        </if>
+        where a.clue_status =1
+        <include refid="selectUserClueListSql"/>
         <if test="page_sql !=null">
             ${page_sql}
         </if>
     </select>
+    <sql id="selectUserClueListSql">
+        <if test="shiroType==1">
+            <if test="aid !=null">
+                and a.clue_aid= #{aid}
+            </if>
+        </if>
+        <if test="shiroType==2">
+            <if test="aid !=null">
+                and a.aid= #{aid}
+            </if>
+        </if>
+        <if  test="clueProcess !=null">
+            and a.clue_process= #{clueProcess}
+        </if>
+        <if test="startTime  !=null and endTime != null">
+            and a.clue_time between #{startTime} and #{endTime}
+        </if>
+    </sql>
     <select id="selectUserClueCount" resultType="java.lang.Integer">
         select count(*) from `user` a
-        where clue_status =1 and clue_process in (0,2)
+        where clue_status =1
+        <if test="aid !=null">
+            and a.aid= #{aid}
+        </if>
+        <if  test="clueProcess !=null">
+            and a.clue_process= #{clueProcess}
+        </if>
+        <if test="startTime  !=null and endTime != null">
+            and a.clue_time between #{startTime} and #{endTime}
+        </if>
     </select>
 </mapper>
 

+ 27 - 0
src/main/java/com/goafanti/customer/bo/InputUserClueList.java

@@ -3,10 +3,37 @@ package com.goafanti.customer.bo;
 public class InputUserClueList {
 
     private Integer shiroType;
+    private Integer clueProcess;
     private String aid;
+    private String startTime;
+    private String endTime;
     private Integer pageSize;
     private Integer pageNo;
 
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getClueProcess() {
+        return clueProcess;
+    }
+
+    public void setClueProcess(Integer clueProcess) {
+        this.clueProcess = clueProcess;
+    }
+
     public Integer getShiroType() {
         return shiroType;
     }

+ 6 - 1
src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

@@ -50,9 +50,14 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
     public Object list(InputUserClueList in) {
         if (TokenManager.hasRole(AFTConstants.SUPERADMIN)){
             in.setShiroType(0);
+        }else if(TokenManager.hasRole(AFTConstants.CLUE_MANAGER)){
+            in.setShiroType(1);
         }else {
-            in.setAid(TokenManager.getAdminId());
+            in.setShiroType(2);
         }
+        in.setAid(TokenManager.getAdminId());
+
+        if(in.getEndTime()!=null)in.setEndTime(in.getEndTime()+ " 23:59:59");
         Pagination<OutUserClueList> page = (Pagination<OutUserClueList>) findPage("selectUserClueList", "selectUserClueCount", in);
         return page;
     }