Commit 694b7e9d authored by huyuchen's avatar huyuchen

项目档案问题优化

parent 8b50aa99
......@@ -52,6 +52,8 @@ public class EmployeeConstants {
public static final String CONTRACT_REDUCE_INFO_NOT_EMPTY = "合同终止时离职日期和减少原因必填";
public static final String CONTRACT_REDUCE_REASON_NOT_EMPTY = "终止原因为其他时原因说明必填";
/**
* 无数据可更新
**/
......
......@@ -858,11 +858,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())
|| EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation())) {
// 终止 离职日期 和减少原因必填
if (EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation())
&& (Common.isEmpty(insert.getReduceReason())
|| Common.isEmpty(insert.getLeaveDate()))){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CONTRACT_REDUCE_INFO_NOT_EMPTY));
return;
if (EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation())) {
if (Common.isEmpty(insert.getReduceReason()) || Common.isEmpty(insert.getLeaveDate())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CONTRACT_REDUCE_INFO_NOT_EMPTY));
return;
}
if (EmployeeConstants.OTHERS.equals(insert.getReduceReason()) &&
Common.isEmpty(insert.getReason())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CONTRACT_REDUCE_REASON_NOT_EMPTY));
return;
}
}
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
......
......@@ -1506,7 +1506,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAccount> aList = new ArrayList<>();
TSalaryAccount a;//定库:
BigDecimal relaySalarySum = BigDecimal.ZERO; //工资应发
List<TSalaryAccountItem> asList; //累计扣税
int size = savList.size();
// 自有员工人数
int ownNum = 0;
......@@ -1518,16 +1517,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 是否重复金额false:否;true:是
boolean repeatFlag = false;
List<String> idCardList = new ArrayList<>();
for (TSalaryAccountVo vo : savList) {
if (Common.isNotNull(vo.getEmpIdcard())) {
idCardList.add(vo.getEmpIdcard());
}
}
// 工资查询所需的全部list,组装Map来使用
Map<String, List<TSalaryAccountItem>> itemMap = tSalaryAccountItemService.getAllItemVoList(idCardList, invoiceTitle);
TSalaryAccountItem sai;
for (int i = CommonConstants.ZERO_INT; i < size; i++) {
a = new TSalaryAccount();
......@@ -1549,14 +1538,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
//累计扣税list
asList = this.getLaborAsList(itemMap.get(a.getEmpIdcard()), a.getSettlementMonth());
// 实发劳务费,按月累计扣税
this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculationLabor(saiList, asList
, saiList, a), CommonConstants.ZERO_INT);
calculationLabor(saiList, saiList, a), CommonConstants.ZERO_INT);
// 自有员工以及自有员工应发金额
if (Common.isNotNull(a.getOwnFlag()) && a.getOwnFlag() == 1) {
......@@ -1584,6 +1569,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
salary.setHaveSpecialFlag(CommonConstants.ZERO_INT);
salary.setIsRepeat(CommonConstants.ZERO_INT);
salary.setStatus(SalaryConstants.AUDIT_STATUS[0]);
salary.setSalaryMonth(DateUtil.getThisMonth());
if (haveSalaryFlag || ownNum > 0 || repeatFlag) {
if (haveSalaryFlag) {
salary.setHaveSalaryFlag(CommonConstants.ONE_INT);
......@@ -1612,6 +1598,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
account.setSaiList(null);
account.setOrderId(salary.getOrderId());
account.setSalaryFormId(salary.getId());
account.setSalaryMonth(DateUtil.getThisMonth());
tSalaryAccountService.save(account);
for (TSalaryAccountItem item : saiList) {
item.setSalaryAccountId(account.getId());
......@@ -1629,15 +1616,13 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param itemList
* @param itemHistoryList
* @param saiList
* @Description: 计算劳务费个税、应发
* @Author: hgw
* @Date: 2022/3/3 11:30
* @return: java.math.BigDecimal
**/
private BigDecimal calculationLabor(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> itemHistoryList,
List<TSalaryAccountItem> saiList, TSalaryAccount a) {
private BigDecimal calculationLabor(List<TSalaryAccountItem> itemList,List<TSalaryAccountItem> saiList, TSalaryAccount a) {
// B7 = 当月实发合计
// 税=ROUND(IF(B7<=800,0,IF(B7<=3360,(B7-800)/4,IF(B7<=21000,0.16*B7/0.84,IF(B7<=49500,(0.24*B7-2000)/0.76,(0.32*B7-7000)/0.68)))),2)
// 本次实发
......
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