Commit 4eca183f authored by wangzb's avatar wangzb

feature-wzb:bug修复

parent d17100dc
...@@ -171,10 +171,12 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal ...@@ -171,10 +171,12 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
data.setErrorFlag(true); data.setErrorFlag(true);
errorMessage.append("所在地、最低工资(元)、状态为空;"); errorMessage.append("所在地、最低工资(元)、状态为空;");
} }
if (data.getLocation().contains("-")) { if(null!=data.getLocation()) {
data.setErrorFlag(true); if (data.getLocation().contains("-")) {
errorMessage.append("所在地格式与列表保持一致;"); data.setErrorFlag(true);
} else { errorMessage.append("所在地格式与列表保持一致;");
}
}else {
if (null != data.getLocation()) { if (null != data.getLocation()) {
String location[] = data.getLocation().split("/"); String location[] = data.getLocation().split("/");
if (!data.getLocation().isEmpty()) { if (!data.getLocation().isEmpty()) {
...@@ -223,10 +225,6 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal ...@@ -223,10 +225,6 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
} }
if (location.length > 2) { if (location.length > 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]); 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]); String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) { if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true); data.setErrorFlag(true);
...@@ -266,20 +264,19 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal ...@@ -266,20 +264,19 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
} }
} }
} }
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.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(data.isErrorFlag()) if(data.isErrorFlag())
...@@ -304,7 +301,6 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal ...@@ -304,7 +301,6 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
TMinSalary selectOne = new TMinSalary(); TMinSalary selectOne = new TMinSalary();
selectOne.setId(e.getId()); selectOne.setId(e.getId());
if (null != e.getLocation()) { if (null != e.getLocation()) {
if (e.getLocation().contains("/")) {
String location[] = e.getLocation().split("/"); String location[] = e.getLocation().split("/");
if (location.length >1) { if (location.length >1) {
for (int i = 0; i < location.length; i++) { for (int i = 0; i < location.length; i++) {
...@@ -322,37 +318,29 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal ...@@ -322,37 +318,29 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
} }
} }
} }
} }
if (e.getLocation().contains("-")) { if(null==e.getLocation()){
String location[] = e.getLocation().split("-"); TMinSalary tMinSalary=baseMapper.selectById(e.getId());
if (location.length > 1) { selectOne.setProvince(tMinSalary.getProvince());
for (int i = 0; i < location.length; i++) { selectOne.setCity(tMinSalary.getCity());
if (i == CommonConstants.ZERO_INT) { selectOne.setTown(tMinSalary.getTown());
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())) { if(null!=e.getStatus()) {
selectOne.setStatus(CommonConstants.ONE_INT); if (CommonConstants.START.equals(e.getStatus())) {
selectOne.setStatus(CommonConstants.ONE_INT);
}
if (CommonConstants.STOP.equals(e.getStatus())) {
selectOne.setStatus(CommonConstants.TWO_INT);
}
} }
if (CommonConstants.STOP.equals(e.getStatus())) { if(null!=e.getSalaryBase()) {
selectOne.setStatus(CommonConstants.TWO_INT); selectOne.setSalaryBase(e.getSalaryBase());
} }
selectOne.setSalaryBase(e.getSalaryBase());
selectOne.setUpdateTime(LocalDateTime.now()); selectOne.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(selectOne); 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