Commit 15785570 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.5.4' into MVP1.5.4

parents b369a81e 8fb96f8a
......@@ -420,6 +420,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
newEmpProject = new TEmployeeProject();
BeanUtil.copyProperties(oldEmpProject,newEmpProject);
newEmpProject.setId(null);
newEmpProject.setEmpNo(tEmployeeProjectService.getEmpNo(newEmpProject.getDeptNo()));
newEmpProject.setDeptId(vo.getNewDeptId());
newEmpProject.setDeptName(vo.getNewDeptName());
newEmpProject.setDeptNo(vo.getNewDeptNo());
......@@ -430,17 +431,23 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
newEmpProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
newEmpProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
newEmpProject.setInsuranceStatus(null);
updateTEmployeeProject.setDeptName(vo.getNewDeptName());
updateTEmployeeProject.setDeptNo(vo.getNewDeptNo());
updateTEmployeeProject.setDeptId(vo.getNewDeptId());
updateTEmployeeProject.setUnitNo(vo.getNewUnitNo());
updateTEmployeeProject.setUnitId(vo.getNewUnitId());
updateTEmployeeProject.setUnitName(vo.getNewUnitName());
updateTEmployeeProject.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
updateTEmployeeProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
updateTEmployeeProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
newEmpProject.setSocialStatus(null);
newEmpProject.setSocialProvince(null);
newEmpProject.setSocialCity(null);
newEmpProject.setSocialTown(null);
newEmpProject.setFundStatus(null);
newEmpProject.setContractStatus(null);
newEmpProject.setContractType(null);
}
updateTEmployeeProject.setDeptName(vo.getNewDeptName());
updateTEmployeeProject.setDeptNo(vo.getNewDeptNo());
updateTEmployeeProject.setDeptId(vo.getNewDeptId());
updateTEmployeeProject.setUnitNo(vo.getNewUnitNo());
updateTEmployeeProject.setUnitId(vo.getNewUnitId());
updateTEmployeeProject.setUnitName(vo.getNewUnitName());
updateTEmployeeProject.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
updateTEmployeeProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
updateTEmployeeProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", updateTEmployeeProject.getId(), oldEmpProject, updateTEmployeeProject);
updateTEmployeeProject.setOdlDeptId(oldEmpProject.getDeptId());
......@@ -456,8 +463,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updatesf.setUnitName(updateTEmployeeProject.getUnitName());
// 处理社保 目标项目档案已有项目档案不做处理
if (vo.getChangeItems().indexOf(CommonConstants.ONE_STRING) >= CommonConstants.ZERO_INT) {
if (!(Common.isEmpty(newEmpProject.getSocialStatus())
|| CommonConstants.ZERO_INT == newEmpProject.getSocialStatus())){
if (Common.isEmpty(newEmpProject.getSocialStatus())
|| CommonConstants.ZERO_INT == newEmpProject.getSocialStatus()){
newEmpProject.setSocialStatus(oldEmpProject.getSocialStatus());
newEmpProject.setSocialProvince(oldEmpProject.getSocialProvince());
newEmpProject.setSocialCity(oldEmpProject.getSocialCity());
......@@ -475,8 +482,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
}
// 处理公积金 如果目标项目档案已存在公积金 不划转
if (vo.getChangeItems().indexOf(CommonConstants.TWO_STRING) >= CommonConstants.ZERO_INT) {
if (!(Common.isEmpty(newEmpProject.getFundStatus())
|| CommonConstants.ZERO_INT == newEmpProject.getFundStatus())){
if (Common.isEmpty(newEmpProject.getFundStatus())
|| CommonConstants.ZERO_INT == newEmpProject.getFundStatus()){
newEmpProject.setFundStatus(oldEmpProject.getFundStatus());
updatesf.setFlag(CommonConstants.ONE_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updatesf);
......@@ -488,8 +495,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
}
// 处理員工合同 目标 已有合同状态 不在处理合同划转
if (vo.getChangeItems().indexOf(CommonConstants.ZERO_STRING) >= CommonConstants.ZERO_INT){
if (!(Common.isEmpty(newEmpProject.getContractStatus())
|| CommonConstants.ZERO_INT != newEmpProject.getContractStatus())){
if (Common.isEmpty(newEmpProject.getContractStatus())
|| CommonConstants.ZERO_INT != newEmpProject.getContractStatus()){
newEmpProject.setContractStatus(oldEmpProject.getContractStatus());
newEmpProject.setContractType(oldEmpProject.getContractType());
// 合同同步划转---只划转在用合同 fxj 2023-03-06
......@@ -506,6 +513,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
tEmployeeProjectService.saveOrUpdate(newEmpProject);
//同步减项老项目档案
if (CommonConstants.ONE_STRING.equals(vo.getChangeType())){
oldEmpProject.setIsLeaveEmployee(CommonConstants.ONE_INT);
R res = tEmployeeProjectService.deleteEmpPro(oldEmpProject);
resStr.append(res.getMsg());
}
......
......@@ -246,8 +246,23 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
if(!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())){
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())){
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("该员工已存在相同起始日期的合同,禁止重复添加");
}
}
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
......@@ -259,8 +274,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("不能重复添加");
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
}
}
return null;
......@@ -290,6 +307,38 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (null != validity.getErrorInfo() && !validity.getErrorInfo().isEmpty()) {
return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL);
}
if(!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())){
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())){
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("该员工已存在相同起始日期的合同,禁止重复添加");
}
}
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
}
return this.saveContractAndAtta(tEmployeeContractInfo, user);
} catch (Exception e) {
log.error("员工合同保存异常:" + e.getMessage());
......@@ -1083,7 +1132,42 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorInfo.append(EmployeeConstants.WORKING_HOURS_EMPTY);
}
}
if(!EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())){
if (CommonConstants.TWO_STRING.equals(insert.getContractType())){
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
errorInfo.append("该员工已存在相同起始日期的合同,禁止重复添加!");
}
}
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, insert.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
errorInfo.append("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
}
}
if (Common.isEmpty(errorInfo.toString())) {
TEmployeeProject project = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, insert.getEmpIdcard())
......@@ -1357,6 +1441,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isEmpty(contractInfos)){
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
List<ErrorMessage> errorMessages = new ArrayList<>();
TEmployeeContractInfo tEmployeeContractInfo;
TEmployeeContractInfo contractInfoInUse;
......@@ -1377,6 +1462,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setContractNo(contract.getContractNo());
tEmployeeContractInfo.setAuditUserName(user.getNickname());
tEmployeeContractInfo.setId(contract.getId());
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[2]) {
// 非作废、终止,本条变为在用
if (Common.isEmpty(contract.getSituation())
......
......@@ -153,5 +153,6 @@ public class ExcelAttributeConstants {
public static final String CUSTOMER = "customer";
public static final String HOUSEHOLD = "household";
// 派单办理失败类型
public static final String DISPATCH_HANDLE_REASON = "dispatch-audit-add-reason";
}
......@@ -171,212 +171,212 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
if (Common.isEmpty(data.getLocation()) && Common.isEmpty(data.getSalaryBase()) && Common.isEmpty(data.getStatus())) {
data.setErrorFlag(true);
errorMessage.append("所在地、最低工资(元)、状态为空;");
}
if (null != data.getLocation()) {
if (data.getLocation().contains("/")) {
String location[] = data.getLocation().split("/");
if (!data.getLocation().isEmpty()) {
if (location.length == 1) {
data.setErrorFlag(true);
errorMessage.append("所在地”请精确到市或县/区;");
}
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
}
if (location.length == 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisProvinceName)) {
query.eq(TMinSalary::getProvince, redisProvinceName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
if (null != data.getLocation()) {
if (data.getLocation().contains("/")) {
String location[] = data.getLocation().split("/");
if (!data.getLocation().isEmpty()) {
if (location.length == 1) {
data.setErrorFlag(true);
errorMessage.append("所在地”请精确到市或县/区;");
}
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
errorMessage.append("对应区域不存在;");
}
}
}
if (location.length > 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisTownName = getRedisAreaValue(location[CommonConstants.TWO_INT] + "_" + location[CommonConstants.ONE_INT]);
if (Common.isEmpty(redisTownName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getProvince, redisCityName);
if (location.length == 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
if (Common.isNotNull(redisTownName)) {
query.eq(TMinSalary::getTown, redisTownName);
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisProvinceName)) {
query.eq(TMinSalary::getProvince, redisProvinceName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
}
query.ne(TMinSalary::getId, data.getId());
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
}
}
if (Common.isEmpty(location[2])) {
query.isNull(TMinSalary::getTown);
}
if (location.length > 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
query.ne(TMinSalary::getId, data.getId());
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
errorMessage.append("对应区域不存在;");
}
String redisTownName = getRedisAreaValue(location[CommonConstants.TWO_INT] + "_" + location[CommonConstants.ONE_INT]);
if (Common.isEmpty(redisTownName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getProvince, redisCityName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
}
if (Common.isNotNull(redisTownName)) {
query.eq(TMinSalary::getTown, redisTownName);
}
if (Common.isEmpty(location[2])) {
query.isNull(TMinSalary::getTown);
}
query.ne(TMinSalary::getId, data.getId());
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
}
}
}
}
if (null != data.getSalaryBase()) {
if (!ValidityUtil.validateStandard(data.getSalaryBase())) {
data.setErrorFlag(true);
errorMessage.append("最低工资,请填写>0的两位小数;");
if (null != data.getSalaryBase()) {
if (!ValidityUtil.validateStandard(data.getSalaryBase())) {
data.setErrorFlag(true);
errorMessage.append("最低工资,请填写>0的两位小数;");
}
}
}
if (!data.getStatus().isEmpty()) {
if (!(CommonConstants.START.equals(data.getStatus()) || CommonConstants.STOP.equals(data.getStatus()))) {
data.setErrorFlag(true);
errorMessage.append("填写的状态不是启用或停用");
if (!data.getStatus().isEmpty()) {
if (!(CommonConstants.START.equals(data.getStatus()) || CommonConstants.STOP.equals(data.getStatus()))) {
data.setErrorFlag(true);
errorMessage.append("填写的状态不是启用或停用");
}
}
}
}
if (data.getLocation().contains("-")) {
String location[] = data.getLocation().split("-");
if (!data.getLocation().isEmpty()) {
if (location.length == 1) {
data.setErrorFlag(true);
errorMessage.append("所在地”请精确到市或县/区;");
}
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
}
if (location.length == 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisProvinceName)) {
query.eq(TMinSalary::getProvince, redisProvinceName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
if (data.getLocation().contains("-")) {
String location[] = data.getLocation().split("-");
if (!data.getLocation().isEmpty()) {
if (location.length == 1) {
data.setErrorFlag(true);
errorMessage.append("所在地”请精确到市或县/区;");
}
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
errorMessage.append("对应区域不存在;");
}
}
}
if (location.length > 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisTownName = getRedisAreaValue(location[CommonConstants.TWO_INT] + "_" + location[CommonConstants.ONE_INT]);
if (Common.isEmpty(redisTownName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getProvince, redisCityName);
if (location.length == 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
if (Common.isNotNull(redisTownName)) {
query.eq(TMinSalary::getTown, redisTownName);
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisProvinceName)) {
query.eq(TMinSalary::getProvince, redisProvinceName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
}
query.ne(TMinSalary::getId, data.getId());
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
}
}
if (Common.isEmpty(location[2])) {
query.isNull(TMinSalary::getTown);
}
if (location.length > 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
query.ne(TMinSalary::getId, data.getId());
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
errorMessage.append("对应区域不存在;");
}
String redisTownName = getRedisAreaValue(location[CommonConstants.TWO_INT] + "_" + location[CommonConstants.ONE_INT]);
if (Common.isEmpty(redisTownName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getProvince, redisCityName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
}
if (Common.isNotNull(redisTownName)) {
query.eq(TMinSalary::getTown, redisTownName);
}
if (Common.isEmpty(location[2])) {
query.isNull(TMinSalary::getTown);
}
query.ne(TMinSalary::getId, data.getId());
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
}
}
}
}
if (null != data.getSalaryBase()) {
if (!ValidityUtil.validateStandard(data.getSalaryBase())) {
data.setErrorFlag(true);
errorMessage.append("最低工资,请填写>0的两位小数;");
if (null != data.getSalaryBase()) {
if (!ValidityUtil.validateStandard(data.getSalaryBase())) {
data.setErrorFlag(true);
errorMessage.append("最低工资,请填写>0的两位小数;");
}
}
}
if (null!=data.getStatus()) {
if (!(CommonConstants.START.equals(data.getStatus()) || CommonConstants.STOP.equals(data.getStatus()))) {
data.setErrorFlag(true);
errorMessage.append("填写的状态不是启用或停用");
if (null != data.getStatus()) {
if (!(CommonConstants.START.equals(data.getStatus()) || CommonConstants.STOP.equals(data.getStatus()))) {
data.setErrorFlag(true);
errorMessage.append("填写的状态不是启用或停用");
}
}
}
}
}
}
if (data.isErrorFlag()) {
data.setErrorMessage(errorMessage.toString());
}
......@@ -398,36 +398,58 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
salaryImportsSuccessList.stream().forEach(e -> {
TMinSalary selectOne = new TMinSalary();
selectOne.setId(e.getId());
String location[] = e.getLocation().split("/");
if(location.length>1) {
for (int i = 0; i < location.length; i++) {
if (i == CommonConstants.ZERO_INT) {
int province = baseMapper.selectByAreaName(location[i]);
selectOne.setProvince(province);
}
if (i == CommonConstants.ONE_INT) {
int city = baseMapper.selectByAreaName(location[i]);
selectOne.setCity(city);
if(null!=e.getLocation()) {
if (e.getLocation().contains("/")) {
String location[] = e.getLocation().split("/");
if (location.length > 1) {
for (int i = 0; i < location.length; i++) {
if (i == CommonConstants.ZERO_INT) {
int province = baseMapper.selectByAreaName(location[i]);
selectOne.setProvince(province);
}
if (i == CommonConstants.ONE_INT) {
int city = baseMapper.selectByAreaName(location[i]);
selectOne.setCity(city);
}
if (i == CommonConstants.TWO_INT) {
int town = baseMapper.selectByAreaName(location[i]);
selectOne.setTown(town);
}
}
}
if (i == CommonConstants.TWO_INT) {
int town = baseMapper.selectByAreaName(location[i]);
selectOne.setTown(town);
;
}
if (e.getLocation().contains("-")) {
String location[] = e.getLocation().split("-");
if (location.length > 1) {
for (int i = 0; i < location.length; i++) {
if (i == CommonConstants.ZERO_INT) {
int province = baseMapper.selectByAreaName(location[i]);
selectOne.setProvince(province);
}
if (i == CommonConstants.ONE_INT) {
int city = baseMapper.selectByAreaName(location[i]);
selectOne.setCity(city);
}
if (i == CommonConstants.TWO_INT) {
int town = baseMapper.selectByAreaName(location[i]);
selectOne.setTown(town);
}
}
}
}
}
if (CommonConstants.START.equals(e.getStatus())) {
selectOne.setStatus(CommonConstants.ONE_INT);
}
if (CommonConstants.STOP.equals(e.getStatus())) {
selectOne.setStatus(CommonConstants.TWO_INT);
if (CommonConstants.START.equals(e.getStatus())) {
selectOne.setStatus(CommonConstants.ONE_INT);
}
if (CommonConstants.STOP.equals(e.getStatus())) {
selectOne.setStatus(CommonConstants.TWO_INT);
}
selectOne.setSalaryBase(e.getSalaryBase());
selectOne.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(selectOne);
}
selectOne.setSalaryBase(e.getSalaryBase());
selectOne.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(selectOne);
});
);
}
}
......
......@@ -65,14 +65,14 @@ public class FundImportHandleVo extends RowIndex implements Serializable {
/**
* 办理意见
*/
@ExcelAttribute(name = "办理意见")
@ExcelAttribute(name = "办理意见",maxLength = 150,errorInfo = "办理意见长度不可超过150!")
@Schema(description = "办理意见" )
@ExcelProperty("办理意见" )
@ExcelProperty("办理意见")
private String remark;
/**
* 失败类型
*/
@ExcelAttribute(name = "失败类型")
@ExcelAttribute(name = "失败类型",isDataId = true,isConvert = false,dataType = ExcelAttributeConstants.DISPATCH_HANDLE_REASON)
@Schema(description = "失败类型" )
@ExcelProperty("失败类型" )
private String reasonType;
......
......@@ -643,7 +643,7 @@ public class TDispatchInfoController {
@Operation(summary = "单个派增 权限:social_dispatchinfo_add", description = "单个派增")
@PostMapping("/fundImportHandle")
//@PreAuthorize("@pms.hasPermission('fund_import_handle')")
public R<List<ErrorMessage>> fundImportHandle(@RequestBody MultipartFile file) {
public R<List<ErrorMessage>> fundImportHandle(@RequestBody MultipartFile file, @RequestParam(required = true)String mId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)) {
return R.failed(CommonConstants.USER_FAIL);
......@@ -659,7 +659,16 @@ public class TDispatchInfoController {
try {
if (Common.isNotNull(requestId)) {
//主动释放锁
return tDispatchInfoService.fundImportHandle(file.getInputStream());
TDispatchInfo tDispatchInfo = new TDispatchInfo();
tDispatchInfo.setMId(mId);
tDispatchInfo.setMenuInfo(mId);
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql()) && tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
tDispatchInfo.setCreateBy(user.getId());
return tDispatchInfoService.fundImportHandle(file.getInputStream(),tDispatchInfo);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
......
......@@ -111,7 +111,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
**/
R<List<ErrorMessage>> dispatchAdd(TDispatchImportVo importVo);
R<List<ErrorMessage>> fundImportHandle(InputStream inputStream);
R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo);
R<Boolean> updateExportSocialFlagById(String id,String status);
......
......@@ -5022,7 +5022,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> fundImportHandle(InputStream inputStream) {
public R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
......@@ -5073,7 +5073,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
fundImportHandle(cachedDataList, errorMessageList,user);
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5091,7 +5091,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user) {
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user,TDispatchInfo dispatchInfo) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5101,6 +5101,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
String handleStatus = "2";
SocialHandleSearchVo tDispatchInfo = new SocialHandleSearchVo();
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
tDispatchInfo.setAuthSql(dispatchInfo.getAuthSql());
tDispatchInfo.setCreateBy(dispatchInfo.getCreateBy());
tDispatchInfo.setMId(dispatchInfo.getMId());
tDispatchInfo.setMenuInfo(dispatchInfo.getMenuInfo());
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql()) && tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
......@@ -5131,6 +5135,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.ZERO_STRING.equals(excel.getHandleStatus())) {
flag = CommonConstants.ZERO_INT;
handleStatus = CommonConstants.ONE_STRING;
excel.setReasonType(CommonConstants.EMPTY_STRING);
}
if (CommonConstants.ONE_STRING.equals(excel.getHandleStatus())) {
flag = CommonConstants.ONE_INT;
......@@ -5141,10 +5146,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.FUND_IMPORT_HANDLE_NOT_EXITS),excel));
continue;
}
if (Common.isEmpty(excel.getRemark())){
excel.setRemark(CommonConstants.EMPTY_STRING);
}
try {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ONE_STRING, user
, flag, handleStatus, excel.getReasonType(), null, excel.getReasonType()+CommonConstants.COLON_STRING+excel.getRemark());
, flag, handleStatus, (Common.isEmpty(excel.getReasonType())?"":excel.getReasonType()+CommonConstants.COLON_STRING)
+excel.getRemark(), null, excel.getReasonType());
if (Common.isNotNull(messageList)){
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
......
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