Browse Source

新增/删除/列表查询/详情查看

zou_ht 8 years ago
parent
commit
c7a3d283bd

+ 0 - 1
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -266,7 +266,6 @@ public class WebpageController extends BaseController {
 	
 	
 	@RequestMapping(value = "/admin/customer", method = RequestMethod.GET)
 	@RequestMapping(value = "/admin/customer", method = RequestMethod.GET)
 	public ModelAndView adminCustomer(HttpServletRequest request, ModelAndView modelview) {
 	public ModelAndView adminCustomer(HttpServletRequest request, ModelAndView modelview) {
-		System.out.println("用户管理");
 		modelview.setViewName("/admin/customer");
 		modelview.setViewName("/admin/customer");
 		return modelview;
 		return modelview;
 	}
 	}

+ 4 - 7
src/main/java/com/goafanti/common/dao/CustomerMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.CustomerExample;
 import com.goafanti.common.model.CustomerExample;
+import com.goafanti.customer.bo.CustomerOut;
+
 import java.util.List;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -46,7 +48,7 @@ public interface CustomerMapper {
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
 	 * @mbg.generated  Fri Oct 13 15:28:17 CST 2017
 	 * @mbg.generated  Fri Oct 13 15:28:17 CST 2017
 	 */
 	 */
-	Customer selectByPrimaryKey(String id);
+	CustomerOut selectByPrimaryKey(String id);
 
 
 	/**
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
@@ -78,14 +80,9 @@ public interface CustomerMapper {
     Customer selectCustomerByPrimaryKey(String id);
     Customer selectCustomerByPrimaryKey(String id);
 
 
     /**
     /**
-     * 新增
-     */
-    int insertCustomer(Customer cus);
-    
-    /**
      * 
      * 
      * @param ladderId 上层领导ID
      * @param ladderId 上层领导ID
-     * @return �?有包�上层领导ID�? 客户记录
+     * @return �??有包�上层领导ID�?? 客户记录
      */
      */
     List<Customer> selectByLadderId(@Param("ladderId")String ladderId);
     List<Customer> selectByLadderId(@Param("ladderId")String ladderId);
 }
 }

+ 1 - 1
src/main/java/com/goafanti/common/enums/CustomerStatusFiled.java

@@ -15,7 +15,7 @@ public enum CustomerStatusFiled {
 	/** 签单客户 **/
 	/** 签单客户 **/
 	status_sign(4,"签单客户"),
 	status_sign(4,"签单客户"),
 	/** 拒绝客户 **/
 	/** 拒绝客户 **/
-	status_refuse(4,"拒绝客户"),
+	status_refuse(5,"拒绝客户"),
 	/** 未知  **/
 	/** 未知  **/
 	OTHER(-1,"未知");
 	OTHER(-1,"未知");
 	
 	

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

@@ -116,26 +116,40 @@
       order by ${orderByClause}
       order by ${orderByClause}
     </if>
     </if>
   </select>
   </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOut">
     <!--
     <!--
       WARNING - @mbg.generated
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Fri Oct 13 15:28:17 CST 2017.
       This element was generated on Fri Oct 13 15:28:17 CST 2017.
     -->
     -->
     select 
     select 
-    <include refid="Base_Column_List" />
-    from customer
-    where id = #{id,jdbcType=VARCHAR}
+    a.id,
+	a.aid,
+	a.paid,
+	a.share_type as shareType,
+	a.customer_type as customerType,
+	a.customer_status as customerStatus,
+	a.company_intention as companyIntention,
+	a.follow_situation as followSituation,
+	a.tag,
+	a.create_time as createTime, 
+	a.follow_id followId,
+    a.from customer a
+    where effective=0 and id = #{id,jdbcType=VARCHAR}
   </select>
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    <!--
+  <!-- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    
       WARNING - @mbg.generated
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Fri Oct 13 15:28:17 CST 2017.
       This element was generated on Fri Oct 13 15:28:17 CST 2017.
-    -->
+   
     delete from customer
     delete from customer
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
-  </delete>
+  </delete> -->
+  <update id="deleteByPrimaryKey" parameterType="java.lang.String">
+    update customer set effective =1 where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
   <delete id="deleteByExample" parameterType="com.goafanti.common.model.CustomerExample">
   <delete id="deleteByExample" parameterType="com.goafanti.common.model.CustomerExample">
     <!--
     <!--
       WARNING - @mbg.generated
       WARNING - @mbg.generated
@@ -161,7 +175,7 @@
     values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{paid,jdbcType=VARCHAR}, 
     values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{paid,jdbcType=VARCHAR}, 
       #{shareType,jdbcType=INTEGER}, #{customerType,jdbcType=INTEGER}, #{customerStatus,jdbcType=INTEGER}, 
       #{shareType,jdbcType=INTEGER}, #{customerType,jdbcType=INTEGER}, #{customerStatus,jdbcType=INTEGER}, 
       #{companyIntention,jdbcType=CHAR}, #{followSituation,jdbcType=INTEGER}, #{tag,jdbcType=VARCHAR}, 
       #{companyIntention,jdbcType=CHAR}, #{followSituation,jdbcType=INTEGER}, #{tag,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{followId,jdbcType=VARCHAR}, #{effective,jdbcType=INTEGER}
+      #{createTime,jdbcType=TIMESTAMP}, #{followId,jdbcType=VARCHAR}, 0
       )
       )
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
@@ -400,7 +414,7 @@
   <select id="selectCustomerByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOut">
   <select id="selectCustomerByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOut">
     select 
     select 
     a.customer_typ as customerTyp,
     a.customer_typ as customerTyp,
-    a.share_typ as shareTyp,
+    a.share_type as shareTyp,
     a.company_intention as companyIntention,
     a.company_intention as companyIntention,
     a.create_time as createTime,
     a.create_time as createTime,
     a.follow_situation as followSituation,
     a.follow_situation as followSituation,
@@ -417,11 +431,54 @@
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </select> 
   </select> 
   
   
-  <select id="selectCustomer" parameterType="com.goafanti.customer.bo.CustomerIn" resultType="com.goafanti.customer.bo.CustomerOut">
-    select a.id,a.customer_typ as customerTyp,a.share_typ as shareTyp,a.tag,a.follow_situation as followSituation,
-    c.name as contactName,c.mobile,c.tel_num as telNum,
-    d.company_name as customerName,d.location_province as locationProvince,
-    e.name as adminName
+  <select id="selectCustomer"  resultType="com.goafanti.customer.bo.CustomerOut">
+    select a.id,a.customer_type as customerType,a.share_type as shareType,a.company_intention as CompanyIntention,
+    a.tag,a.follow_situation as followSituation,a.customer_status as customerStatus,
+    b.follow_date as followDate,
+    c.name as contactName ,c.mobile,c.tel_num as telNum,
+    d.company_name as companyName,d.location_province as locationProvince,
+    e.name as adminName,
+    b.follow_date as followDate
+    from customer a
+    left join follow_up_record b on a.follow_id = b.id 
+    left join customer_user_info c on b.cuid = c.id 
+    left join customer_organization_info d on a.id = d.cid
+    left join admin e on a.aid = e.id 
+    where a.effective = 0
+    <if test="aid != null">
+    	and a.aid = #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="shareTyp != null">
+        and a.share_type = #{shareTyp,jdbcType=INTEGER}
+    </if>
+    <if test="customerType != null">
+        and a.customer_type = #{customerTyp,jdbcType=INTEGER}
+    </if>
+    <if test="customerStauts != null">
+    	and a.customer_status = #{customerStauts,jdbcType=INTEGER}
+    </if>
+    <if test="companyIntention != null">
+    	and a.company_intention = #{companyIntention,jdbcType=INTEGER}
+    </if>
+    <if test="followSituation != null">
+    	and a.follow_situation = #{followSituation,jdbcType=INTEGER}
+    </if>
+    <if test="contactName != null">
+    	and c.name = #{contactName,jdbcType=VARCHAR}
+    </if>
+    <if test="contactTel != null">
+    	 and c.tel_num = #{contactTel,jdbcType=VARCHAR}
+    </if>
+   	<if test="adminName != null">
+   	 	and e.name = #{adminName,jdbcType=VARCHAR}
+   	</if>
+   	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="selectCustomerCount"  resultType="java.lang.Integer">
+    select count(0)
     from customer a
     from customer a
     left join follow_up_record b on a.follow_id = b.id 
     left join follow_up_record b on a.follow_id = b.id 
     left join customer_user_info c on b.cuid = c.id 
     left join customer_user_info c on b.cuid = c.id 
@@ -432,10 +489,10 @@
     	and a.aid = #{aid,jdbcType=VARCHAR}
     	and a.aid = #{aid,jdbcType=VARCHAR}
     </if>
     </if>
     <if test="shareTyp != null">
     <if test="shareTyp != null">
-        and a.share_typ = #{shareTyp,jdbcType=INTEGER}
+        and a.share_type = #{shareTyp,jdbcType=INTEGER}
     </if>
     </if>
     <if test="customerType != null">
     <if test="customerType != null">
-        and a.customer_typ = #{customerTyp,jdbcType=INTEGER}
+        and a.customer_type = #{customerTyp,jdbcType=INTEGER}
     </if>
     </if>
     <if test="customerStauts != null">
     <if test="customerStauts != null">
     	and a.customer_status = #{customerStauts,jdbcType=INTEGER}
     	and a.customer_status = #{customerStauts,jdbcType=INTEGER}

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

@@ -3,6 +3,9 @@ package com.goafanti.customer.bo;
 public class CustomerIn {
 public class CustomerIn {
 	/** 客户编号 **/
 	/** 客户编号 **/
 	private String id;
 	private String id;
+	/** 客户编号 **/
+	private String followId;
+	
 	/** 客户名 **/
 	/** 客户名 **/
 	private String customerName;
 	private String customerName;
 	
 	
@@ -27,12 +30,18 @@ public class CustomerIn {
 	/** 跟进进度 **/
 	/** 跟进进度 **/
 	private String followSituation;
 	private String followSituation;
 	
 	
+	/** 跟进结果**/
+	private String followResult;
+	
 	/** 跟单人 **/
 	/** 跟单人 **/
 	private String adminName;
 	private String adminName;
 	
 	
 	/** 跟单人ID **/
 	/** 跟单人ID **/
 	private String aid;
 	private String aid;
 	
 	
+	/** 客户标签 **/
+	private String tag;
+	
 	public String getId() {
 	public String getId() {
 		return id;
 		return id;
 	}
 	}
@@ -40,6 +49,15 @@ public class CustomerIn {
 	public void setId(String id) {
 	public void setId(String id) {
 		this.id = id;
 		this.id = id;
 	}
 	}
+	
+
+	public String getFollowId() {
+		return followId;
+	}
+
+	public void setFollowId(String followId) {
+		this.followId = followId;
+	}
 
 
 	public String getCustomerName() {
 	public String getCustomerName() {
 		return customerName;
 		return customerName;
@@ -104,6 +122,14 @@ public class CustomerIn {
 	public void setFollowSituation(String followSituation) {
 	public void setFollowSituation(String followSituation) {
 		this.followSituation = followSituation;
 		this.followSituation = followSituation;
 	}
 	}
+	
+	public String getFollowResult() {
+		return followResult;
+	}
+
+	public void setFollowResult(String followResult) {
+		this.followResult = followResult;
+	}
 
 
 	public String getAdminName() {
 	public String getAdminName() {
 		return adminName;
 		return adminName;
@@ -121,4 +147,13 @@ public class CustomerIn {
 		this.aid = aid;
 		this.aid = aid;
 	}
 	}
 
 
+	public String getTag() {
+		return tag;
+	}
+
+	public void setTag(String tag) {
+		this.tag = tag;
+	}
+	
+	
 }
 }

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

@@ -380,4 +380,21 @@ public class CustomerOut {
 		this.followDate = followDate;
 		this.followDate = followDate;
 	}
 	}
 
 
+	@Override
+	public String toString() {
+		return "CustomerOut [customerType=" + customerType + ", _customerType=" + _customerType + ", id=" + id
+				+ ", customerName=" + customerName + ", cid=" + cid + ", shareType=" + shareType + ", _shareType="
+				+ _shareType + ", companyIntention=" + companyIntention + ", _companyIntention=" + _companyIntention
+				+ ", createTime=" + createTime + ", followSituation=" + followSituation + ", _followSituation="
+				+ _followSituation + ", customerStatus=" + customerStatus + ", _customerStatus=" + _customerStatus
+				+ ", contactName=" + contactName + ", sex=" + sex + ", mobile=" + mobile + ", telNum=" + telNum
+				+ ", email=" + email + ", qq=" + qq + ", wechat=" + wechat + ", depatrment=" + depatrment
+				+ ", customerPosition=" + customerPosition + ", remarks=" + remarks + ", companyName=" + companyName
+				+ ", locationProvince=" + locationProvince + ", companyIndustry=" + companyIndustry + ", locationCity="
+				+ locationCity + ", locationArea=" + locationArea + ", adress=" + adress + ", adminName=" + adminName
+				+ ", followDate=" + followDate + "]";
+	}
+	
+	
+
 }
 }

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

@@ -18,6 +18,7 @@ import com.goafanti.customer.bo.CustomerOut;
 import com.goafanti.customer.service.CustomerOrganizationService;
 import com.goafanti.customer.service.CustomerOrganizationService;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.customer.service.CustomerUserService;
 import com.goafanti.customer.service.CustomerUserService;
+import com.goafanti.customer.service.FollowUpService;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.AFTConstants;
@@ -26,7 +27,9 @@ import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.CustomerOrganizationInfo;
 import com.goafanti.common.model.CustomerOrganizationInfo;
 import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.common.model.CustomerUserInfo;
+import com.goafanti.common.model.FollowUpRecord;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 
 
 @RestController
 @RestController
 @RequestMapping(value = "/api/admin/customer")
 @RequestMapping(value = "/api/admin/customer")
@@ -40,6 +43,8 @@ public class AdminCustomerApiController extends BaseController {
 	private CustomerOrganizationService customerOrganizationService;
 	private CustomerOrganizationService customerOrganizationService;
 	@Resource
 	@Resource
 	private AdminService adminService;
 	private AdminService adminService;
+	@Resource
+	private FollowUpService followUpService;
 
 
 	/**
 	/**
 	 * 新增客户
 	 * 新增客户
@@ -50,22 +55,41 @@ public class AdminCustomerApiController extends BaseController {
 	 * @throws IllegalAccessException 
 	 * @throws IllegalAccessException 
 	 */
 	 */
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
-	public Result addCustomer(CustomerIn cusIn,CustomerOrganizationInfo coi,CustomerUserInfo cui) throws ParseException, IllegalAccessException, InvocationTargetException {
+	public Result addCustomer(CustomerIn cusIn,CustomerOrganizationInfo coi,CustomerUserInfo cui,FollowUpRecord fur) throws ParseException, IllegalAccessException, InvocationTargetException {
 		Result res=new Result();
 		Result res=new Result();
 		//添加 customer
 		//添加 customer
-		String customerId = UUID.randomUUID().toString();
+		String customerId = UUID.randomUUID().toString();//客户记录ID
+		String  customerUsrId= UUID.randomUUID().toString();//客户联系人ID
+		String followId=UUID.randomUUID().toString();//跟进记录ID
 		Customer c = new Customer();
 		Customer c = new Customer();
+		cusIn.setFollowId(followId);
+		
+		cui.setId(customerUsrId);
+		cui.setCid(customerId);//客户联系人表中的cid
+		
+		coi.setId(UUID.randomUUID().toString());//客户公司ID
+		coi.setCid(customerId);//客户公司表中的cid
+		
+		fur.setId(followId);//跟进记录的ID
+		fur.setCid(customerId);//跟进记录表中的cid
+		fur.setCuid(customerUsrId);//跟进记录表中的联系人id
+		fur.setAid(TokenManager.getUserId());
+		/*if(StringUtils.isNotBlank(cusIn.getAid())) fur.setAid(cusIn.getAid());*//*暂时注释*/
+		
 		BeanUtils.copyProperties(c, cusIn);
 		BeanUtils.copyProperties(c, cusIn);
+		c.setShareType(Integer.parseInt(cusIn.getShareTyp()));
+		c.setCustomerType(Integer.parseInt(cusIn.getCustomerTyp()));
 		c.setId(customerId);
 		c.setId(customerId);
+		
 		customerService.addCustomer(c);
 		customerService.addCustomer(c);
 		//插入 customerUserInfo
 		//插入 customerUserInfo
-		coi.setCid(customerId);
-		customerService.addCustomerOrganizationInfo(coi);
+		customerUserService.addCustomerUserInfo(cui);
 		//插入 customerOrganizationInfo
 		//插入 customerOrganizationInfo
-		cui.setCid(customerId);
-		customerService.addCustomerOrganizationInfo(coi);
+		customerOrganizationService.addCustomerOrganizationInfo(coi);
+		//插入跟进表
+		followUpService.addFollowUp(fur,cusIn);
 		//添加日志
 		//添加日志
-		customerService.saveCustomerLogo(cusIn, AFTConstants.CUSTOMER_CREATE);
+		customerService.saveCustomerLogo(cusIn, AFTConstants.CUSTOMER_CREATE,customerId);
 		return res;
 		return res;
 	}
 	}
 	
 	
@@ -79,7 +103,7 @@ public class AdminCustomerApiController extends BaseController {
 	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.POST)
 	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.POST)
 	public Result deleteCustomer(String id) throws ParseException {
 	public Result deleteCustomer(String id) throws ParseException {
 		Result res=new Result();
 		Result res=new Result();
-		//把 customer 的 effective 修改为 1 - 失效
+		customerService.deleteCustomer(id);
 		return res;
 		return res;
 	}
 	}
 	
 	
@@ -122,5 +146,39 @@ public class AdminCustomerApiController extends BaseController {
 		res.setData(boList);
 		res.setData(boList);
 		return res;
 		return res;
 	}
 	}
-
+	
+	
+	/**
+	 * 查询客户资料
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/findCustomerUserDetails", method = RequestMethod.POST)
+	public Result findCustomerUserDetails(String id) {
+		Result res=new Result();
+		res.setData(customerService.findCustomerDetails(id));
+		return res;
+	}
+	
+	/**
+	 * 查询联系人资料
+	 * 
+	 * @return
+	 */
+	public Result findCustomerUserName (String cid) {
+		return null;
+		
+	}
+	
+	
+	/**
+	 * 删除
+	 * 
+	 * @return
+	 */
+	public Result addFollowUpRecord(CustomerIn cusIn,FollowUpRecord fur) throws ParseException, IllegalAccessException, InvocationTargetException {
+		
+		
+		return null;
+	}
 }
 }

+ 6 - 5
src/main/java/com/goafanti/customer/service/CustomerOrganizationService.java

@@ -3,9 +3,10 @@ package com.goafanti.customer.service;
 import com.goafanti.common.model.CustomerOrganizationInfo;
 import com.goafanti.common.model.CustomerOrganizationInfo;
 
 
 public interface CustomerOrganizationService {
 public interface CustomerOrganizationService {
-	int addCustomerOrganization(CustomerOrganizationInfo coi);
-	
-	void deleteCustomerOrganizationByCid(String cid);
-	
-	void updCustomerOrganizationByByPrimaryKey(String cid);
+	/**
+	 * 添加客户公司信息
+	 * @param coi
+	 * @return
+	 */
+	int addCustomerOrganizationInfo(CustomerOrganizationInfo coi);
 }
 }

+ 10 - 16
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -1,8 +1,6 @@
 package com.goafanti.customer.service;
 package com.goafanti.customer.service;
 
 
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.Customer;
-import com.goafanti.common.model.CustomerOrganizationInfo;
-import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.CustomerIn;
 import com.goafanti.customer.bo.CustomerIn;
 import com.goafanti.customer.bo.CustomerOut;
 import com.goafanti.customer.bo.CustomerOut;
@@ -17,19 +15,6 @@ public interface CustomerService {
 	int addCustomer(Customer cus);
 	int addCustomer(Customer cus);
 	
 	
 	/**
 	/**
-	 * 添加客户联系人信息
-	 * @param cui
-	 * @return
-	 */
-	int addCustomerUserInfo(CustomerUserInfo cui);
-	
-	/**
-	 * 添加客户公司信息
-	 * @param coi
-	 * @return
-	 */
-	int addCustomerOrganizationInfo(CustomerOrganizationInfo coi);
-	/**
 	 * 删除客户信息
 	 * 删除客户信息
 	 * @param id
 	 * @param id
 	 */
 	 */
@@ -65,6 +50,15 @@ public interface CustomerService {
 	 * @param cus 添加日志
 	 * @param cus 添加日志
 	 * @param operatorType
 	 * @param operatorType
 	 */
 	 */
-	public void saveCustomerLogo(CustomerIn cus,String operatorType);
+	public void saveCustomerLogo(CustomerIn cus,String operatorType,String cid);
+	
+	/**
+	 * 
+	 * @param 查询客户详情
+	 * @param operatorType
+	 */
+	public CustomerOut findCustomerDetails(String id);
+	
+	
 	
 	
 }
 }

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

@@ -3,9 +3,18 @@ package com.goafanti.customer.service;
 import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.common.model.CustomerUserInfo;
 
 
 public interface CustomerUserService {
 public interface CustomerUserService {
-	int addCustomerUser(CustomerUserInfo cui);
 	
 	
-	void deleteCustomerUserByCid(String id);
+	/**
+	 * 添加客户联系人信息
+	 * @param cui
+	 * @return
+	 */
+	int addCustomerUserInfo(CustomerUserInfo cui);
 	
 	
-	void updCustomerUserByByPrimaryKey(String cid);
+	/**
+	 * 查询联系人姓名列表
+	 * @param cui
+	 * @return
+	 */
+	int findCustomerUserNameList(String cid);
 }
 }

+ 13 - 0
src/main/java/com/goafanti/customer/service/FollowUpService.java

@@ -0,0 +1,13 @@
+package com.goafanti.customer.service;
+
+import com.goafanti.common.model.FollowUpRecord;
+import com.goafanti.customer.bo.CustomerIn;
+
+public interface FollowUpService {
+	/**
+	 * 添加跟进记录
+	 * @param cui
+	 * @return
+	 */
+	int addFollowUp(FollowUpRecord fur,CustomerIn cusIn);
+}

+ 3 - 12
src/main/java/com/goafanti/customer/service/impl/CustomerOrganizationServiceImp.java

@@ -1,5 +1,6 @@
 package com.goafanti.customer.service.impl;
 package com.goafanti.customer.service.impl;
 
 
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -13,18 +14,8 @@ public class CustomerOrganizationServiceImp extends BaseMybatisDao<CustomerOrgan
 	private CustomerOrganizationInfoMapper customerOrganizationInfoMapper ;
 	private CustomerOrganizationInfoMapper customerOrganizationInfoMapper ;
 
 
 	@Override
 	@Override
-	public int addCustomerOrganization(CustomerOrganizationInfo coi) {
-		return customerOrganizationInfoMapper.insertCustomerOrganization(coi);
-	}
-
-	@Override
-	public void deleteCustomerOrganizationByCid(String cid) {
-		customerOrganizationInfoMapper.deleteCustomerOrganizationByCid(cid);
-	}
-
-	@Override
-	public void updCustomerOrganizationByByPrimaryKey(String cid) {
-		customerOrganizationInfoMapper.updateCustomerOrganizationByPrimaryKey(cid);
+	public int addCustomerOrganizationInfo(CustomerOrganizationInfo coi) {
+		return customerOrganizationInfoMapper.insert(coi);
 	}
 	}
 
 
 
 

+ 53 - 55
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -18,16 +18,12 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.CustomerLogMapper;
 import com.goafanti.common.dao.CustomerLogMapper;
 import com.goafanti.common.dao.CustomerMapper;
 import com.goafanti.common.dao.CustomerMapper;
-import com.goafanti.common.dao.CustomerOrganizationInfoMapper;
-import com.goafanti.common.dao.CustomerUserInfoMapper;
 import com.goafanti.common.enums.CustomerFollowFiled;
 import com.goafanti.common.enums.CustomerFollowFiled;
 import com.goafanti.common.enums.CustomerIntentionFiled;
 import com.goafanti.common.enums.CustomerIntentionFiled;
 import com.goafanti.common.enums.CustomerStatusFiled;
 import com.goafanti.common.enums.CustomerStatusFiled;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.CustomerLog;
 import com.goafanti.common.model.CustomerLog;
-import com.goafanti.common.model.CustomerOrganizationInfo;
-import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
 @Service
 @Service
 public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implements CustomerService {
 public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implements CustomerService {
@@ -37,13 +33,12 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	private AdminMapper adminMapper;
 	private AdminMapper adminMapper;
 	@Autowired
 	@Autowired
 	private CustomerLogMapper CustomerLogMapper;
 	private CustomerLogMapper CustomerLogMapper;
-	@Autowired
-	private CustomerOrganizationInfoMapper customerOrganizationInfoMapper;
-	@Autowired
-	private CustomerUserInfoMapper customerUserInfoMapper;
 	@Override
 	@Override
 	public int addCustomer(Customer cus) {
 	public int addCustomer(Customer cus) {
-		int res = customerMapper.insertCustomer(cus);
+		Date data =new Date();
+		cus.setCreateTime(data);
+		cus.setAid(TokenManager.getUserId().toString());
+		int res = customerMapper.insert(cus);
 		return res;
 		return res;
 	}
 	}
 
 
@@ -111,47 +106,51 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	}
 	}
 	private List<CustomerOut> setResult(List<CustomerOut> list){
 	private List<CustomerOut> setResult(List<CustomerOut> list){
 		for(CustomerOut co :list){
 		for(CustomerOut co :list){
-			switch(co.getShareType()){
-				case 0 : co.set_shareType("个人客户");
-				case 1 : co.set_shareType("公共客户");
-			}
-			switch(co.getCustomerStatus()){
-				case 0 : co.set_customerStatus("新客户");
-				case 1 : co.set_customerStatus("意向客户");
-				case 2 : co.set_customerStatus("重点客户");
-				case 3 : co.set_customerStatus("面谈客户");
-				case 4 : co.set_customerStatus("签单客户");
-				case 5 : co.set_customerStatus("被拒绝客户");
-			}
-			switch(co.getFollowSituation()){
-				case 0 : co.set_followSituation("已发项目介绍资料");
-				case 1 : co.set_followSituation("已约面谈");
-				case 2 : co.set_followSituation("已发合同计划书");
-				case 3 : co.set_followSituation("已报价");
-				case 4 : co.set_followSituation("已发合同");
-				case 5 : co.set_followSituation("已签合同");
-				case 6 : co.set_followSituation("面谈中");
-				case 7 : co.set_followSituation("已面签");
-			}
-			String[] temp = co.getCompanyIntention().split(",");
-			String _companyIntention = "";
-			if(temp.length>0){
-				for(String s:temp){
-					if(s.equals("0")) _companyIntention += "发明专利&nbsp;";
-					if(s.equals("1")) _companyIntention += "实用型新型专利&nbsp;";
-					if(s.equals("2")) _companyIntention += "外观专利&nbsp;";
-					if(s.equals("3")) _companyIntention += "软件著作权&nbsp;";
-					if(s.equals("4")) _companyIntention += "知识产权贯标&nbsp;";
-					if(s.equals("5")) _companyIntention += "高企认定&nbsp;";
-					if(s.equals("0")) _companyIntention += "技术成果&nbsp;";
-				}
-				_companyIntention = _companyIntention.substring(0, _companyIntention.length()-6);
-			}
-			co.set_companyIntention(_companyIntention);
+			setFiled(co);
 		}
 		}
 		return list;
 		return list;
 	}
 	}
 	
 	
+	private CustomerOut setFiled(CustomerOut co) {
+		switch(co.getShareType()){
+			case 0 : co.set_shareType("个人客户") ;break;
+			case 1 : co.set_shareType("公共客户") ;break;
+		}
+		switch(co.getCustomerStatus()){
+			case 0 : co.set_customerStatus("新客户") ;break;
+			case 1 : co.set_customerStatus("意向客户") ;break;
+			case 2 : co.set_customerStatus("重点客户") ;break;
+			case 3 : co.set_customerStatus("面谈客户") ;break;
+			case 4 : co.set_customerStatus("签单客户") ;break;
+			case 5 : co.set_customerStatus("被拒绝客户") ;break;
+		}
+		switch(co.getFollowSituation()){
+			case 0 : co.set_followSituation("已发项目介绍资料") ;break; 
+			case 1 : co.set_followSituation("已约面谈") ;break;
+			case 2 : co.set_followSituation("已发合同计划书") ;break;
+			case 3 : co.set_followSituation("已报价") ;break;
+			case 4 : co.set_followSituation("已发合同") ;break;
+			case 5 : co.set_followSituation("已签合同") ;break;
+			case 6 : co.set_followSituation("面谈中") ;break;
+			case 7 : co.set_followSituation("已面签") ;break;
+		}
+		String[] temp = co.getCompanyIntention().split(",");
+		String _companyIntention = "";
+		if(temp.length>0){
+			for(String s:temp){
+				if(s.equals("0")) _companyIntention += "发明专利&nbsp;";
+				if(s.equals("1")) _companyIntention += "实用型新型专利&nbsp;";
+				if(s.equals("2")) _companyIntention += "外观专利&nbsp;";
+				if(s.equals("3")) _companyIntention += "软件著作权&nbsp;";
+				if(s.equals("4")) _companyIntention += "知识产权贯标&nbsp;";
+				if(s.equals("5")) _companyIntention += "高企认定&nbsp;";
+				if(s.equals("0")) _companyIntention += "技术成果&nbsp;";
+			}
+			_companyIntention = _companyIntention.substring(0, _companyIntention.length()-6);
+		}
+		co.set_companyIntention(_companyIntention);
+		return co;
+	}
 	/**
 	/**
 	 * 获取客户意向
 	 * 获取客户意向
 	 * @param intentions
 	 * @param intentions
@@ -169,18 +168,20 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	}
 	}
 	
 	
 	@Override
 	@Override
-	public void saveCustomerLogo(CustomerIn cus,String operatorType){
+	public void saveCustomerLogo(CustomerIn cus,String operatorType,String cid){
 		/* 记录日志 */
 		/* 记录日志 */
 		CustomerLog log = new CustomerLog();
 		CustomerLog log = new CustomerLog();
 		log.setId(UUID.randomUUID().toString());
 		log.setId(UUID.randomUUID().toString());
-		log.setCid(cus.getId());
+		log.setCid(cid);
 		log.setOperatorTime(new Date());
 		log.setOperatorTime(new Date());
 		log.setOperatorName(TokenManager.getAdminToken().getName());
 		log.setOperatorName(TokenManager.getAdminToken().getName());
 		log.setAfterFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getFollowSituation())).getDesc()); //跟进状态
 		log.setAfterFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getFollowSituation())).getDesc()); //跟进状态
 		log.setAfterCustomerIntention(getCompanyIntention(cus.getCompanyIntention())); //跟进意向
 		log.setAfterCustomerIntention(getCompanyIntention(cus.getCompanyIntention())); //跟进意向
 		log.setAfterCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getCustomerStatus())).getDesc()); //客户状态
 		log.setAfterCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getCustomerStatus())).getDesc()); //客户状态
 		if(operatorType.equals(AFTConstants.CUSTOMER_CREATE)){//创建用户
 		if(operatorType.equals(AFTConstants.CUSTOMER_CREATE)){//创建用户
-			log.setAfterAdminName(adminMapper.selectByPrimaryKey(cus.getAid()).getName()); //接单人
+			//暂时注释为了测试
+			/*log.setAfterAdminName(adminMapper.selectByPrimaryKey(cus.getAid()).getName());*/ //接单人
+			log.setAfterAdminName(adminMapper.selectByPrimaryKey(TokenManager.getUserId()).getName());
 			log.setOperatorType(AFTConstants.CUSTOMER_CREATE);
 			log.setOperatorType(AFTConstants.CUSTOMER_CREATE);
 		}else if(operatorType.equals(AFTConstants.CUSTOMER_MODIFY)){ //修改用户
 		}else if(operatorType.equals(AFTConstants.CUSTOMER_MODIFY)){ //修改用户
 			
 			
@@ -193,12 +194,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	}
 	}
 
 
 	@Override
 	@Override
-	public int addCustomerUserInfo(CustomerUserInfo cui) {
-		return customerUserInfoMapper.insert(cui);
+	public CustomerOut findCustomerDetails(String id) {
+		 return setFiled(customerMapper.selectByPrimaryKey(id));
 	}
 	}
 
 
-	@Override
-	public int addCustomerOrganizationInfo(CustomerOrganizationInfo coi) {
-		return customerOrganizationInfoMapper.insert(coi);
-	}
+	
 }
 }

+ 5 - 8
src/main/java/com/goafanti/customer/service/impl/CustomerUserServiceImp.java

@@ -1,5 +1,6 @@
 package com.goafanti.customer.service.impl;
 package com.goafanti.customer.service.impl;
 
 
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -13,18 +14,14 @@ public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMappe
 	private CustomerUserInfoMapper customerUserInfoMapper ;
 	private CustomerUserInfoMapper customerUserInfoMapper ;
 
 
 	@Override
 	@Override
-	public int addCustomerUser(CustomerUserInfo cui) {
-		return customerUserInfoMapper.insertCustomerUser(cui);
+	public int addCustomerUserInfo(CustomerUserInfo cui) {
+		return customerUserInfoMapper.insert(cui);
 	}
 	}
 
 
 	@Override
 	@Override
-	public void deleteCustomerUserByCid(String cid) {
-		customerUserInfoMapper.deleteCustomerUserByCid(cid);
+	public int findCustomerUserNameList(String cid) {
+		return 0;
 	}
 	}
 
 
-	@Override
-	public void updCustomerUserByByPrimaryKey(String cid) {
-		customerUserInfoMapper.updateCustomerUserByPrimaryKey(cid);
-	}
 
 
 }
 }

+ 29 - 0
src/main/java/com/goafanti/customer/service/impl/FollowUpServiceImp.java

@@ -0,0 +1,29 @@
+package com.goafanti.customer.service.impl;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.CustomerUserInfoMapper;
+import com.goafanti.common.dao.FollowUpRecordMapper;
+import com.goafanti.common.model.FollowUpRecord;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.customer.bo.CustomerIn;
+import com.goafanti.customer.service.FollowUpService;
+@Service
+public class FollowUpServiceImp extends BaseMybatisDao<CustomerUserInfoMapper>  implements FollowUpService{
+	@Autowired
+	private FollowUpRecordMapper followUpRecordMapper ;
+
+	@Override
+	public int addFollowUp(FollowUpRecord fur,CustomerIn cusIn) {
+		fur.setFollowDate(new Date());
+		if(StringUtils.isNotBlank(cusIn.getFollowSituation())) fur.setFollowStatus( Integer.parseInt(cusIn.getFollowSituation()));
+		if(StringUtils.isNotBlank(cusIn.getFollowResult())) fur.setFollowResult(cusIn.getFollowResult());
+		return followUpRecordMapper.insert(fur);
+	}
+
+
+}

+ 0 - 1
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -749,7 +749,6 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 
 	@Override
 	@Override
 	public ArrayList<DemandListBo> selectDemandList(Integer boutique) {
 	public ArrayList<DemandListBo> selectDemandList(Integer boutique) {
-		System.out.println(TokenManager.getUserId());
 		return demandMapper.selectDemandList(boutique);
 		return demandMapper.selectDemandList(boutique);
 	}
 	}
 
 

+ 0 - 1
src/main/java/com/goafanti/portal/controller/PortalInterestApiController.java

@@ -138,7 +138,6 @@ public class PortalInterestApiController extends CertifyApiController{
 		Result res = new Result();
 		Result res = new Result();
 
 
 		if (StringUtils.isBlank(id)) {
 		if (StringUtils.isBlank(id)) {
-			System.out.println("找不到成果ID");
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "科技成果ID"));
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "科技成果ID"));
 			return res;
 			return res;
 		}
 		}

+ 0 - 1
src/main/java/com/goafanti/portal/controller/PortalOrderApiController.java

@@ -183,7 +183,6 @@ public class PortalOrderApiController extends CertifyApiController {
 		BeanUtils.copyProperties(order, achievementOrder);
 		BeanUtils.copyProperties(order, achievementOrder);
 		BeanUtils.copyProperties(order, aol);
 		BeanUtils.copyProperties(order, aol);
 		achievementOrderService.saveAchievementOrder(achievementOrder, aol);
 		achievementOrderService.saveAchievementOrder(achievementOrder, aol);
-		System.out.println("已完成下单");
 		return res;
 		return res;
 	}
 	}