Commit 0bd6e881 authored by zhenbin wang's avatar zhenbin wang

feature-wzb:最低工资bug修复

parent a106eb90
......@@ -171,7 +171,7 @@ 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("/")) {
......@@ -209,7 +209,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
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) {
......@@ -310,7 +310,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
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) {
......@@ -367,7 +367,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
errorMessage.append("最低工资,请填写>0的两位小数;");
}
}
if (null!=data.getStatus()) {
if (null != data.getStatus()) {
if (!(CommonConstants.START.equals(data.getStatus()) || CommonConstants.STOP.equals(data.getStatus()))) {
data.setErrorFlag(true);
errorMessage.append("填写的状态不是启用或停用");
......@@ -376,7 +376,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
}
}
}
}
if (data.isErrorFlag()) {
data.setErrorMessage(errorMessage.toString());
}
......@@ -398,6 +398,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
salaryImportsSuccessList.stream().forEach(e -> {
TMinSalary selectOne = new TMinSalary();
selectOne.setId(e.getId());
if(null!=e.getLocation()) {
if (e.getLocation().contains("/")) {
String location[] = e.getLocation().split("/");
if (location.length > 1) {
......@@ -413,19 +414,9 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
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);
}
selectOne.setSalaryBase(e.getSalaryBase());
selectOne.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(selectOne);
}
if (e.getLocation().contains("-")) {
String location[] = e.getLocation().split("-");
......@@ -442,7 +433,9 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
if (i == CommonConstants.TWO_INT) {
int town = baseMapper.selectByAreaName(location[i]);
selectOne.setTown(town);
;
}
}
}
}
}
......@@ -456,7 +449,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
selectOne.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(selectOne);
}
});
);
}
}
......
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