Commit 1fb1e3c5 by jianan

【ydlife】-【客户管理】-补全客户信息

parent c7299c35
...@@ -2112,6 +2112,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2112,6 +2112,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
orderIdList.addAll(vehiclePolicyOrderIdList); orderIdList.addAll(vehiclePolicyOrderIdList);
if (CollectionUtils.isNotEmpty(orderIdList)) { if (CollectionUtils.isNotEmpty(orderIdList)) {
List<CustomerHolder> list = aclPolicyholderMapper.queryThisPractitiionerAllPolicyHolderList(orderIdList); List<CustomerHolder> list = aclPolicyholderMapper.queryThisPractitiionerAllPolicyHolderList(orderIdList);
// 如果姓名,出生日期为空就去查ag_acl_policyholder表的记录
this.completeCustomerHolder(list);
resp.setList(list); resp.setList(list);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
...@@ -2127,6 +2129,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2127,6 +2129,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
resp.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001"))); resp.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001")));
if (customerId != null) { if (customerId != null) {
List<CustomerHolder> list = aclPolicyholderMapper.queryInsuredListByHolderCustomerId(customerId); List<CustomerHolder> list = aclPolicyholderMapper.queryInsuredListByHolderCustomerId(customerId);
// 如果姓名,出生日期为空就去查ag_acl_policyholder表的记录
this.completeCustomerHolder(list);
resp.setList(list); resp.setList(list);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
...@@ -2135,6 +2139,18 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2135,6 +2139,18 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return resp; return resp;
} }
private void completeCustomerHolder(List<CustomerHolder> list) {
CustomerHolder info;
for (CustomerHolder holder:list) {
if (holder.getName() == null || holder.getBirthDate() == null) {
info = aclPolicyholderMapper.queryUsefulInfo(holder.getCustomerId(), 2);
if (info != null) {
BeanUtils.copyProperties(info, holder);
}
}
}
}
@Override @Override
public QueryPolicyListByHolderCustomerIdResponesVO queryPolicyListByHolderCustomerId(Long customerId) { public QueryPolicyListByHolderCustomerIdResponesVO queryPolicyListByHolderCustomerId(Long customerId) {
QueryPolicyListByHolderCustomerIdResponesVO resp = new QueryPolicyListByHolderCustomerIdResponesVO(); QueryPolicyListByHolderCustomerIdResponesVO resp = new QueryPolicyListByHolderCustomerIdResponesVO();
......
...@@ -3,6 +3,7 @@ package com.yd.dal.mapper.customer; ...@@ -3,6 +3,7 @@ package com.yd.dal.mapper.customer;
import com.yd.api.practitioner.vo.practitionerCustomer.CustomerHolder; import com.yd.api.practitioner.vo.practitionerCustomer.CustomerHolder;
import com.yd.dal.entity.customer.AclPolicyholder; import com.yd.dal.entity.customer.AclPolicyholder;
import com.yd.dal.entity.order.CustomerPolicyInfo; import com.yd.dal.entity.order.CustomerPolicyInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -28,4 +29,6 @@ public interface AclPolicyholderMapper { ...@@ -28,4 +29,6 @@ public interface AclPolicyholderMapper {
List<CustomerHolder> queryThisPractitiionerAllPolicyHolderList(List<Long> orderIdList); List<CustomerHolder> queryThisPractitiionerAllPolicyHolderList(List<Long> orderIdList);
List<CustomerPolicyInfo> queryPolicyListByHolderCustomerId(Long customerId); List<CustomerPolicyInfo> queryPolicyListByHolderCustomerId(Long customerId);
CustomerHolder queryUsefulInfo(@Param("customerId") Long customerId, @Param("type") int type);
} }
\ No newline at end of file
...@@ -999,4 +999,21 @@ ...@@ -999,4 +999,21 @@
and p.customer_id = #{customerId,jdbcType=BIGINT} and p.customer_id = #{customerId,jdbcType=BIGINT}
</select> </select>
<select id="queryUsefulInfo" resultMap="customerHolder">
select h.customer_id id,
h.name,
h.mobile_no ,
IF(h.gender = 1,'男','女') gender,
h.birth_date
from ag_acl_policyholder h
where h.name is not null and h.birth_date is not null
<if test="customerId != null">
and h.customer_id = #{customerId,jdbcType=BIGINT}
</if>
<if test="type != null">
and h.type = #{type,jdbcType=INTEGER}
</if>
limit 0,1
</select>
</mapper> </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