Commit a083a905 by jianan

我的团队寿险数据统计N22问题3

parent ad29ce1d
...@@ -2618,21 +2618,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2618,21 +2618,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if (myStaffSearchResponseVO.getResponseBody() == null || CollectionUtils.isEmpty(myStaffSearchResponseVO.getResponseBody().getStaffArray())) { if (myStaffSearchResponseVO.getResponseBody() == null || CollectionUtils.isEmpty(myStaffSearchResponseVO.getResponseBody().getStaffArray())) {
throw new Exception("N22查询我管的人错误"); throw new Exception("N22查询我管的人错误");
} }
List<String> nameList = new ArrayList<>(); List<String> loginNameList = new ArrayList<>();
for (MyStaff myStaff : staffArray) { for (MyStaff myStaff : staffArray) {
nameList.add(myStaff.getManage_StaffName()); loginNameList.add(myStaff.getManage_LoginName());
}
// 2.查询所有辅导的人
List<AclPractitioner> practitionerList = aclPractitionerDALService.findByIds(this.getPractitionerIdList(practitionerId,null));
for(AclPractitioner item : practitionerList){
nameList.add(item.getName());
} }
System.out.println(nameList);
// 3.通过姓名查询手机号
List<PractitionerInfo> practitionerInfoList = aclPractitionerDALService.findPractitionerInfoByNameList(nameList);
// 4.根据Agent_id当前经纪人的佣金明细 System.out.println(loginNameList);
// 4.1.根据查询时间范围获取查询开始时间和结束时间
// 2.根据Agent_id当前经纪人的佣金明细
// 2.1.根据查询时间范围获取查询开始时间和结束时间
String startTime; String startTime;
String endTime; String endTime;
if (Integer.valueOf("1") == time) { if (Integer.valueOf("1") == time) {
...@@ -2651,38 +2645,51 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2651,38 +2645,51 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
searchStaffAchievementRequestBody.setPolicystatus("201"); searchStaffAchievementRequestBody.setPolicystatus("201");
searchStaffAchievementRequestBody.setIssuedatestart(startTime); searchStaffAchievementRequestBody.setIssuedatestart(startTime);
searchStaffAchievementRequestBody.setIssuedateend(endTime); searchStaffAchievementRequestBody.setIssuedateend(endTime);
// 2.2.根据loginName循环查询N22业绩接口
List<SubordinateSystemMemberInfoE> subordinateSystemMemberInfoEList = new ArrayList<>();
SubordinateSystemMemberInfoE info = null;
Achieve achieve = null;
List<String> mobileList = new ArrayList<>();
for (String loginName : loginNameList) {
searchStaffAchievementRequestBody.setAgent_id(loginName);
SearchStaffAchievementResponseVO searchStaffAchievementResponseVO = n22SalaryService.searchStaffAchievement(searchStaffAchievementRequestBody); SearchStaffAchievementResponseVO searchStaffAchievementResponseVO = n22SalaryService.searchStaffAchievement(searchStaffAchievementRequestBody);
if (!"查询成功".equals(searchStaffAchievementResponseVO.getResponseHead().getMessage())){ if (!"查询成功".equals(searchStaffAchievementResponseVO.getResponseHead().getMessage())) {
throw new Exception( "N22寿险业绩统计查询错误"); throw new Exception("N22寿险业绩统计查询错误");
} }
List<Achieve> achieveList = searchStaffAchievementResponseVO.getResponseBody().getAchieveList(); List<Achieve> resultList = searchStaffAchievementResponseVO.getResponseBody().getAchieveList();
// 5.交集
List<Achieve> intersection = achieveList.stream().filter(item -> nameList.contains(item.getDescription())).collect(toList());
System.out.println("看看交集");
System.out.println(intersection);
// 6.组装 if (CollectionUtils.isNotEmpty(resultList)) {
List<SubordinateSystemMemberInfoE> subordinateSystemMemberInfoEList = new ArrayList<>();
SubordinateSystemMemberInfoE info = null;
String name = "";
for (PractitionerInfo item : practitionerInfoList) {
name = item.getName();
for (Achieve achieve : intersection) {
if (name.equals(achieve.getDescription())) {
info = new SubordinateSystemMemberInfoE(); achieve = resultList.get(0);
BeanUtils.copyProperties(item, info); info = new SubordinateSystemMemberInfoE();
info.setCount(achieve.getSucNumber()); info.setCount(achieve.getSucNumber());
info.setFyp(achieve.getFYP()); info.setFyp(achieve.getFYP());
info.setFyc(achieve.getFYC()); info.setFyc(achieve.getFYC());
info.setName(achieve.getDescription()); info.setName(achieve.getDescription());
info.setLoginName(loginName);
// 查询N22的电话号码
Staff staff1 = n22StaffService.queryN22StaffByLoginName(loginName);
if (staff1 != null) {
info.setMobileNo(staff1.getMobile());
mobileList.add(staff1.getMobile());
}
subordinateSystemMemberInfoEList.add(info); subordinateSystemMemberInfoEList.add(info);
} }
} }
// 3.通过姓名查询手机号
List<PractitionerInfo> practitionerInfoList = aclPractitionerDALService.findPractitionerInfoByMobileList(mobileList);
for (SubordinateSystemMemberInfoE infoE : subordinateSystemMemberInfoEList) {
for (PractitionerInfo item : practitionerInfoList) {
if (infoE.getLoginName().equals(item.getName())) {
BeanUtils.copyProperties(item, infoE);
}
}
} }
System.out.println("看看根据手机号查询的N22"); System.out.println("看看根据手机号查询的N22");
...@@ -2695,7 +2702,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2695,7 +2702,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Integer count; Integer count;
//4、根据id查询出所有的成员的fyc和fyp //4、根据id查询出所有的成员的fyc和fyp
for(SubordinateSystemMemberInfoE item : subordinateSystemMemberInfoEList){ for(SubordinateSystemMemberInfoE item : subordinateSystemMemberInfoEList){
mobileNoForMember = getMobileNo(item.getMobileNo()); mobileNoForMember = item.getMobileNo();
if(memberInfoMap.containsKey(mobileNoForMember)){ if(memberInfoMap.containsKey(mobileNoForMember)){
memberInfo = memberInfoMap.get(mobileNoForMember); memberInfo = memberInfoMap.get(mobileNoForMember);
fyp = memberInfo.getFyp(); fyp = memberInfo.getFyp();
......
...@@ -9,6 +9,7 @@ public class SubordinateSystemMemberInfoE { ...@@ -9,6 +9,7 @@ public class SubordinateSystemMemberInfoE {
private Double fyc; private Double fyc;
private Integer count; private Integer count;
private String mobileNo; private String mobileNo;
private String loginName;
public Long getPractitionerId() { public Long getPractitionerId() {
return practitionerId; return practitionerId;
...@@ -73,4 +74,12 @@ public class SubordinateSystemMemberInfoE { ...@@ -73,4 +74,12 @@ public class SubordinateSystemMemberInfoE {
public void setMobileNo(String mobileNo) { public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo; this.mobileNo = mobileNo;
} }
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
} }
...@@ -81,5 +81,9 @@ public interface AclPractitionerMapper { ...@@ -81,5 +81,9 @@ public interface AclPractitionerMapper {
List<AclPractitioner> queryAllLifePractitioner(); List<AclPractitioner> queryAllLifePractitioner();
List<PractitionerInfo> findPractitionerInfoByPractitionerCode(List<String> paramList);
List<PractitionerInfo> findPractitionerInfoByNameList(List<String> nameList); List<PractitionerInfo> findPractitionerInfoByNameList(List<String> nameList);
List<PractitionerInfo> findPractitionerInfoByMobileList(List<String> mobileList);
} }
\ No newline at end of file
...@@ -66,10 +66,10 @@ public interface AclPractitionerDALService { ...@@ -66,10 +66,10 @@ public interface AclPractitionerDALService {
/** /**
* 经纪人基本信息查询 * 经纪人基本信息查询
* @param nameList * @param paramList
* @return * @return
*/ */
List<PractitionerInfo> findPractitionerInfoByNameList(List<String> nameList); List<PractitionerInfo> findPractitionerInfoByPractitionerCode(List<String> paramList);
/** /**
* 通过经纪人id查找经纪人 * 通过经纪人id查找经纪人
...@@ -203,4 +203,8 @@ public interface AclPractitionerDALService { ...@@ -203,4 +203,8 @@ public interface AclPractitionerDALService {
* @return * @return
*/ */
List<AclPractitioner> queryAllLifePractitioner(); List<AclPractitioner> queryAllLifePractitioner();
List<PractitionerInfo> findPractitionerInfoByNameList(List<String> nameList);
List<PractitionerInfo> findPractitionerInfoByMobileList(List<String> mobileList);
} }
...@@ -74,8 +74,8 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService ...@@ -74,8 +74,8 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
} }
@Override @Override
public List<PractitionerInfo> findPractitionerInfoByNameList(List<String> nameList) { public List<PractitionerInfo> findPractitionerInfoByPractitionerCode(List<String> paramList) {
return aclPractitionerMapper.findPractitionerInfoByNameList(nameList); return aclPractitionerMapper.findPractitionerInfoByPractitionerCode(paramList);
} }
@Override @Override
...@@ -216,4 +216,14 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService ...@@ -216,4 +216,14 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
public List<AclPractitioner> queryAllLifePractitioner() { public List<AclPractitioner> queryAllLifePractitioner() {
return aclPractitionerMapper.queryAllLifePractitioner(); return aclPractitionerMapper.queryAllLifePractitioner();
} }
@Override
public List<PractitionerInfo> findPractitionerInfoByNameList(List<String> nameList) {
return aclPractitionerMapper.findPractitionerInfoByNameList(nameList);
}
@Override
public List<PractitionerInfo> findPractitionerInfoByMobileList(List<String> mobileList) {
return aclPractitionerMapper.findPractitionerInfoByMobileList(mobileList);
}
} }
...@@ -15,8 +15,6 @@ import java.util.*; ...@@ -15,8 +15,6 @@ import java.util.*;
@Service @Service
public class N22SalaryServiceImpl implements N22SalaryService { public class N22SalaryServiceImpl implements N22SalaryService {
private final static Logger logger = LoggerFactory.getLogger(N22SalaryServiceImpl.class);
@Autowired @Autowired
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
...@@ -29,13 +27,10 @@ public class N22SalaryServiceImpl implements N22SalaryService { ...@@ -29,13 +27,10 @@ public class N22SalaryServiceImpl implements N22SalaryService {
obj.put("requestHead", requestHead); obj.put("requestHead", requestHead);
obj.put("requestBody", salaryDetailsSearchRequestBody); obj.put("requestBody", salaryDetailsSearchRequestBody);
logger.info("N22佣金明细查询请求报文:"+obj.toString());
String url = systemConfigService.getSingleConfigValue("N22_URL_Salary_Details_Search"); String url = systemConfigService.getSingleConfigValue("N22_URL_Salary_Details_Search");
String result = N22Utils.postTransaction(url, obj.toString()); String result = N22Utils.postTransaction(url, obj.toString());
logger.info("N22佣金明细查询响应报文:"+result);
SalaryDetailsSearchResponseVO response = JSONObject.parseObject(result, SalaryDetailsSearchResponseVO.class); SalaryDetailsSearchResponseVO response = JSONObject.parseObject(result, SalaryDetailsSearchResponseVO.class);
return response; return response;
...@@ -50,8 +45,6 @@ public class N22SalaryServiceImpl implements N22SalaryService { ...@@ -50,8 +45,6 @@ public class N22SalaryServiceImpl implements N22SalaryService {
obj.put("requestHead", requestHead); obj.put("requestHead", requestHead);
obj.put("requestBody", searchStaffAchievementRequestBody); obj.put("requestBody", searchStaffAchievementRequestBody);
logger.info("N22寿险业绩统计查询请求报文:"+obj.toString());
// String url = systemConfigService.getSingleConfigValue("N22_URL_Salary_Details_Search"); // String url = systemConfigService.getSingleConfigValue("N22_URL_Salary_Details_Search");
......
...@@ -12,5 +12,12 @@ public interface N22StaffService { ...@@ -12,5 +12,12 @@ public interface N22StaffService {
*/ */
Staff queryN22StaffByMobileNo(String mobileNo); Staff queryN22StaffByMobileNo(String mobileNo);
/**
* 根据N22员工编号查询N22经纪人信息
* @param loginName
* @return
*/
Staff queryN22StaffByLoginName(String loginName);
MyStaffSearchResponseVO myStaffSearch(MyStaffSearchRequestBody myStaffSearchRequestBody); MyStaffSearchResponseVO myStaffSearch(MyStaffSearchRequestBody myStaffSearchRequestBody);
} }
...@@ -60,6 +60,26 @@ public class N22StaffServiceImpl implements N22StaffService { ...@@ -60,6 +60,26 @@ public class N22StaffServiceImpl implements N22StaffService {
} }
@Override @Override
public Staff queryN22StaffByLoginName(String loginName) {
GetStaffNewRequestBody getStaffNewRequestBody = new GetStaffNewRequestBody();
getStaffNewRequestBody.setLoginname(loginName);
GetStaffNewResponseVO resp = this.getStaffNew(getStaffNewRequestBody);
Staff staff = null;
if(resp != null){
if ("查询成功".equals(resp.getResponseHead().getMessage())){
List<Staff> staffList = resp.getResponseBody().getStaff();
if (staffList.size() > 0) {
staff = staffList.get(0);
}
}
}
return staff;
}
@Override
public MyStaffSearchResponseVO myStaffSearch(MyStaffSearchRequestBody myStaffSearchRequestBody) { public MyStaffSearchResponseVO myStaffSearch(MyStaffSearchRequestBody myStaffSearchRequestBody) {
JSONObject obj = new JSONObject(); //传参 JSONObject obj = new JSONObject(); //传参
......
...@@ -1719,6 +1719,35 @@ ...@@ -1719,6 +1719,35 @@
and p.is_active=1 and p.is_active=1
</select> </select>
<select id="findPractitionerInfoByPractitionerCode" resultMap="practitioner_info_map">
select
p.customer_id as customerId,
p.id as practitionerId,
p.name as name,
p.gender as gender,
s.practitioner_type_id as practitionerType,
sys.name as subsystem,
o.drop_option_code as levelCode,
o.drop_option_name as levelName,
b.branch_name as insurerBranchName,
p.subordinate_system_id as subordinateId,
p.wechat_id as weChatId,
p.qq_id as qqId,
p.practitioner_reg_no as practitionerRegNo,
p.mobile_no,
p.can_see_salary_list as canSeeSalaryList
from ag_acl_practitioner p
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_subordinate_system sys on p.subordinate_system_id = sys.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_md_drop_options o on s.practitioner_level = o.id
where p.practitioner_code in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and p.is_active = 1
</select>
<select id="findPractitionerInfoByNameList" resultMap="practitioner_info_map"> <select id="findPractitionerInfoByNameList" resultMap="practitioner_info_map">
select select
p.customer_id as customerId, p.customer_id as customerId,
...@@ -1749,4 +1778,33 @@ ...@@ -1749,4 +1778,33 @@
</select> </select>
<select id="findPractitionerInfoByMobileList" resultMap="practitioner_info_map">
select
p.customer_id as customerId,
p.id as practitionerId,
p.name as name,
p.gender as gender,
s.practitioner_type_id as practitionerType,
sys.name as subsystem,
o.drop_option_code as levelCode,
o.drop_option_name as levelName,
b.branch_name as insurerBranchName,
p.subordinate_system_id as subordinateId,
p.wechat_id as weChatId,
p.qq_id as qqId,
p.practitioner_reg_no as practitionerRegNo,
p.mobile_no,
p.can_see_salary_list as canSeeSalaryList
from ag_acl_practitioner p
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_subordinate_system sys on p.subordinate_system_id = sys.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_md_drop_options o on s.practitioner_level = o.id
where p.mobile_no in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item,typeHandler=com.yd.util.deshandler.DESTypeHandler}
</foreach>
and p.is_active = 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