Procházet zdrojové kódy

新增/删除接口

zou_ht před 8 roky
rodič
revize
560652e9b7

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

@@ -24,7 +24,7 @@ public interface CustomerMapper {
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
 	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
 	 */
-	int deleteByPrimaryKey(String id);
+	int deleteCustomerByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer

+ 1 - 1
src/main/java/com/goafanti/common/dao/CustomerOrganizationInfoMapper.java

@@ -23,7 +23,7 @@ public interface CustomerOrganizationInfoMapper {
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
 	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
 	 */
-	int deleteByPrimaryKey(String id);
+	int deleteCustomerOrganizationByCid(String cid);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info

+ 1 - 1
src/main/java/com/goafanti/common/dao/CustomerUserInfoMapper.java

@@ -23,7 +23,7 @@ public interface CustomerUserInfoMapper {
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
 	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
 	 */
-	int deleteByPrimaryKey(String id);
+	int deleteCustomerUserByCid(String cid);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info

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

@@ -125,7 +125,7 @@
     from customer
     where id = #{id,jdbcType=VARCHAR}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+  <delete id="deleteCustomerByPrimaryKey" parameterType="java.lang.String">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
@@ -160,7 +160,7 @@
       #{createTime,jdbcType=TIMESTAMP}, #{followSituation,jdbcType=VARCHAR}, #{customerStatue,jdbcType=VARCHAR}, 
       #{paid,jdbcType=VARCHAR})
   </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
+  <insert id="insertCustomer" parameterType="com.goafanti.common.model.Customer">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.

+ 12 - 0
src/main/java/com/goafanti/common/mapper/CustomerOrganizationInfoMapper.xml

@@ -5,6 +5,7 @@
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="cid" jdbcType="VARCHAR" property="cid" />
     <result column="company_name" jdbcType="VARCHAR" property="companyName" />
+    <result column="company_industry" jdbcType="VARCHAR" property="companyIndustry" />
     <result column="location_province" jdbcType="CHAR" property="locationProvince" />
     <result column="location_city" jdbcType="VARCHAR" property="locationCity" />
     <result column="location_area" jdbcType="VARCHAR" property="locationArea" />
@@ -26,6 +27,9 @@
       <if test="locationProvince != null">
         location_province,
       </if>
+      <if test="companyIndustry != null">
+        company_industry,
+      </if>
       <if test="locationCity != null">
         location_city,
       </if>
@@ -46,6 +50,9 @@
       <if test="companyName != null">
         #{companyName,jdbcType=VARCHAR},
       </if>
+      <if test="companyIndustry != null">
+        #{companyIndustry,jdbcType=VARCHAR},
+      </if>
       <if test="locationProvince != null">
         #{locationProvince,jdbcType=CHAR},
       </if>
@@ -60,4 +67,9 @@
       </if>
     </trim>
   </insert>
+  
+  <delete id="deleteCustomerOrganizationByCid" parameterType="java.lang.String">
+    delete from customer_organization_info 
+    where cid = #{cid,jdbcType=VARCHAR}
+  </delete>
 </mapper>

+ 13 - 0
src/main/java/com/goafanti/common/mapper/CustomerUserInfoMapper.xml

@@ -7,6 +7,7 @@
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="sex" jdbcType="CHAR" property="sex" />
     <result column="mobile" jdbcType="VARCHAR" property="mobile" />
+    <result column="tel_num" jdbcType="VARCHAR" property="telNum" />
     <result column="email" jdbcType="VARCHAR" property="email" />
     <result column="qq" jdbcType="VARCHAR" property="qq" />
     <result column="wechat" jdbcType="VARCHAR" property="wechat" />
@@ -35,6 +36,9 @@
       <if test="mobile != null">
         mobile,
       </if>
+      <if test="telNum != null">
+        tel_num,
+      </if>
       <if test="email != null">
         email,
       </if>
@@ -70,6 +74,9 @@
       <if test="mobile != null">
         #{mobile,jdbcType=VARCHAR},
       </if>
+      <if test="telNum != null">
+        #{telNum,jdbcType=VARCHAR},
+      </if>
       <if test="email != null">
         #{email,jdbcType=VARCHAR},
       </if>
@@ -90,4 +97,10 @@
       </if>
     </trim>
   </insert>
+  
+  <delete id="deleteCustomerUserByCid" parameterType="java.lang.String">
+    delete from customer_user_info 
+    where cid = #{cid,jdbcType=VARCHAR}
+  </delete>
+  
 </mapper>

+ 10 - 20
src/main/java/com/goafanti/common/model/Customer.java

@@ -5,71 +5,61 @@ import java.util.Date;
 public class Customer {
    
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.id
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * id
 	 */
 	private String id;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.aid
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 归属人id
 	 */
 	private String aid;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.customer_typ
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 客户类型(1-个人用户,2-公司用户)
 	 */
 	private String customerTyp;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.share_typ
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 分享类型(1-个人用户,2-公共用户)
 	 */
 	private Integer shareTyp;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.agent_id
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 代理人id
 	 */
 	private String agentId;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.company_intention
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 公司意向
 	 */
 	private String companyIntention;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.create_time
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 创建时间
 	 */
 	private Date createTime;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.follow_situation
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 跟进进度(0-已发项目介绍资料,1-已约面谈,2-已发合同计划书,3-已报价,4-已发合同,5-已签合同,6-面谈中,7-已面签)
 	 */
 	private String followSituation;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.customer_statue
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 客户状态(0-新客户,1-意向客户,2-重点客户,3-面谈客户,4-签单客户,5-被拒绝客户)
 	 */
 	private String customerStatue;
 
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer.paid
-	 * @mbg.generated  Wed Oct 11 15:40:31 CST 2017
+	 * 上级ID
 	 */
 	private String paid;
 

+ 19 - 14
src/main/java/com/goafanti/common/model/CustomerOrganizationInfo.java

@@ -3,38 +3,35 @@ package com.goafanti.common.model;
 public class CustomerOrganizationInfo {
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_organization_info.id
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * ID
 	 */
 	private String id;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_organization_info.cid
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 客户记录id
 	 */
 	private String cid;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_organization_info.company_name
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 *公司名称
 	 */
 	private String companyName;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_organization_info.location_province
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 归属省份
 	 */
 	private String locationProvince;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_organization_info.location_city
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 行业
+	 */
+	private String companyIndustry;
+	/**
+	 * 归属城市
 	 */
 	private String locationCity;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_organization_info.location_area
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 归属地区
 	 */
 	private String locationArea;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_organization_info.adress
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 详细地址
 	 */
 	private String adress;
 
@@ -55,6 +52,14 @@ public class CustomerOrganizationInfo {
 	public void setId(String id) {
 		this.id = id;
 	}
+	
+	public String getCompanyIndustry() {
+		return companyIndustry;
+	}
+
+	public void setCompanyIndustry(String companyIndustry) {
+		this.companyIndustry = companyIndustry;
+	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column customer_organization_info.cid

+ 23 - 22
src/main/java/com/goafanti/common/model/CustomerUserInfo.java

@@ -3,58 +3,51 @@ package com.goafanti.common.model;
 public class CustomerUserInfo {
 
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.id
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * id
 	 */
 	private String id;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.cid
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 客户记录id
 	 */
 	private String cid;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.name
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 个人客户姓名
 	 */
 	private String name;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.sex
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 性别(0-男,1-女)
 	 */
 	private String sex;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.mobile
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 座机号码
 	 */
 	private String mobile;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.email
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 手机号
+	 */
+	private String telNum;
+	/**
+	 * 电子邮件
 	 */
 	private String email;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.qq
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * qq
 	 */
 	private String qq;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.wechat
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 微信
 	 */
 	private String wechat;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.depatrment
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 部门
 	 */
 	private String depatrment;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.customer_position
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 职位
 	 */
 	private String customerPosition;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column customer_user_info.remarks
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 备注
 	 */
 	private String remarks;
 
@@ -147,6 +140,14 @@ public class CustomerUserInfo {
 	public void setMobile(String mobile) {
 		this.mobile = mobile;
 	}
+	
+	public String getTelNum() {
+		return telNum;
+	}
+
+	public void setTelNum(String telNum) {
+		this.telNum = telNum;
+	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column customer_user_info.email

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

@@ -48,13 +48,28 @@ public class AdminCustomerApiController extends CertifyApiController {
 		if(result>0) {
 			/*插入客户个人信息*/
 			cui.setCid(cid);
+			cui.setId(UUID.randomUUID().toString());
 			customerUserService.addCustomerUser(cui);
 			/*插入客户公司信息*/
 			coi.setCid(cid);
+			coi.setId(UUID.randomUUID().toString());
 			customerOrganizationService.addCustomerOrganization(coi);
 		}
 		return res;
 	}
-
+	
+	
+	/**
+	 * 删除
+	 * 
+	 * @return
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.POST)
+	public Result deleteCustomer(String id) throws ParseException {
+		Result res=new Result();
+		
+		return res;
+	}
 
 }

+ 2 - 0
src/main/java/com/goafanti/customer/service/CustomerOrganizationService.java

@@ -4,4 +4,6 @@ import com.goafanti.common.model.CustomerOrganizationInfo;
 
 public interface CustomerOrganizationService {
 	int addCustomerOrganization(CustomerOrganizationInfo coi);
+	
+	void deleteCustomerOrganizationByCid(String cid);
 }

+ 2 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -7,4 +7,6 @@ public interface CustomerService {
 
 	int addCustomer(Customer cus);
 	
+	void deleteCustomer(String id);
+	
 }

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

@@ -4,4 +4,6 @@ import com.goafanti.common.model.CustomerUserInfo;
 
 public interface CustomerUserService {
 	int addCustomerUser(CustomerUserInfo cui);
+	
+	void deleteCustomerUserByCid(String id);
 }

+ 6 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerOrganizationServiceImp.java

@@ -17,4 +17,10 @@ public class CustomerOrganizationServiceImp extends BaseMybatisDao<CustomerOrgan
 		return customerOrganizationInfoMapper.insertCustomerOrganization(coi);
 	}
 
+	@Override
+	public void deleteCustomerOrganizationByCid(String cid) {
+		customerOrganizationInfoMapper.deleteCustomerOrganizationByCid(cid);
+	}
+
+
 }

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

@@ -16,5 +16,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 		int res = customerMapper.insertCustomer(cus);
 		return res;
 	}
+	@Override
+	public void deleteCustomer(String id) {
+		customerMapper.deleteCustomerByPrimaryKey(id);
+	}
 	
 }

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

@@ -17,4 +17,9 @@ public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMappe
 		return customerUserInfoMapper.insertCustomerUser(cui);
 	}
 
+	@Override
+	public void deleteCustomerUserByCid(String cid) {
+		customerUserInfoMapper.deleteCustomerUserByCid(cid);
+	}
+
 }