Commit 2815ba7e authored by hongguangwu's avatar hongguangwu

特殊金额

parent c3260b74
......@@ -55,6 +55,7 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
* @return: java.util.List<java.lang.String>
**/
List<AccountCheckVo> getAccountCheckList(@Param("settleId") String settleId, @Param("settleMonth") String settleMonth);
List<AccountCheckVo> getAccountSpecialList(@Param("invoiceTitle") String invoiceTitle, @Param("unitId") String unitId, @Param("salaryMonth") String salaryMonth);
List<AccountCheckVo> getAccountCheckListLabor(@Param("settleId") String settleId, @Param("settleMonth") String settleMonth);
......
......@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
......@@ -57,6 +58,8 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
**/
Map<String, Integer> getAccountCheckMap(String settleId, String settleMonth, String salaryType);
Map<String, BigDecimal> getAccountSpecialMap(String invoiceTitle, String unitId, String salaryMonth);
/**
* @param empIdCard
* @param nowYear
......
......@@ -126,7 +126,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return R.failed("获取登录用户信息失败!");
}
TConfigSalary configSalary = new TConfigSalary();
TConfigSalary configSalary;
if (Common.isNotNull(configId)) {
// 薪资配置-结算月、社保月等信息
......@@ -168,6 +168,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()), salaryType);
Map<String, BigDecimal> specialMap = tSalaryAccountService.getAccountSpecialMap(invoiceTitle, dept.getCustomerId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
List<String> checkListY = new ArrayList<>();
// 劳务费和稿酬 薪资类型互斥校验Map格式:本年度#身份证号
if (CommonConstants.THREE_STRING.equals(salaryType) || CommonConstants.FOUR_STRING.equals(salaryType)) {
......@@ -178,7 +180,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
util1.getJsonStringToList(user, jsonString, dept, configSalary, salaryConfigMap, isMustMap,
empIdCardMap, empNameMap, isDuplicateName, salaryType, checkListY, invoiceTitle,
employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
employeeService, checkMap, specialMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
......
......@@ -174,6 +174,18 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
return map;
}
@Override
public Map<String, BigDecimal> getAccountSpecialMap(String invoiceTitle, String unitId, String salaryMonth) {
List<AccountCheckVo> list = baseMapper.getAccountSpecialList(invoiceTitle, unitId, salaryMonth);
Map<String, BigDecimal> map = new HashMap<>();
if (list != null && !list.isEmpty()) {
for (AccountCheckVo str : list) {
map.put(str.getTitle(), str.getRelaySalary());
}
}
return map;
}
/**
* @param empIdCard
* @param nowYear
......
......@@ -66,7 +66,7 @@ public class SalaryAccountUtil implements Serializable {
, TConfigSalary configSalary, Map<String, TSalaryConfigStandard> salaryConfigMap, Map<String, Boolean> isMustMap
, Map<String, TSalaryEmployee> empIdCardMap, Map<String, TSalaryEmployee> empNameMap, boolean isDuplicateName
, String salaryType, List<String> checkListY,String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, Map<String, Integer> checkMap, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> checkMap, Map<String, BigDecimal> specialMap, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService) {
List<TSalaryAccountVo> tList = new ArrayList<>();
List<HashMap> list = JSONObject.parseArray(jsonStr, HashMap.class);
......@@ -111,6 +111,9 @@ public class SalaryAccountUtil implements Serializable {
String empName;
String salaryStyle;//工资发放方式(0现金/1银行)/2线下
BigDecimal relaySalary; //应发工资
BigDecimal relaySalarySum; //应发工资合计,算3500与5000使用的
BigDecimal money3500 = new BigDecimal("3500"); //特殊金额3500
BigDecimal money5000 = new BigDecimal("5000"); //特殊金额5000
BigDecimal actualSalarySum; //实发工资
// 当前年月
String nowMonth = DateUtil.addMonth(CommonConstants.ZERO_INT);
......@@ -329,8 +332,9 @@ public class SalaryAccountUtil implements Serializable {
+ CommonConstants.DOWN_LINE_STRING + salaryType + CommonConstants.DOWN_LINE_STRING + relaySalary) != null) {
entity.setIsRepeat(CommonConstants.ONE_INT);
}
if (new BigDecimal("3500").compareTo(relaySalary) == CommonConstants.ZERO_INT
|| new BigDecimal("5000").compareTo(relaySalary) == CommonConstants.ZERO_INT) {
relaySalarySum = BigDecimalUtils.safeAdd(relaySalary, specialMap.get(entity.getEmpIdcard()));
if (money3500.compareTo(relaySalarySum) == CommonConstants.ZERO_INT
|| money5000.compareTo(relaySalarySum) == CommonConstants.ZERO_INT) {
entity.setHaveSpecialFlag(CommonConstants.ONE_INT);
}
}
......
......@@ -261,6 +261,16 @@
where a.DELETE_FLAG = 0 and a.DEPT_ID = #{settleId} and a.SALARY_MONTH = #{settleMonth}
</select>
<!-- 获取校验的报账明细 ### 格式:身份证号_工资月份_报表类型_应发金额 -->
<select id="getAccountSpecialList" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo">
select
a.EMP_IDCARD title,ifnull(relaySalary.SALARY_MONEY,0) relaySalary
from t_salary_account a
t_salary_standard s on a.SALARY_FORM_ID = s.id
left join t_salary_account_item relaySalary on relaySalary.SALARY_ACCOUNT_ID = a.id and relaySalary.JAVA_FIED_NAME='relaySalary'
where a.DELETE_FLAG = 0 and s.UNIT_ID = #{unitId} and a.SALARY_MONTH = #{salaryMonth}
</select>
<!-- 获取校验的报账明细 ### 格式:身份证号_工资月份_报表类型_应发金额 -->
<select id="getAccountCheckListLabor" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo">
select
......
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