Browse Source

客户管理整体规划(查询部分)

Michael 8 years ago
parent
commit
2f37007e93

+ 316 - 14
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -17,14 +17,14 @@
 			b.contact_mobile as contactMobile,
 			b.international,
 			b.expert,
-			b.celebrity,
 			b.audit_status as auditStatus,
-			b.consultant,
 			dg1.name as province,
 			dg2.name as city, 
 			dg3.name as area,
 			c.name as industry,
-			d.name as adminName
+			d.name as adminName,
+			b.expert_audit as expertAudit,
+			b.release_status as releaseStatus
 		from user a inner join user_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.province = dg1.id
 		left join district_glossory dg2 on b.city = dg2.id
@@ -80,9 +80,6 @@
 		<if test="expert != null">
 			and b.expert = #{expert,jdbcType=INTEGER}
 		</if>
-		<if test="celebrity != null">
-			and b.celebrity = #{celebrity,jdbcType=INTEGER}
-		</if>
 		<if test="international != null">
 			and b.international = #{international,jdbcType=INTEGER}
 		</if>
@@ -146,9 +143,6 @@
 		<if test="expert != null">
 			and b.expert = #{expert,jdbcType=INTEGER}
 		</if>
-		<if test="celebrity != null">
-			and b.celebrity = #{celebrity,jdbcType=INTEGER}
-		</if>
 		<if test="international != null">
 			and b.international = #{international,jdbcType=INTEGER}
 		</if>
@@ -350,7 +344,6 @@
 			b.id,
 			b.contacts,
 			b.contact_mobile as contactMobile,
-			b.investment,
 			b.audit_status as auditStatus
 		from 
 			user a inner join organization_identity b on a.id = b.uid
@@ -382,7 +375,6 @@
 			b.fixed_tel as fixedTel,
 			b.email,
 			b.expert,
-			b.celebrity,		
 			b.international,
 			b.contacts,
 			b.contact_mobile as contactMobile,
@@ -392,11 +384,11 @@
 			b.education,
 			b.major_category as majorCategory,
 			b.qualification,
-			b.investment,
 			b.audit_status as auditStatus,
 			b.graduate_school as graduateSchool,
-			b.consultant,
-			b.consultation_price as consultationPrice
+			b.consultation_price as consultationPrice,
+			b.expert_audit as expertAudit,
+			b.release_status as releaseStatus
 		from
 			user a inner join user_identity b on
 			a.id = b.uid	
@@ -787,4 +779,314 @@
 		and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
 	</if>		
   </select>
+  
+  <select id="selectManagePersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
+		select
+			a.id as uid,
+			a.type,
+			a.status, 
+			date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
+			a.business_audit as businessAudit,
+			a.current_member_status as currentMemberStatus,
+			a.identify_name as name,
+			a.lvl,a.is_member as isMember,
+			a.society_tag as societyTag,
+			a.share_type as shareType,
+			b.contacts,
+			b.contact_mobile as contactMobile,
+			b.international,
+			b.expert,
+			b.audit_status as auditStatus,
+			dg1.name as province,
+			dg2.name as city, 
+			dg3.name as area,
+			c.name as industry,
+			d.name as adminName,
+			b.expert_audit as expertAudit,
+			b.release_status as releaseStatus
+		from user a inner join user_identity b on a.id = b.uid
+		left join district_glossory dg1 on b.province = dg1.id
+		left join district_glossory dg2 on b.city = dg2.id
+		left join district_glossory dg3 on b.area = dg3.id
+		left join industry_category c on b.industry = c.id
+		left join admin d on a.aid = d.id
+		LEFT JOIN department_management dm on dm.id = d.department_id 		
+		where a.type = 0  and a.status != 1
+		<if test="aid != null and aid !=''">
+			and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
+		</if>
+		<if test="name != null and name != ''">
+			and a.identify_name like concat('%',#{name},'%')
+		</if>
+		<if test="shareType != null">
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and a.status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="businessAudit != null">
+			and a.business_audit = #{businessAudit,jdbcType=INTEGER}
+		</if>
+		<if test="isMember != null">
+			and a.is_member = #{isMember,jdbcType=INTEGER}
+		</if>
+		<if test="lvl != null">
+			and a.lvl = #{lvl,jdbcType=INTEGER}
+		</if> 
+		<if test="currentMemberStatus != null">
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="societyTag != null and societyTag != ''">
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="province != null">
+			and b.province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.city = #{city,jdbcType=INTEGER}
+		</if>
+		<if test="area != null">
+			and b.area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="expert != null">
+			and b.expert = #{expert,jdbcType=INTEGER}
+		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
+		<if test="auditStatus != null">
+			and b.audit_status = #{auditStatus,jdbcType=INTEGER}
+		</if>
+			order by a.create_time desc 
+		 <if test="page_sql != null">
+    		${page_sql}
+   		 </if>
+	</select>
+	<select id="selectManagePersonalCustomerCount" resultType="java.lang.Integer">
+		select count(0)
+			from user a inner join user_identity b on a.id = b.uid
+			left join admin d on a.aid = d.id
+			LEFT JOIN department_management dm on dm.id = d.department_id 	
+		where a.type = 0  and a.status != 1
+		<if test="aid != null and aid !=''">
+			and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
+		</if>
+		<if test="name != null and name != ''">
+			and a.identify_name like concat('%',#{name},'%')
+		</if>
+		<if test="shareType != null">
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and a.status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="businessAudit != null">
+			and a.business_audit = #{businessAudit,jdbcType=INTEGER}
+		</if>
+		<if test="isMember != null">
+			and a.is_member = #{isMember,jdbcType=INTEGER}
+		</if>
+		<if test="lvl != null">
+			and a.lvl = #{lvl,jdbcType=INTEGER}
+		</if> 
+		<if test="currentMemberStatus != null">
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="societyTag != null and societyTag != ''">
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="province != null">
+			and b.province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.city = #{city,jdbcType=INTEGER}
+		</if>
+		<if test="area != null">
+			and b.area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="expert != null">
+			and b.expert = #{expert,jdbcType=INTEGER}
+		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
+		<if test="auditStatus != null">
+			and b.audit_status = #{auditStatus,jdbcType=INTEGER}
+		</if>
+	</select>
+	
+	<select id="selectManageOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
+		select
+			a.id as uid,
+			a.type,
+			a.status, 
+			date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
+			a.business_audit as businessAudit,
+			a.current_member_status as currentMemberStatus,
+			a.identify_name as name,
+			a.lvl,
+			a.is_member as isMember,
+			a.society_tag as societyTag,
+			share_type as shareType,
+			b.contacts,
+			b.contact_mobile as contactMobile,
+			b.international,
+			b.listed,
+			b.high_tech_zone as highTechZone,
+			b.audit_status as auditStatus,
+			dg1.name as province,
+			dg2.name as city, 
+			dg3.name as area,
+			c.name as industry,
+			d.name as adminName		
+		from user a inner join organization_identity b on a.id = b.uid
+		left join district_glossory dg1 on b.location_province = dg1.id
+		left join district_glossory dg2 on b.location_city = dg2.id
+		left join district_glossory dg3 on b.location_area = dg3.id
+		left join industry_category c on b.industry = c.id
+		left join admin d on a.aid = d.id
+		LEFT JOIN department_management dm on dm.id = d.department_id 	 	
+		where a.type = 1 and a.status != 1
+		<if test="aid != null and aid !=''">
+			and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
+		</if>
+		<if test="name != null and name != ''">
+			and a.identify_name like concat('%',#{name},'%')
+		</if>
+		<if test="shareType != null">
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and a.status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="businessAudit != null">
+      		and a.business_audit = #{businessAudit,jdbcType=INTEGER}
+   		</if>
+		<if test="isMember != null">
+			and a.is_member = #{isMember,jdbcType=INTEGER}
+		</if>
+		<if test="currentMemberStatus != null">
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="lvl != null">
+			and a.lvl = #{lvl,jdbcType=INTEGER}
+		</if> 
+		<if test="societyTag != null and societyTag != ''">
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="province != null">
+			and b.location_province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.location_city = #{city,jdbcType=INTEGER}
+		</if>
+		<if test="area != null">
+			and b.location_area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="listed != null">
+			and b.listed = #{listed,jdbcType=INTEGER}
+		</if>
+		<if test="highTechZone != null">
+			and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
+		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
+		<if test="auditStatus != null">
+      		and b.audit_status = #{auditStatus,jdbcType=INTEGER}
+   		 </if>
+			order by a.create_time desc 
+		 <if test="page_sql != null">
+    		${page_sql}
+   		 </if>
+	</select>
+	
+	<select id="selectManageOrganizationCustomerCount" resultType="java.lang.Integer">
+		select 
+			count(0)	
+		from user a inner join organization_identity b on a.id = b.uid
+		LEFT JOIN department_management dm on dm.id = d.department_id 
+		where a.type = 1 and a.status != 1
+		<if test="aid != null and aid !=''">
+			and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
+		</if>
+		<if test="name != null and name != ''">
+			and a.identify_name like concat('%',#{name},'%')
+		</if>
+		<if test="shareType != null">
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and a.status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="businessAudit != null">
+      		and a.business_audit = #{businessAudit,jdbcType=INTEGER}
+   		</if>
+		<if test="currentMemberStatus != null">
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="isMember != null">
+			and a.is_member = #{isMember,jdbcType=INTEGER}
+		</if>
+		<if test="societyTag != null and societyTag != ''">
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="province != null">
+			and b.location_province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.location_city = #{city,jdbcType=INTEGER}
+		</if>
+		<if test="area != null">
+			and b.location_area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="listed != null">
+			and b.listed = #{listed,jdbcType=INTEGER}
+		</if>
+		<if test="highTechZone != null">
+			and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
+		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
+		<if test="auditStatus != null">
+     		and b.audit_status = #{auditStatus,jdbcType=INTEGER}
+    	</if>
+	</select>
 </mapper>

+ 22 - 0
src/main/java/com/goafanti/customer/bo/CustomerListOut.java

@@ -16,6 +16,28 @@ public class CustomerListOut extends CustomerListIn{
 	/** 营销员姓名 **/
 	private String adminName;
 	
+	/** 专家审核状态 **/
+	private Integer expertAudit;
+	
+	/** 专家发布状态**/
+	private Integer releaseStatus;
+	
+	public Integer getReleaseStatus() {
+		return releaseStatus;
+	}
+
+	public void setReleaseStatus(Integer releaseStatus) {
+		this.releaseStatus = releaseStatus;
+	}
+
+	public Integer getExpertAudit() {
+		return expertAudit;
+	}
+
+	public void setExpertAudit(Integer expertAudit) {
+		this.expertAudit = expertAudit;
+	}
+
 	public String getUid() {
 		return uid;
 	}

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

@@ -8,6 +8,13 @@ public class CustomerPersonalDetailBo extends UserIdentity{
 	private String headPortraitUrl;
 	private String introduction;
 	private Integer businessAudit;
+	private Integer expertAudit;
+	public Integer getExpertAudit() {
+		return expertAudit;
+	}
+	public void setExpertAudit(Integer expertAudit) {
+		this.expertAudit = expertAudit;
+	}
 	public String getIdentifyName() {
 		return identifyName;
 	}

+ 17 - 0
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -84,6 +84,15 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 	
+	/** 管理个人客户查询 **/
+	@RequestMapping(value = "/listAllManagePersonalCustomer" , method = RequestMethod.POST)
+	public Result listAllManagePersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		cli.setAid(TokenManager.getAdminId());
+		res.setData(customerService.listAllManagePersonalCustomer(cli, pageNo, pageSize));
+		return res;
+	}
+	
 	/** 私有单位客户列表 **/
 	@RequestMapping(value = "/listPrivateOrganizationCustomer" , method = RequestMethod.POST)
 	public Result listPrivateOrganizationCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
@@ -108,6 +117,14 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 	
+	/** 管理单位客户查询 **/
+	@RequestMapping(value = "/listAllManageOrganizationCustomer" , method = RequestMethod.POST)
+	public Result listAllManageOrganizationCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		cli.setAid(TokenManager.getAdminId());
+		res.setData(customerService.listAllManageOrganizationCustomer(cli, pageNo, pageSize));
+		return res;
+	}
 	
 	/** 客户即时检索 **/
 	@RequestMapping(value = "/findCustomerByName",method = RequestMethod.GET)

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

@@ -52,6 +52,15 @@ public interface CustomerService {
 	Pagination<CustomerListOut> listAllPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
 	
 	/**
+	 * 管理个人客户查询(所属人同部门客户管理)
+	 * @param cin
+	 * @param pageSize
+	 * @param pageNumber
+	 * @return
+	 */
+	Pagination<CustomerListOut> listAllManagePersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	
+	/**
 	 * 私有单位客户列表查询
 	 * @param cin
 	 * @param pageSize
@@ -78,6 +87,15 @@ public interface CustomerService {
 	 * @return
 	 */
 	Pagination<CustomerListOut> listAllOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	
+	/**
+	 * 管理单位客户列表查询
+	 * @param cin
+	 * @param pageSize
+	 * @param pageNumber
+	 * @return
+	 */
+	Pagination<CustomerListOut> listAllManageOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
 
 	/**
 	 * 使用客户名检索客户

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

@@ -112,6 +112,15 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList","selectPersonalCustomerCount",params,pageNo,pageSize);
 		return list;
 	}
+	
+	@Override
+	public Pagination<CustomerListOut> listAllManagePersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
+		Map<String,Object> params = disposeParams(cli);
+		@SuppressWarnings("unchecked")
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectManagePersonalCustomerList","selectManagePersonalCustomerCount",params,pageNo,pageSize);
+		return list;
+	}
 
 	@Override
 	public Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
@@ -143,6 +152,15 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
 		return list;
 	}
+	
+	@Override
+	public Pagination<CustomerListOut> listAllManageOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
+		Map<String,Object> params = disposeParams(cli);
+		@SuppressWarnings("unchecked")
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectManageOrganizationCustomerList","selectManageOrganizationCustomerCount",params,pageNo,pageSize);
+		return list;
+	}
 
 	private Map<String,Object> disposeParams(CustomerListIn cli){
 		Map<String,Object> params = new HashMap<String, Object>();