Browse Source

合并冲突

zou_ht 8 years ago
parent
commit
9ded513f20

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

@@ -417,11 +417,11 @@
     <if test="aid != null">
     	and a.aid = #{aid,jdbcType=VARCHAR}
     </if>
-    <if test="shareTyp != null">
-        and a.share_type = #{shareTyp,jdbcType=INTEGER}
+    <if test="shareType != null">
+        and a.share_type = #{shareType,jdbcType=INTEGER}
     </if>
     <if test="customerType != null">
-        and a.customer_type = #{customerTyp,jdbcType=INTEGER}
+        and a.customer_type = #{customerType,jdbcType=INTEGER}
     </if>
     <if test="customerStauts != null">
     	and a.customer_status = #{customerStauts,jdbcType=INTEGER}
@@ -457,11 +457,11 @@
     <if test="aid != null">
     	and a.aid = #{aid,jdbcType=VARCHAR}
     </if>
-    <if test="shareTyp != null">
-        and a.share_type = #{shareTyp,jdbcType=INTEGER}
+    <if test="shareType != null">
+        and a.share_type = #{shareType,jdbcType=INTEGER}
     </if>
     <if test="customerType != null">
-        and a.customer_type = #{customerTyp,jdbcType=INTEGER}
+        and a.customer_type = #{customerType,jdbcType=INTEGER}
     </if>
     <if test="customerStauts != null">
     	and a.customer_status = #{customerStauts,jdbcType=INTEGER}

+ 11 - 0
src/main/java/com/goafanti/customer/bo/CustomerIn.java

@@ -1,5 +1,6 @@
 package com.goafanti.customer.bo;
 
+
 public class CustomerIn {
 	/** 客户编号 **/
 	private String id;
@@ -7,6 +8,8 @@ public class CustomerIn {
 	private String followId;
 	/** 客户编号 **/
 	private String cuid;
+	/** 跟进时间 **/
+	private String followDate;
 	
 	/** 客户名 **/
 	private String customerName;
@@ -209,6 +212,14 @@ public class CustomerIn {
 	public void setBeforeAdminName(String beforeadminName) {
 		this.beforeAdminName = beforeadminName;
 	}
+
+	public String getFollowDate() {
+		return followDate;
+	}
+
+	public void setFollowDate(String followDate) {
+		this.followDate = followDate;
+	}
 	
 	
 }

+ 28 - 1
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -64,6 +64,7 @@ public class AdminCustomerApiController extends BaseController {
 		String followId=UUID.randomUUID().toString();//跟进记录ID
 		Customer c = new Customer();
 		cusIn.setFollowId(followId);
+		cusIn.setId(customerId);
 		
 		cui.setId(customerUsrId);
 		cui.setCid(customerId);//客户联系人表中的cid
@@ -264,7 +265,7 @@ public class AdminCustomerApiController extends BaseController {
 	 * @return
 	 * @throws ParseException 
 	 */
-	@RequestMapping(value = "addFollow", method = RequestMethod.POST)
+	@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);
@@ -283,9 +284,35 @@ public class AdminCustomerApiController extends BaseController {
 		} catch (IllegalAccessException | InvocationTargetException e) {			
 			e.printStackTrace();
 		}
+		
 		customerService.updateCustomer(cus);
 		return res;
 	}
 	
+	/**
+	 * 查看公司基本信息
+	 * @return
+	 */
+	@RequestMapping(value = "/findCustomerBaseInfo" , method = RequestMethod.GET)
+	public Result findCustomerBaseInfo(String customerId,String customerName){
+		Result res= new Result();
+		CustomerOut cusOut = customerService.findCustomerBaseInfo(customerId);
+		cusOut.setCustomerName(customerName);
+		res.setData(cusOut);
+		return res;
+	}
+	
+	/**
+	 * 查看跟进记录
+	 * @param customerId
+	 * @return
+	 */
+	@RequestMapping(value = "/listFollowUpRecord" , method = RequestMethod.GET)
+	public Result listFollowUpRecord(String customerId){
+		Result res= new Result();
+		res.setData(followUpService.listFollowUpRecord(customerId));
+		return res;
+	}
+	
 	
 }

+ 19 - 3
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -94,13 +94,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	private Map<String,Object> disposeParams(CustomerIn cin){
 		Map<String,Object> params = new HashMap<String,Object>();
 		if(StringUtils.isNotBlank(cin.getAdminName())) params.put("adminName", cin.getAdminName());
-		if(StringUtils.isNotBlank(cin.getAid())) params.put("adminId", cin.getAid());
+		if(StringUtils.isNotBlank(cin.getAid())) params.put("aid", cin.getAid());
 		if(StringUtils.isNotBlank(cin.getCompanyIntention())) params.put("companyIntention", Integer.parseInt(cin.getCompanyIntention()));
 		if(StringUtils.isNotBlank(cin.getContactName())) params.put("contactName", cin.getContactName());
 		if(StringUtils.isNotBlank(cin.getCustomerStatus())) params.put("customerStauts", Integer.parseInt(cin.getCustomerStatus()));
 		if(StringUtils.isNotBlank(cin.getFollowSituation())) params.put("followSituation", Integer.parseInt(cin.getFollowSituation()));
-		if(StringUtils.isNotBlank(cin.getShareTyp())) params.put("shareTyp", Integer.parseInt(cin.getShareTyp()));
-		if(StringUtils.isNotBlank(cin.getCustomerTyp())) params.put("customerTyp", Integer.parseInt(cin.getCustomerTyp()));
+		if(StringUtils.isNotBlank(cin.getShareTyp())) params.put("shareType", Integer.parseInt(cin.getShareTyp()));
+		if(StringUtils.isNotBlank(cin.getCustomerTyp())) params.put("customerType", Integer.parseInt(cin.getCustomerTyp()));
 		if(StringUtils.isNotBlank(cin.getContactTel())) params.put("contactTel", cin.getContactTel());
 		return params;
 	}
@@ -230,5 +230,21 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 		 return customerMapper.updateByPrimaryKeySelective(c);
 	}
 	
+	/**
+	 *  查询客户基本信息
+	 */
+	@Override
+	public CustomerOut findCustomerBaseInfo(String id) {
+		Customer cus = customerMapper.selectByPrimaryKey(id);
+		CustomerOut cusOut = new CustomerOut();
+		try {
+			BeanUtils.copyProperties(cusOut, cus);
+		} catch (IllegalAccessException | InvocationTargetException e) {
+			e.printStackTrace();
+		}
+		if(cusOut != null) setFiled(cusOut);
+		return cusOut;
+	}
+	
 	
 }