wanghui лет назад: 8
Родитель
Сommit
30a8205bec

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

@@ -352,7 +352,7 @@
 	  select
 		c.name as businessName,
 		b.identify_name as identifyName,
-		a.id,
+		a.id as businessId,
 		a.create_time as createTime,
 		a.follow_situation as followSituation,
 		a.customer_status as customerStatus,
@@ -364,7 +364,7 @@
 		a.uid = d.id
 	where a.aid = #{aid,jdbcType=VARCHAR}
 	<if test="businessId !=null and businessId != ''">
-		and c.id = #{businessId,jdbcType=VARCHAR}
+		and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
 	</if>
 	<if test="identifyName != null and identifyName != ''">
 		and b.identify_name = #{identifyName,jdbcType=VARCHAR}
@@ -421,7 +421,7 @@
   </select>
   
   <select id="findBusinessGlossory" resultType="com.goafanti.customer.bo.BusinessListBo">
-  	select id as businessId,name as businessName from business_glossory
+  	select id as businessGlossoryId,name as businessName from business_glossory
   </select>
   
   <select id="judgeBusiness" resultType="java.lang.Integer">

+ 9 - 9
src/main/java/com/goafanti/customer/bo/BusinessListBo.java

@@ -2,8 +2,6 @@ package com.goafanti.customer.bo;
 
 public class BusinessListBo {
 	/** 客户业务ID **/
-	private String id;
-	/** 业务字典ID **/
 	private String businessId;
 	/** 业务名称 **/
 	private String businessName;
@@ -23,13 +21,9 @@ public class BusinessListBo {
 	private String endDate;
 	/** 业务创建时间 **/
 	private String createTime;
-	
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
+	/** 业务字典ID **/
+	private String businessGlossoryId;
+
 	public String getBusinessId() {
 		return businessId;
 	}
@@ -90,4 +84,10 @@ public class BusinessListBo {
 	public void setCreateTime(String createTime) {
 		this.createTime = createTime;
 	}
+	public String getBusinessGlossoryId() {
+		return businessGlossoryId;
+	}
+	public void setBusinessGlossoryId(String businessGlossoryId) {
+		this.businessGlossoryId = businessGlossoryId;
+	}
 }

+ 25 - 0
src/main/java/com/goafanti/customer/controller/BusinessApiController.java

@@ -91,4 +91,29 @@ public class BusinessApiController extends BaseController{
 		businessService.updateBusiness(bfb);
 		return res;
 	}
+	
+	/** 进入跟进单个客户意向 **/
+	@RequestMapping(value = "/toFollowOneBusiness", method = RequestMethod.GET)
+	public Result toFollowOneBusiness(String businessId){
+		Result res = new Result();
+		res.setData(businessService.findBusinessDetail(businessId));
+		return res;
+	}
+	
+	/** 跟进单个客户意向 **/
+	@RequestMapping(value = "/followOneBusiness", method = RequestMethod.POST)
+	public Result followOneBusiness(BussinessFollowBo bfb){
+		Result res = new Result();
+		if(StringUtils.isBlank(bfb.getBusinessId()) ||
+				StringUtils.isBlank(bfb.getUid()) || StringUtils.isBlank(bfb.getOcbId())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
+			return res;
+		}
+		try {
+			businessService.followOneBusiness(bfb);
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
+		return res;
+	}
 }

+ 7 - 0
src/main/java/com/goafanti/customer/service/BusinessService.java

@@ -57,4 +57,11 @@ public interface BusinessService {
 	 * @return
 	 */
 	int updateBusiness(BussinessFollowBo bfb);
+
+	/**
+	 * 跟进单个业务意向
+	 * @param bfb
+	 * @return
+	 */
+	int followOneBusiness(BussinessFollowBo bfb) throws ParseException;
 }

+ 36 - 0
src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java

@@ -130,4 +130,40 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 		return 1;
 	}
 
+	@Override
+	@Transactional
+	public int followOneBusiness(BussinessFollowBo bfb) throws ParseException {
+		Date updateTime = new Date();
+		SimpleDateFormat format = new  SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		UserBusiness userBusiness = new UserBusiness();
+		userBusiness.setId(bfb.getBusinessId());
+		userBusiness.setUpdateTime(updateTime);
+		userBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		userBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
+		UserFollow userFollow = new UserFollow();
+		String followId = UUID.randomUUID().toString();
+		int followCount = userBusinessMapper.judgeBusiness(bfb.getUid(), null, TokenManager.getAdminId()) + 1;
+		userFollow.setId(followId);
+		userFollow.setResult(bfb.getResult());
+		userFollow.setCreateTime(format.parse(bfb.getFollowTime()));
+		userFollow.setEffective(0);
+		userFollow.setOcbId(bfb.getOcbId());
+		userFollow.setFollowCount(followCount);
+		userFollow.setContactType(Integer.parseInt(bfb.getContactType()));
+		userFollow.setAid(TokenManager.getAdminId());
+		userFollowMapper.insert(userFollow);
+		UserFollowBusiness userFollowBusiness = new UserFollowBusiness();
+		String ufbId = UUID.randomUUID().toString();
+		userFollowBusiness.setId(ufbId);
+		userFollowBusiness.setFollowId(followId);
+		userFollowBusiness.setBusinessGlossoryId(Integer.parseInt(bfb.getBusinessGlossoryId()));
+		userFollowBusiness.setBusinessId(bfb.getBusinessId());
+		userFollowBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		userFollowBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		userFollowBusiness.setRemarks(bfb.getRemarks());
+		userFollowBusinessMapper.insert(userFollowBusiness);
+		return 1;
+	}
+
 }