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

跟进修改,待处理打卡的状态

anderx лет назад: 4
Родитель
Сommit
6018f15e70

+ 0 - 1
pom.xml

@@ -416,7 +416,6 @@
 				<resource>
 				<resource>
 					<directory>src/main/java</directory>
 					<directory>src/main/java</directory>
 					<includes>
 					<includes>
-						<include>**/*.properties</include>
 						<include>**/*.xml</include>
 						<include>**/*.xml</include>
 					</includes>
 					</includes>
 				</resource>
 				</resource>

+ 5 - 6
src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

@@ -268,12 +268,11 @@
 
 
 
 
 	<select id="userFollowList" resultType="com.goafanti.user.bo.outUserFollowList">
 	<select id="userFollowList" resultType="com.goafanti.user.bo.outUserFollowList">
-		select b.nickname,b.share_type shareType ,b.channel,b.id,
-			   date_format(b.transfer_time,'%Y-%m-%d %H:%i:%s')startTimes,
-			   a.contact_type contactType,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
+        select b.nickname,b.share_type shareType ,b.channel,b.id,date_format(b.transfer_time,'%Y-%m-%d %H:%i:%s')startTimes,
+        a.contact_type contactType,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,a.guidance_name guidanceName
+        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">
 		<if test="userName != null">
 		  and b.nickname like concat('%',#{userName},'%')
 		  and b.nickname like concat('%',#{userName},'%')
 		</if>
 		</if>

+ 4 - 3
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1734,12 +1734,13 @@
     </if>
     </if>
     <if test="power ==1  or power ==2">
     <if test="power ==1  or power ==2">
       and a.aid
       and a.aid
-      <if test="alist2 !=null">
+      <if test="alist != null">
+        in
         <foreach item="item" collection="alist" separator="," open="(" close=")" index="">
         <foreach item="item" collection="alist" separator="," open="(" close=")" index="">
-          in #{item}
+          #{item}
         </foreach>
         </foreach>
       </if>
       </if>
-      <if test="alist2 !=null">
+      <if test="alist == null">
         is null
         is null
       </if>
       </if>
     </if>
     </if>

+ 5 - 4
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -223,9 +223,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage(
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage(
 				"selectPrivateOrganizationCustomerList", "selectPrivateOrganizationCustomerCount", params, pageNo,
 				"selectPrivateOrganizationCustomerList", "selectPrivateOrganizationCustomerCount", params, pageNo,
 				pageSize);
 				pageSize);
-		List<CustomerListOut> tmpList = (List<CustomerListOut>) list.getList();
-		setCustomerList(tmpList, 0, type);
-		list.setList(tmpList);
+//		List<CustomerListOut> tmpList = (List<CustomerListOut>) list.getList();
+//		setCustomerList(tmpList, 0, type);
+//		list.setList(tmpList);
 		return list;
 		return list;
 	}
 	}
 
 
@@ -2011,7 +2011,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		uf.setGuidanceTime(new Date());
 		uf.setGuidanceTime(new Date());
 		String aid=TokenManager.getAdminId();
 		String aid=TokenManager.getAdminId();
 		Admin a=adminMapper.selectByPrimaryKey(aid);
 		Admin a=adminMapper.selectByPrimaryKey(aid);
-
+		uf.setGuidanceAid(a.getId());
+		uf.setGuidanceName(a.getName());
 		userFollowMapper.pushUserGuidance(followId, 1);
 		userFollowMapper.pushUserGuidance(followId, 1);
 		return userFollowMapper.updateByPrimaryKeySelective(uf);
 		return userFollowMapper.updateByPrimaryKeySelective(uf);
 	}
 	}

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

@@ -1,19 +1,42 @@
 package com.goafanti.user.bo;
 package com.goafanti.user.bo;
 
 
+import com.goafanti.common.utils.excel.Excel;
+
 public class outUserFollowList {
 public class outUserFollowList {
+    @Excel(name = "客户名称")
     private String nickname;
     private String nickname;
+    @Excel(name = "客户类型" ,readConverterExp = "0=私有,1=公共,2签单")
     private Integer shareType;
     private Integer shareType;
+    @Excel(name = "渠道" ,readConverterExp = "0=否,1=是")
     private Integer channel;
     private Integer channel;
     private String id;
     private String id;
+    @Excel(name = "客户初始时间")
     private String startTimes;
     private String startTimes;
+    @Excel(name = "跟进方式",readConverterExp = "0=外出,1=电话,2=QQ,3=微信,4=邮件")
     private Integer contactType;
     private Integer contactType;
+    @Excel(name = "跟进人")
     private String followName;
     private String followName;
+    @Excel(name = "跟进公司")
     private String followDep;
     private String followDep;
+    @Excel(name = "跟进说明")
     private String result;
     private String result;
+    @Excel(name = "跟进次数")
     private Integer followCount;
     private Integer followCount;
+    @Excel(name = "指导人")
+    private String guidanceName;
+    @Excel(name = "指导意见")
     private String guidance;
     private String guidance;
+    @Excel(name = "指导时间")
     private String guidanceTimes;
     private String guidanceTimes;
 
 
+    public String getGuidanceName() {
+        return guidanceName;
+    }
+
+    public void setGuidanceName(String guidanceName) {
+        this.guidanceName = guidanceName;
+    }
+
     public Integer getShareType() {
     public Integer getShareType() {
         return shareType;
         return shareType;
     }
     }

+ 14 - 0
src/main/java/com/goafanti/user/controller/UserFollowController.java

@@ -2,18 +2,25 @@ package com.goafanti.user.controller;
 
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.user.bo.InputUserFollowList;
 import com.goafanti.user.bo.InputUserFollowList;
+import com.goafanti.user.bo.outUserFollowList;
 import com.goafanti.user.service.UserFollowService;
 import com.goafanti.user.service.UserFollowService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.List;
+
 @RestController
 @RestController
 @RequestMapping(value = "/api/admin")
 @RequestMapping(value = "/api/admin")
 public class UserFollowController extends BaseApiController {
 public class UserFollowController extends BaseApiController {
     @Autowired
     @Autowired
     private UserFollowService userFollowService;
     private UserFollowService userFollowService;
+    @Value(value = "${upload.path}")
+    private String	uploadPath			= null;
 
 
     @RequestMapping(value = "/userFollowList", method = RequestMethod.GET)
     @RequestMapping(value = "/userFollowList", method = RequestMethod.GET)
     public Result  userFollowList(InputUserFollowList in){
     public Result  userFollowList(InputUserFollowList in){
@@ -21,5 +28,12 @@ public class UserFollowController extends BaseApiController {
         res.data(userFollowService.userFollowList(in));
         res.data(userFollowService.userFollowList(in));
         return res;
         return res;
     }
     }
+    @RequestMapping(value = "/userFollowListExport", method = RequestMethod.GET)
+    public Result  userFollowListExport(InputUserFollowList in){
+        Result res =new Result();
+        List<outUserFollowList> list= userFollowService.userFollowListExport(in);
+        NewExcelUtil<outUserFollowList> excel=new NewExcelUtil<>(outUserFollowList.class);
+        return excel.exportExcel(list,"客户跟进列表",uploadPath);
+    }
 }
 }
 
 

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

@@ -4,6 +4,10 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.bo.InputUserFollowList;
 import com.goafanti.user.bo.InputUserFollowList;
 import com.goafanti.user.bo.outUserFollowList;
 import com.goafanti.user.bo.outUserFollowList;
 
 
+import java.util.List;
+
 public interface UserFollowService {
 public interface UserFollowService {
      Pagination<outUserFollowList> userFollowList(InputUserFollowList in);
      Pagination<outUserFollowList> userFollowList(InputUserFollowList in);
+
+    List<outUserFollowList> userFollowListExport(InputUserFollowList in);
 }
 }

+ 27 - 7
src/main/java/com/goafanti/user/service/impl/UserFollowServiceImpl.java

@@ -1,28 +1,48 @@
 package com.goafanti.user.service.impl;
 package com.goafanti.user.service.impl;
 
 
 import com.goafanti.common.dao.UserFollowMapper;
 import com.goafanti.common.dao.UserFollowMapper;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.bo.InputUserFollowList;
 import com.goafanti.user.bo.InputUserFollowList;
 import com.goafanti.user.bo.outUserFollowList;
 import com.goafanti.user.bo.outUserFollowList;
 import com.goafanti.user.service.UserFollowService;
 import com.goafanti.user.service.UserFollowService;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.terracotta.offheapstore.HashingMap;
 import org.terracotta.offheapstore.HashingMap;
 
 
 import java.util.HashMap;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 @Service
 @Service
 public class UserFollowServiceImpl extends BaseMybatisDao<UserFollowMapper>  implements UserFollowService {
 public class UserFollowServiceImpl extends BaseMybatisDao<UserFollowMapper>  implements UserFollowService {
+
+
+
     @Override
     @Override
     public Pagination<outUserFollowList> userFollowList(InputUserFollowList in) {
     public Pagination<outUserFollowList> 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());
+        Map<String,Object>map=setParam(in);
+
         return (Pagination<outUserFollowList>) findPage("userFollowList","userFollowCount",map,in.getPageNo(), in.getPageSize());
         return (Pagination<outUserFollowList>) findPage("userFollowList","userFollowCount",map,in.getPageNo(), in.getPageSize());
     }
     }
+
+    private Map<String,Object> setParam(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 map;
+    }
+
+    @Override
+    public List<outUserFollowList> userFollowListExport(InputUserFollowList in) {
+        Map<String,Object>map=setParam(in);
+        List<outUserFollowList>list= (List<outUserFollowList>) findList("userFollowList",map,1,999999);
+
+        return list;
+    }
 }
 }