zou_ht 8 years ago
parent
commit
57f9f54a13

+ 3 - 0
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -8,6 +8,7 @@ import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AdminLocation;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.customer.bo.AdminOut;
 
 public interface AdminService {
 
@@ -61,6 +62,8 @@ public interface AdminService {
 	int insertNewAdmin(Admin ad, List<AdminLocation> adminLocationList);
 
 	Map<String, String> listAdminSelect();
+	
+	List<AdminOut> selectAdmin();
 
 
 }

+ 6 - 0
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -23,6 +23,7 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.AdminOut;
 
 @Service
 public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements AdminService {
@@ -250,4 +251,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		return map;
 	}
 
+	@Override
+	public List<AdminOut> selectAdmin() {
+		return adminMapper.selectAdmin();
+	}
+
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
 
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Role;
+import com.goafanti.customer.bo.AdminOut;
 
 public interface AdminMapper {
     int deleteByPrimaryKey(String id);
@@ -57,5 +58,7 @@ public interface AdminMapper {
 	List<Admin> listAdminSelectBySuperAdmin();
 
 	List<Admin> listAdminSelectByAreaAdmin(@Param("provinceList")List<Integer> provinceList, @Param("cityList")List<Integer> cityList);
+	
+	List<AdminOut> selectAdmin();
 
 }

+ 0 - 11
src/main/java/com/goafanti/common/dao/CustomerMapper.java

@@ -93,15 +93,4 @@ public interface CustomerMapper {
      */
     List<Customer> selectByLadderId(@Param("ladderId")String ladderId);
     
-    /**
-     * 
-     * @param ladderId 上层领导ID
-     * @return 查询团队 客户记录
-     */
-    List<Customer> updFollowId(Customer record);
-    
-    
-    
-    int updCustomerByPrimaryKey(Customer record);
-    
 }

+ 6 - 0
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -168,6 +168,12 @@
     from admin 
   </select>
   
+   <select id="selectAdmin" resultType="com.goafanti.customer.bo.AdminOut">
+    select 
+    <include refid="Base_Column_List" />
+    from admin 
+  </select>
+  
   <select id="selectByMobile" parameterType="java.lang.String" resultMap="BaseResultMap">
      select 
     <include refid="Base_Column_List" />

+ 248 - 0
src/main/java/com/goafanti/customer/bo/AdminOut.java

@@ -0,0 +1,248 @@
+package com.goafanti.customer.bo;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.model.Admin;
+
+public class AdminOut extends Admin{
+	private static final long	serialVersionUID	= 1L;
+
+	private String				id;
+	
+	/**
+	 * 客户记录id
+	 */
+	private String              cid;
+
+	/**
+	 * 手机号(登录帐号)
+	 */
+	private String				mobile;
+
+	/**
+	 * 用户名
+	 */
+	private String				name;
+
+	/**
+	 * 密码
+	 */
+	private String				password;
+
+	/**
+	 * 邮箱
+	 */
+	private String				email;
+
+	/**
+	 * 创建时间
+	 */
+	private Date				createTime;
+
+	/**
+	 * 员工工号
+	 */
+	private Integer				number;
+
+	/**
+	 * 所在省份
+	 */
+	private Integer				province;
+	/**
+	 * 职位
+	 */
+	private String				position;
+
+	/**
+	 * 上级管理用户ID
+	 */
+	private String				superiorId;
+
+	/**
+	 * 意向
+	 */
+	private String				beforeCompanyIntention;
+	/**
+	 * 状态
+	 */
+	private String				beforeCustomerStatus;
+	/**
+	 * 跟进状态
+	 */
+	private String				beforeFollowSituation;
+	/**
+	 * 转交人
+	 */
+	private String				beforeAdminName;
+	/**
+	 * 所在市
+	 */
+	private Integer				city;
+	
+	public String getSuperiorId() {
+		return superiorId;
+	}
+
+	public void setSuperiorId(String superiorId) {
+		this.superiorId = superiorId;
+	}
+
+	
+	public String getCid() {
+		return cid;
+	}
+
+	public void setCid(String cid) {
+		this.cid = cid;
+	}
+
+	public String getPosition() {
+		return position;
+	}
+
+	public void setPosition(String position) {
+		this.position = position;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	@JsonIgnore
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public String getEmail() {
+		return email;
+	}
+
+	public void setEmail(String email) {
+		this.email = email;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Integer getNumber() {
+		return number;
+	}
+
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+
+
+	public Integer getProvince() {
+		return province;
+	}
+
+	public void setProvince(Integer province) {
+		this.province = province;
+	}
+
+	public Integer getCity() {
+		return city;
+	}
+
+	public void setCity(Integer city) {
+		this.city = city;
+	}
+
+	// 创建时间
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
+
+	}
+
+	@JsonIgnore
+	@Override
+	public String getAid() {
+		return null;
+	}
+
+	@Override
+	public Integer getType() {
+		return null;
+	}
+
+
+	public String getBeforeCompanyIntention() {
+		return beforeCompanyIntention;
+	}
+
+	public void setBeforeCompanyIntention(String beforeCompanyIntention) {
+		this.beforeCompanyIntention = beforeCompanyIntention;
+	}
+
+	public String getBeforeCustomerStatus() {
+		return beforeCustomerStatus;
+	}
+
+	public void setBeforeCustomerStatus(String beforeCustomerStatus) {
+		this.beforeCustomerStatus = beforeCustomerStatus;
+	}
+
+	public String getBeforeFollowSituation() {
+		return beforeFollowSituation;
+	}
+
+	public void setBeforeFollowSituation(String beforeFollowSituation) {
+		this.beforeFollowSituation = beforeFollowSituation;
+	}
+
+	public String getBeforeAdminName() {
+		return beforeAdminName;
+	}
+
+	public void setBeforeAdminName(String beforeAdminName) {
+		this.beforeAdminName = beforeAdminName;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
+
+	
+
+}

+ 42 - 0
src/main/java/com/goafanti/customer/bo/CustomerOut.java

@@ -123,6 +123,16 @@ public class CustomerOut {
 	 * 跟单时间
 	 */
 	private String followDate;
+	/** 操作前客户状态  **/
+	private String beforeCustomerStatus;
+	
+	/** 操作前意向服务 **/
+	private String beforeCompanyIntention;
+	
+	/** 操作前跟进进度 **/
+	private String beforeFollowSituation;
+	/** 跟单人 **/
+	private String beforeAdminName;
 
 	public Integer getCustomerType() {
 		return customerType;
@@ -379,6 +389,38 @@ public class CustomerOut {
 	public void setFollowDate(String followDate) {
 		this.followDate = followDate;
 	}
+	
+	public String getBeforeCustomerStatus() {
+		return beforeCustomerStatus;
+	}
+
+	public void setBeforeCustomerStatus(String beforeCustomerStatus) {
+		this.beforeCustomerStatus = beforeCustomerStatus;
+	}
+
+	public String getBeforeCompanyIntention() {
+		return beforeCompanyIntention;
+	}
+
+	public void setBeforeCompanyIntention(String beforeCompanyIntention) {
+		this.beforeCompanyIntention = beforeCompanyIntention;
+	}
+
+	public String getBeforeFollowSituation() {
+		return beforeFollowSituation;
+	}
+
+	public void setBeforeFollowSituation(String beforeFollowSituation) {
+		this.beforeFollowSituation = beforeFollowSituation;
+	}
+
+	public String getBeforeAdminName() {
+		return beforeAdminName;
+	}
+
+	public void setBeforeAdminName(String beforeAdminName) {
+		this.beforeAdminName = beforeAdminName;
+	}
 
 	@Override
 	public String toString() {

+ 68 - 9
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -2,6 +2,7 @@ package com.goafanti.customer.controller;
 
 import java.lang.reflect.InvocationTargetException;
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.UUID;
 
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.goafanti.customer.bo.AdminOut;
 import com.goafanti.customer.bo.CustomerIn;
 import com.goafanti.customer.bo.CustomerOut;
 import com.goafanti.customer.service.CustomerOrganizationService;
@@ -24,13 +26,11 @@ import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.BaseController;
-import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.CustomerOrganizationInfo;
 import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.common.model.FollowUpRecord;
 import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.core.shiro.token.TokenManager;
 
 @RestController
 @RequestMapping(value = "/api/admin/customer")
@@ -73,8 +73,7 @@ public class AdminCustomerApiController extends BaseController {
 		
 		fur.setId(followId);//跟进记录的ID
 		fur.setCid(customerId);//跟进记录表中的cid
-		fur.setCuid(customerUsrId);//跟进记录表中的联系人id
-		fur.setAid(TokenManager.getUserId());
+		fur.setCuid(customerUsrId);//跟进记录表中的联系人id		
 		/*if(StringUtils.isNotBlank(cusIn.getAid())) fur.setAid(cusIn.getAid());*//*暂时注释*/
 		
 		BeanUtils.copyProperties(c, cusIn);
@@ -114,13 +113,22 @@ public class AdminCustomerApiController extends BaseController {
 	 * 查询操作员信息
 	 * 
 	 * @return
+	 * @throws InvocationTargetException 
+	 * @throws IllegalAccessException 
 	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/findAdmin", method = RequestMethod.POST)
-	public Result selectAllAdmin() throws ParseException {
+	public Result selectAllAdmin(CustomerIn cusIn) throws IllegalAccessException, InvocationTargetException  {
 		Result res = new Result();
-		List<Admin> selectAllAdmin = adminService.selectAllAdmin();
-		res.setData(selectAllAdmin);
+		List<AdminOut> adminList = adminService.selectAdmin();
+		for (int i = 0; i < adminList.size(); i++) {
+			adminList.get(i).setBeforeAdminName(cusIn.getBeforeAdminName());
+			adminList.get(i).setBeforeCompanyIntention(cusIn.getBeforeCompanyIntention());
+			adminList.get(i).setBeforeCustomerStatus(cusIn.getBeforeCustomerStatus());
+			adminList.get(i).setBeforeFollowSituation(cusIn.getBeforeFollowSituation());
+			adminList.get(i).setCid(cusIn.getId());
+		}
+		res.setData(adminList);
 		return res;
 	}
 
@@ -217,8 +225,8 @@ public class AdminCustomerApiController extends BaseController {
 	 * @throws InvocationTargetException 
 	 * @throws IllegalAccessException 
 	 */
-	@RequestMapping(value = "/transferCsutomer", method = RequestMethod.POST)
-	public Result transferCsutomer (CustomerIn cusIn) throws IllegalAccessException, InvocationTargetException  {
+	@RequestMapping(value = "/transferCustomer", method = RequestMethod.POST)
+	public Result transferCustomer (CustomerIn cusIn) throws IllegalAccessException, InvocationTargetException  {
 		Result res=new Result();
 		Customer c =new Customer();
 		BeanUtils.copyProperties(c, cusIn);
@@ -229,4 +237,55 @@ public class AdminCustomerApiController extends BaseController {
 	    return res;
 	}
 	
+	/**
+	 * 查询单个联系人信息
+	 * @return
+	 */
+	/*@RequestMapping(value = "/transferCsutomer", method = RequestMethod.POST)
+	public Result findContractById (String id)  {
+		Result res=new Result();
+		res.setData(customerUserService.findContractById(id));
+		return res;
+	}*/
+	
+	/**
+	 * 修改单个联系人信息
+	 * @return
+	 */
+	/*@RequestMapping(value = "/transferCsutomer", method = RequestMethod.POST)
+	public Result updContractById (String id)  {
+		Result res=new Result();
+		return res;
+	}*/
+	
+	/**
+	 * 添加跟进记录
+	 * @param fur
+	 * @return
+	 * @throws ParseException 
+	 */
+	@RequestMapping(value = "addFollow", method = RequestMethod.POST)
+	public Result addFollowUpRecord(FollowUpRecord fur, CustomerIn cusIn ,String followDate) throws ParseException{
+		Result res = new Result();
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		if(StringUtils.isNotBlank(followDate)) fur.setFollowDate(format.parse(followDate));
+		String followId = UUID.randomUUID().toString();
+		fur.setId(followId);
+		cusIn.setFollowId(followId);
+		followUpService.addFollowUp(fur, cusIn);	
+		Customer cus = new Customer();
+		try {
+			BeanUtils.copyProperties(cus, cusIn);
+			if(StringUtils.isNotBlank(cusIn.getFollowSituation()))
+				cus.setFollowSituation(Integer.parseInt(cusIn.getFollowSituation()));	
+			if(StringUtils.isNotBlank(cusIn.getCustomerStatus()))
+				cus.setCustomerStatus(Integer.parseInt(cusIn.getCustomerStatus()));
+		} catch (IllegalAccessException | InvocationTargetException e) {			
+			e.printStackTrace();
+		}
+		customerService.updateCustomer(cus);
+		return res;
+	}
+	
+	
 }

+ 12 - 0
src/main/java/com/goafanti/customer/service/CustomerUserService.java

@@ -33,4 +33,16 @@ public interface CustomerUserService {
 	 * @return
 	 */
 	int updPrimaryFlg (String cid);
+	
+	/**
+	 * 查询单个联系人信息
+	 * @return
+	 */
+	CustomerUserInfo findContractById (String id);
+	
+	/**
+	 * 修改单个联系人信息
+	 * @return
+	 */
+	int updateContractById (CustomerUserInfo cui);
 }

+ 10 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerUserServiceImp.java

@@ -36,6 +36,16 @@ public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMappe
 		return customerUserInfoMapper.updataPrimaryFlg(cid);
 	}
 
+	@Override
+	public CustomerUserInfo findContractById(String id) {
+		return customerUserInfoMapper.selectByPrimaryKey(id);
+	}
+
+	@Override
+	public int updateContractById(CustomerUserInfo cui) {
+		return customerUserInfoMapper.updateByPrimaryKey(cui);
+	}
+