Commit a6a2a0d5 authored by huyuchen's avatar huyuchen

劳务费导入修改

parent 348de57c
......@@ -77,4 +77,13 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
@Param("month2")String month2,
@Param("month3")String month3);
/**
* @param settleId
* @Description: 薪资类型互斥校验 获取本年度身份证号列表
* @Author: huyc
* @Date: 2022/8/18
* @return:
**/
List<String> getAccountYearCheckList(@Param("settleId") String settleId);
}
......@@ -76,4 +76,12 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
**/
List<THaveSalaryNosocial> getLastMonthTHaveSalaryNosocial(String month);
/**
* @param settleId
* @Description: 薪资类型互斥校验 获取本年度身份证号列表
* @Author: huyc
* @Date: 2022/8/18
* @return:
**/
List<String> getAccountYearCheckMap(String settleId);
}
......@@ -168,7 +168,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
util1.getJsonStringToList(user, jsonString,
dept, configSalary, salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName
, salaryType, invoiceTitle, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
, salaryType, null,invoiceTitle, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
......@@ -220,14 +220,19 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 自有员工所在结算主体Map
Map<String, Integer> ownEmployeeMap = tOwnDeptService.getOwnEmpMap();
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
// 薪资类型互斥校验Map格式:本年度#身份证号_报表类型
List<String> checkListY = new ArrayList<>();
if (Common.isNotNull(configSalary)) {
checkListY = tSalaryAccountService.getAccountYearCheckMap(dept.getId());
}
// 校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map<String, Integer> checkMap = new HashMap<>();
if (Common.isNotNull(configSalary)) {
checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
}
util1.getJsonStringToList(user, jsonString, dept, !Common.isNotNull(configSalary) ? null: configSalary,
salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName, salaryType,
null, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName, salaryType,checkListY
,null, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
......@@ -1730,7 +1735,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal salaryTax = BigDecimalUtils.safeSubtract(nowTaxY,BigDecimalUtils.safeAdd(nowTaxT,sumTax));
a.setSalaryTax(salaryTax);
a.setRelaySalaryUnit(relaySalary);
a.setSalaryTaxUnit(nowTaxT);
a.setActualSalary(BigDecimalUtils.safeSubtract(actualSalarySumNow,salaryTax));
} else {
......@@ -1739,10 +1743,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumTax).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
}
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxY).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
a.setRelaySalaryUnit(relaySalary);
a.setSalaryTaxUnit(nowTaxY);
a.setActualSalary(actualSalarySumNow);
}
a.setRelaySalaryUnit(relaySalary);
// 本次个人应发合计
TSalaryAccountItem sai = new TSalaryAccountItem();
sai.setCnName(SalaryConstants.RELAY_SALARY);
......
......@@ -195,4 +195,9 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
DateUtil.getYearAndMonth(month,CommonConstants.ONE_INT),
DateUtil.getYearAndMonth(month,CommonConstants.TWO_INT));
}
@Override
public List<String> getAccountYearCheckMap(String settleId) {
return baseMapper.getAccountYearCheckList(settleId);
}
}
......@@ -65,7 +65,7 @@ public class SalaryAccountUtil implements Serializable {
public void getJsonStringToList(YifuUser user, String jsonStr, TSettleDomainSelectVo dept
, TConfigSalary configSalary, Map<String, TSalaryConfigStandard> salaryConfigMap, Map<String, Boolean> isMustMap
, Map<String, TSalaryEmployee> empIdCardMap, Map<String, TSalaryEmployee> empNameMap, boolean isDuplicateName
, String salaryType, String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, String salaryType, List<String> checkListY,String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, Map<String, Integer> checkMap, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService) {
List<TSalaryAccountVo> tList = new ArrayList<>();
......@@ -305,6 +305,9 @@ public class SalaryAccountUtil implements Serializable {
entity.setHaveSpecialFlag(CommonConstants.ONE_INT);
}
}
if (Common.isNotNull(checkListY) && checkListY.contains(entity.getEmpIdcard())) {
entity.setHaveSalaryFlag(CommonConstants.ONE_INT);
}
if (null == error) {
if (Common.isNotNull(entity.getSalaryStyle())) {
salaryStyle = entity.getSalaryStyle();
......
......@@ -313,4 +313,11 @@
and a.social = 0
GROUP BY a.EMP_IDCARD HAVING count(1) = 3
</select>
<!-- 薪资类型互斥校验 获取本年度身份证号列表 -->
<select id="getAccountYearCheckList" resultType="java.lang.String">
select a.EMP_IDCARD
from t_salary_account a
where a.DELETE_FLAG = 0 and a.DEPT_ID = #{settleId} and a.FORM_TYPE = '0' and a.SALARY_MONTH like concat(DATE_FORMAT(NOW(), '%Y'), '%')
</select>
</mapper>
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