Commit 840c67aa by hongzhong

Merge remote-tracking branch 'origin/dev_20210330' into dev_20210330

parents 091846a2 a2d9c44b
package com.yd.api.practitioner.service.impl;
import com.google.common.base.Strings;
import com.yd.api.practitioner.service.PractitionerBasicInfoService;
import com.yd.api.practitioner.service.PractitionerService;
import com.yd.api.practitioner.vo.n22.QuerySalaryDetailRequestVO;
import com.yd.api.practitioner.vo.n22.QuerySalaryDetailResponseVO;
import com.yd.api.practitioner.vo.n22.SalaryDetail;
import com.yd.api.practitioner.vo.organization.*;
import com.yd.api.practitioner.vo.payscale.PayScalePdfRequestVO;
import com.yd.api.practitioner.service.PractitionerBasicInfoService;
import com.yd.api.practitioner.vo.payscale.PayScaleInfo;
import com.yd.api.practitioner.vo.payscale.PayScalePdfResponseVO;
import com.yd.api.practitioner.vo.payscale.PayScaleQueryRequestVO;
import com.yd.api.practitioner.vo.payscale.PayScaleQueryResponseVO;
import com.yd.api.practitioner.vo.payscale.*;
import com.yd.api.practitioner.vo.policy.PolicyInfo;
import com.yd.api.practitioner.vo.policy.PolicyListQueryRequestVO;
import com.yd.api.practitioner.vo.policy.PolicyListQueryResponseVO;
......@@ -73,12 +69,13 @@ import com.yd.util.config.ZHBErrorConfig;
import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.*;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
......@@ -86,6 +83,8 @@ import java.util.stream.Collectors;
@Service("practitionerBasicInfoService")
public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoService {
private final static Logger logger = LoggerFactory.getLogger(PractitionerBasicInfoServiceImpl.class);
@Autowired
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
......@@ -391,13 +390,13 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
// 查询全部,把本年和历史集合合并到一起
resultList = this.queryAll(requestVO);
}
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
responseVO.setPayScaleInfos(resultList);
} catch (Exception e) {
e.printStackTrace();
responseVO.setCommonResult(new CommonResult(false, e.getMessage()));
}
responseVO.setPayScaleInfos(resultList);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
......@@ -415,22 +414,25 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
String yearMonth = "";
String year = "";
String month = "";
for (PayScaleInfo newSalary : salaryList) {
map.put(newSalary.getMonDtlPeriod(), newSalary);
if (CollectionUtils.isNotEmpty(salaryList)) {
for (PayScaleInfo newSalary : salaryList) {
map.put(newSalary.getMonDtlPeriod(), newSalary);
}
}
for (PayScaleInfo infoN22 : listN22) {
year = infoN22.getYears() == null ? "" : infoN22.getYears();
month = infoN22.getMonth() == null ? "" : infoN22.getMonth();
yearMonth = this.getYearMonth(year, month);
infoN22.setMonDtlPeriod(yearMonth);
if (!map.containsKey(yearMonth)) {
map.put(yearMonth, infoN22);
if (CollectionUtils.isNotEmpty(listN22)) {
for (PayScaleInfo infoN22 : listN22) {
year = infoN22.getYears() == null ? "" : infoN22.getYears();
month = infoN22.getMonth() == null ? "" : infoN22.getMonth();
yearMonth = this.getYearMonth(year, month);
infoN22.setMonDtlPeriod(yearMonth);
if (!map.containsKey(yearMonth)) {
map.put(yearMonth, infoN22);
}
}
}
ArrayList<PayScaleInfo> resultList = new ArrayList<>(map.values());
// 排序
resultList.sort(Comparator.comparing(PayScaleInfo :: getMonDtlPeriod).reversed());
resultList.sort(Comparator.comparing(PayScaleInfo::getMonDtlPeriod).reversed());
return resultList;
}
......@@ -501,7 +503,7 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
return yearMonth;
}
private List<PayScaleInfo> queryPayScaleListFromN22(PayScaleQueryRequestVO requestVO) throws Exception {
private List<PayScaleInfo> queryPayScaleListFromN22(PayScaleQueryRequestVO requestVO) {
Long practitionerId = requestVO.getPractitionerId();
String isHistory = requestVO.getIsHistory();
......@@ -509,7 +511,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
String mobileNo = aclPractitionerDALService.findMobileNoByPractitionerId(practitionerId);
Staff staff = n22StaffService.queryN22StaffByMobileNo(mobileNo);
if (staff == null || StringUtils.isBlank(staff.getAgent_id())) {
throw new Exception("未查询到N22LoginName");
logger.error("未查询到N22LoginName");
return null;
}
// 1.根据Agent_id当前经纪人的佣金明细
......@@ -527,7 +530,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
SalaryDetailsSearchResponseVO salaryDetailsSearchResponseVO = n22SalaryService.salaryDetailsSearch(salaryDetailsSearchRequestBody);
if (!"查询成功".equals(salaryDetailsSearchResponseVO.getResponseHead().getMessage())){
throw new Exception(salaryDetailsSearchResponseVO.getResponseHead().getMessage());
logger.error(salaryDetailsSearchResponseVO.getResponseHead().getMessage());
return null;
}
List<SalaryDetails> salaryDetailsList = salaryDetailsSearchResponseVO.getResponseBody().getSalaryDetailsLIST();
......
......@@ -785,6 +785,13 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
List<String> mobileNoList = new ArrayList<>(3);
mobileNoList.add(basicInfo.getMobileNo());
String name = basicInfo.getName();
Map<String,List<String>> smsParam = new HashMap<>();
List<String> list = new ArrayList<>();
list.add(systemConfigService.getSingleConfigValue("ALI_SMS_CONTRACT_3"));
list.add("{\"name\":\""+name+"\"}");
smsParam.put(basicInfo.getMobileNo(), list);
if (memberShip.getMentorPractitionerId() != null) {
AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId());
mobileNoList.add(mentor.getMobileNo());
......@@ -797,7 +804,6 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
// 若辅导人和团队长为同一人,去重
List<String> uniqueList = mobileNoList.stream().distinct().collect(Collectors.toList());
String name = basicInfo.getName();
String system = memberShip.getSubsystem();
String mobileNo;
String templateCode;
......@@ -816,6 +822,10 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
for (int i = 0; i < uniqueList.size(); i++) {
mobileNo = uniqueList.get(i);
if(smsParam.get(mobileNo) != null && smsParam.get(mobileNo).size() > 1){
templateCode = smsParam.get(mobileNo).get(0);
content = smsParam.get(mobileNo).get(1);
}
sendService.sendEmailOrSMS("sms", mobileNo, "0", content, templateCode, null, null, "电子报聘合同生成提醒", 99, hiringBasicInfoId);
}
......
......@@ -288,8 +288,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//查询该手机号码的经纪人id,是否存在
Map<Integer, PractitionerBasicInfo> practitionerBasicInfoMap = getPractitionerBasicInfo(mobileNo);
if (!practitionerBasicInfoMap.isEmpty()) {
Long practitionerTypeId = practitionerBasicInfoMap.get(1).getPractitionerTypeId();
PractitionerBasicInfo practitionerBasicInfo1 = practitionerBasicInfoMap.get(1);
Long practitionerTypeId = null;
if (null == practitionerBasicInfo1) {
responseVO.setCommonResult(new CommonResult(false, "该经纪人不存在"));
return responseVO;
}
practitionerTypeId = practitionerBasicInfo1.getPractitionerTypeId();
PractitionerBasicInfo practitionerBasicInfo = practitionerBasicInfoMap.get(platform);
if (practitionerBasicInfo != null && practitionerTypeId != null) {
......
......@@ -5,9 +5,20 @@ mybatis.mapper-locations=classpath:mapper/**/*.xml
######datasource######
###spring boot自动配置单数据源###
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true&zeroDateTimeBehavior=convertToNull
spring.datasource.username=devdbuser
spring.datasource.password=devdbpass1
## 服务端开启SSL,配置证书,客户端连服务端,配置双向验证服务端证书和客户端证书
ssl.cert.path=/var/lib/mysql/ssl
ssl.config=&allowMultiQueries=true&autoReconnect=true&clientCertificateKeyStoreUrl=file:${ssl.cert.path}/keystoreAJB.jks&clientCertificateKeyStorePassword=AJBMysqlSSL@Pass1&trustCertificateKeyStoreUrl=file:${ssl.cert.path}/truststoreAJB.jks&trustCertificateKeyStorePassword=AJBMysqlSSL@Pass1
spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useAffectedRows=true&useSSL=true&requireSSL=true&verifyServerCertificate=true${ssl.config}
## 服务端开启SSL,配置证书,客户端连服务端,直接信任证书,不用配置证书
#spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useAffectedRows=true&useSSL=true&requireSSL=true&verifyServerCertificate=false
spring.datasource.username=devdbuserSSL
spring.datasource.password=devdbpass1SSL
#服务端开启SSL之前的配置
#spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true
#spring.datasource.username=devdbuser
#spring.datasource.password=devdbpass1
##druid sql监控设置登录访问权限
spring.datasource.druid.stat-view-servlet.login-username=yddruiduser
......@@ -18,9 +29,20 @@ spring.datasource.druid.stat-view-servlet.enabled=false
###手动配置多数据源###
#master
multiple.datasource.master.driver-class-name=com.mysql.jdbc.Driver
multiple.datasource.master.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true&zeroDateTimeBehavior=convertToNull
multiple.datasource.master.username=devdbuser
multiple.datasource.master.password=devdbpass1
## 服务端开启SSL,配置证书,客户端连服务端,配置双向验证服务端证书和客户端证书
ssl.cert.master.path=/var/lib/mysql/ssl
ssl.master.config=&allowMultiQueries=true&autoReconnect=true&clientCertificateKeyStoreUrl=file:${ssl.cert.master.path}/keystoreAJB.jks&clientCertificateKeyStorePassword=AJBMysqlSSL@Pass1&trustCertificateKeyStoreUrl=file:${ssl.cert.master.path}/truststoreAJB.jks&trustCertificateKeyStorePassword=AJBMysqlSSL@Pass1
multiple.datasource.master.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useAffectedRows=true&useSSL=true&requireSSL=true&verifyServerCertificate=true${ssl.master.config}
## 服务端开启SSL,配置证书,客户端连服务端,直接信任证书,不用配置证书
#spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useAffectedRows=true&useSSL=true&requireSSL=true&verifyServerCertificate=false
multiple.datasource.master.username=devdbuserSSL
multiple.datasource.master.password=devdbpass1SSL
#服务端开启SSL之前的配置
#multiple.datasource.master.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true
#multiple.datasource.master.username=devdbuser
#multiple.datasource.master.password=devdbpass1
#egolden
#multiple.datasource.egolden.driver-class-name=com.mysql.jdbc.Driver
......
......@@ -5,9 +5,21 @@ mybatis.mapper-locations=classpath:mapper/**/*.xml
######datasource######
###spring boot缺省配置单数据源###
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true&zeroDateTimeBehavior=convertToNull
spring.datasource.username=devdbuser
spring.datasource.password=devdbpass1
## 服务端开启SSL,配置证书,客户端连服务端,配置双向验证服务端证书和客户端证书
#ssl.cert.path=D\:/ydProjectGit/yd-backend/yd-api/src/main/resources/mysqlSSL
ssl.cert.path=classpath:mysqlSSL
ssl.config=&allowMultiQueries=true&autoReconnect=true&clientCertificateKeyStoreUrl=file:${ssl.cert.path}/keystoreAJB.jks&clientCertificateKeyStorePassword=AJBMysqlSSL@Pass1&trustCertificateKeyStoreUrl=file:${ssl.cert.path}/truststoreAJB.jks&trustCertificateKeyStorePassword=AJBMysqlSSL@Pass1
spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useAffectedRows=true&useSSL=true&requireSSL=true&verifyServerCertificate=true${ssl.config}
## 服务端开启SSL,配置证书,客户端连服务端,直接信任证书,不用配置证书
#spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=true&requireSSL=true&verifyServerCertificate=false
spring.datasource.username=devdbuserSSL
spring.datasource.password=devdbpass1SSL
#服务端开启SSL之前的配置
#spring.datasource.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true
#spring.datasource.username=devdbuser
#spring.datasource.password=devdbpass1
##druid sql监控设置登录访问权限
spring.datasource.druid.stat-view-servlet.login-username=yddruiduser
......@@ -17,9 +29,21 @@ spring.datasource.druid.stat-view-servlet.enabled=false
###手动配置主数据源###
#master
multiple.datasource.master.driver-class-name=com.mysql.jdbc.Driver
multiple.datasource.master.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true&zeroDateTimeBehavior=convertToNull
multiple.datasource.master.username=devdbuser
multiple.datasource.master.password=devdbpass1
## 服务端开启SSL,配置证书,客户端连服务端,配置双向验证服务端证书和客户端证书
#ssl.cert.master.path=D\:/ydProjectGit/yd-backend/yd-api/src/main/resources/mysqlSSL
ssl.cert.master.path=classpath:mysqlSSL
ssl.master.config=&allowMultiQueries=true&autoReconnect=true&clientCertificateKeyStoreUrl=file:${ssl.cert.master.path}/keystoreAJB.jks&clientCertificateKeyStorePassword=AJBMysqlSSL@Pass1&trustCertificateKeyStoreUrl=file:${ssl.cert.master.path}/truststoreAJB.jks&trustCertificateKeyStorePassword=AJBMysqlSSL@Pass1
multiple.datasource.master.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useAffectedRows=true&useSSL=true&requireSSL=true&verifyServerCertificate=true${ssl.master.config}
## 服务端开启SSL,配置证书,客户端连服务端,直接信任证书,不用配置证书
#multiple.datasource.master.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=true&requireSSL=true&verifyServerCertificate=false
multiple.datasource.master.username=devdbuserSSL
multiple.datasource.master.password=devdbpass1SSL
#服务端开启SSL之前的配置
#multiple.datasource.master.url=jdbc:mysql://139.224.139.2:13307/ajb?useUnicode=true&characterEncoding=utf8&useSSL=false&useAffectedRows=true&zeroDateTimeBehavior=convertToNull
#multiple.datasource.master.username=devdbuser
#multiple.datasource.master.password=devdbpass1
#egolden
#multiple.datasource.egolden.driver-class-name=com.mysql.jdbc.Driver
......
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