Commit ffbb263d by yao.xiao

Merge branch 'dev' into dev_20210308_sharing

parents 9c359686 a9bc0382
......@@ -853,7 +853,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
private void createCSV(List<FortunePayToOrderInfo> fortunePayToOrderInfos, HttpServletResponse response) {
String charset = "UTF-8"; // 读取字符编码
String[] columnName = new String[]{"序号","预计发佣年月","经纪人","佣金","应发佣金","保单号","保费","佣金率","发佣状态","佣金类型","手机号","职级","分公司","营业部","体系","购买方案"};
String[] columnName = new String[]{"序号","预计发佣年月","经纪人","佣金","应发佣金","首年销售佣金(fyc)","保单号","保费","佣金率","发佣状态","佣金类型","手机号","职级","分公司","营业部","体系","购买方案"};
String tableName = "YD_Export_Fortune_Pay";
String CSV_COLUMN_SEPARATOR = ",";//CSV文件列分隔符
String CSV_ROW_SEPARATOR = "\r\n";//CSV文件行分隔符
......@@ -873,6 +873,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
buf.append(info.getPractitionerName()).append(CSV_COLUMN_SEPARATOR);
buf.append(info.getCommissionAmount()).append(CSV_COLUMN_SEPARATOR);
buf.append(info.getReferralAmount()).append(CSV_COLUMN_SEPARATOR);
buf.append(info.getFycAmount()).append(CSV_COLUMN_SEPARATOR);
buf.append("P_").append(info.getPolicyNo()).append(CSV_COLUMN_SEPARATOR);
buf.append(info.getOrderPrice()).append(CSV_COLUMN_SEPARATOR);
buf.append(info.getCommissionRate()).append(CSV_COLUMN_SEPARATOR);
......
......@@ -7,8 +7,10 @@ import com.yd.api.result.CommonResult;
import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.meta.MdCode;
import com.yd.dal.entity.meta.MdDropOptions;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.practitioner.ScheduleTrack;
import com.yd.dal.entity.practitioner.hiring.HiringApproveRecords;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.customer.AclPractitionerHiringBasicInfoMapper;
......@@ -17,6 +19,7 @@ import com.yd.dal.mapper.customer.AclPractitionerMapper;
import com.yd.dal.service.agms.AgmsHiringDALService;
import com.yd.dal.service.customer.*;
import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.dal.service.user.AclUserDALService;
......@@ -62,6 +65,10 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
private MdCodeDALService mdCodeDALService;
@Autowired
private SendService sendService;
@Autowired
private AclPractitionerPotentialAssignedTrackDALService aclPractitionerPotentialAssignedTrackDALService;
@Autowired
private MdDropOptionsDALService mdDropOptionsDALService;
@Autowired
public void setAgmsHiringDalService(AgmsHiringDALService agmsHiringDalService){
......@@ -251,6 +258,8 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
//最后一步通过发邮件通知人事填写相关经纪人信息
this.sendMailToHR(basicInfo2);
basicInfoStatus = "0";
//更新增员状态为"成功报聘"
insertPotentialAssignedTrack(basicInfo2);
} else {
basicInfoStatus = "-1";
......@@ -265,6 +274,44 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
}
private void insertPotentialAssignedTrack(AclPractitionerHiringBasicInfo basicInfo) {
Long practitionerId = null;
Long potentialId = basicInfo.getPractitionerPotentialId();
AclPractitionerPotentialAssignedTrack assignedTrack = new AclPractitionerPotentialAssignedTrack();
List<AclPractitionerPotentialAssignedTrack> assignedTrackIsLastedList = aclPractitionerPotentialAssignedTrackDALService.findByPotentialIdAndIsLasted(potentialId,1);
//1、更新最新的状态
if(assignedTrackIsLastedList != null && !assignedTrackIsLastedList.isEmpty()){
List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList = new ArrayList<>();
for(AclPractitionerPotentialAssignedTrack item : assignedTrackIsLastedList){
practitionerId = item.getCreatedBy();
item.setIsLasted(0);
item.setUpdatedBy(practitionerId);
item.setUpdaterType(2);
item.setUpdatedAt(new Date());
assignedTrackUpdateList.add(item);
}
aclPractitionerPotentialAssignedTrackDALService.updateAll(assignedTrackUpdateList);
}
//2、插入
MdDropOptions options = mdDropOptionsDALService.findById(113L);
assignedTrack.setTrackScore(options.getDropOptionScore());
assignedTrack.setPractitionerAssignedId(practitionerId);
assignedTrack.setPractitionerPotentialId(potentialId);
assignedTrack.setTrackStatusId(113L);
assignedTrack.setTrackTime(new Date());
assignedTrack.setIsActive(1);
assignedTrack.setIsLasted(1);
assignedTrack.setCreatorType(2);
assignedTrack.setCreatedBy(practitionerId);
assignedTrack.setCreatedAt(new Date());
aclPractitionerPotentialAssignedTrackDALService.save(assignedTrack);
}
@Override
public PractitionerHiringListResponseVO practitionerHiringListV2(PractitionerHiringListRequestVO requestVO) {
PractitionerHiringListResponseVO resp = new PractitionerHiringListResponseVO();
......
......@@ -136,8 +136,9 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
PayScaleQueryResponseVO responseVO = new PayScaleQueryResponseVO();
String practitionerIdEG = requestVO.getPractitionerIdEG();
Long practitionerId = requestVO.getPractitionerId();
Map<Long,PayScaleInfo> payScaleInfoMap = new HashMap<>();
if(!Strings.isNullOrEmpty(practitionerIdEG) && practitionerId != null){
if(!Strings.isNullOrEmpty(practitionerIdEG)){
List<PayScaleInfo> payScaleInfoListAll = aclPractitionerDALService.findPayScaleByPractitionerEG(practitionerIdEG);
if(!payScaleInfoListAll.isEmpty()){
Map<String,String> dtlTypeMap = new HashMap<>();
......@@ -146,7 +147,7 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
optionsEGoldenList.forEach(i->dtlTypeMap.put(i.getOptAttr(),i.getOptName()));
List<OptionsEGolden> titleList = mdDropOptionsDALService.findAllTitleEG();
titleList.forEach(i->titleMap.put(i.getTitleCode(),i.getTitleName()));
Map<Long,PayScaleInfo> payScaleInfoMap = new HashMap<>();
PayScaleInfo payScaleInfo;
Long time;
for(PayScaleInfo item : payScaleInfoListAll){
......@@ -167,21 +168,20 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
for(PayScaleInfo item : payScaleInfoListAll){
item.setMonDtlRAmount(CommonUtil.doubleFormat(item.getMonDtlRAmount(),2));
}
List<PayScaleInfo> resultList = new ArrayList<>(payScaleInfoMap.values());
// 加入临时薪资表的数据
List<AgAclLifePractitionerSalary> list = practitionerSalaryMapper.queryListByPractitionerId(practitionerId);
translateObj(list, resultList);
// 排序
resultList.sort(Comparator.comparingLong(PayScaleInfo :: getMonDtlPeriod).reversed());
responseVO.setPayScaleInfos(resultList);
}
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String[] params = {"practitionerIdEG, practitionerId"};
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("610002", params)));
}
List<PayScaleInfo> resultList = new ArrayList<>(payScaleInfoMap.values());
// 加入临时薪资表的数据
List<AgAclLifePractitionerSalary> list = practitionerSalaryMapper.queryListByPractitionerId(practitionerId);
translateObj(list, resultList);
// 排序
resultList.sort(Comparator.comparingLong(PayScaleInfo :: getMonDtlPeriod).reversed());
responseVO.setPayScaleInfos(resultList);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
......
......@@ -4,6 +4,7 @@ import com.yd.api.practitioner.service.PractitionerHiringContractService;
import com.yd.api.practitioner.service.PractitionerHiringService;
import com.yd.api.practitioner.vo.hiring.*;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.agms.hiring.PractitionerHiringListInfo;
import com.yd.dal.entity.agms.hiring.PractitionerHiringWorkingExperience;
import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
......@@ -430,8 +431,11 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
hiringListInfoList = practitionerHiringDalService.queryHandledList(practitionerId, status);
}
responseVO.setHiringListInfoList(hiringListInfoList);
// 按申请时间倒序排序
Collections.sort(hiringListInfoList);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
responseVO.setHiringListInfoList(hiringListInfoList);
return responseVO;
}
......
......@@ -7,7 +7,6 @@ import java.math.BigDecimal;
/**
* @author xxy
*/
@Data
public class FortunePayToOrderInfo {
/**
* 保险公司
......@@ -93,5 +92,359 @@ public class FortunePayToOrderInfo {
* 体系
*/
private String subordinateSystemName;
/**
* fyc
*/
private BigDecimal fycAmount;
/**
* 获取 保险公司
*
* @return the insurerName 保险公司
*/
public String getInsurerName() {
return this.insurerName;
}
/**
* 设置 保险公司
*
* @param insurerName the 保险公司 to set
*/
public void setInsurerName(String insurerName) {
this.insurerName = insurerName;
}
/**
* 获取 保单号
*
* @return the policyNo 保单号
*/
public String getPolicyNo() {
return this.policyNo;
}
/**
* 设置 保单号
*
* @param policyNo the 保单号 to set
*/
public void setPolicyNo(String policyNo) {
this.policyNo = policyNo;
}
/**
* 获取 保费
*
* @return the orderPrice 保费
*/
public BigDecimal getOrderPrice() {
return this.orderPrice;
}
/**
* 设置 保费
*
* @param orderPrice the 保费 to set
*/
public void setOrderPrice(BigDecimal orderPrice) {
this.orderPrice = orderPrice;
}
/**
* 获取 佣金类型
*
* @return the commissionType 佣金类型
*/
public String getCommissionType() {
return this.commissionType;
}
/**
* 设置 佣金类型
*
* @param commissionType the 佣金类型 to set
*/
public void setCommissionType(String commissionType) {
this.commissionType = commissionType;
}
/**
* 获取 应发佣率
*
* @return the referralRate 应发佣率
*/
public BigDecimal getReferralRate() {
return this.referralRate;
}
/**
* 设置 应发佣率
*
* @param referralRate the 应发佣率 to set
*/
public void setReferralRate(BigDecimal referralRate) {
this.referralRate = referralRate;
}
/**
* 获取 应发金额
*
* @return the referralAmount 应发金额
*/
public BigDecimal getReferralAmount() {
return this.referralAmount;
}
/**
* 设置 应发金额
*
* @param referralAmount the 应发金额 to set
*/
public void setReferralAmount(BigDecimal referralAmount) {
this.referralAmount = referralAmount;
}
/**
* 获取 购买方案
*
* @return the productName 购买方案
*/
public String getProductName() {
return this.productName;
}
/**
* 设置 购买方案
*
* @param productName the 购买方案 to set
*/
public void setProductName(String productName) {
this.productName = productName;
}
/**
* 获取 预计发佣年月
*
* @return the payoutYearmonth 预计发佣年月
*/
public String getPayoutYearmonth() {
return this.payoutYearmonth;
}
/**
* 设置 预计发佣年月
*
* @param payoutYearmonth the 预计发佣年月 to set
*/
public void setPayoutYearmonth(String payoutYearmonth) {
this.payoutYearmonth = payoutYearmonth;
}
/**
* 获取 经纪人
*
* @return the practitionerName 经纪人
*/
public String getPractitionerName() {
return this.practitionerName;
}
/**
* 设置 经纪人
*
* @param practitionerName the 经纪人 to set
*/
public void setPractitionerName(String practitionerName) {
this.practitionerName = practitionerName;
}
/**
* 获取 佣金
*
* @return the commissionAmount 佣金
*/
public BigDecimal getCommissionAmount() {
return this.commissionAmount;
}
/**
* 设置 佣金
*
* @param commissionAmount the 佣金 to set
*/
public void setCommissionAmount(BigDecimal commissionAmount) {
this.commissionAmount = commissionAmount;
}
/**
* 获取 佣金率
*
* @return the commissionRate 佣金率
*/
public BigDecimal getCommissionRate() {
return this.commissionRate;
}
/**
* 设置 佣金率
*
* @param commissionRate the 佣金率 to set
*/
public void setCommissionRate(BigDecimal commissionRate) {
this.commissionRate = commissionRate;
}
/**
* 获取 发佣状态
*
* @return the commissionPayoutStatus 发佣状态
*/
public String getCommissionPayoutStatus() {
return this.commissionPayoutStatus;
}
/**
* 设置 发佣状态
*
* @param commissionPayoutStatus the 发佣状态 to set
*/
public void setCommissionPayoutStatus(String commissionPayoutStatus) {
this.commissionPayoutStatus = commissionPayoutStatus;
}
/**
* 获取 手机号
*
* @return the mobileNo 手机号
*/
public String getMobileNo() {
return this.mobileNo;
}
/**
* 设置 手机号
*
* @param mobileNo the 手机号 to set
*/
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
/**
* 获取 经纪人职级
*
* @return the practitionerLevel 经纪人职级
*/
public String getPractitionerLevel() {
return this.practitionerLevel;
}
/**
* 设置 经纪人职级
*
* @param practitionerLevel the 经纪人职级 to set
*/
public void setPractitionerLevel(String practitionerLevel) {
this.practitionerLevel = practitionerLevel;
}
/**
* 获取 分公司
*
* @return the insurerBranchName 分公司
*/
public String getInsurerBranchName() {
return this.insurerBranchName;
}
/**
* 设置 分公司
*
* @param insurerBranchName the 分公司 to set
*/
public void setInsurerBranchName(String insurerBranchName) {
this.insurerBranchName = insurerBranchName;
}
/**
* 获取 营业部
*
* @return the insurerBranchDeptName 营业部
*/
public String getInsurerBranchDeptName() {
return this.insurerBranchDeptName;
}
/**
* 设置 营业部
*
* @param insurerBranchDeptName the 营业部 to set
*/
public void setInsurerBranchDeptName(String insurerBranchDeptName) {
this.insurerBranchDeptName = insurerBranchDeptName;
}
/**
* 获取 体系
*
* @return the subordinateSystemName 体系
*/
public String getSubordinateSystemName() {
return this.subordinateSystemName;
}
/**
* 设置 体系
*
* @param subordinateSystemName the 体系 to set
*/
public void setSubordinateSystemName(String subordinateSystemName) {
this.subordinateSystemName = subordinateSystemName;
}
/**
* 获取 fyc
*
* @return the fycAmount fyc
*/
public BigDecimal getFycAmount() {
return this.fycAmount;
}
/**
* 设置 fyc
*
* @param fycAmount the fyc to set
*/
public void setFycAmount(BigDecimal fycAmount) {
this.fycAmount = fycAmount;
}
@Override
public String toString() {
return "FortunePayToOrderInfo{" +
"insurerName='" + insurerName + '\'' +
", policyNo='" + policyNo + '\'' +
", orderPrice=" + orderPrice +
", commissionType='" + commissionType + '\'' +
", referralRate=" + referralRate +
", referralAmount=" + referralAmount +
", productName='" + productName + '\'' +
", payoutYearmonth='" + payoutYearmonth + '\'' +
", practitionerName='" + practitionerName + '\'' +
", commissionAmount=" + commissionAmount +
", commissionRate=" + commissionRate +
", commissionPayoutStatus='" + commissionPayoutStatus + '\'' +
", mobileNo='" + mobileNo + '\'' +
", practitionerLevel='" + practitionerLevel + '\'' +
", insurerBranchName='" + insurerBranchName + '\'' +
", insurerBranchDeptName='" + insurerBranchDeptName + '\'' +
", subordinateSystemName='" + subordinateSystemName + '\'' +
", fycAmount=" + fycAmount +
'}';
}
}
package com.yd.dal.entity.practitioner.hiring;
import com.google.common.base.Strings;
import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.util.CommonUtil;
import java.util.Date;
/**
* @author xxy
*/
public class HiringListInfo {
public class HiringListInfo implements Comparable<HiringListInfo> {
/**
* 经纪人基本信息id
......@@ -164,4 +170,20 @@ public class HiringListInfo {
Long in = this.hiringBasicInfoId;
return in.hashCode();
}
@Override
public int compareTo(HiringListInfo o) {
String orderDate1 = o.getApplicationTime();
if(!Strings.isNullOrEmpty(applicationTime) && !Strings.isNullOrEmpty(orderDate1)){
Date orderDateDT = CommonUtil.stringParseDate(applicationTime,"yyyy-MM-dd HH:mm:ss");
Date orderDate1DT = CommonUtil.stringParseDate(orderDate1,"yyyy-MM-dd HH:mm:ss");
if(orderDate1DT != null && orderDateDT != null){
return orderDate1DT.compareTo(orderDateDT);
}else{
return 0;
}
}else{
return 0;
}
}
}
......@@ -109,7 +109,8 @@
f.practitioner_level practitionerLevel,
dept.name insurerBranchDeptName,
sub.name subordinateSystemName,
ib.branch_name insurerBranchName
ib.branch_name insurerBranchName,
f.fyc_amount fycAmount
from ag_acl_customer_fortune f
left join ag_po_order o
left join ag_product_plan pp on pp.id = o.plan_id
......
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