Commit ce85301a by jianan

N22保单列表查询接口和保单详情接口

parent b6a130c3
......@@ -203,56 +203,42 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
isSpecial = mobileSpecials.contains(mobileNo);
}
// if(28L == practitionerType || isSpecial){//只有寿险的经纪人和注册为经纪人的员工才能登录
Long practitionerId = practitionerInfo.getPractitionerId();
Long customerId = practitionerInfo.getCustomerId();
AclCustomer customer = aclCustomerDALService.findById(customerId);
PractitionerLoginBasicInfo basicInfo = new PractitionerLoginBasicInfo();
BeanUtils.copyProperties(practitionerInfo,basicInfo);
//获取头像
Integer targetType = 1, targetUseFor = 1;
CustomerFileUpload fileUpload = aclFileUploadDALService.findFilePathInfo(targetType,targetUseFor,practitionerId);
String imagePath = (fileUpload != null) ? fileUpload.getFilePath() : null;
basicInfo.setHeadImagePath(imagePath);
//获取体系信息
Long subordinateId = practitionerInfo.getSubordinateId();
if(subordinateId != null){
PractitionerSubordinateInfo subordinateInfo = aclPractitionerSubordinateSystemDALService.findSubordinateInfo(subordinateId);
if(subordinateInfo != null){
basicInfo.setSubordinateName(subordinateInfo.getSubordinateName());
basicInfo.setSubordinateLeader(subordinateInfo.getSubordinateLeader());
}
}
// 1.根据手机号查询经纪人在N22系统的Agent_id
GetStaffNewRequestBody getStaffNewRequestBody = new GetStaffNewRequestBody();
getStaffNewRequestBody.setMobile(mobileNo);
GetStaffNewResponseVO resp = n22StaffService.getStaffNew(getStaffNewRequestBody);
if(resp != null){
if ("查询成功".equals(resp.getResponseHead().getMessage())){
List<Staff> staffList = resp.getResponseBody().getStaff();
if (staffList.size() > 0) {
Staff staff = staffList.get(0);
String agent_id = staff.getAgent_id();
responseVO.setPractitionerIdEG(agent_id);
}
}
PractitionerBasicInfo practitionerBasicInfo = aclPractitionerDALService.findByMobileNoE(mobileNo);
Long practitionerId = practitionerInfo.getPractitionerId();
Long customerId = practitionerInfo.getCustomerId();
AclCustomer customer = aclCustomerDALService.findById(customerId);
PractitionerLoginBasicInfo basicInfo = new PractitionerLoginBasicInfo();
BeanUtils.copyProperties(practitionerInfo,basicInfo);
//获取头像
Integer targetType = 1, targetUseFor = 1;
CustomerFileUpload fileUpload = aclFileUploadDALService.findFilePathInfo(targetType,targetUseFor,practitionerId);
String imagePath = (fileUpload != null) ? fileUpload.getFilePath() : null;
basicInfo.setHeadImagePath(imagePath);
//获取体系信息
Long subordinateId = practitionerInfo.getSubordinateId();
if(subordinateId != null){
PractitionerSubordinateInfo subordinateInfo = aclPractitionerSubordinateSystemDALService.findSubordinateInfo(subordinateId);
if(subordinateInfo != null){
basicInfo.setSubordinateName(subordinateInfo.getSubordinateName());
basicInfo.setSubordinateLeader(subordinateInfo.getSubordinateLeader());
}
//获取用户的登录次数
List<AclCustomerLog> customerLogList = aclCustomerLogDALService.findLogInfoByCustomerId(customerId);
int logTimes = (customerLogList.isEmpty()) ? 0 : customerLogList.size();
//保存用户的登录记录
aclCustomerLogDALService.saveCustomerLog(customerId,2);
getOpenIdUrl(responseVO,customer);
responseVO.setCustomerId(customerId);
responseVO.setPractitionerId(practitionerId);
responseVO.setPractitionerTypeId(practitionerType);
responseVO.setPractitionerBasicInfo(basicInfo);
responseVO.setLoginTimes(logTimes);
responseVO.setCanSeeSalaryList(practitionerInfo.getCanSeeSalaryList());
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
}
if(practitionerBasicInfo != null){
responseVO.setPractitionerIdEG(practitionerBasicInfo.getPractitionerId());
}
//获取用户的登录次数
List<AclCustomerLog> customerLogList = aclCustomerLogDALService.findLogInfoByCustomerId(customerId);
int logTimes = (customerLogList.isEmpty()) ? 0 : customerLogList.size();
//保存用户的登录记录
aclCustomerLogDALService.saveCustomerLog(customerId,2);
getOpenIdUrl(responseVO,customer);
responseVO.setCustomerId(customerId);
responseVO.setPractitionerId(practitionerId);
responseVO.setPractitionerTypeId(practitionerType);
responseVO.setPractitionerBasicInfo(basicInfo);
responseVO.setLoginTimes(logTimes);
responseVO.setCanSeeSalaryList(practitionerInfo.getCanSeeSalaryList());
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
// }
}else{
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830001")));
......
......@@ -3,6 +3,7 @@ package com.yd.api.practitioner.vo.policy;
public class PolicyListQueryRequestVO {
private Long practitionerId;
private Integer time;
private Integer platform;//平台,1--yd,2--N22
public Long getPractitionerId() {
return practitionerId;
......@@ -19,4 +20,12 @@ public class PolicyListQueryRequestVO {
public void setTime(Integer time) {
this.time = time;
}
public Integer getPlatform() {
return platform;
}
public void setPlatform(Integer platform) {
this.platform = platform;
}
}
......@@ -37,6 +37,7 @@ public class N22Utils {
postMethod.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"GBK");
postMethod.setRequestHeader("Content_Type","application/json;charset=utf-8");
postMethod.setRequestHeader("Accept","application/json;charset=utf-8");
postMethod.setRequestHeader("eliteSign","n9WLrWtWrNmUlhw8SvvwIhyDJXsS1OPWRzUFBPbj89TWRJTfuk4SITBhAiSmNMY6");
RequestEntity requestEntity = new StringRequestEntity(requestJson,"application/json","UTF-8");
postMethod.setRequestEntity(requestEntity);
int statusCode = httpClient.executeMethod(postMethod);
......@@ -74,4 +75,20 @@ public class N22Utils {
public static Long getN22RelationType(String idType) {
return null;
}
public static String getN22PolicyStatus(String policyStatus) {
//(1, "投保")
//(2, "已承保/已回执")
//(3, "未支付/支付失败")
//(7, "支付成功")
//(98, "撤单")
switch(policyStatus){
case "1": return "投保";
case "2": return "已承保/已回执";
case "3": return "未支付/支付失败";
case "7": return "支付成功";
case "98": return "撤单";
}
return "";
}
}
......@@ -29,10 +29,12 @@ public class N22PolicyServiceImpl implements N22PolicyService {
obj.put("requestBody", requestBody);
logger.info("N22查询保单列表请求报文:"+obj.toString());
String url = "https://life.ydinsurance.cn/EliteGeneralHttpTask/GeneralService/PolicyList";
// String url = "https://life.ydinsurance.cn/EliteGeneralHttpTask/GeneralService/PolicyList";
String url = "http://101.132.32.185:8082/EliteGeneralHttpTask/GeneralService/PolicyList";
String result = N22Utils.postTransaction(url, obj.toString());
logger.info("N22查询保单列表响应报文:"+result);
// logger.info("N22查询保单列表响应报文:"+result);
rObj = JSONObject.parseObject(result, PolicyListQueryResponseVO.class);
return rObj;
......@@ -45,12 +47,14 @@ public class N22PolicyServiceImpl implements N22PolicyService {
JSONObject requestHead = new JSONObject();
requestHead.put("seqNo", UUID.randomUUID().toString());
requestHead.put("appId", "eliteNgpcrtaVU9NAz");
obj.put("requestHead", requestHead);
obj.put("requestBody", requestBody);
logger.info("N22查询保单详情请求报文:"+obj.toString());
String url = "https://life.ydinsurance.cn/EliteGeneralHttpTask/GeneralService/PolicyInfo";
// String url = "https://life.ydinsurance.cn/EliteGeneralHttpTask/GeneralService/PolicyInfo";
String url = "http://101.132.32.185:8082/EliteGeneralHttpTask/GeneralService/PolicyInfo";
String result = N22Utils.postTransaction(url, obj.toString());
logger.info("N22查询保单详情响应报文:"+result);
......
......@@ -28,12 +28,13 @@ public class N22StaffServiceImpl implements N22StaffService {
obj.put("requestHead", requestHead);
obj.put("requestBody", getStaffNewRequestBody);
logger.info("N22查询保单列表请求报文:"+obj.toString());
logger.info("N22员工查询请求报文:"+obj.toString());
String url = "https://life.ydinsurance.cn/EliteGeneralHttpTask/GeneralService/getStaffNew";
// String url = "https://life.ydinsurance.cn/EliteGeneralHttpTask/GeneralService/getStaffNew";
String url = "http://101.132.32.185:8082/EliteGeneralHttpTask/GeneralService/getStaffNew";
String result = N22Utils.postTransaction(url, obj.toString());
logger.info("N22查询保单列表响应报文:"+result);
logger.info("N22员工查询响应报文:"+result);
GetStaffNewResponseVO response = JSONObject.parseObject(result, GetStaffNewResponseVO.class);
......
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