Commit 7ef00a57 authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents 5369e292 4c82cca4
...@@ -235,6 +235,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -235,6 +235,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.lambda().eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_STRING) .lambda().eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_STRING)
.isNotNull(TEmployeeContractInfo::getAuditTimeLast) .isNotNull(TEmployeeContractInfo::getAuditTimeLast)
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getContractType,CommonConstants.ONE_STRING) .eq(TEmployeeContractInfo::getContractType,CommonConstants.ONE_STRING)
.eq(TEmployeeContractInfo::getWorkFlag,CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getWorkFlag,CommonConstants.ZERO_STRING)
.ne(TEmployeeContractInfo::getSituation,"续签 ") .ne(TEmployeeContractInfo::getSituation,"续签 ")
......
...@@ -61,7 +61,6 @@ import javax.servlet.ServletOutputStream; ...@@ -61,7 +61,6 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -2007,23 +2006,22 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2007,23 +2006,22 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list); //EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeExportVO.class).includeColumnFieldNames(searchVo.getExportFields()).build(); ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
// 获取所有字典type
Map<String,String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeExportVO.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap))
.includeColumnFieldNames(searchVo.getExportFields()).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT){ if (count > CommonConstants.ZERO_INT){
Field[] allFields = EmployeeExportVO.class.getDeclaredFields();
WriteSheet writeSheet; WriteSheet writeSheet;
ExcelUtil<EmployeeExportVO> util;
for (int i = 0; i <= count; ) { for (int i = 0; i <= count; ) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo); list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo:list){
util.convertEntityAsso(vo,null,null,null,allFields);
}
}
if (Common.isNotNull(list)){ if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet("人员档案批量导出"+index).build(); writeSheet = EasyExcel.writerSheet("人员档案批量导出"+index).build();
excelWriter.write(list,writeSheet); excelWriter.write(list,writeSheet);
...@@ -2088,7 +2086,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2088,7 +2086,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeLeaveExportVO.class).includeColumnFieldNames(searchVo.getExportFields()).build(); ExcelWriter excelWriter = EasyExcel.write(out, EmployeeLeaveExportVO.class).includeColumnFieldNames(searchVo.getExportFields()).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT){ if (count > CommonConstants.ZERO_INT){
Field[] allFields = EmployeeLeaveExportVO.class.getDeclaredFields();
WriteSheet writeSheet; WriteSheet writeSheet;
ExcelUtil<EmployeeLeaveExportVO> util; ExcelUtil<EmployeeLeaveExportVO> util;
for (int i = 0; i <= count; ) { for (int i = 0; i <= count; ) {
...@@ -2096,12 +2093,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2096,12 +2093,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageLeaveDiy(searchVo); list = noPageLeaveDiy(searchVo);
/*if (Common.isNotNull(list)){
util = new ExcelUtil<>(EmployeeLeaveExportVO.class);
for (EmployeeLeaveExportVO vo:list){
util.convertEntityAsso(vo,null,null,null,allFields);
}
}*/
if (Common.isNotNull(list)){ if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet("离职档案批量导出"+index).build(); writeSheet = EasyExcel.writerSheet("离职档案批量导出"+index).build();
excelWriter.write(list,writeSheet); excelWriter.write(list,writeSheet);
......
...@@ -30,8 +30,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -30,8 +30,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants; import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
...@@ -187,9 +185,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -187,9 +185,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setUnitId(tSettleDomain.getCustomerId()); tEmployeeProject.setUnitId(tSettleDomain.getCustomerId());
tEmployeeProject.setUnitNo(tSettleDomain.getCustomerNo()); tEmployeeProject.setUnitNo(tSettleDomain.getCustomerNo());
tEmployeeProject.setUnitName(tSettleDomain.getCustomerName()); tEmployeeProject.setUnitName(tSettleDomain.getCustomerName());
String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO);
} }
String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO);
tEmployeeProject.setEmpId(tEmployeeInfo.getId()); tEmployeeProject.setEmpId(tEmployeeInfo.getId());
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]); tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
this.save(tEmployeeProject); this.save(tEmployeeProject);
...@@ -639,7 +637,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -639,7 +637,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/** /**
* 单次缓存的数据量 * 单次缓存的数据量
*/ */
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT; public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT1;
/** /**
*临时存储 *临时存储
*/ */
...@@ -705,9 +703,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -705,9 +703,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String idCard; String idCard;
String deptNo; String deptNo;
TSettleDomain tSettleDomain;
TEmployeeInfo tEmployeeInfo;
TEmployeeProject tEmployeeProject;
EmployeeProjectVO excel;
// 执行数据插入操作 组装 PostDto // 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
EmployeeProjectVO excel = excelVOList.get(i); excel = excelVOList.get(i);
idCard = excel.getEmpIdcard(); idCard = excel.getEmpIdcard();
deptNo = excel.getDeptNo(); deptNo = excel.getDeptNo();
...@@ -732,7 +734,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -732,7 +734,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} }
//项目编码校验 //项目编码校验
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda() tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getDeptNo()) .eq(TSettleDomain::getDepartNo, excel.getDeptNo())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING) .eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
...@@ -741,18 +743,18 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -741,18 +743,18 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} }
//根据身份证获取人员档案 //根据身份证获取人员档案
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda() tEmployeeInfo= tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard()) .eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL)); .eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
//根据身份证和项目编码获取项目档案 //根据身份证和项目编码获取项目档案
TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda() tEmployeeProject = baseMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()) .eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeProject::getDeptNo, excel.getDeptNo()) .eq(TEmployeeProject::getDeptNo, excel.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)); .eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL));
//状态为草稿、已审核 //状态为草稿、已审核
if (Common.isNotNull(tEmployeeProject) && (CommonConstants.dingleDigitIntArray[0] == tEmployeeProject.getStatus() || if (Common.isNotNull(tEmployeeProject) && (CommonConstants.ZERO_INT == tEmployeeProject.getStatus() ||
CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getStatus())) { CommonConstants.ONE_INT == tEmployeeProject.getStatus())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.EXIT_PRIJECT_STATUS)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.EXIT_PRIJECT_STATUS));
} }
//不存在复档或复项的情况 //不存在复档或复项的情况
...@@ -761,87 +763,47 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -761,87 +763,47 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EXIT_EMPPROJECT_ERROR))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EXIT_EMPPROJECT_ERROR)));
//档案有(在档人员),项目无 //档案有(在档人员),项目无
} else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject) } else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)
&& CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) { && CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus()) {
/*if (Common.isNotNull(excel.getBankNo())) {
TCheckBankNo check = new TCheckBankNo();
check.setBankNo(excel.getBankNo());
check.setIdNum(excel.getEmpIdcard());
check.setName(excel.getEmpName());
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckBankNoVo vo = checkListR.getData();
check = (null == vo.getRes()) ? null : vo.getRes().getData();
if (Common.isEmpty(vo)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), vo.getRes().getMsg()));
} else if (null != check && !check.getResult().equals(CommonConstants.ZERO_ONE)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getRemark()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
}
}*/
updateExcelPost(updateList, tEmployeeInfo); updateExcelPost(updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList, tEmployeeInfo); insertExcelPro(excel, proInsList, tEmployeeInfo,tSettleDomain);
//档案有(在档人员),项目有(草稿/已审核); //档案有(在档人员),项目有(草稿/已审核);
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus() } else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[0] == tEmployeeProject.getProjectStatus()) { && Common.isNotNull(tEmployeeProject) && CommonConstants.ZERO_INT == tEmployeeProject.getProjectStatus()) {
updateExcelPost(updateList, tEmployeeInfo); updateExcelPost(updateList, tEmployeeInfo);
updateExcelPro(excel, proupdateList, tEmployeeProject); updateExcelPro(excel, proupdateList, tEmployeeProject);
} }
//存在复档或复项的情况,允许复档复项 //存在复档或复项的情况,允许复档复项
if (CommonConstants.ONE_STRING.equals(idAdd)) { if (Common.isNotNull(tEmployeeInfo)) {
//档案有(离职库),项目(已减档) if (CommonConstants.ONE_STRING.equals(idAdd)) {
if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus() //档案有(离职库),项目(已减档)
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) { if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus() && Common.isNotNull(tEmployeeProject)
updateExcelPro(excel, proupdateList, tEmployeeProject); && CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
//档案有(离职库),项目无; updateExcelPro(excel, proupdateList, tEmployeeProject);
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus() //档案有(离职库),项目无;
&& Common.isEmpty(tEmployeeProject)) { } else if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()
/*if (Common.isNotNull(excel.getBankNo())) { && Common.isEmpty(tEmployeeProject)) {
TCheckBankNo check = new TCheckBankNo(); insertExcelPro(excel, proInsList, tEmployeeInfo, tSettleDomain);
check.setBankNo(excel.getBankNo()); //档案有(在档人员),项目(已减档)
check.setIdNum(excel.getEmpIdcard()); } else if (CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus() && Common.isNotNull(
check.setName(excel.getEmpName()); tEmployeeProject) && CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId() updateExcelPro(excel, proupdateList, tEmployeeProject);
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN); }
if (checkListR != null && checkListR.getData() != null) { updateExcelPost(updateList, tEmployeeInfo);
CheckBankNoVo vo = checkListR.getData(); //不允许复档复项
check = (null == vo.getRes()) ? null : vo.getRes().getData(); } else {
if (Common.isEmpty(vo)) { //档案有(离职库),项目(已减档)
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE)); if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) { && Common.isNotNull(tEmployeeProject) && CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), vo.getRes().getMsg())); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EMP_PROJECT_ERROR)));
} else if (null != check && !check.getResult().equals(CommonConstants.ZERO_ONE)) { } else if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getRemark())); && Common.isEmpty(tEmployeeProject)) {
} errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_EMP_ERROR)));
} else { //档案有(在档人员),项目(已减档)
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE)); } else if (CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus()
} && Common.isNotNull(tEmployeeProject) && CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
}*/ errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_PROJECT_ERROR)));
insertExcelPro(excel, proInsList, tEmployeeInfo); }
//档案有(在档人员),项目(已减档)
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
updateExcelPost(updateList, tEmployeeInfo);
//不允许复档复项
} else {
//档案有(离职库),项目(已减档)
if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EMP_PROJECT_ERROR)));
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_EMP_ERROR)));
//档案有(在档人员),项目(已减档)
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_PROJECT_ERROR)));
} }
} }
} }
...@@ -853,7 +815,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -853,7 +815,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
doJointTask.doUpdateEmployeeInfo(updateList, user); doJointTask.doUpdateEmployeeInfo(updateList, user);
} }
if (!proInsList.isEmpty()) { if (!proInsList.isEmpty()) {
doJointTask.insertExcelEmpProject(proInsList); baseMapper.insertExcelEmpProject(proInsList);
} }
if (!proupdateList.isEmpty()) { if (!proupdateList.isEmpty()) {
baseMapper.updateExcelEmpProject(proupdateList); baseMapper.updateExcelEmpProject(proupdateList);
...@@ -1027,18 +989,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1027,18 +989,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/** /**
* 插入excel Pro * 插入excel Pro
*/ */
private void insertExcelPro(EmployeeProjectVO excel, List<TEmployeeProject> proInsList, TEmployeeInfo tEmployeeInfo) { private void insertExcelPro(EmployeeProjectVO excel, List<TEmployeeProject> proInsList, TEmployeeInfo tEmployeeInfo,
TSettleDomain tSettleDomain) {
TEmployeeProject insTEmployeePro = new TEmployeeProject(); TEmployeeProject insTEmployeePro = new TEmployeeProject();
BeanUtil.copyProperties(excel, insTEmployeePro); BeanUtil.copyProperties(excel, insTEmployeePro);
insTEmployeePro.setId(String.valueOf(UUID.randomUUID()).replaceAll("-", "")); insTEmployeePro.setId(String.valueOf(UUID.randomUUID()).replaceAll("-", ""));
insTEmployeePro.setDeleteFlag(CommonConstants.STATUS_NORMAL); insTEmployeePro.setDeleteFlag(CommonConstants.STATUS_NORMAL);
insTEmployeePro.setStatus(CommonConstants.dingleDigitIntArray[0]); insTEmployeePro.setStatus(CommonConstants.ZERO_INT);
//获取项目和单位信息 //获取项目和单位信息
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, insTEmployeePro.getDeptNo()).eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag, CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tSettleDomain)) { if (Common.isNotNull(tSettleDomain)) {
insTEmployeePro.setDeptId(tSettleDomain.getId()); insTEmployeePro.setDeptId(tSettleDomain.getId());
insTEmployeePro.setDeptName(tSettleDomain.getDepartName()); insTEmployeePro.setDeptName(tSettleDomain.getDepartName());
...@@ -1048,17 +1008,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1048,17 +1008,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
insTEmployeePro.setUnitId(tSettleDomain.getCustomerId()); insTEmployeePro.setUnitId(tSettleDomain.getCustomerId());
insTEmployeePro.setUnitNo(tSettleDomain.getCustomerNo()); insTEmployeePro.setUnitNo(tSettleDomain.getCustomerNo());
insTEmployeePro.setUnitName(tSettleDomain.getCustomerName()); insTEmployeePro.setUnitName(tSettleDomain.getCustomerName());
String empNO = getEmpNo(insTEmployeePro.getDeptNo());
insTEmployeePro.setEmpNo(empNO);
} }
String empNO = getEmpNo(insTEmployeePro.getDeptNo());
insTEmployeePro.setEmpNo(empNO);
//员工编码生成规则 //员工编码生成规则
insTEmployeePro.setEmpCode(tEmployeeInfo.getEmpCode()); insTEmployeePro.setEmpCode(tEmployeeInfo.getEmpCode());
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
insTEmployeePro.setCreateBy(user.getId()); insTEmployeePro.setCreateBy(user.getId());
insTEmployeePro.setEmpName(tEmployeeInfo.getEmpName()); insTEmployeePro.setEmpName(tEmployeeInfo.getEmpName());
insTEmployeePro.setCreateName(user.getNickname()); insTEmployeePro.setCreateName(user.getNickname());
insTEmployeePro.setProjectSource(CommonConstants.dingleDigitStrArray[6]); insTEmployeePro.setProjectSource(CommonConstants.SIX_STRING);
insTEmployeePro.setEmpId(tEmployeeInfo.getId()); insTEmployeePro.setEmpId(tEmployeeInfo.getId());
proInsList.add(insTEmployeePro); proInsList.add(insTEmployeePro);
} }
......
...@@ -235,10 +235,7 @@ ...@@ -235,10 +235,7 @@
</sql> </sql>
<sql id="Base_Export_List"> <sql id="Base_Export_List">
a a.EMP_CODE,
.
EMP_CODE
,
a.EMP_NATRUE, a.EMP_NATRUE,
a.EMP_NAME, a.EMP_NAME,
a.EMP_IDCARD, a.EMP_IDCARD,
...@@ -951,12 +948,65 @@ ...@@ -951,12 +948,65 @@
<!--tEmployeeInfo人员档案导出查询改造 fxj 2022-11-02--> <!--tEmployeeInfo人员档案导出查询改造 fxj 2022-11-02-->
<select id="noPageDiy" resultMap="tEmployeeExportMap"> <select id="noPageDiy" resultMap="tEmployeeExportMap">
select select
<include refid="Base_Export_List"/>, a.EMP_CODE,
a.EMP_NATRUE,
a.EMP_NAME,
a.EMP_IDCARD,
a.VALIDITY_START,
a.VALIDITY_END,
a.EMP_MARRI_STATUS,
a.EMP_NATIONAL,
a.POLITICAL_STATUS,
a.EMP_PHONE,
a.EMP_EMAIL,
a1.AREA_NAME as "ID_PROVINCE",
a2.AREA_NAME as "ID_CITY",
a3.AREA_NAME as "ID_TOWN",
a.EMP_REGIS_TYPE,
a4.AREA_NAME as "FILE_PROVINCE",
a5.AREA_NAME as "FILE_CITY",
a6.AREA_NAME as "FILE_TOWN",
CASE WHEN a.IS_COLLEGE=0 THEN "否"
WHEN a.IS_COLLEGE =1 THEN "是"
ELSE a.IS_COLLEGE END as "IS_COLLEGE",
a.HIGN_EDUCATION,
a.SCHOOL,
a.MAJOR,
a.ADMISSION_DATE,
a.GRADUTION_DATE,
a.REMARK,
CASE WHEN a.FILE_SOURCE=1 THEN "社保、公积金派单"
WHEN a.FILE_SOURCE =2 THEN "人员发薪"
WHEN a.FILE_SOURCE =3 THEN "商险派单"
WHEN a.FILE_SOURCE =4 THEN "档案新建"
WHEN a.FILE_SOURCE =5 THEN "批量导入"
ELSE a.FILE_SOURCE END as "FILE_SOURCE", # 1=社保、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
a.PROJECT_NUM,
a.CONTRACT_STATUS,
a.INSURANCE_STATUS,
a.SOCIAL_STATUS,
a.FUND_STATUS,
CASE WHEN a.SALARY_STATUS=0 THEN "无"
WHEN a.SALARY_STATUS =1 THEN "是"
WHEN a.SALARY_STATUS =2 THEN "否"
ELSE a.SALARY_STATUS END as "SALARY_STATUS",# 0=无,1=是,2=否
a.CREATE_NAME,
a.CREATE_TIME,
CASE WHEN a.`STATUS`=0 THEN "草稿"
WHEN a.`STATUS` =1 THEN "已审核"
ELSE a.`STATUS` END as "STATUS", # 0=草稿,1=已审核
a.CONTACT_ADDRESS,
p.IS_PROJECTS , p.IS_PROJECTS ,
p.DEPT_NAME, p.DEPT_NAME,
p.DEPT_NO, p.DEPT_NO,
P.PROJECT_NUM P.PROJECT_NUM
from t_employee_info a from t_employee_info a
LEFT JOIN sys_area a1 on a1.id=a.ID_PROVINCE
LEFT JOIN sys_area a2 on a2.id=a.ID_CITY
LEFT JOIN sys_area a3 on a3.id=a.ID_TOWN
LEFT JOIN sys_area a4 on a4.id=a.FILE_PROVINCE
LEFT JOIN sys_area a5 on a5.id=a.FILE_CITY
LEFT JOIN sys_area a6 on a6.id=a.FILE_TOWN
LEFT JOIN view_project p on a.EMP_IDCARD=p.EMP_IDCARD LEFT JOIN view_project p on a.EMP_IDCARD=p.EMP_IDCARD
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0'
......
...@@ -769,22 +769,14 @@ ...@@ -769,22 +769,14 @@
FROM FROM
t_employee_project t_employee_project
WHERE WHERE
id not like '%abc' EMP_NO LIKE CONCAT(#{deptNo},'%')
and
EMP_NO LIKE CONCAT(
(
SELECT
DEPART_NO
FROM
t_settle_domain
WHERE
DEPART_NO = #{deptNo}
),
'%'
)
) AS 'empNo' ) AS 'empNo'
FROM FROM
DUAL DUAL
select MAX(EMP_NO) from t_employee_project where
id not like '%abc' and
DEPT_NO = #{deptNo}
GROUP BY DEPT_NO
</select> </select>
<update id="updateEmpIdById" parameterType="java.util.List"> <update id="updateEmpIdById" parameterType="java.util.List">
......
...@@ -53,6 +53,10 @@ public interface CacheConstants { ...@@ -53,6 +53,10 @@ public interface CacheConstants {
* 字典信息缓存 * 字典信息缓存
*/ */
String DICT_DETAILS = "dict_details"; String DICT_DETAILS = "dict_details";
/**
* 字典转义信息缓存
*/
String REDIS_DICT_LABLE = "redis_dict_lable";
/** /**
* 字典项信息缓存 * 字典项信息缓存
......
package com.yifu.cloud.plus.v1.yifu.common.core.util;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import java.util.Map;
/**
* @Author fxj
* @Date 2022/11/24
* @Description
* @Version 1.0
*/
public class DictConverter implements Converter<String>{
public DictConverter(Map<String,String> nameAndDicTypeMap,Map<String,String> redisLabelMap){
this.nameAndDicTypeMap=nameAndDicTypeMap;
this.redisLabelMap=redisLabelMap;
}
private Map<String,String> nameAndDicTypeMap;
private Map<String,String> redisLabelMap;
@Override
public Class<String> supportJavaTypeKey() {
return String.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
/**
* @Author fxj
* @Description 转换成功java 导入用
* @Date 18:24 2022/11/24
**/
@Override
public String convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty
, GlobalConfiguration globalConfiguration) {
return cellData.getStringValue();
}
/**
* @Author fxj
* @Description 装换成String 导出用
* @Date 18:25 2022/11/24
**/
@Override
public WriteCellData<String> convertToExcelData(String value, ExcelContentProperty contentProperty
, GlobalConfiguration globalConfiguration) {
if (null != nameAndDicTypeMap && nameAndDicTypeMap.size() > 0){
String dicType = nameAndDicTypeMap.get(contentProperty.getField().getName());
if (null != dicType){
String temp =redisLabelMap.get(dicType+CommonConstants.DOWN_LINE_STRING+value);
return new WriteCellData<>(null==temp?value:temp);
}
}
return new WriteCellData<>(String.valueOf(value));
}
@Override
public WriteCellData<?> convertToExcelData(WriteConverterContext<String> context) throws Exception {
return this.convertToExcelData(context.getValue(), context.getContentProperty(), context.getWriteContext().currentWriteHolder().globalConfiguration());
}
}
...@@ -1125,4 +1125,27 @@ public class ExcelUtil <T> implements Serializable { ...@@ -1125,4 +1125,27 @@ public class ExcelUtil <T> implements Serializable {
} }
} }
} }
public Map<String,String> getConverterDicType() {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
Map<String,String> nameDicMap = new HashMap<>();
List<Field> fields = new ArrayList<>();
// 将需要字典表头存起来备用,如果没传,则全部翻译
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
}
}
ExcelAttribute attr;
Field field;
for (int j = 0; j < fields.size(); j++) {
field = fields.get(j);
attr = field.getAnnotation(ExcelAttribute.class);
if (Common.isNotNull(field) && Common.isNotNull(attr)){
nameDicMap.put(field.getName(),attr.dataType());
}
}
return nameDicMap;
}
} }
...@@ -42,8 +42,6 @@ import org.springframework.security.core.userdetails.UserDetails; ...@@ -42,8 +42,6 @@ import org.springframework.security.core.userdetails.UserDetails;
@RequiredArgsConstructor @RequiredArgsConstructor
public class YifuUserDetailsServiceImpl implements YifuUserDetailsService { public class YifuUserDetailsServiceImpl implements YifuUserDetailsService {
//private final RemoteUserService remoteUserService;
private final CacheManager cacheManager; private final CacheManager cacheManager;
private final DaprUpmsProperties daprUpmsProperties; private final DaprUpmsProperties daprUpmsProperties;
...@@ -57,13 +55,11 @@ public class YifuUserDetailsServiceImpl implements YifuUserDetailsService { ...@@ -57,13 +55,11 @@ public class YifuUserDetailsServiceImpl implements YifuUserDetailsService {
@SneakyThrows @SneakyThrows
public UserDetails loadUserByUsername(String username) { public UserDetails loadUserByUsername(String username) {
Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS); Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS);
Object o = cache.get(username);
if (cache != null && cache.get(username) != null) { if (cache != null && cache.get(username) != null) {
return (YifuUser) cache.get(username).get(); return (YifuUser) cache.get(username).get();
} }
R<UserInfo> result;// = remoteUserService.info(username, SecurityConstants.FROM_IN); R<UserInfo> result = HttpDaprUtil.invokeMethodGet(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(), "/user/getInfoByUsername", "?username="+username, UserInfo.class);
result = HttpDaprUtil.invokeMethodGet(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(), "/user/getInfoByUsername", "?username="+username, UserInfo.class);
UserDetails userDetails = getUserDetails(result); UserDetails userDetails = getUserDetails(result);
if (cache != null) { if (cache != null) {
cache.put(username, userDetails); cache.put(username, userDetails);
......
...@@ -19,8 +19,8 @@ spring: ...@@ -19,8 +19,8 @@ spring:
ekp: ekp:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
username: hroread username: root
password: 123456 password: ekp!@#123
jdbc-url: jdbc:mysql://119.96.192.73:3306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true jdbc-url: jdbc:mysql://119.96.192.73:3306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari: hikari:
minimum-idle: 10 # 最小空闲连接数量 minimum-idle: 10 # 最小空闲连接数量
......
...@@ -6,8 +6,8 @@ spring: ...@@ -6,8 +6,8 @@ spring:
activate: activate:
on-profile: test on-profile: test
redis: redis:
host: 192.168.1.65 host: 127.0.0.1
port: 22379 port: 6379
password: '@yf_2017' password: '@yf_2017'
datasource: datasource:
insurances: insurances:
...@@ -19,9 +19,9 @@ spring: ...@@ -19,9 +19,9 @@ spring:
ekp: ekp:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
username: hroread username: root
password: 123456 password: ekp!@#123
jdbc-url: jdbc:mysql://119.96.192.73:3306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true jdbc-url: jdbc:mysql://36.7.147.19:20023/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari: hikari:
minimum-idle: 10 # 最小空闲连接数量 minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟) idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
......
...@@ -166,7 +166,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -166,7 +166,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
@Override @Override
public void importDiy(HttpServletResponse response, List<TStatisticsBonusImportVo> list, String deptId){ public void importDiy(HttpServletResponse response, List<TStatisticsBonusImportVo> list, String deptId){
String fileName = "全年一次性奖金测算导出" + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = "全年一次性奖金测算导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
ServletOutputStream out = null;
//本次纳税额 //本次纳税额
BigDecimal res; BigDecimal res;
//应发工资合计 //应发工资合计
...@@ -194,8 +193,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -194,8 +193,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal twlSalaryTax; BigDecimal twlSalaryTax;
//12月社保公积金扣费 //12月社保公积金扣费
BigDecimal socialFundTax; BigDecimal socialFundTax;
try { try(ServletOutputStream out = response.getOutputStream()) {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
...@@ -352,9 +350,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -352,9 +350,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
sumDeductSalary = BigDecimalUtils.safeAdd(isTax,infoVo.getDeductTaxSalary()); sumDeductSalary = BigDecimalUtils.safeAdd(isTax,infoVo.getDeductTaxSalary());
} }
//最优解计算区间
BigDecimal oneBecimal = new BigDecimal("36000");
BigDecimal twoBecimal = new BigDecimal("144000");
BigDecimal subOneBecimal = BigDecimalUtils.safeSubtract(wSalary,oneBecimal);
BigDecimal subTwoBecimal1 = BigDecimalUtils.safeSubtract(wSalary,twoBecimal);
if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("36000")) <= 0) { compareTo(oneBecimal) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) { if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -362,12 +366,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -362,12 +366,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000")); if (isSend) {
maxAnualSalary = new BigDecimal("36000"); minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = oneBecimal;
} }
} else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). } else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("72000")) <= 0) { compareTo(new BigDecimal("72000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) { if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -375,12 +383,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -375,12 +383,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000")); if (isSend) {
maxAnualSalary = new BigDecimal("36000"); minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = oneBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("203100")) <= 0) { compareTo(new BigDecimal("203100")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) { if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -388,12 +400,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -388,12 +400,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000")); if (isSend) {
maxAnualSalary = new BigDecimal("36000"); minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = oneBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("288000")) <= 0) { compareTo(new BigDecimal("288000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("144000")) <= 0) { if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -401,12 +417,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -401,12 +417,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000")); if (isSend) {
maxAnualSalary = new BigDecimal("144000"); minSalary = subTwoBecimal1;
} else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
maxAnualSalary = twoBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("672000")) <= 0) { compareTo(new BigDecimal("672000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("144000")) <= 0) { if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -414,12 +434,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -414,12 +434,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000")); if (isSend) {
maxAnualSalary = new BigDecimal("36000"); minSalary = subTwoBecimal1;
} else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
maxAnualSalary = twoBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1277500")) <= 0) { compareTo(new BigDecimal("1277500")) <= 0) {
if (wSalary.compareTo(new BigDecimal("300000")) <= 0) { BigDecimal threeBecimal = new BigDecimal("300000");
BigDecimal subThreeBecimal = BigDecimalUtils.safeSubtract(wSalary,threeBecimal);
if (wSalary.compareTo(threeBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -427,12 +453,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -427,12 +453,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("300000")); if (isSend) {
maxAnualSalary = new BigDecimal("300000"); minSalary = subThreeBecimal;
} else {
minSalary = subThreeBecimal.compareTo(socialFundTax) >0 ? subThreeBecimal : socialFundTax;
}
maxAnualSalary = threeBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) <= 0) { compareTo(new BigDecimal("1452500")) <= 0) {
if (wSalary.compareTo(new BigDecimal("420000")) <= 0) { BigDecimal fourBecimal = new BigDecimal("420000");
BigDecimal subFourBecimal = BigDecimalUtils.safeSubtract(wSalary,fourBecimal);
if (wSalary.compareTo(fourBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -440,12 +472,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -440,12 +472,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("420000")); if (isSend) {
maxAnualSalary = new BigDecimal("420000"); minSalary = subFourBecimal;
} else {
minSalary = subFourBecimal.compareTo(socialFundTax) >0 ? subFourBecimal : socialFundTax;
}
maxAnualSalary = fourBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) > 0) { compareTo(new BigDecimal("1452500")) > 0) {
if (wSalary.compareTo(new BigDecimal("660000")) <= 0) { BigDecimal fiveBecimal = new BigDecimal("660000");
BigDecimal subFiveBecimal = BigDecimalUtils.safeSubtract(wSalary,fiveBecimal);
if (wSalary.compareTo(fiveBecimal) <= 0) {
if (isSend) { if (isSend) {
maxAnualSalary = wSalary; maxAnualSalary = wSalary;
} else { } else {
...@@ -453,8 +491,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -453,8 +491,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax); maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("660000")); if (isSend) {
maxAnualSalary = new BigDecimal("660000"); minSalary = subFiveBecimal;
} else {
minSalary = subFiveBecimal.compareTo(socialFundTax) >0 ? subFiveBecimal : socialFundTax;
}
maxAnualSalary = fiveBecimal;
} }
} }
...@@ -484,16 +526,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -484,16 +526,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} }
out.flush(); out.flush();
excelWriter.finish(); excelWriter.finish();
}catch (Exception e){ }catch (Exception e) {
log.error("执行异常" ,e); log.error("执行异常", e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
} }
} }
......
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import lombok.Data;
/**
* @Author fxj
* @Date 2022/11/25
* @Description
* @Version 1.0
*/
@Data
public class DictRedisVo {
private String key;
private String value;
}
package com.yifu.cloud.plus.v1.yifu.admin.init; package com.yifu.cloud.plus.v1.yifu.admin.init;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -46,6 +47,16 @@ public class DictItemRedisInit { ...@@ -46,6 +47,16 @@ public class DictItemRedisInit {
} }
} }
log.info("字典数据加入缓存初始化结束..."); log.info("字典数据加入缓存初始化结束...");
log.info("转义字典数据加入缓存初始化开始...");
List<DictRedisVo> lables = dictItemService.getDictRedisVo();
if (Common.isNotNull(lables)){
Map<String,String> lableMap = new HashMap<>();
for (DictRedisVo vo:lables){
lableMap.put(vo.getKey(),vo.getValue());
}
redisUtil.set(CacheConstants.REDIS_DICT_LABLE ,lableMap);
}
log.info("转义字典数据加入缓存初始化结束...");
log.info("区域数据加入缓存初始化开始..."); log.info("区域数据加入缓存初始化开始...");
List<SysArea> allAreas = sysAreaService.getAllArea(); List<SysArea> allAreas = sysAreaService.getAllArea();
......
...@@ -18,9 +18,12 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper; ...@@ -18,9 +18,12 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p> * <p>
* 字典表 Mapper 接口 * 字典表 Mapper 接口
...@@ -43,4 +46,6 @@ public interface SysDictMapper extends BaseMapper<SysDict> { ...@@ -43,4 +46,6 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @Date 10:21 2022/6/21 * @Date 10:21 2022/6/21
**/ **/
int selectChildDictItemCount(@Param("parentItemType")String parentItemType, @Param("parentId")String parentId); int selectChildDictItemCount(@Param("parentItemType")String parentItemType, @Param("parentId")String parentId);
List<DictRedisVo> getDictRedisVo();
} }
...@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List; import java.util.List;
...@@ -86,4 +87,6 @@ public interface SysDictItemService extends IService<SysDictItem> { ...@@ -86,4 +87,6 @@ public interface SysDictItemService extends IService<SysDictItem> {
R<Boolean> saveDiy(SysDictItem sysDictItem); R<Boolean> saveDiy(SysDictItem sysDictItem);
R<String> getLableFronValue(String value,String type); R<String> getLableFronValue(String value,String type);
List<DictRedisVo> getDictRedisVo();
} }
...@@ -19,6 +19,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -19,6 +19,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import java.util.List;
/** /**
* 字典表 * 字典表
...@@ -52,4 +55,6 @@ public interface SysDictService extends IService<SysDict> { ...@@ -52,4 +55,6 @@ public interface SysDictService extends IService<SysDict> {
String getParentDicLabelById(String type, String value); String getParentDicLabelById(String type, String value);
int selectChildDictItemCount(String parentItemType, String parentId); int selectChildDictItemCount(String parentItemType, String parentId);
List<DictRedisVo> getDictRedisVo();
} }
...@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper; import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService;
...@@ -138,6 +139,11 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi ...@@ -138,6 +139,11 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return R.ok(CommonConstants.EMPTY_STRING); return R.ok(CommonConstants.EMPTY_STRING);
} }
@Override
public List<DictRedisVo> getDictRedisVo() {
return dictService.getDictRedisVo();
}
private void updateDictItem(String type, Map<String,Object> resultMap){ private void updateDictItem(String type, Map<String,Object> resultMap){
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda() List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.in(SysDictItem::getType,type) .in(SysDictItem::getType,type)
......
...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper; import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictMapper; import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService;
...@@ -37,6 +38,8 @@ import org.springframework.stereotype.Service; ...@@ -37,6 +38,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.util.List;
/** /**
* 字典表 * 字典表
* *
...@@ -117,6 +120,11 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl ...@@ -117,6 +120,11 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
return baseMapper.selectChildDictItemCount(parentItemType,parentId); return baseMapper.selectChildDictItemCount(parentItemType,parentId);
} }
@Override
public List<DictRedisVo> getDictRedisVo() {
return baseMapper.getDictRedisVo();
}
/** /**
* 构建查询的 wrapper * 构建查询的 wrapper
* @param sysDict 查询条件 * @param sysDict 查询条件
......
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
<result property="createName" column="create_name"/> <result property="createName" column="create_name"/>
</resultMap> </resultMap>
<resultMap id="dictRedisMap" type="com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo">
<result property="key" column="key"/>
<result property="value" column="value"/>
</resultMap>
<select id="getParentDicLabelById" resultType="java.lang.String"> <select id="getParentDicLabelById" resultType="java.lang.String">
SELECT SELECT
i.label, i.label,
...@@ -71,4 +76,14 @@ ...@@ -71,4 +76,14 @@
and t.parent_id= #{parentId} and t.del_flag='0' and t.parent_id= #{parentId} and t.del_flag='0'
) )
</select> </select>
<select id="getDictRedisVo" resultMap="dictRedisMap">
SELECT
CONCAT(a.type,"_",a.`value`) as "key",
a.label as "value"
FROM
sys_dict_item a
WHERE
a.del_flag='0'
</select>
</mapper> </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