Kaynağa Gözat

开发客服跟进列表

anderx 4 yıl önce
ebeveyn
işleme
780fe36314

+ 70 - 0
src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

@@ -435,4 +435,74 @@
 		where a.uid= #{uid}
 		and a.aid= #{aid}
 	</select>
+
+
+	<select id="userFollowList" resultType="com.goafanti.user.bo.outUserFollowList">
+		select b.nickname,b.share_type ,b.channel,b.id,
+			   date_format(b.transfer_time,'%Y-%m-%d %H:%i:%s')startTimes,
+			   a.contact_type,c.name followName ,d.name followDep,a.`result` ,a.follow_count followCount,
+			   a.guidance ,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%s') guidanceTimes
+		from user_follow a left join  `user`b on a.uid =b.id left join admin c on b.aid =c.id
+		left join department d on c.department_id =d.id where 1=1
+		<if test="userName != null">
+		  and b.nickname like concat('%',#{userName},'%')
+		</if>
+		<if test="userType == 1">
+		  and b.share_type =0
+		</if>
+		<if test="userType == 2">
+		  and b.share_type =2
+		</if>
+		<if test="userType == 3">
+			and b.channel =1
+		</if>
+		<if test="contactType != null">
+			and a.contact_type = #{contactType}
+		</if>
+		<if test="dateType !=null and startTime !=null and endTime !=null">
+		<if test="dateType ==1">
+		  and a.create_time between #{startTime} and #{endTime}
+		</if><if test="dateType ==1">
+		and b.transfer_time between #{startTime} and #{endTime}
+		</if><if test="dateType ==1">
+		and a.guidance_time between #{startTime} and #{endTime}
+		</if>
+		</if>
+		order by  a.create_time desc
+		<if test="${page_sql}!=null">
+			${page_sql}
+		</if>
+	</select>
+	<select id="userFollowCount" resultType="java.lang.Integer">
+		select b.nickname,b.share_type ,b.channel,b.id,
+		date_format(b.transfer_time,'%Y-%m-%d %H:%i:%s')startTimes,
+		a.contact_type,c.name followName ,d.name followDep,a.`result` ,a.follow_count followCount,
+		a.guidance ,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%s') guidanceTimes
+		from user_follow a left join  `user`b on a.uid =b.id left join admin c on b.aid =c.id
+		left join department d on c.department_id =d.id where 1=1
+		<if test="userName != null">
+			and b.nickname like concat('%',#{userName},'%')
+		</if>
+		<if test="userType == 1">
+			and b.share_type =0
+		</if>
+		<if test="userType == 2">
+			and b.share_type =2
+		</if>
+		<if test="userType == 3">
+			and b.channel =1
+		</if>
+		<if test="contactType != null">
+			and a.contact_type = #{contactType}
+		</if>
+		<if test="dateType !=null and startTime !=null and endTime !=null">
+			<if test="dateType ==1">
+				and a.create_time between #{startTime} and #{endTime}
+			</if><if test="dateType ==1">
+			and b.transfer_time between #{startTime} and #{endTime}
+		</if><if test="dateType ==1">
+			and a.guidance_time between #{startTime} and #{endTime}
+		</if>
+		</if>
+	</select>
 </mapper>

+ 78 - 0
src/main/java/com/goafanti/user/bo/InputUserFollowList.java

@@ -0,0 +1,78 @@
+package com.goafanti.user.bo;
+
+public class InputUserFollowList {
+
+    private String userName;
+    /* 0所有 1私有客户2签单客户3渠道客户*/
+    private Integer userType;
+    private Integer contactType;
+    private Integer dateType;
+    private String startTime;
+    private String endTime;
+    private Integer pageSize;
+    private Integer pageNo;
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Integer getUserType() {
+        return userType;
+    }
+
+    public void setUserType(Integer userType) {
+        this.userType = userType;
+    }
+
+    public Integer getContactType() {
+        return contactType;
+    }
+
+    public void setContactType(Integer contactType) {
+        this.contactType = contactType;
+    }
+
+    public Integer getDateType() {
+        return dateType;
+    }
+
+    public void setDateType(Integer dateType) {
+        this.dateType = dateType;
+    }
+
+    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;
+    }
+}

+ 5 - 0
src/main/java/com/goafanti/user/bo/outUserFollowList.java

@@ -0,0 +1,5 @@
+package com.goafanti.user.bo;
+
+public class outUserFollowList {
+
+}

+ 11 - 2
src/main/java/com/goafanti/user/controller/UserFollowController.java

@@ -1,6 +1,11 @@
 package com.goafanti.user.controller;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.model.UserFollow;
+import com.goafanti.user.bo.InputUserFollowList;
+import com.goafanti.user.bo.InputUserServiceFollow;
+import com.goafanti.user.service.UserFollowService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -8,11 +13,15 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping(value = "/api/admin/follow")
 public class UserFollowController {
+    @Autowired
+    private UserFollowService userFollowService;
 
     @RequestMapping(value = "userFollowList", method = RequestMethod.POST)
-    public Result  userFollowList(){
+    public Result  userFollowList(InputUserFollowList in){
         Result res =new Result();
-
+        System.out.println("11111");
+        res.data(userFollowService.userFollowList(in));
         return res;
     }
 }
+

+ 7 - 0
src/main/java/com/goafanti/user/service/UserFollowService.java

@@ -0,0 +1,7 @@
+package com.goafanti.user.service;
+
+import com.goafanti.user.bo.InputUserFollowList;
+
+public interface UserFollowService {
+     Object userFollowList(InputUserFollowList in);
+}

+ 26 - 0
src/main/java/com/goafanti/user/service/impl/UserFollowServiceImpl.java

@@ -0,0 +1,26 @@
+package com.goafanti.user.service.impl;
+
+import com.goafanti.common.dao.UserFollowMapper;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.user.bo.InputUserFollowList;
+import com.goafanti.user.service.UserFollowService;
+import org.springframework.stereotype.Service;
+import org.terracotta.offheapstore.HashingMap;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class UserFollowServiceImpl extends BaseMybatisDao<UserFollowMapper>  implements UserFollowService {
+    @Override
+    public Object userFollowList(InputUserFollowList in) {
+        Map<String,Object>map=new HashMap<>();
+        if (in.getUserName()!=null)map.put("userName",in.getUserName());
+        if (in.getContactType()!=null)map.put("contactType",in.getContactType());
+        if (in.getDateType()!=null)map.put("dateType",in.getDateType());
+        if (in.getUserType()!=null)map.put("userType",in.getUserType());
+        if (in.getStartTime()!=null)map.put("startTime",in.getStartTime());
+        if (in.getEndTime()!=null)map.put("endTime",in.getEndTime());
+        return findPage("userFollowList","userFollowCount",map,in.getPageNo(), in.getPageSize());
+    }
+}