Commit f95cc6e3 by jianan

薪资单临时方案

parent b6aa9bdb
......@@ -28,10 +28,12 @@ import com.yd.dal.entity.meta.OptionsEGolden;
import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.dal.entity.order.PolicyDetailInfoE;
import com.yd.dal.entity.order.PolicyFactorInfoE;
import com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary;
import com.yd.dal.entity.practitioner.payscale.PayScaleBasicInfo;
import com.yd.dal.entity.product.Product;
import com.yd.dal.entity.product.ProductE;
import com.yd.dal.entity.product.ProductPlan;
import com.yd.dal.mapper.practitioner.AgAclLifePractitionerSalaryMapper;
import com.yd.dal.service.customer.AclFileUploadDALService;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService;
......@@ -73,6 +75,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
private AclFileUploadDALService aclFileUploadDALService;
@Autowired
private PractitionerService practitionerService;
@Autowired
private AgAclLifePractitionerSalaryMapper practitionerSalaryMapper;
@Override
public PolicyListQueryResponseVO policyListQuery(PolicyListQueryRequestVO requestVO) {
......@@ -131,45 +135,50 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
public PayScaleQueryResponseVO payScaleListQuery(PayScaleQueryRequestVO requestVO) {
PayScaleQueryResponseVO responseVO = new PayScaleQueryResponseVO();
String practitionerIdEG = requestVO.getPractitionerIdEG();
if(!Strings.isNullOrEmpty(practitionerIdEG)){
List<PayScaleInfo> payScaleInfoListAll = aclPractitionerDALService.findPayScaleByPractitionerEG(practitionerIdEG);
if(!payScaleInfoListAll.isEmpty()){
Map<String,String> dtlTypeMap = new HashMap<>();
Map<String,String> titleMap = new HashMap<>();
List<OptionsEGolden> optionsEGoldenList = mdDropOptionsDALService.findByMasterIdsE(Collections.singletonList(101));
optionsEGoldenList.forEach(i->dtlTypeMap.put(i.getOptAttr(),i.getOptName()));
List<OptionsEGolden> titleList = mdDropOptionsDALService.findAllTitleEG();
titleList.forEach(i->titleMap.put(i.getTitleCode(),i.getTitleName()));
Map<Integer,PayScaleInfo> payScaleInfoMap = new HashMap<>();
PayScaleInfo payScaleInfo;
Integer time;
for(PayScaleInfo item : payScaleInfoListAll){
time = item.getMonDtlPeriod();
if(payScaleInfoMap.containsKey(time)){
payScaleInfo = payScaleInfoMap.get(time);
calculateRAmount(payScaleInfo,item);
}else{
calculateRAmount(item,item);
item.setMonDtlItem("实发薪水");
payScaleInfoMap.put(time,item);
item.setDrpTitleCode(titleMap.get(item.getDrpTitleCode()));
item.setMonDtlType(dtlTypeMap.get(item.getMonDtlType()));
Long practitionerId = requestVO.getPractitionerId();
}
}
//修改金钱格式
for(PayScaleInfo item : payScaleInfoListAll){
item.setMonDtlRAmount(CommonUtil.doubleFormat(item.getMonDtlRAmount(),2));
}
List<PayScaleInfo> resultList = new ArrayList<>(payScaleInfoMap.values());
resultList.sort(Comparator.comparingInt(PayScaleInfo :: getMonDtlPeriod).reversed());
responseVO.setPayScaleInfos(resultList);
}
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String[] params = {"practitionerIdEG"};
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("610002", params)));
}
List<AgAclLifePractitionerSalary> list = practitionerSalaryMapper.queryListByPractitionerId(practitionerId);
responseVO.setList(list);
// if(!Strings.isNullOrEmpty(practitionerIdEG)){
// List<PayScaleInfo> payScaleInfoListAll = aclPractitionerDALService.findPayScaleByPractitionerEG(practitionerIdEG);
// if(!payScaleInfoListAll.isEmpty()){
// Map<String,String> dtlTypeMap = new HashMap<>();
// Map<String,String> titleMap = new HashMap<>();
// List<OptionsEGolden> optionsEGoldenList = mdDropOptionsDALService.findByMasterIdsE(Collections.singletonList(101));
// optionsEGoldenList.forEach(i->dtlTypeMap.put(i.getOptAttr(),i.getOptName()));
// List<OptionsEGolden> titleList = mdDropOptionsDALService.findAllTitleEG();
// titleList.forEach(i->titleMap.put(i.getTitleCode(),i.getTitleName()));
// Map<Integer,PayScaleInfo> payScaleInfoMap = new HashMap<>();
// PayScaleInfo payScaleInfo;
// Integer time;
// for(PayScaleInfo item : payScaleInfoListAll){
// time = item.getMonDtlPeriod();
// if(payScaleInfoMap.containsKey(time)){
// payScaleInfo = payScaleInfoMap.get(time);
// calculateRAmount(payScaleInfo,item);
// }else{
// calculateRAmount(item,item);
// item.setMonDtlItem("实发薪水");
// payScaleInfoMap.put(time,item);
// item.setDrpTitleCode(titleMap.get(item.getDrpTitleCode()));
// item.setMonDtlType(dtlTypeMap.get(item.getMonDtlType()));
//
// }
// }
// //修改金钱格式
// for(PayScaleInfo item : payScaleInfoListAll){
// item.setMonDtlRAmount(CommonUtil.doubleFormat(item.getMonDtlRAmount(),2));
// }
// List<PayScaleInfo> resultList = new ArrayList<>(payScaleInfoMap.values());
// resultList.sort(Comparator.comparingInt(PayScaleInfo :: getMonDtlPeriod).reversed());
// responseVO.setPayScaleInfos(resultList);
// }
// responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
// }else{
// String[] params = {"practitionerIdEG"};
// responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("610002", params)));
// }
return responseVO;
}
......
......@@ -3,6 +3,8 @@ package com.yd.api.practitioner.vo.payscale;
public class PayScaleQueryRequestVO {
private String practitionerIdEG;
private Long practitionerId;
public String getPractitionerIdEG() {
return practitionerIdEG;
}
......@@ -10,4 +12,12 @@ public class PayScaleQueryRequestVO {
public void setPractitionerIdEG(String practitionerIdEG) {
this.practitionerIdEG = practitionerIdEG;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
}
package com.yd.api.practitioner.vo.payscale;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary;
import java.util.List;
public class PayScaleQueryResponseVO {
private List<PayScaleInfo> payScaleInfos;
private CommonResult commonResult;
private List<AgAclLifePractitionerSalary> list;
public List<PayScaleInfo> getPayScaleInfos() {
return payScaleInfos;
......@@ -23,4 +25,12 @@ public class PayScaleQueryResponseVO {
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
public List<AgAclLifePractitionerSalary> getList() {
return list;
}
public void setList(List<AgAclLifePractitionerSalary> list) {
this.list = list;
}
}
package com.yd.dal.entity.practitioner.payscale;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* ag_acl_life_practitioner_salary
* @author
*/
public class AgAclLifePractitionerSalary implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_practitioner.id 从业人员ID
*/
private Long practitionerId;
/**
* 从业人员编号
*/
private String practitionerCode;
/**
* 薪资年月
*/
private String yearMonth;
/**
* 应发佣金
*/
private BigDecimal payableAmount;
/**
* 扣除税金
*/
private BigDecimal taxoutAmount;
/**
* 实发佣金
*/
private BigDecimal netAmount;
/**
* 薪资单pdf文件
*/
private String pdfOssPath;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public String getPractitionerCode() {
return practitionerCode;
}
public void setPractitionerCode(String practitionerCode) {
this.practitionerCode = practitionerCode;
}
public String getYearMonth() {
return yearMonth;
}
public void setYearMonth(String yearMonth) {
this.yearMonth = yearMonth;
}
public BigDecimal getPayableAmount() {
return payableAmount;
}
public void setPayableAmount(BigDecimal payableAmount) {
this.payableAmount = payableAmount;
}
public BigDecimal getTaxoutAmount() {
return taxoutAmount;
}
public void setTaxoutAmount(BigDecimal taxoutAmount) {
this.taxoutAmount = taxoutAmount;
}
public BigDecimal getNetAmount() {
return netAmount;
}
public void setNetAmount(BigDecimal netAmount) {
this.netAmount = netAmount;
}
public String getPdfOssPath() {
return pdfOssPath;
}
public void setPdfOssPath(String pdfOssPath) {
this.pdfOssPath = pdfOssPath;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
AgAclLifePractitionerSalary other = (AgAclLifePractitionerSalary) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getPractitionerId() == null ? other.getPractitionerId() == null : this.getPractitionerId().equals(other.getPractitionerId()))
&& (this.getPractitionerCode() == null ? other.getPractitionerCode() == null : this.getPractitionerCode().equals(other.getPractitionerCode()))
&& (this.getYearMonth() == null ? other.getYearMonth() == null : this.getYearMonth().equals(other.getYearMonth()))
&& (this.getPayableAmount() == null ? other.getPayableAmount() == null : this.getPayableAmount().equals(other.getPayableAmount()))
&& (this.getTaxoutAmount() == null ? other.getTaxoutAmount() == null : this.getTaxoutAmount().equals(other.getTaxoutAmount()))
&& (this.getNetAmount() == null ? other.getNetAmount() == null : this.getNetAmount().equals(other.getNetAmount()))
&& (this.getPdfOssPath() == null ? other.getPdfOssPath() == null : this.getPdfOssPath().equals(other.getPdfOssPath()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getPractitionerId() == null) ? 0 : getPractitionerId().hashCode());
result = prime * result + ((getPractitionerCode() == null) ? 0 : getPractitionerCode().hashCode());
result = prime * result + ((getYearMonth() == null) ? 0 : getYearMonth().hashCode());
result = prime * result + ((getPayableAmount() == null) ? 0 : getPayableAmount().hashCode());
result = prime * result + ((getTaxoutAmount() == null) ? 0 : getTaxoutAmount().hashCode());
result = prime * result + ((getNetAmount() == null) ? 0 : getNetAmount().hashCode());
result = prime * result + ((getPdfOssPath() == null) ? 0 : getPdfOssPath().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", practitionerId=").append(practitionerId);
sb.append(", practitionerCode=").append(practitionerCode);
sb.append(", yearMonth=").append(yearMonth);
sb.append(", payableAmount=").append(payableAmount);
sb.append(", taxoutAmount=").append(taxoutAmount);
sb.append(", netAmount=").append(netAmount);
sb.append(", pdfOssPath=").append(pdfOssPath);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary;
import java.util.List;
public interface AgAclLifePractitionerSalaryMapper {
int deleteByPrimaryKey(Long id);
int insert(AgAclLifePractitionerSalary record);
int insertSelective(AgAclLifePractitionerSalary record);
AgAclLifePractitionerSalary selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AgAclLifePractitionerSalary record);
int updateByPrimaryKey(AgAclLifePractitionerSalary record);
List<AgAclLifePractitionerSalary> queryListByPractitionerId(Long practitionerId);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.practitioner.AgAclLifePractitionerSalaryMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="practitioner_code" jdbcType="VARCHAR" property="practitionerCode" />
<result column="year_month" jdbcType="VARCHAR" property="yearMonth" />
<result column="payable_amount" jdbcType="DECIMAL" property="payableAmount" />
<result column="taxout_amount" jdbcType="DECIMAL" property="taxoutAmount" />
<result column="net_amount" jdbcType="DECIMAL" property="netAmount" />
<result column="pdf_oss_path" jdbcType="VARCHAR" property="pdfOssPath" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_id, practitioner_code, `year_month`, payable_amount, taxout_amount,
net_amount, pdf_oss_path
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_life_practitioner_salary
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_life_practitioner_salary
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary" useGeneratedKeys="true">
insert into ag_acl_life_practitioner_salary (practitioner_id, practitioner_code,
`year_month`, payable_amount, taxout_amount,
net_amount, pdf_oss_path)
values (#{practitionerId,jdbcType=BIGINT}, #{practitionerCode,jdbcType=VARCHAR},
#{yearMonth,jdbcType=VARCHAR}, #{payableAmount,jdbcType=DECIMAL}, #{taxoutAmount,jdbcType=DECIMAL},
#{netAmount,jdbcType=DECIMAL}, #{pdfOssPath,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary" useGeneratedKeys="true">
insert into ag_acl_life_practitioner_salary
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="practitionerCode != null">
practitioner_code,
</if>
<if test="yearMonth != null">
`year_month`,
</if>
<if test="payableAmount != null">
payable_amount,
</if>
<if test="taxoutAmount != null">
taxout_amount,
</if>
<if test="netAmount != null">
net_amount,
</if>
<if test="pdfOssPath != null">
pdf_oss_path,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="practitionerCode != null">
#{practitionerCode,jdbcType=VARCHAR},
</if>
<if test="yearMonth != null">
#{yearMonth,jdbcType=VARCHAR},
</if>
<if test="payableAmount != null">
#{payableAmount,jdbcType=DECIMAL},
</if>
<if test="taxoutAmount != null">
#{taxoutAmount,jdbcType=DECIMAL},
</if>
<if test="netAmount != null">
#{netAmount,jdbcType=DECIMAL},
</if>
<if test="pdfOssPath != null">
#{pdfOssPath,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary">
update ag_acl_life_practitioner_salary
<set>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="practitionerCode != null">
practitioner_code = #{practitionerCode,jdbcType=VARCHAR},
</if>
<if test="yearMonth != null">
`year_month` = #{yearMonth,jdbcType=VARCHAR},
</if>
<if test="payableAmount != null">
payable_amount = #{payableAmount,jdbcType=DECIMAL},
</if>
<if test="taxoutAmount != null">
taxout_amount = #{taxoutAmount,jdbcType=DECIMAL},
</if>
<if test="netAmount != null">
net_amount = #{netAmount,jdbcType=DECIMAL},
</if>
<if test="pdfOssPath != null">
pdf_oss_path = #{pdfOssPath,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary">
update ag_acl_life_practitioner_salary
set practitioner_id = #{practitionerId,jdbcType=BIGINT},
practitioner_code = #{practitionerCode,jdbcType=VARCHAR},
`year_month` = #{yearMonth,jdbcType=VARCHAR},
payable_amount = #{payableAmount,jdbcType=DECIMAL},
taxout_amount = #{taxoutAmount,jdbcType=DECIMAL},
net_amount = #{netAmount,jdbcType=DECIMAL},
pdf_oss_path = #{pdfOssPath,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="queryListByPractitionerId" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from ag_acl_life_practitioner_salary
where practitioner_id = #{practitionerId,jdbcType=BIGINT}
</select>
</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