Commit 5ef31dc8 authored by huyuchen's avatar huyuchen

薪资审核页面接口修改

parent 2d8d9e1c
......@@ -39,9 +39,9 @@ import java.util.Date;
*/
@Data
@TableName("t_approval_record")
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode()
@Schema(description = "审批记录表")
public class TApprovalRecord extends BaseEntity {
public class TApprovalRecord {
/**
* 主键
......@@ -60,8 +60,7 @@ public class TApprovalRecord extends BaseEntity {
/**
* 节点id
*/
@ExcelAttribute(name = "节点id", isNotEmpty = true, errorInfo = "节点id不能为空", maxLength = 32)
@NotBlank(message = "节点id不能为空")
@ExcelAttribute(name = "节点id", maxLength = 32)
@Length(max = 32, message = "节点id不能超过32个字符")
@ExcelProperty("节点id")
private String nodeId;
......
......@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
......@@ -32,13 +31,16 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TApprovalRecordService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -58,6 +60,10 @@ import java.util.List;
@Log4j2
@Service
public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements TSalaryStandardService {
@Autowired
private TApprovalRecordService approvalRecordService;
/**
* 标准薪酬工资表简单分页查询
*
......@@ -234,15 +240,29 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
YifuUser user = SecurityUtils.getUser();
TSalaryStandard tSalaryStandard = baseMapper.selectById(id);
if (Common.isNotNull(tSalaryStandard)) {
//新增流程进展明细
TApprovalRecord tApprovalRecord = new TApprovalRecord();
if (CommonConstants.ZERO_STRING.equals(auditFlag)) {
tSalaryStandard.setStatus(CommonConstants.TWO_INT);
tApprovalRecord.setApprovalResult(CommonConstants.ZERO_STRING);
} else {
tSalaryStandard.setStatus(CommonConstants.FIVE_INT);
tApprovalRecord.setApprovalResult(CommonConstants.ONE_STRING);
}
if (Common.isNotNull(auditRemark)) {
tSalaryStandard.setRemark(auditRemark);
tApprovalRecord.setApprovalOpinion(auditRemark);
}
tSalaryStandard.setAuditUser(user.getId());
tSalaryStandard.setAuditTime(DateUtil.getCurrentDateTime());
baseMapper.updateById(tSalaryStandard);
tApprovalRecord.setSalaryId(tSalaryStandard.getId());
tApprovalRecord.setApprovalMan(user.getId());
tApprovalRecord.setApprovalManName(user.getNickname());
tApprovalRecord.setApprovalTime(DateUtil.getCurrentDateTime());
approvalRecordService.save(tApprovalRecord);
}
return R.ok();
......
......@@ -95,7 +95,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
* 社保缴纳月份empNo
*/
@Length(max = 6, message = "社保缴纳月份不能超过6个字符")
@ExcelAttribute(name = "社保缴纳月份", isNotEmpty = true, errorInfo = "社保缴纳月份不可为空", maxLength = 6)
@ExcelAttribute(name = "社保缴纳月份", isNotEmpty = true, errorInfo = "社保缴纳月份不可为空", maxLength = 6,isInteger = true)
@Schema(description = "社保缴纳月份")
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
......@@ -103,7 +103,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
* 社保生成月份
*/
@Length(max = 6, message = "社保生成月份不能超过6个字符")
@ExcelAttribute(name = "社保生成月份", isNotEmpty = true, errorInfo = "社保生成月份不可为空", maxLength = 6)
@ExcelAttribute(name = "社保生成月份", isNotEmpty = true, errorInfo = "社保生成月份不可为空", maxLength = 6,isInteger = true)
@Schema(description = "社保生成月份")
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
......
......@@ -38,6 +38,15 @@ import java.util.Date;
@Data
public class TPaymentInfoVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Length(max = 32, message = "主键 不能超过32 个字符")
@ExcelAttribute(name = "主键", maxLength = 32)
@Schema(description = "主键")
@ExcelProperty("主键")
private String id;
/**
* 员工姓名
*/
......@@ -115,7 +124,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 社保缴纳月份
*/
@Length(max = 6, message = "社保缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6)
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6,isInteger = true)
@Schema(description = "社保缴纳月份")
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
......@@ -123,7 +132,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 社保生成月份
*/
@Length(max = 6, message = "社保生成月份 不能超过6 个字符")
@ExcelAttribute(name = "社保生成月份", maxLength = 6)
@ExcelAttribute(name = "社保生成月份", maxLength = 6,isInteger = true)
@Schema(description = "社保生成月份")
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
......@@ -146,7 +155,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 公积金缴纳月份
*/
@Length(max = 6, message = "公积金缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6)
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6,isInteger = true)
@Schema(description = "公积金缴纳月份")
@ExcelProperty("公积金缴纳月份")
private String providentPayMonth;
......@@ -154,7 +163,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 公积金生成月份
*/
@Length(max = 6, message = "公积金生成月份 不能超过6 个字符")
@ExcelAttribute(name = "公积金生成月份", maxLength = 6)
@ExcelAttribute(name = "公积金生成月份", maxLength = 6,isInteger = true)
@Schema(description = "公积金生成月份")
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
......
......@@ -19,14 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoImportLogService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import org.apache.commons.lang.StringUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
......@@ -57,19 +55,15 @@ public class TPaymentInfoImportLogController {
@Operation(description = "导出社保导入日志")
@GetMapping("/exportPaymentInfoLog")
public void exportPaymentInfoLog(HttpServletResponse response) {
public String exportPaymentInfoLog(HttpServletResponse response) {
YifuUser user = SecurityUtils.getUser();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
String importRandom = (String) redisUtil.get(key);
if (StringUtils.isBlank(importRandom)) {
ServiceUtil.runTimeExceptionDiy("当前社保数据还未导入完成或者数据不存在");
return importRandom;
}
String res = tPaymentInfoImportLogService.exportPaymentInfoLog(response, importRandom);
if (Common.isNotNull(res)){
ServiceUtil.runTimeExceptionDiy(res);
return null;
}
}
/**
* @description: 清空社保导入日志表
......
......@@ -54,6 +54,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import com.alibaba.excel.EasyExcel;
......@@ -497,7 +498,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 处理第一个0位元素
final List<TPaymentInfoVo> finalList = list.subList(0, 1);
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2,
executeImportSocialList(user, atomicLine, random, finalList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
CommonConstants.ONE_INT, errorMessageList), yfSocialImportThreadPoolExecutor);
......@@ -512,7 +513,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoVo> finalTempList = tempList;
final int idx = i - partSize + 2;
CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2,
executeImportSocialList(user, atomicLine, random, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
idx, errorMessageList), yfSocialImportThreadPoolExecutor);
......@@ -538,7 +539,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoVo> finalTempList = tempList;
int finalLastIdx = lastIdx + 1;
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2,
executeImportSocialList(user, atomicLine, random, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
finalLastIdx, errorMessageList), yfSocialImportThreadPoolExecutor);
......@@ -557,7 +558,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} while (computeFlag);
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
redisUtil.set(importSuccessKey, random, 1800L);
DecimalFormat df = new DecimalFormat("0.00000");
String maerialRatio = df.format((float)atomicLine.get()/list.size());
redisUtil.set(importSuccessKey, maerialRatio, 1800L);
} catch (Exception e) {
log.error("社保缴费库数据批量导入异常:" + e);
......@@ -1021,6 +1024,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialSum(BigDecimalUtils.safeAdd(
paymentInfo.getUnitSocialSum(), paymentInfo.getSocialSecurityPersonalSum()));
paymentInfo.setSumAll(paymentInfo.getSocialSum());
paymentInfo.setCreateBy(user.getId());
paymentInfo.setCreateName(user.getNickname());
if (null != paymentInfo && Common.isEmpty(paymentInfo.getSocialId())) {
paymentInfo.setSocialId(UUID.randomUUID().toString());
}
......@@ -1272,7 +1277,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) {
areaMap.put(area.getAreaName(), Integer.toString(area.getId()));
areaMap.put(Integer.toString(area.getId()), area.getAreaName());
}
}
}
......@@ -1376,8 +1381,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!"));
continue;
}
if (null != fundMap || null != fundMapTemp) {
if (null != fundMap) {
if (fundMap.size() >CommonConstants.ZERO_INT || fundMapTemp.size() >CommonConstants.ZERO_INT) {
if (fundMap.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMap.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
......@@ -1387,10 +1392,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
areaArray = infoVo.getProvidentPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
fund = checkAddress(areaArray, areaMap, fund);
fund = checkAddress(areaArray, areaMap,fund);
if (null == fund || (null != fund && !ServiceUtil.checkMothForPaymentImport(
fund.getProvidentStart(), infoVo.getProvidentPayMonth(), fund.getFundReduceDate()))) {
if (null != fundMapTemp) {
if (fundMapTemp.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMapTemp.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
......@@ -1406,7 +1411,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for (TProvidentFund f : fundListTemp) {
if (f.getEmpIdcard().equals(infoVo.getEmpIdcard()) && ServiceUtil.checkMothForPaymentImport(
f.getProvidentStart(), infoVo.getProvidentPayMonth(), f.getFundReduceDate())) {
fund = checkAddress(areaArray, areaMap, f);
fund = checkAddress(areaArray, areaMap,f);
if (null != fund) {
break;
}
......@@ -1432,7 +1437,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//计算公积金合计,个人金额和单位金额一致
infoVo.setProvidentSum(BigDecimalUtils.safeAdd(infoVo.getUnitProvidentSum(), infoVo.getUnitProvidentSum()));
// 判重
if (null != paymentInfoMap) {
if (paymentInfoMap.size() >CommonConstants.ZERO_INT) {
paymentInfo = (TPaymentInfo) paymentInfoMap.get(infoVo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim()
......@@ -1849,6 +1854,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
if (socialInfo != null && socialInfo.getSocialStartDate() == null) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), infoVo.getEmpIdcard() + "的社保起缴日期为空!"));
......@@ -2104,6 +2110,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
payExists.setSumAll(payExists.getSocialSum());
payExists.setCreateBy(user.getId());
payExists.setCreateName(user.getNickname());
if (null != payExists && Common.isEmpty(payExists.getSocialId())) {
payExists.setSocialId(UUID.randomUUID().toString());
}
......@@ -2230,12 +2238,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
if (areaArray.length >= CommonConstants.TWO_INT) {
if (null != s.getFundProvince()) {
if (areaArray[0].equals(areaMap.get(String.valueOf(s.getFundProvince())))) {
if (areaArray[0].equals(areaMap.get(s.getFundProvince()))) {
if (null != s.getFundCity()) {
if (areaArray[1].equals(areaMap.get(String.valueOf(s.getFundCity())))) {
if (areaArray[1].equals(areaMap.get(s.getFundCity()))) {
if (areaArray.length >= CommonConstants.THREE_INT) {
if (null != s.getFundTown() && areaArray[CommonConstants.TWO_INT].equals(
areaMap.get(String.valueOf(s.getFundTown())))) {
areaMap.get(s.getFundTown()))) {
return s;
}
} else {
......@@ -2255,7 +2263,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} else if (areaArray.length == 1) {
if (null != s.getFundProvince() && null == s.getFundCity()) {
if (areaArray[0].equals(areaMap.get(String.valueOf(s.getFundProvince())))) {
if (areaArray[0].equals(areaMap.get(s.getFundProvince()))) {
return s;
}
} else {
......
......@@ -197,10 +197,11 @@
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.CREATE_USER,
a.CREATE_BY,
a.UPDATE_TIME,
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.LAST_UPDATE_USER,
a.LAST_UPDATE_TIME,
a.LOCK_STATUS,
a.SUM_ALL,
a.PROVIDENT_PAY_MONTH,
......
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