Commit d69f8030 by Water Wang

optimize

parent 0f2e0034
...@@ -418,9 +418,9 @@ public class PractitionerController { ...@@ -418,9 +418,9 @@ public class PractitionerController {
} }
/** /**
* 经纪人保单列表查询接口 * 经纪人保单详情查询接口
* @param requestVO 请求信息 * @param requestVO 请求信息
* @return PolicyListQueryResponseVO * @return PolicyInfoQueryResponseVO
*/ */
@RequestMapping("/policyInfoQuery") @RequestMapping("/policyInfoQuery")
public Object policyInfoQuery(@RequestBody PolicyInfoQueryRequestVO requestVO){ public Object policyInfoQuery(@RequestBody PolicyInfoQueryRequestVO requestVO){
......
...@@ -9,11 +9,14 @@ import com.yd.api.practitioner.vo.policy.policyinfoquery.PolicyInfoQueryRequestV ...@@ -9,11 +9,14 @@ import com.yd.api.practitioner.vo.policy.policyinfoquery.PolicyInfoQueryRequestV
import com.yd.api.practitioner.vo.policy.policyinfoquery.PolicyInfoQueryResponseVO; import com.yd.api.practitioner.vo.policy.policyinfoquery.PolicyInfoQueryResponseVO;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.AclPractitioner; import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.meta.OptionsEGolden;
import com.yd.dal.entity.order.CustomerPolicyInfo; import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.dal.entity.order.PolicyDetailInfoE;
import com.yd.dal.entity.product.Product; import com.yd.dal.entity.product.Product;
import com.yd.dal.entity.product.ProductE; import com.yd.dal.entity.product.ProductE;
import com.yd.dal.entity.product.ProductPlan; import com.yd.dal.entity.product.ProductPlan;
import com.yd.dal.service.customer.AclPractitionerDALService; import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.dal.service.order.PoOrderDALService; import com.yd.dal.service.order.PoOrderDALService;
import com.yd.dal.service.product.ProductDALService; import com.yd.dal.service.product.ProductDALService;
import com.yd.dal.service.product.ProductPlanDALService; import com.yd.dal.service.product.ProductPlanDALService;
...@@ -35,6 +38,8 @@ public class PractitionerPolicyServiceImpl implements PractitionerPolicyService ...@@ -35,6 +38,8 @@ public class PractitionerPolicyServiceImpl implements PractitionerPolicyService
private ProductPlanDALService productPlanDALService; private ProductPlanDALService productPlanDALService;
@Autowired @Autowired
private ProductDALService productDALService; private ProductDALService productDALService;
@Autowired
private MdDropOptionsDALService mdDropOptionsDALService;
@Override @Override
public PolicyListQueryResponseVO policyListQuery(PolicyListQueryRequestVO requestVO) { public PolicyListQueryResponseVO policyListQuery(PolicyListQueryRequestVO requestVO) {
PolicyListQueryResponseVO responseVO = new PolicyListQueryResponseVO(); PolicyListQueryResponseVO responseVO = new PolicyListQueryResponseVO();
...@@ -64,7 +69,44 @@ public class PractitionerPolicyServiceImpl implements PractitionerPolicyService ...@@ -64,7 +69,44 @@ public class PractitionerPolicyServiceImpl implements PractitionerPolicyService
@Override @Override
public PolicyInfoQueryResponseVO policyInfoQuery(PolicyInfoQueryRequestVO requestVO) { public PolicyInfoQueryResponseVO policyInfoQuery(PolicyInfoQueryRequestVO requestVO) {
return null; PolicyInfoQueryResponseVO responseVO = new PolicyInfoQueryResponseVO();
String orderNo = requestVO.getOrderNo();
String policyNo = requestVO.getPolicyNo();
if(!Strings.isNullOrEmpty(orderNo) || !Strings.isNullOrEmpty(policyNo)){
Integer platform = requestVO.getPlatform();
platform = (platform == null) ? 1 : platform;
if(platform == 2){//EGolden
//1、EGolden--获取orderNo
orderNo = (Strings.isNullOrEmpty(orderNo)) ? getOrderNoE(policyNo) : orderNo;
//2、根据orderNo获取保单和被保人的相关数据
List<PolicyDetailInfoE> policyDetailInfoES = poOrderDALService.findPolicyDetailsInfoByOrderNoE(orderNo);
if(!policyDetailInfoES.isEmpty()){
getResponseMessage(responseVO,policyDetailInfoES);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}
}else if(platform == 1){//YD
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}
}else{
String[] params = {"orderNo,policyNo"};
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("610002", params)));
}
return responseVO;
}
private String getOrderNoE(String policyNo) {
String orderNo = null;
if(!Strings.isNullOrEmpty(policyNo)){
orderNo = poOrderDALService.findOrderNoByPolicyNo(policyNo);
}
return orderNo;
}
private void getResponseMessage(PolicyInfoQueryResponseVO responseVO, List<PolicyDetailInfoE> policyDetailInfoES) {
if(!policyDetailInfoES.isEmpty()){
List<Integer> materIds = Arrays.asList(20); // 20--保单状态
List<OptionsEGolden> optionsEGoldenList = mdDropOptionsDALService.findByMasterIds(materIds);
}
} }
/** /**
......
package com.yd.api.practitioner.vo.policy.policyinfoquery;
public class BuildingOrderInfo {
private String address; //详细地址
private String roomQty; //房间数范围
/**
* 获取属性 address 详细地址
* @return address
*/
public String getAddress() {
return address;
}
/**
* 属性赋值 address 详细地址
* @param address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* 获取属性 roomQty 房间数范围
* @return the roomQty
*/
public String getRoomQty() {
return roomQty;
}
/**
* 属性赋值 roomQty 房间数范围
* @param roomQty the roomQty to set
*/
public void setRoomQty(String roomQty) {
this.roomQty = roomQty;
}
}
package com.yd.api.practitioner.vo.policy.policyinfoquery;
public class DestinationInfo {
private Integer destinationType;//目的地类型 1-洲;2-国家;3-地区
private Long destinationId;//对应的洲、国家、地区ID
private String destinationName;//目的地名称
public Integer getDestinationType() {
return destinationType;
}
public void setDestinationType(Integer destinationType) {
this.destinationType = destinationType;
}
public Long getDestinationId() {
return destinationId;
}
public void setDestinationId(Long destinationId) {
this.destinationId = destinationId;
}
public String getDestinationName() {
return destinationName;
}
public void setDestinationName(String destinationName) {
this.destinationName = destinationName;
}
}
package com.yd.api.practitioner.vo.policy.policyinfoquery; package com.yd.api.practitioner.vo.policy.policyinfoquery;
import com.ajb.web.order.vo.commoninfo.BuildingOrderInfo;
import com.ajb.web.order.vo.commoninfo.DestinationInfo;
import com.ajb.web.order.vo.commoninfo.VehicleOrderInfo;
public class InsureFactorInfo { public class InsureFactorInfo {
private Integer socialInsured;//(社保:新农合 1-有 2-无) private Integer socialInsured;//(社保:新农合 1-有 2-无)
......
...@@ -5,6 +5,7 @@ public class PolicyInfoQueryRequestVO { ...@@ -5,6 +5,7 @@ public class PolicyInfoQueryRequestVO {
private String orderNo;//订单号 private String orderNo;//订单号
private Long policyId;//保单ID private Long policyId;//保单ID
private String policyNo;//保单号 private String policyNo;//保单号
private Integer platform;//平台,1--yd,2--EGolden
/** /**
* 获取属性 orderId 订单ID * 获取属性 orderId 订单ID
...@@ -53,4 +54,12 @@ public class PolicyInfoQueryRequestVO { ...@@ -53,4 +54,12 @@ public class PolicyInfoQueryRequestVO {
public void setPolicyNo(String policyNo) { public void setPolicyNo(String policyNo) {
this.policyNo = policyNo; this.policyNo = policyNo;
} }
public Integer getPlatform() {
return platform;
}
public void setPlatform(Integer platform) {
this.platform = platform;
}
} }
package com.yd.api.practitioner.vo.policy.policyinfoquery;
public class VehicleOrderInfo {
private String licenseNo;//车牌号
private Integer seatCount;//核定座位数
private String frameNo;//车架号
/**
* 获取属性licenseNo 车牌号
*/
public String getLicenseNo() {
return licenseNo;
}
/**
* 属性设置licenseNo 车牌号
* @param licenseNo
*/
public void setLicenseNo(String licenseNo) {
this.licenseNo = licenseNo;
}
/**
* 获取属性seatCount 核定座位数
*/
public Integer getSeatCount() {
return seatCount;
}
/**
* 属性设置seatCount 核定座位数
* @param seatCount
*/
public void setSeatCount(Integer seatCount) {
this.seatCount = seatCount;
}
/**
* 获取属性frameNo 车架号
*/
public String getFrameNo() {
return frameNo;
}
/**
* 属性设值 frameNo 车架号
* @param frameNo
*/
public void setFrameNo(String frameNo) {
this.frameNo = frameNo;
}
}
package com.yd.dal.entity.meta;
public class OptionsEGolden {
private Integer optId;
private Integer mstId;
private String optName;
private String optAttr;
private String optOrder;
public Integer getOptId() {
return optId;
}
public void setOptId(Integer optId) {
this.optId = optId;
}
public Integer getMstId() {
return mstId;
}
public void setMstId(Integer mstId) {
this.mstId = mstId;
}
public String getOptName() {
return optName;
}
public void setOptName(String optName) {
this.optName = optName;
}
public String getOptAttr() {
return optAttr;
}
public void setOptAttr(String optAttr) {
this.optAttr = optAttr;
}
public String getOptOrder() {
return optOrder;
}
public void setOptOrder(String optOrder) {
this.optOrder = optOrder;
}
}
package com.yd.dal.entity.order;
public class PolicyDetailInfoE {
private String orderNo;
private String policyNo;
private String policyStatus;
private String orderDate;
private String startDate;
private String endDate;
private String holderId;
private String holderName;
private String holderIdNo;
private String holderSex;
private String holderBirthday;
private String holderMobileNo;
private String insuredId;
private String insuredName;
private String insuredIdNo;
private String insuredSex;
private String insuredBirthday;
private String insuredMobileNo;
private String productId;
private String productCode;
private String productName;
private String insurerId;
private String insurerName;
private String premium;
private String commission;
private String commissionRate;
private String policyType;
private String payFrequency;
private String payCommissionStatus;
private String commissionType;
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getPolicyNo() {
return policyNo;
}
public void setPolicyNo(String policyNo) {
this.policyNo = policyNo;
}
public String getPolicyStatus() {
return policyStatus;
}
public void setPolicyStatus(String policyStatus) {
this.policyStatus = policyStatus;
}
public String getOrderDate() {
return orderDate;
}
public void setOrderDate(String orderDate) {
this.orderDate = orderDate;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getHolderId() {
return holderId;
}
public void setHolderId(String holderId) {
this.holderId = holderId;
}
public String getHolderName() {
return holderName;
}
public void setHolderName(String holderName) {
this.holderName = holderName;
}
public String getHolderIdNo() {
return holderIdNo;
}
public void setHolderIdNo(String holderIdNo) {
this.holderIdNo = holderIdNo;
}
public String getHolderSex() {
return holderSex;
}
public void setHolderSex(String holderSex) {
this.holderSex = holderSex;
}
public String getHolderBirthday() {
return holderBirthday;
}
public void setHolderBirthday(String holderBirthday) {
this.holderBirthday = holderBirthday;
}
public String getHolderMobileNo() {
return holderMobileNo;
}
public void setHolderMobileNo(String holderMobileNo) {
this.holderMobileNo = holderMobileNo;
}
public String getInsuredId() {
return insuredId;
}
public void setInsuredId(String insuredId) {
this.insuredId = insuredId;
}
public String getInsuredName() {
return insuredName;
}
public void setInsuredName(String insuredName) {
this.insuredName = insuredName;
}
public String getInsuredIdNo() {
return insuredIdNo;
}
public void setInsuredIdNo(String insuredIdNo) {
this.insuredIdNo = insuredIdNo;
}
public String getInsuredSex() {
return insuredSex;
}
public void setInsuredSex(String insuredSex) {
this.insuredSex = insuredSex;
}
public String getInsuredBirthday() {
return insuredBirthday;
}
public void setInsuredBirthday(String insuredBirthday) {
this.insuredBirthday = insuredBirthday;
}
public String getInsuredMobileNo() {
return insuredMobileNo;
}
public void setInsuredMobileNo(String insuredMobileNo) {
this.insuredMobileNo = insuredMobileNo;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getInsurerId() {
return insurerId;
}
public void setInsurerId(String insurerId) {
this.insurerId = insurerId;
}
public String getInsurerName() {
return insurerName;
}
public void setInsurerName(String insurerName) {
this.insurerName = insurerName;
}
public String getPremium() {
return premium;
}
public void setPremium(String premium) {
this.premium = premium;
}
public String getCommission() {
return commission;
}
public void setCommission(String commission) {
this.commission = commission;
}
public String getCommissionRate() {
return commissionRate;
}
public void setCommissionRate(String commissionRate) {
this.commissionRate = commissionRate;
}
public String getPolicyType() {
return policyType;
}
public void setPolicyType(String policyType) {
this.policyType = policyType;
}
public String getPayFrequency() {
return payFrequency;
}
public void setPayFrequency(String payFrequency) {
this.payFrequency = payFrequency;
}
public String getPayCommissionStatus() {
return payCommissionStatus;
}
public void setPayCommissionStatus(String payCommissionStatus) {
this.payCommissionStatus = payCommissionStatus;
}
public String getCommissionType() {
return commissionType;
}
public void setCommissionType(String commissionType) {
this.commissionType = commissionType;
}
}
...@@ -2,6 +2,7 @@ package com.yd.dal.mapper.order; ...@@ -2,6 +2,7 @@ package com.yd.dal.mapper.order;
import com.yd.dal.entity.order.CustomerPolicyInfo; import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.dal.entity.order.PoOrder; import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.order.PolicyDetailInfoE;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -24,4 +25,8 @@ public interface PoOrderMapper { ...@@ -24,4 +25,8 @@ public interface PoOrderMapper {
List<CustomerPolicyInfo> findPolicyInfoByCustomerId(@Param("customerId")Long customerId, @Param("time")Integer time); List<CustomerPolicyInfo> findPolicyInfoByCustomerId(@Param("customerId")Long customerId, @Param("time")Integer time);
List<CustomerPolicyInfo> findPolicyInfoByMobileNoE(@Param("mobileNo")String mobileNo, @Param("time")Integer time); List<CustomerPolicyInfo> findPolicyInfoByMobileNoE(@Param("mobileNo")String mobileNo, @Param("time")Integer time);
String findOrderNoByPolicyNo(@Param("policyNo")String policyNo);
List<PolicyDetailInfoE> findPolicyDetailsInfoByOrderNoE(@Param("orderNo")String orderNo);
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yd.dal.service.order.Impl; ...@@ -2,6 +2,7 @@ package com.yd.dal.service.order.Impl;
import com.yd.dal.entity.order.CustomerPolicyInfo; import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.dal.entity.order.PoOrder; import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.order.PolicyDetailInfoE;
import com.yd.dal.mapper.order.PoOrderMapper; import com.yd.dal.mapper.order.PoOrderMapper;
import com.yd.dal.service.order.PoOrderDALService; import com.yd.dal.service.order.PoOrderDALService;
import com.yd.util.intercept.annotation.TargetDataSource; import com.yd.util.intercept.annotation.TargetDataSource;
...@@ -36,4 +37,16 @@ public class PoOrderDALServiceImpl implements PoOrderDALService { ...@@ -36,4 +37,16 @@ public class PoOrderDALServiceImpl implements PoOrderDALService {
public List<CustomerPolicyInfo> findPolicyInfoByMobileNoE(String mobileNo, Integer time) { public List<CustomerPolicyInfo> findPolicyInfoByMobileNoE(String mobileNo, Integer time) {
return poOrderMapper.findPolicyInfoByMobileNoE(mobileNo,time); return poOrderMapper.findPolicyInfoByMobileNoE(mobileNo,time);
} }
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public String findOrderNoByPolicyNo(String policyNo) {
return poOrderMapper.findOrderNoByPolicyNo(policyNo);
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public List<PolicyDetailInfoE> findPolicyDetailsInfoByOrderNoE(String orderNo) {
return poOrderMapper.findPolicyDetailsInfoByOrderNoE(orderNo);
}
} }
...@@ -2,6 +2,7 @@ package com.yd.dal.service.order; ...@@ -2,6 +2,7 @@ package com.yd.dal.service.order;
import com.yd.dal.entity.order.CustomerPolicyInfo; import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.dal.entity.order.PoOrder; import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.order.PolicyDetailInfoE;
import java.util.List; import java.util.List;
...@@ -13,4 +14,8 @@ public interface PoOrderDALService { ...@@ -13,4 +14,8 @@ public interface PoOrderDALService {
List<CustomerPolicyInfo> findPolicyInfoByCustomerId(Long customerId, Integer time); List<CustomerPolicyInfo> findPolicyInfoByCustomerId(Long customerId, Integer time);
List<CustomerPolicyInfo> findPolicyInfoByMobileNoE(String mobileNo, Integer time); List<CustomerPolicyInfo> findPolicyInfoByMobileNoE(String mobileNo, Integer time);
String findOrderNoByPolicyNo(String policyNo);
List<PolicyDetailInfoE> findPolicyDetailsInfoByOrderNoE(String orderNo);
} }
...@@ -1033,4 +1033,49 @@ ...@@ -1033,4 +1033,49 @@
</choose> </choose>
group by policy.ins_mst_id group by policy.ins_mst_id
</select> </select>
<select id="findOrderNoByPolicyNo" resultType="java.lang.String">
select
INS_MST_ID
from ins001
where INS_MST_POLICY_NUM = #{policyNo,jdbcType=VARCHAR};
</select>
<select id="findPolicyDetailsInfoByOrderNoE" resultType="com.yd.dal.entity.order.PolicyDetailInfoE">
SELECT
policy.INS_MST_ID as orderNo , -- 订单号
policy.INS_MST_POLICY_NUM as policyNo , -- 保单号
policy.INS_MST_STATUS as policyStatus, -- 保单状态
date_format(policy.INS_MST_ACCEPT_DATE, '%Y-%m-%d %H:%i:%s') as orderDate, -- 下单日期
date_format(policy.INS_MST_EFFECT_DATE, '%Y-%m-%d %H:%i:%s') as startDate, -- 保险起期
date_format(policy.INS_MST_INVALID_DATE, '%Y-%m-%d %H:%i:%s') as endDate, -- 保险止期
product.PRD_MST_ID as productId , -- 产品编号
product.PRD_MST_INS_CODE as productCode , -- 产品code
product.PRD_MST_PRO_NAME as productName , -- 产品名字
insurer.PRD_SUP_ID as insurerId , -- 保险公司编号
insurer.PRD_SUP_NAME as insurerName , -- 保险公司名称
holder.CUS_MST_NAME as holderName, -- 投保人姓名
holder.CUS_MST_ID as holderId, -- 投保人编码
holder.CUS_MST_ID_NUM as holderIdNo, -- 投保人编码
holder.CUS_MST_SEX as holderSex, -- 投保人性别
holder.CUS_MST_BIRTHDAY as holderBirthday, -- 投保人出生年月
holder.CUS_MST_CELL_NUM as holderMobileNo, -- 投保人手机号码
insured.CUS_MST_NAME as insuredName, -- 被保人姓名
insured.CUS_MST_ID as insuredId, -- 被保人编码
insured.CUS_MST_ID_NUM as insuredIdNo, -- 被保人编码
insured.CUS_MST_SEX as insuredSex, -- 被保人性别
insured.CUS_MST_BIRTHDAY as insuredBirthday, -- 被保人出生年月
insured.CUS_MST_CELL_NUM as insuredMobileNo, -- 被保人手机号码
m.MON025_405 as commission, -- 佣金
m.MON025_404 as commissionRate, -- 佣金率
m.MON025_004 as productId, -- 产品ID
m.MON025_401 as premium, -- 保费
m.MON025_101 as policyType, -- 保单类型
m.MON025_102 as payFrequency, -- 缴费频率
m.MON025_109 as payCommissionStatus -- 发佣状态
FROM ins001 policy INNER JOIN MON025 m on m.MON025_002 = policy.INS_MST_ID and m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1 AND m.mon025_108 = 'S01'-- 业务员id
inner join cus001 holder on policy.FK_CUS_PRO_ID = holder.CUS_MST_ID
inner join cus001 insured on policy.FK_CUS_PRO_ID = insured.CUS_MST_ID
inner join prd001 product on m.MON025_004 = product.PRD_MST_ID
inner join prd004 insurer on product.FK_PRD_SUP_ID = insurer.PRD_SUP_ID
WHERE policy.INS_MST_ID = #{orderNo,jdbcType=VARCHAR};
</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