Commit 8f07e369 by jianan

零时薪资单2

parent 7f607ba8
......@@ -403,8 +403,9 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
private List<PayScaleInfo> queryNew(PayScaleQueryRequestVO requestVO) throws Exception {
// 1.先查本地新基本法的薪资
List<AgAclSalary> newSalaryList = agAclSalaryMapper.queryListByPractitionerId(requestVO.getPractitionerId());
List<PayScaleInfo> salaryList = this.translateAgAclSalaryToPayScaleInfo(newSalaryList);
// List<AgAclSalary> newSalaryList = agAclSalaryMapper.queryListByPractitionerId(requestVO.getPractitionerId());
List<AgAclLifePractitionerSalary> list = practitionerSalaryMapper.queryListByPractitionerIdAndIsbasic(requestVO.getPractitionerId(), 1);
List<PayScaleInfo> salaryList = this.translateAgAclLifePractitionerSalaryToPayScaleInfo(list);
// 2.再查N22
List<PayScaleInfo> listN22 = this.queryPayScaleListFromN22(requestVO);
......@@ -434,20 +435,30 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
return resultList;
}
private List<PayScaleInfo> translateAgAclSalaryToPayScaleInfo(List<AgAclSalary> newSalaryList) {
private List<PayScaleInfo> translateAgAclLifePractitionerSalaryToPayScaleInfo(List<AgAclLifePractitionerSalary> newSalaryList) {
List<PayScaleInfo> resultList = new ArrayList<>();
PayScaleInfo payScaleInfo;
for (AgAclSalary item : newSalaryList) {
String time;
for (AgAclLifePractitionerSalary salary : newSalaryList) {
payScaleInfo = new PayScaleInfo();
payScaleInfo.setMonShId(item.getId());
payScaleInfo.setMonShId(salary.getId());
payScaleInfo.setMonDtlPeriod(salary.getYearMonth());
payScaleInfo.setMonDtlAmount(salary.getPayableAmount().doubleValue());
payScaleInfo.setMonDtlRAmount(salary.getNetAmount().doubleValue());
if ("1".equals(salary.getIsBasic())) {
payScaleInfo.setIsBasic(1);
payScaleInfo.setMonDtlPeriod(item.getYearMonth());
payScaleInfo.setMonDtlAmount(item.getAmount().doubleValue());
payScaleInfo.setMonDtlRAmount(item.getAfterTaxAmount().doubleValue());
}
resultList.add(payScaleInfo);
}
for (PayScaleInfo info : resultList) {
if (StringUtils.isNotBlank(info.getMonDtlPeriod())) {
time = info.getMonDtlPeriod();
info.setYears(time.substring(0, 4));
info.setMonth(time.substring(4));
}
}
return resultList;
}
......@@ -758,6 +769,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
@Override
public QuerySalaryDetailResponseVO querySalaryDetail(QuerySalaryDetailRequestVO requestVO) {
QuerySalaryDetailResponseVO responseVO = new QuerySalaryDetailResponseVO();
// N22
if ("0".equals(requestVO.getIsBasic())) {
// 1.检查请求参数
if (StringUtils.isBlank(requestVO.getYears())||StringUtils.isBlank(requestVO.getMonth())) {
responseVO.setCommonResult(new CommonResult(false, "查询年月不能为空"));
......@@ -783,6 +796,44 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
} else {
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001")));
}
} else {
Long practitionerId = requestVO.getPractitionerId();
if (null != practitionerId) {
String years = requestVO.getYears();
String month = requestVO.getMonth();
String payoutYearmonth = "";
if (month.length() == 2) {
payoutYearmonth = years + "-" + month;
} else if (month.length() == 1) {
payoutYearmonth = years + "-0" + month;
}
AgAclSalary agAclSalary = new AgAclSalary();
agAclSalary.setPractitionerId(practitionerId);
agAclSalary.setYearMonth(payoutYearmonth);
List<AgAclSalary> newSalaryList = agAclSalaryMapper.queryByRecord(agAclSalary);
BigDecimal abc = BigDecimal.ZERO;
for (AgAclSalary item : newSalaryList) {
abc = abc.add(item.getAmount());
}
responseVO.setAbc(abc.toString());
// list
List<SalaryDetail> list = new ArrayList<>();
for (AgAclSalary item : newSalaryList) {
SalaryDetail target = new SalaryDetail();
target.setSalaryName(item.getSalaryName());
target.setCommission(item.getAmount().doubleValue());
target.setSalaryType(item.getSalaryType());
list.add(target);
}
responseVO.setList(list);
} else {
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001")));
}
}
return responseVO;
}
......
......@@ -10,4 +10,8 @@ public class QuerySalaryDetailRequestVO {
private String month;
private String agent_id;
private Long practitionerId;
private String isBasic;
}
......@@ -16,4 +16,6 @@ public class SalaryDetail {
private Double personal_tax;
private Double after_tax_comis;//税后应发
private Integer salaryType;
}
......@@ -48,6 +48,8 @@ public class AgAclLifePractitionerSalary implements Serializable {
*/
private String pdfOssPath;
private Integer isBasic;
private static final long serialVersionUID = 1L;
public Long getId() {
......@@ -169,4 +171,12 @@ public class AgAclLifePractitionerSalary implements Serializable {
sb.append("]");
return sb.toString();
}
public Integer getIsBasic() {
return isBasic;
}
public void setIsBasic(Integer isBasic) {
this.isBasic = isBasic;
}
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.payscale.AgAclLifePractitionerSalary;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -18,4 +19,6 @@ public interface AgAclLifePractitionerSalaryMapper {
int updateByPrimaryKey(AgAclLifePractitionerSalary record);
List<AgAclLifePractitionerSalary> queryListByPractitionerId(Long practitionerId);
List<AgAclLifePractitionerSalary> queryListByPractitionerIdAndIsbasic(@Param("practitionerId") Long practitionerId, @Param("isBasic") Integer isBasic);
}
\ No newline at end of file
......@@ -18,4 +18,6 @@ public interface AgAclSalaryMapper {
int updateByPrimaryKey(AgAclSalary record);
List<AgAclSalary> queryListByPractitionerId(Long practitionerId);
List<AgAclSalary> queryByRecord(AgAclSalary record);
}
\ No newline at end of file
......@@ -10,10 +10,11 @@
<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" />
<result column="is_basic" jdbcType="BIGINT" property="isBasic" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_id, practitioner_code, `year_month`, payable_amount, taxout_amount,
net_amount, pdf_oss_path
net_amount, pdf_oss_path, is_basic
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
......@@ -126,4 +127,11 @@
from ag_acl_life_practitioner_salary
where practitioner_id = #{practitionerId,jdbcType=BIGINT}
</select>
<select id="queryListByPractitionerIdAndIsbasic" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from ag_acl_life_practitioner_salary
where practitioner_id = #{practitionerId,jdbcType=BIGINT}
and is_basic = #{isBasic,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
......@@ -233,4 +233,59 @@
select * from ag_acl_salary
where practitioner_id = #{practitionerId,jdbcType=BIGINT}
</select>
<select id="queryByRecord" parameterType="com.yd.dal.entity.salary.AgAclSalary" resultMap="BaseResultMap">
select * from ag_acl_salary
where
<trim suffixOverrides=",">
<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="salaryType != null">
salary_type = #{salaryType,jdbcType=INTEGER},
</if>
<if test="salaryCode != null">
salary_code = #{salaryCode,jdbcType=VARCHAR},
</if>
<if test="salaryName != null">
salary_name = #{salaryName,jdbcType=VARCHAR},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="tax != null">
tax = #{tax,jdbcType=DECIMAL},
</if>
<if test="afterTaxAmount != null">
after_tax_amount = #{afterTaxAmount,jdbcType=DECIMAL},
</if>
<if test="lifePractitionerSalaryId != null">
life_practitioner_salary_id = #{lifePractitionerSalaryId,jdbcType=BIGINT},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</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