|
@@ -255,7 +255,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
try {
|
|
|
User creator = userMapper.selectById(request.getHeader("Token"));
|
|
|
//处理时薪
|
|
|
- BigDecimal costValue = cost == null ? null : BigDecimal.valueOf(cost);
|
|
|
+ BigDecimal costValue = cost == null ? BigDecimal.valueOf(0) : BigDecimal.valueOf(cost);
|
|
|
if (targetId == null) {
|
|
|
//新增
|
|
|
if (creator.getRole() == 2 && role != 0) {
|
|
@@ -276,11 +276,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
.setRole(role)
|
|
|
.setCompanyId(creator.getCompanyId())
|
|
|
.setCost(costValue);
|
|
|
- if (userMapper.selectCount(new QueryWrapper<User>().eq("company_id", creator.getCompanyId())) >= (companyMapper.selectById(creator.getCompanyId()).getStaffCountMax())) {
|
|
|
+ if (userMapper.selectCount(new QueryWrapper<User>()
|
|
|
+ .eq("company_id", creator.getCompanyId())) >=
|
|
|
+ (companyMapper.selectById(creator.getCompanyId()).getStaffCountMax())) {
|
|
|
httpRespMsg.setError("公司人员已达上限");
|
|
|
- return httpRespMsg;
|
|
|
- }
|
|
|
- if (userMapper.insert(user) == 0) {
|
|
|
+ }else if (userMapper.insert(user) == 0) {
|
|
|
httpRespMsg.setError("操作失败");
|
|
|
}
|
|
|
}
|
|
@@ -349,7 +349,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
continue;
|
|
|
}
|
|
|
String costString = costCell.getStringCellValue();
|
|
|
- BigDecimal cost = costString != null ? new BigDecimal(costString) : null;
|
|
|
+ BigDecimal cost = costString != null ? new BigDecimal(costString) : BigDecimal.valueOf(0);
|
|
|
phoneList.add(phone);
|
|
|
userList.add(new User()
|
|
|
.setId(id.toString())
|