Commit ce85301a by jianan

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

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