This commit is contained in:
2023-03-24 13:54:43 +08:00
6 changed files with 218 additions and 104 deletions

View File

@@ -19,6 +19,8 @@ import org.nl.system.service.menu.dao.mapper.SysMenuMapper;
import org.nl.system.service.role.ISysRoleService;
import org.nl.system.service.role.dao.SysRole;
import org.nl.system.service.role.dao.mapper.SysRoleMapper;
import org.nl.system.service.user.dao.SysUser;
import org.nl.system.service.user.dao.mapper.SysUserMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -39,6 +41,7 @@ import java.util.*;
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
private final SysRoleMapper roleMapper;
private final SysUserMapper userMapper;
private final SysMenuMapper sysMenuMapper;
@@ -130,7 +133,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
public List<String> getPermissionList(JSONObject userDto) {
List<String> permission = new LinkedList<>();
// 查看是否为管理员
permission.add("admin");
String currentUserId = SecurityUtils.getCurrentUserId();
SysUser sysUser = userMapper.selectOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserId, currentUserId));
if ( ObjectUtil.isNotEmpty(sysUser.getIsAdmin()) && sysUser.getIsAdmin()) permission.add("admin");
permission.addAll(sysMenuMapper.getPermissionByUserId(userDto.getString("userId")));
return permission;
}

View File

@@ -162,11 +162,24 @@ public class ProductInstorServiceImpl implements ProductInstorService {
// 木箱尺寸长度低于950的不入立体库长度大于1385的立体库无法入库
String length_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_length_up").getValue();
String length_down = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_length_down").getValue();
Double box_length_up = Double.valueOf(length_up);
Double box_length_down = Double.valueOf(length_down);
String with_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_with_up").getValue();
String high_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_high_up").getValue();
Double box_length_up = Double.valueOf(length_up); // 木箱长度上限
Double box_length_down = Double.valueOf(length_down); // 木箱长度下限
Double box_with_up = Double.valueOf(with_up); // 木箱宽度上限
Double box_high_up = Double.valueOf(high_up); // 木箱高度上限
if (!(box_length_down <= box_length && box_length <= box_length_up)) {
throw new BadRequestException("无法入立体,木箱长度为:"+box_length);
throw new BadRequestException("无法入立体库,木箱超长;当前木箱长度为:"+box_length);
}
if (!(box_width <= box_with_up)) {
throw new BadRequestException("无法入立体库,木箱超宽;当前木箱宽度为:"+box_width);
}
if (!(box_high <= box_high_up)) {
throw new BadRequestException("无法入立体库,木箱超高;当前木箱高度为:"+box_high);
}
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code + "'").uniqueResult(0);