Quellcode durchsuchen

客户资料相关接口开发

anderx vor 7 Jahren
Ursprung
Commit
6692f6d8ae

+ 15 - 0
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -1129,6 +1129,21 @@
       <if test="investment != null">
         investment = #{investment,jdbcType=INTEGER},
       </if>
+      <if test=" yearSalesAmount!= null">
+        year_sales_amount = #{yearSalesAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="lastYearResearchAmount != null">
+        last_year_research_amount = #{lastYearResearchAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="assets != null">
+        assets = #{assets,jdbcType=DECIMAL},
+      </if>
+      <if test=" qualification!= null">
+        qualification = #{qualification,jdbcType=VARCHAR},
+      </if>
+      <if test=" cooperationSituation!= null">
+        cooperation_situation= #{cooperationSituation,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>

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

@@ -177,7 +177,7 @@
       introduction, value_added_tag, organization_id, 
       identify_name, background_url, audit_opinion, 
       audit_status, share_type, aid, 
-      transfer_time)
+      transfer_time,information_maintainer)
     values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
       #{nickname,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
       #{number,jdbcType=BIGINT}, #{lvl,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{mid,jdbcType=VARCHAR}, 
@@ -186,7 +186,7 @@
       #{introduction,jdbcType=VARCHAR}, #{valueAddedTag,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR}, 
       #{identifyName,jdbcType=VARCHAR}, #{backgroundUrl,jdbcType=VARCHAR}, #{auditOpinion,jdbcType=VARCHAR}, 
       #{auditStatus,jdbcType=INTEGER}, #{shareType,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, 
-      #{transferTime,jdbcType=TIMESTAMP})
+      #{transferTime,jdbcType=TIMESTAMP},#{informationMaintainer,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.User">
     <!--
@@ -581,10 +581,21 @@
       <if test="aid != null">
         aid = #{aid,jdbcType=VARCHAR},
       </if>
-      
       <if test="transferTime != null">
         transfer_time = #{transferTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="informationMaintainer != null">
+         information_maintainer= #{informationMaintainer,jdbcType=VARCHAR},
+      </if>
+      <if test="coreTechnology != null">
+         core_technology= #{coreTechnology,jdbcType=VARCHAR},
+      </if>
+      <if test="accomplishSituation != null">
+         accomplish_situation= #{accomplishSituation,jdbcType=VARCHAR},
+      </if>
+      <if test="intellectualProperty != null">
+         intellectual_property= #{intellectualProperty,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>

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

@@ -666,7 +666,7 @@
 	</select>
 	
 	<select id="findOrganizationCustomerDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOrganizationDetailBo">
-		select 
+		 select 
 			a.id as uid,
 			a.society_tag as societyTag,
 			a.company_logo_url as companyLogoUrl,
@@ -693,7 +693,16 @@
 			b.contact_mobile as contactMobile,
 			b.licence_number as licenceNumber,
 			a.aid as aid,
-			d.name as adminName
+			d.name as adminName,
+			a.information_maintainer as informationMaintainer,
+			a.core_technology as coreTechnology,
+			a. accomplish_situation as  accomplishSituation,
+			a.intellectual_property as  intellectualProperty,
+			b.year_sales_amount as  yearSalesAmount,
+			b.last_year_research_amount as  lastYearResearchAmount,
+			b.assets,
+			b.qualification,
+			b.cooperation_situation as  cooperationSituation
 		from 
 			user a inner join organization_identity b on a.id = b.uid
 			left join admin d on d.id = a.aid
@@ -1668,4 +1677,142 @@
 		and a.create_time &gt; #{dailyStart,jdbcType=VARCHAR}
 		and a.create_time &lt; #{dailyEnd,jdbcType=VARCHAR}
 	</select>
+	
+	<select id="selectCustomerInformationList" resultType="com.goafanti.customer.bo.CustomerListIn">
+		select a.id,a.nickname as name,c.name as province,c1.name as city,c2.name as area,b.contacts,b.contact_mobile as contactMobile,
+			a.create_time as createTime,d.name as industry
+			from user a left join organization_identity b 
+			on a.id=b.uid left join district_glossory c 
+			on b.location_province=c.id left join district_glossory c1 
+			on b.location_city=c1.id left join district_glossory c2 
+			on b.location_area=c2.id left join industry_category d on b.industry = d.id
+			where a.information_maintainer = #{aid,jdbcType=VARCHAR}
+			<if test="type !=null and type!=''">
+			and a.`type`=#{type,jdbcType=VARCHAR}
+			</if>
+			<if test="name!=null and name!=''">
+			and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
+			</if>
+			<if test="province!=null and province!=''">
+			and b.location_province= #{province,jdbcType=VARCHAR}
+			</if>
+			<if test="city!=null and city!=''">
+			and b.location_city=#{city,jdbcType=VARCHAR}
+			</if>
+			<if test="area !=null and area !=''">
+			and b.location_area= #{area,jdbcType=VARCHAR}
+			</if>
+			<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; #{endDate}
+			</if>
+		 order by a.create_time desc
+		 <if test="page_sql != null">
+    		${page_sql}
+   		 </if>
+	</select>
+	<select id="selectCustomerInformationCount" resultType="java.lang.Integer">
+		select count(0)
+			from user a left join organization_identity b 
+			on a.id=b.uid 
+			where a.information_maintainer = #{aid,jdbcType=VARCHAR}
+			<if test="type !=null and type!=''">
+			and a.`type`=#{type,jdbcType=VARCHAR}
+			</if>
+			<if test="name!=null and name!=''">
+			and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
+			</if>
+			<if test="province!=null and province!=''">
+			and b.location_province= #{province,jdbcType=VARCHAR}
+			</if>
+			<if test="city!=null and city!=''">
+			and b.location_city=#{city,jdbcType=VARCHAR}
+			</if>
+			<if test="area !=null and area !=''">
+			and b.location_area= #{area,jdbcType=VARCHAR}
+			</if>
+			<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; #{endDate}
+			</if>
+	</select>
+	
+	
+		<select id="selectDepCustomerInformationList" resultType="com.goafanti.customer.bo.CustomerListIn">
+		select a.id,a.nickname as name,c.name as province,c1.name as city,c2.name as area,b.contacts,b.contact_mobile as contactMobile,
+			a.create_time as createTime,d.name as industry
+			from user a left join organization_identity b 
+			on a.id=b.uid left join district_glossory c 
+			on b.location_province=c.id left join district_glossory c1 
+			on b.location_city=c1.id left join district_glossory c2 
+			on b.location_area=c2.id left join industry_category d 
+			on b.industry = d.id inner join (select id
+			from admin
+			where id=   #{aid,jdbcType=VARCHAR}
+			or superior_id=  #{aid,jdbcType=VARCHAR}
+			) y
+			on y.id=a.information_maintainer
+			where 1=1
+			<if test="type !=null and type!=''">
+			and a.`type`=#{type,jdbcType=VARCHAR}
+			</if>
+			<if test="name!=null and name!=''">
+			and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
+			</if>
+			<if test="province!=null and province!=''">
+			and b.location_province= #{province,jdbcType=VARCHAR}
+			</if>
+			<if test="city!=null and city!=''">
+			and b.location_city=#{city,jdbcType=VARCHAR}
+			</if>
+			<if test="area !=null and area !=''">
+			and b.location_area= #{area,jdbcType=VARCHAR}
+			</if>
+			<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; #{endDate}
+			</if>
+		 order by a.create_time desc
+		 <if test="page_sql != null">
+    		${page_sql}
+   		 </if>
+	</select>
+	<select id="selectDepCustomerInformationCount" resultType="java.lang.Integer">
+		select count(0)
+			from user a left join organization_identity b 
+			on a.id=b.uid  inner join (select id
+			from admin
+			where id=   #{aid,jdbcType=VARCHAR}
+			or superior_id=  #{aid,jdbcType=VARCHAR}
+			) y
+			on y.id=a.information_maintainer
+			where 1=1
+			<if test="type !=null and type!=''">
+			and a.`type`=#{type,jdbcType=VARCHAR}
+			</if>
+			<if test="name!=null and name!=''">
+			and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
+			</if>
+			<if test="province!=null and province!=''">
+			and b.location_province= #{province,jdbcType=VARCHAR}
+			</if>
+			<if test="city!=null and city!=''">
+			and b.location_city=#{city,jdbcType=VARCHAR}
+			</if>
+			<if test="area !=null and area !=''">
+			and b.location_area= #{area,jdbcType=VARCHAR}
+			</if>
+			<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; #{endDate}
+			</if>
+	</select>
 </mapper>

+ 52 - 0
src/main/java/com/goafanti/common/model/OrganizationIdentity.java

@@ -320,7 +320,59 @@ public class OrganizationIdentity {
 	 * @mbg.generated  Thu Nov 30 17:32:28 CST 2017
 	 */
 	private Integer investment;
+	
+	/** '年度销售额'*/
+	private BigDecimal  yearSalesAmount;
+	  /**'上年度研发费用'*/
+	private BigDecimal lastYearResearchAmount;
+	/**  '总资产情况'*/
+	private BigDecimal assets;
+	/** '企业资质情况(特殊资质)'*/
+	private String qualification;
+	/** '企业与高校院所(科研单位)合作情况'*/
+	private String cooperationSituation;
+	
+	public BigDecimal getYearSalesAmount() {
+		return yearSalesAmount;
+	}
+
+	public void setYearSalesAmount(BigDecimal yearSalesAmount) {
+		this.yearSalesAmount = yearSalesAmount;
+	}
+
+	public BigDecimal getLastYearResearchAmount() {
+		return lastYearResearchAmount;
+	}
+
+	public void setLastYearResearchAmount(BigDecimal lastYearResearchAmount) {
+		this.lastYearResearchAmount = lastYearResearchAmount;
+	}
+
+	public BigDecimal getAssets() {
+		return assets;
+	}
+
+	public void setAssets(BigDecimal assets) {
+		this.assets = assets;
+	}
+
+	public String getQualification() {
+		return qualification;
+	}
+
+	public void setQualification(String qualification) {
+		this.qualification = qualification;
+	}
+
+	public String getCooperationSituation() {
+		return cooperationSituation;
+	}
+
+	public void setCooperationSituation(String cooperationSituation) {
+		this.cooperationSituation = cooperationSituation;
+	}
 
+	
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_identity.id
 	 * @return  the value of organization_identity.id

+ 48 - 0
src/main/java/com/goafanti/common/model/User.java

@@ -138,6 +138,54 @@ public class  User  extends BaseModel implements AftUser{
 	 * @mbg.generated  Thu May 03 16:11:41 CST 2018
 	 */
 	private Date transferTime;
+	
+	
+	/**  '资料维护人'*/
+	private String informationMaintainer;
+	/** '核心技术'*/
+	private String coreTechnology;
+	/** '客户已完成项目情况'*/
+	private String accomplishSituation;
+	/** '已有知识产权情况'*/
+	private String intellectualProperty;
+	
+	
+
+	public String getInformationMaintainer() {
+		return informationMaintainer;
+	}
+
+	public void setInformationMaintainer(String informationMaintainer) {
+		this.informationMaintainer = informationMaintainer;
+	}
+
+	public String getCoreTechnology() {
+		return coreTechnology;
+	}
+
+	public void setCoreTechnology(String coreTechnology) {
+		this.coreTechnology = coreTechnology;
+	}
+
+	public String getAccomplishSituation() {
+		return accomplishSituation;
+	}
+
+	public void setAccomplishSituation(String accomplishSituation) {
+		this.accomplishSituation = accomplishSituation;
+	}
+
+	public String getIntellectualProperty() {
+		return intellectualProperty;
+	}
+
+	public void setIntellectualProperty(String intellectualProperty) {
+		this.intellectualProperty = intellectualProperty;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user.id

+ 46 - 0
src/main/java/com/goafanti/customer/bo/CustomerListIn.java

@@ -2,6 +2,10 @@ package com.goafanti.customer.bo;
 
 
 public class CustomerListIn {
+	/**
+	 * 客户ID
+	 */
+	private String id;
 	/** 客户类型  0-个人 1-单位**/
 	private String type;
 	
@@ -38,6 +42,16 @@ public class CustomerListIn {
 	/** 社会性质 **/
 	private String societyTag;
 	
+	/** 联系人 **/
+	private String contacts;
+	/** 联系人电话 **/
+	private String contactMobile;
+	/**
+	 * 创建时间
+	 */
+	private String createTime;
+	
+	
 	public String getType() {
 		return type;
 	}
@@ -133,4 +147,36 @@ public class CustomerListIn {
 	public void setSocietyTag(String societyTag) {
 		this.societyTag = societyTag;
 	}
+
+	public String getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile;
+	}
+
+	public String getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(String createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
 }

+ 34 - 0
src/main/java/com/goafanti/customer/bo/CustomerOrganizationDetailBo.java

@@ -9,6 +9,40 @@ public class CustomerOrganizationDetailBo extends OrganizationIdentity{
 	private String introduction;
 	private Integer businessAudit;
 	private String licenceNumber;
+	
+	/**  '资料维护人'*/
+	private String informationMaintainer;
+	/** '核心技术'*/
+	private String coreTechnology;
+	/** '客户已完成项目情况'*/
+	private String accomplishSituation;
+	/** '已有知识产权情况'*/
+	private String intellectualProperty;
+	
+	public String getInformationMaintainer() {
+		return informationMaintainer;
+	}
+	public void setInformationMaintainer(String informationMaintainer) {
+		this.informationMaintainer = informationMaintainer;
+	}
+	public String getCoreTechnology() {
+		return coreTechnology;
+	}
+	public void setCoreTechnology(String coreTechnology) {
+		this.coreTechnology = coreTechnology;
+	}
+	public String getAccomplishSituation() {
+		return accomplishSituation;
+	}
+	public void setAccomplishSituation(String accomplishSituation) {
+		this.accomplishSituation = accomplishSituation;
+	}
+	public String getIntellectualProperty() {
+		return intellectualProperty;
+	}
+	public void setIntellectualProperty(String intellectualProperty) {
+		this.intellectualProperty = intellectualProperty;
+	}
 	public String getLicenceNumber() {
 		return licenceNumber;
 	}

+ 2 - 0
src/main/java/com/goafanti/customer/bo/CustomerPersonalDetailBo.java

@@ -12,6 +12,8 @@ public class CustomerPersonalDetailBo extends UserIdentity{
 	private Integer releaseStatus;
 	private String aid;
 	private String adminName;
+	
+
 	public String getAdminName() {
 		return adminName;
 	}

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

@@ -181,7 +181,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		Result res = new Result();
 		if(StringUtils.isBlank(name) || StringUtils.isBlank(contacts)
 				|| StringUtils.isBlank(contactMobile) || StringUtils.isBlank(societyTag)){
-			res.getError().add(buildError("客户名称、联系人、联系电话、社会性质不能为空"));
+			res.getError().add(buildError("","客户名称、联系人、联系电话、社会性质不能为空"));
 			return res;
 		}
 		customerService.addCustomer(name, contacts, contactMobile,type,source,societyTag);
@@ -983,4 +983,29 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.setData(customerService.updateAgainProjectTask(uid,projectId,aid));
 		return res;
 	}
+	/** 客户资料转交 **/
+	@RequestMapping(value = "/updateInformationMaintainerr", method = RequestMethod.POST)
+	public Result updateInformationMaintainerr(String id,String aid){
+		Result res = new Result();
+		if(StringUtils.isBlank(id) || StringUtils.isBlank(aid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,""));
+			return res;
+		} 
+		res.data(customerService.updateInformationMaintainerr(id,aid));
+		return res;
+	}
+	/** 个人客户信息列表 **/
+	@RequestMapping(value = "/listCustomerInformation", method = RequestMethod.POST)
+	public Result listCustomerInformation(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.data(customerService.listCustomerInformation(cli,pageNo,pageSize));
+		return res;
+	}
+	/** 所属客户信息列表 **/
+	@RequestMapping(value = "/listDepCustomerInformation", method = RequestMethod.POST)
+	public Result listDepCustomerInformation(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.data(customerService.listDepCustomerInformation(cli,pageNo,pageSize));
+		return res;
+	}
 }

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

@@ -472,5 +472,28 @@ public interface CustomerService {
 	 * @return
 	 */
 	int updateAgainProjectTask(String uid, String projectId, String aid);
+	/**
+	 * 客户资料转交
+	 * @param id
+	 * @param aid
+	 * @return
+	 */
+	int updateInformationMaintainerr(String id, String aid);
+	/**
+	 * 个人客户资料列表
+	 * @param cli
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<CustomerListIn> listCustomerInformation(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	/**
+	 * 部门客户资料列表
+	 * @param cli
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<CustomerListIn> listDepCustomerInformation(CustomerListIn cli, Integer pageNo, Integer pageSize);
 	
 }

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

@@ -228,6 +228,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		user.setUpdateTime(now);
 		user.setMobile(contactMobile);
 		user.setPassword(AFTConstants.INITIALPASSWORD);
+		user.setInformationMaintainer(TokenManager.getAdminId());
 		passwordUtil.encryptPassword(user);
 		if(type == UserType.PERSONAL.getCode()){
 			if(userMapper.checkUser("", "", contactMobile, type,null,null).size()>0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_EXIST, name,""));
@@ -295,6 +296,10 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 			user.setCompanyLogoUrl(bo.getCompanyLogoUrl());
 			user.setIntroduction(bo.getIntroduction());
 			user.setUpdateTime(new Date());
+			user.setInformationMaintainer(bo.getInformationMaintainer());
+			user.setCoreTechnology(bo.getCoreTechnology());
+			user.setAccomplishSituation(bo.getAccomplishSituation());
+			user.setIntellectualProperty(bo.getIntellectualProperty());
 		} catch (IllegalAccessException |InvocationTargetException e) {
 			e.printStackTrace();
 		} 
@@ -519,6 +524,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		}
 	
 
+	@SuppressWarnings("unused")
 	private void releaseProject(List<LockingReleaseBo> businessLockedList) {
 		if(businessLockedList != null && businessLockedList.size()>0){
 			UserLockRelease ulr = null;
@@ -822,6 +828,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		if(operatorType.equals(AFTConstants.USER_RECEIVE)){
 			user.setAid(TokenManager.getAdminId());
 			user.setShareType(AFTConstants.USER_SHARE_PRIVATE);
+			user.setInformationMaintainer(TokenManager.getAdminId());
 			user.setTransferTime(now);
 			flag = addUserLock(uid,TokenManager.getAdminId(),now); //指定用户锁定客户
 			if(flag <= 0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_RECEIVE,""));
@@ -1272,4 +1279,34 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		}
 		return 0;
 	}
+
+	@Override
+	public int updateInformationMaintainerr(String id, String aid) {
+		User u=new User();
+		u.setId(id);
+		u.setInformationMaintainer(aid);
+		return userMapper.updateByPrimaryKeySelective(u);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CustomerListIn> listCustomerInformation(CustomerListIn cli, Integer pageNo, Integer pageSize) {
+			cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
+			cli.setAid(TokenManager.getAdminId());
+			//cli.setAid("1");
+			cli.setShareType(String.valueOf(AFTConstants.USER_SHARE_PRIVATE));
+			Map<String,Object> params = disposeParams(cli);
+			return (Pagination<CustomerListIn>) findPage("selectCustomerInformationList","selectCustomerInformationCount",params,pageNo,pageSize);
+			}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CustomerListIn> listDepCustomerInformation(CustomerListIn cli, Integer pageNo, Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
+//		cli.setAid(TokenManager.getAdminId());
+		cli.setAid("1");
+		cli.setShareType(String.valueOf(AFTConstants.USER_SHARE_PRIVATE));
+		Map<String,Object> params = disposeParams(cli);
+		return (Pagination<CustomerListIn>) findPage("selectDepCustomerInformationList","selectDepCustomerInformationCount",params,pageNo,pageSize);
+		}
 }