Commit 463c67f9 by jianan

【ydlife】-【客户管理】-增加维护客户功能

parent 85183640
......@@ -21,6 +21,9 @@ import com.yd.api.practitioner.vo.policy.PolicyListQueryRequestVO;
import com.yd.api.practitioner.vo.policy.PolicyListQueryResponseVO;
import com.yd.api.practitioner.vo.policy.policyinfoquery.PolicyInfoQueryRequestVO;
import com.yd.api.practitioner.vo.policy.policyinfoquery.PolicyInfoQueryResponseVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryCustomerHolderListResponesVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryCustomerInsuredListResponesVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryPolicyListByHolderCustomerIdResponesVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.recruit.*;
......@@ -646,4 +649,31 @@ public class PractitionerController {
return result;
}
@RequestMapping("/queryCustomerHolderList/{practitionerId}")
public Object queryCustomerHolderList(@PathVariable Long practitionerId) {
JsonResult result = new JsonResult();
QueryCustomerHolderListResponesVO responseVO = practitionerService.queryCustomerHolderList(practitionerId);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
@RequestMapping("/queryCustomerInsuredList/{customerId}")
public Object queryCustomerInsuredList(@PathVariable Long customerId) {
JsonResult result = new JsonResult();
QueryCustomerInsuredListResponesVO responseVO = practitionerService.queryCustomerInsuredList(customerId);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
@RequestMapping("/queryPolicyListByHolderCustomerId/{customerId}")
public Object queryPolicyListByHolderCustomerId(@PathVariable Long customerId) {
JsonResult result = new JsonResult();
QueryPolicyListByHolderCustomerIdResponesVO responseVO = practitionerService.queryPolicyListByHolderCustomerId(customerId);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
}
package com.yd.api.practitioner.service;
import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryCustomerHolderListResponesVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryCustomerInsuredListResponesVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryPolicyListByHolderCustomerIdResponesVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsActionsUpdateResponseVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsQueryResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
......@@ -232,4 +235,10 @@ public interface PractitionerService {
* @return
*/
CanSeeSalaryListResponseVO canSeeSalaryList(Long practitionerId);
QueryCustomerHolderListResponesVO queryCustomerHolderList(Long practitionerId);
QueryCustomerInsuredListResponesVO queryCustomerInsuredList(Long customerId);
QueryPolicyListByHolderCustomerIdResponesVO queryPolicyListByHolderCustomerId(Long customerId);
}
......@@ -5,6 +5,11 @@ import com.yd.api.customer.service.CustomerService;
import com.yd.api.customer.vo.register.RegisterRequestVO;
import com.yd.api.customer.vo.register.RegisterResponseVO;
import com.yd.api.practitioner.vo.login.CanSeeSalaryListResponseVO;
import com.yd.api.practitioner.vo.policy.PolicyInfo;
import com.yd.api.practitioner.vo.practitionerCustomer.CustomerHolder;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryCustomerHolderListResponesVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryCustomerInsuredListResponesVO;
import com.yd.api.practitioner.vo.practitionerCustomer.QueryPolicyListByHolderCustomerIdResponesVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsActionsUpdateResponseVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsQueryResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginBasicInfo;
......@@ -32,12 +37,16 @@ import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;
import com.yd.dal.entity.marketing.MktLeadsGoals;
import com.yd.dal.entity.marketing.MktLeadsPool;
import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.dal.entity.practitioner.PersonalOffLineFYC;
import com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo;
import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.practitioner.opportunity.PlayerSalesActivityInfo;
import com.yd.dal.entity.product.Product;
import com.yd.dal.entity.product.ProductPlan;
import com.yd.dal.entity.survey.SurveyCustomerAnswers;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.customer.AclPolicyholderMapper;
import com.yd.dal.service.agms.AgmsDashboardDALService;
import com.yd.dal.service.customer.*;
import com.yd.dal.service.marketing.*;
......@@ -178,6 +187,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private N22SalaryService n22SalaryService;
@Autowired
private AgmsDashboardDALService agmsDashboardDALService;
@Autowired
private AclPolicyholderMapper aclPolicyholderMapper;
@Override
public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) {
......@@ -2084,6 +2095,56 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}
@Override
public QueryCustomerHolderListResponesVO queryCustomerHolderList(Long practitionerId) {
QueryCustomerHolderListResponesVO resp = new QueryCustomerHolderListResponesVO();
resp.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001")));
if (practitionerId != null) {
AclPractitioner practitioner = aclPractitionerDALService.findById(practitionerId);
if (practitioner != null) {
Long customerId = practitioner.getCustomerId();
List<CustomerPolicyInfo> policyInfos = poOrderDALService.findPolicyInfoByCustomerId(customerId, null);
if (CollectionUtils.isNotEmpty(policyInfos)) {
List<CustomerHolder> list = aclPolicyholderMapper.queryThisPractitiionerAllPolicyHolderList(policyInfos);
resp.setList(list);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
}
}
}
return resp;
}
@Override
public QueryCustomerInsuredListResponesVO queryCustomerInsuredList(Long customerId) {
QueryCustomerInsuredListResponesVO resp = new QueryCustomerInsuredListResponesVO();
resp.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001")));
if (customerId != null) {
List<CustomerHolder> list = aclPolicyholderMapper.queryInsuredListByHolderCustomerId(customerId);
resp.setList(list);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
}
return resp;
}
@Override
public QueryPolicyListByHolderCustomerIdResponesVO queryPolicyListByHolderCustomerId(Long customerId) {
QueryPolicyListByHolderCustomerIdResponesVO resp = new QueryPolicyListByHolderCustomerIdResponesVO();
resp.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001")));
if (customerId != null) {
List<CustomerPolicyInfo> policyInfos = aclPolicyholderMapper.queryPolicyListByHolderCustomerId(customerId);
resp.setList(policyInfos);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
}
return resp;
}
@Override
public PotentialGoalsActionsQueryResponseVO potentialGoalsActionsQuery(PotentialGoalsActionsQueryRequestVO requestVO) {
PotentialGoalsActionsQueryResponseVO responseVO = new PotentialGoalsActionsQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
......
package com.yd.api.practitioner.vo.practitionerCustomer;
import lombok.Data;
@Data
public class CustomerHolder {
private Long customerId;//客户customer_id
private String name;//客户姓名
private String mobileNo;//客户电话
private String gender;//客户性别
private String birthDate;//客户生日
}
package com.yd.api.practitioner.vo.practitionerCustomer;
import com.yd.api.result.CommonResult;
import lombok.Data;
import java.util.List;
@Data
public class QueryCustomerHolderListResponesVO {
private CommonResult commonResult;
private List<CustomerHolder> list;
}
package com.yd.api.practitioner.vo.practitionerCustomer;
import com.yd.api.result.CommonResult;
import lombok.Data;
import java.util.List;
@Data
public class QueryCustomerInsuredListResponesVO {
private CommonResult commonResult;
private List<CustomerHolder> list;
}
package com.yd.api.practitioner.vo.practitionerCustomer;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.order.CustomerPolicyInfo;
import lombok.Data;
import java.util.List;
@Data
public class QueryPolicyListByHolderCustomerIdResponesVO {
private CommonResult commonResult;
private List<CustomerPolicyInfo> list;
}
package com.yd.dal.mapper.customer;
import com.yd.api.practitioner.vo.practitionerCustomer.CustomerHolder;
import com.yd.dal.entity.customer.AclPolicyholder;
import com.yd.dal.entity.order.CustomerPolicyInfo;
import java.util.List;
......@@ -20,4 +22,10 @@ public interface AclPolicyholderMapper {
int updateByPrimaryKey(AclPolicyholder record);
List<AclPolicyholder> findByOrderId(Long orderId);
List<CustomerHolder> queryInsuredListByHolderCustomerId(Long customerId);
List<CustomerHolder> queryThisPractitiionerAllPolicyHolderList(List<CustomerPolicyInfo> policyInfos);
List<CustomerPolicyInfo> queryPolicyListByHolderCustomerId(Long customerId);
}
\ No newline at end of file
......@@ -927,4 +927,67 @@
from ag_acl_policyholder
where order_id = #{orderId,jdbcType=BIGINT}
</select>
<resultMap id="customerHolder" type="com.yd.api.practitioner.vo.practitionerCustomer.CustomerHolder">
<result column="id" jdbcType="BIGINT" property="customerId"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
<result column="gender" jdbcType="VARCHAR" property="gender"/>
<result column="birth_date" jdbcType="VARCHAR" property="birthDate"/>
</resultMap>
<select id="queryThisPractitiionerAllPolicyHolderList" resultMap="customerHolder">
select c.id,
c.name,
c.mobile_no ,
IF(c.gender = 1,'男','女') gender,
c.birth_date
from
(select distinct t.customer_id,
from ag_acl_policyholder
where 1 = 1
and t.type = 2
and t.order_id in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
#{item.orderId}
</foreach>
)t left join ag_acl_customer c on t.customer_id = c.id
</select>
<select id="queryInsuredListByHolderCustomerId" resultMap="customerHolder">
select
c.id,
c.name,
c.mobile_no ,
IF(c.gender = 1,'男','女') gender,
c.birth_date
from
(select DISTINCT h.customer_id
from ag_acl_policyholder h
where h.type = 3
and h.order_id in
(select t1.order_id from ag_acl_policyholder t1 where t1.customer_id = 802 and t1.type = 2)
) t
left join ag_acl_customer c on t.customer_id = c.id
</select>
<select id="queryPolicyListByHolderCustomerId" resultType="com.yd.dal.entity.order.CustomerPolicyInfo">
SELECT
o.id as orderId,
o.order_no as orderNo ,
o.policy_no as policyNo ,
p.name as holderName,
o.destination as destination,
date_format(o.order_date, '%Y-%m-%d %H:%i:%s') as orderDate,
date_format(o.effective_start_date, '%Y-%m-%d %H:%i:%s') as startDate,
date_format(o.effective_end_date, '%Y-%m-%d %H:%i:%s') as endDate,
f.referral_amount as referralAmount,
f.order_price as orderPrice,
o.plan_id as planId,
o.product_id as productId ,
f.id as fortuneId
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price
&gt; 0 and o.insurer_id != 888
inner JOIN ag_acl_policyholder p ON o.id = p.order_id and p.type = 2
WHERE p.customer_id = #{customerId,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment