Commit cc707139 authored by wangzb's avatar wangzb

feature-wzb :通讯补贴自然月限制

parent ec56fdf7
......@@ -361,5 +361,13 @@ public class TSalaryAccountVo implements Serializable {
@ExcelProperty("是否新员工(默认否)")
private String isNewEmployee;
/**
* 应发薪酬(劳务费、稿酬)
*/
@ExcelAttribute(name = "通讯补贴(不计税)")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("通讯补贴(不计税)")
private BigDecimal phoneSubsidy;
private List<TSalaryAccountItemVo> saiList = new ArrayList<>(); //工资组成部分明细
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmpRosterVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
......@@ -50,5 +51,7 @@ public interface TSalaryEmployeeMapper extends BaseMapper<TSalaryEmployee> {
TSalaryEmployee getByEmpIdCard(@Param("empIdCard") String empIdCard);
TSalaryAccountItem selectByIdCard(@Param("empIdCard") String empIdCard, @Param("nowMonth") String nowMonth);
List<TSalaryEmpRosterVo> getSalaryEmpRoster(@Param("idCards") List<String> idCardList);
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
......@@ -50,6 +51,8 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> {
List<TSalaryEmployeeExportVo> noPageDiy(TSalaryEmployeeSearchVo searchVo);
TSalaryAccountItem selectByIdcard(String idCard,String nowMonth);
/**
* @param notLabour 是:非劳务费人员。 否:劳务费,不保存
* @param employee
......
......@@ -43,6 +43,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TBankSetService;
......@@ -164,6 +165,11 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
return baseMapper.noPageDiy(searchVo,Common.getList(searchVo.getIds()));
}
@Override
public TSalaryAccountItem selectByIdcard(String idCard,String nowMonth) {
return baseMapper.selectByIdCard(idCard,nowMonth);
}
private Long noPageCountDiy(TSalaryEmployeeSearchVo searchVo) {
LambdaQueryWrapper<TSalaryEmployee> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
......@@ -11,6 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryConfigStandard;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
......@@ -21,6 +22,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountVo;
import lombok.Data;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import java.io.Serializable;
import java.lang.reflect.Field;
......@@ -119,6 +121,7 @@ public class SalaryAccountUtil implements Serializable {
String empName;
String salaryStyle;//工资发放方式(0现金/1银行)/2线下
BigDecimal relaySalary; //应发工资
BigDecimal phoneSubsidy;
BigDecimal relaySalarySum; //应发工资合计,算3500与5000使用的
BigDecimal money3500 = new BigDecimal("3500"); //特殊金额3500
BigDecimal money5000 = new BigDecimal("5000"); //特殊金额5000
......@@ -154,6 +157,7 @@ public class SalaryAccountUtil implements Serializable {
saiList = new ArrayList<>();
salaryStyle = SalaryConstants.SALARY_STYLE_BANK;
relaySalary = null;
phoneSubsidy =null;
actualSalarySum = null;
entity.setSettlementMonth(nowMonth);
for (Map.Entry<String, TSalaryConfigStandard> entry : salaryConfigMap.entrySet()) {
......@@ -174,6 +178,15 @@ public class SalaryAccountUtil implements Serializable {
if (SalaryConstants.ANNUAL_BONUS_JAVA.equals(scs.getJavaFiedName()) && Common.isNotNull(cellValueStr)) {
annualBonusFlag = true;
}
if (SalaryConstants.PHONE_SUBSIDY_JAVA.equals(scs.getJavaFiedName())) {
BigDecimal bigDecimal1 = NumberUtils.createBigDecimal(cellValueStr);
if(bigDecimal1.compareTo(BigDecimal.valueOf(300)) == 1) {
errorFlag = false;
error = "第" + (i + 2) + "行:当月已发"+cellValueStr+"元,超出300元的限制,禁止导入";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
}
if (SalaryConstants.ANNUAL_BONUS_TAX_TYPE.equals(scs.getJavaFiedName())) {
if (SalaryConstants.ANNUAL_BONUS_ALONE.equals(cellValueStr)) {
entity.setAnnualBonusType(SalaryConstants.ANNUAL_BONUS_TAX_TYPE_VALUE[1]);
......@@ -198,6 +211,22 @@ public class SalaryAccountUtil implements Serializable {
continue;
}
}
if (SalaryConstants.PHONE_SUBSIDY_JAVA.equals(scs.getJavaFiedName())) {
try {
phoneSubsidy = new BigDecimal(cellValueStr.replace(",", ""));
sai = new TSalaryAccountItemVo();
sai.setCnName(dbFiedName);
sai.setJavaFiedName(scs.getJavaFiedName());
sai.setIsTax(CommonConstants.ZERO_INT);
sai.setSalaryMoney(phoneSubsidy);
saiList.add(sai);
} catch (Exception e) {
errorFlag = false;
error = "第" + (i + 2) + "行:通讯补贴:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
}
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(scs.getJavaFiedName())) {
try {
actualSalarySum = new BigDecimal(cellValueStr.replace(",", ""));
......@@ -230,6 +259,7 @@ public class SalaryAccountUtil implements Serializable {
}
newEmp.setEmpName(empName);
}
if ((SalaryConstants.IF_NEW_EMPLOYEE.equals(dbFiedName) || SalaryConstants.IS_NEW_EMPLOYEE.equals(dbFiedName))
&& SalaryConstants.IS_NEW.equals(cellValueStr)) {
isNewEmployee = true;
......@@ -250,10 +280,13 @@ public class SalaryAccountUtil implements Serializable {
emp = empIdCardMap.get(cellValueStr);
newEmp.setEmpIdcard(cellValueStr);
}
if (SalaryConstants.SALARY_GIVE_TIME.equals(cellValueStr)) {
salaryGiveTimeFlag = false;
entity.setSalaryGiveTime(CommonConstants.ONE_STRING);
}
field = fieldsMap.get(scs.getJavaFiedName());
if (field == null) {
sai = new TSalaryAccountItemVo();
......@@ -299,13 +332,9 @@ public class SalaryAccountUtil implements Serializable {
errorList.add(new ErrorMessage((i + 2), "请注意:工资发放时间,只能是【立即发】或【暂停发】!你的内容:【"+cellValueStr+"】"));
continue;
}
if (SalaryConstants.SALARY_STYLE.equals(scs.getJavaFiedName())
&& !SalaryConstants.SALARY_STYLE_YIN.equals(cellValueStr)
&& !SalaryConstants.SALARY_STYLE_XIAN.equals(cellValueStr)) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "请注意:发放方式,只能是【银行】或【现金】!你的内容:【"+cellValueStr+"】"));
continue;
}
if (SalaryConstants.IS_PERSON_TAX.equals(scs.getJavaFiedName())
&& !SalaryConstants.IS_COMPANY.equals(cellValueStr)
&& !SalaryConstants.IS_PERSON_OTHER.equals(cellValueStr)
......@@ -341,7 +370,16 @@ public class SalaryAccountUtil implements Serializable {
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
TSalaryAccountItem item=tSalaryEmployeeService.selectByIdcard(newEmp.getEmpIdcard(),nowMonth);
if(Common.isNotNull(item)) {
BigDecimal LL = item.getSalaryMoney().add(phoneSubsidy);
if (LL.compareTo(BigDecimal.valueOf(300)) == 1) {
BigDecimal HH = LL.subtract(phoneSubsidy);
error = "第" + (i + 2) + "行:当月已发"+HH+"元,超出300元的限制,禁止导入";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
}
if (annualBonusFlag && Common.isEmpty(entity.getAnnualBonusType())) {
error = "第" + (i + 2) + "行:年终奖有值,【年终奖扣税方式】需填写【单独】/【合并】";
errorList.add(new ErrorMessage((i + 2), error));
......@@ -369,7 +407,6 @@ public class SalaryAccountUtil implements Serializable {
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
// 版本2.6.6判重:对同一“项目”、同一“结算月份”、同一“报表类型”、同一“工资月份”、同一“身份证号”、同一“应发金额”进行校验
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
entity.setIsRepeat(CommonConstants.ZERO_INT);
......@@ -450,6 +487,10 @@ public class SalaryAccountUtil implements Serializable {
entity.setIsDeductFund("0");
}
}
//通讯补贴导入限制
//验证扣社保以及扣公积金时的关联关系
if (CommonConstants.dingleDigitStrArray[1].equals(entity.getIsDeductSocial()) && Common.isEmpty(entity.getDeduSocialMonth())) {
error = "第" + (i + 2) + "行:扣社保无社保扣缴月份";
......@@ -482,6 +523,7 @@ public class SalaryAccountUtil implements Serializable {
List<TSalaryEmployee> saveNewEmpList = new ArrayList<>();
List<String> checkTaxMonthList = new ArrayList<>();
boolean isContinue = true;
if (!newEmpList.isEmpty()) {
TSalaryEmployee newEmps;
for (int i = 0; i < newEmpList.size(); i++) {
......
......@@ -198,6 +198,6 @@ public class SalaryConstants {
public static final String SALARY_STYLE = "salaryStyle";
public static final String SALARY_STYLE_YIN = "银行";
public static final String SALARY_STYLE_XIAN = "现金";
public static final String SALARY_PHONES = "通讯补贴(不计税)";
public static final String IS_PERSON_TAX = "isPersonTax";
}
......@@ -264,6 +264,23 @@
where a.EMP_IDCARD = #{empIdCard}
ORDER BY a.BANK_CITY DESC LIMIT 1
</select>
<select id="selectByIdCard" resultType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem">
SELECT
a.ID,
a.SALARY_ACCOUNT_ID,
a.CN_NAME,
a.JAVA_FIED_NAME,
SUM(a.SALARY_MONEY)SALARY_MONEY,
a.IS_TAX,
a.TEXT_VALUE,
b.EMP_IDCARD,
b.SALARY_MONTH
FROM `t_salary_account_item` a LEFT JOIN t_salary_account b on a.SALARY_ACCOUNT_ID =b.ID
WHERE a.JAVA_FIED_NAME ='phoneSubsidy'
and b.EMP_IDCARD= #{empIdCard}
and b.SETTLEMENT_MONTH=#{nowMonth}
</select>
<!-- 人员花名册薪资信息 -->
<select id="getSalaryEmpRoster" resultMap="salaryEmpRosterMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmpRosterVo">
select a.EMP_IDCARD,BANK_NO,BANK_NAME,BANK_SUB_NAME,a.BANK_PROVINCE,a.BANK_CITY from t_salary_employee a
......
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