| | |
| | | */ |
| | | public static <T> void addRoleWrapperByCrn(Long userId, EntityWrapper<T> wrapper) { |
| | | // super账号 |
| | | if (userId == 9527) { |
| | | return; |
| | | } |
| | | |
| | | UserService userService = SpringUtils.getBean(UserService.class); |
| | | User user = userService.selectById(userId); |
| | | String roleName = user.getRoleName(); |
| | | |
| | | // 管理员角色 |
| | | if (Cools.isEmpty(roleName)) { |
| | | wrapper.eq("1", 0); |
| | | } else if (roleName.equals("管理员")) { |
| | | return; |
| | | } |
| | | |
| | | // 其他角色看继承角色 |
| | | String roleLeaderCode = user.getRoleLeaderCode(); |
| | | if (Cools.isEmpty(roleLeaderCode)) { |
| | | wrapper.eq("1", 0); |
| | | } else if (roleLeaderCode.equals("stacker_hangar")) { // 堆垛机库 |
| | | wrapper.le("crn_no", 4); // 限制1~4号堆垛机 |
| | | } else if (roleLeaderCode.equals("four_directional_library")) { // 四向库 |
| | | wrapper.eq("crn_no", 7); // 限制7号堆垛机 |
| | | } else if (roleLeaderCode.equals("ctu_library")) { // ctu库 |
| | | wrapper.in("crn_no", 8, 9); //限制8,9号堆垛机 |
| | | } |
| | | // if (userId == 9527) { |
| | | // return; |
| | | // } |
| | | // |
| | | // UserService userService = SpringUtils.getBean(UserService.class); |
| | | // User user = userService.selectById(userId); |
| | | // String roleName = user.getRoleName(); |
| | | // |
| | | // // 管理员角色 |
| | | // if (Cools.isEmpty(roleName)) { |
| | | // wrapper.eq("1", 0); |
| | | // } else if (roleName.equals("管理员")) { |
| | | // return; |
| | | // } |
| | | // |
| | | // // 其他角色看继承角色 |
| | | // String roleLeaderCode = user.getRoleLeaderCode(); |
| | | // if (Cools.isEmpty(roleLeaderCode)) { |
| | | // wrapper.eq("1", 0); |
| | | // } else if (roleLeaderCode.equals("stacker_hangar")) { // 堆垛机库 |
| | | // wrapper.le("crn_no", 4); // 限制1~4号堆垛机 |
| | | // } else if (roleLeaderCode.equals("four_directional_library")) { // 四向库 |
| | | // wrapper.eq("crn_no", 7); // 限制7号堆垛机 |
| | | // } else if (roleLeaderCode.equals("ctu_library")) { // ctu库 |
| | | // wrapper.in("crn_no", 8, 9); //限制8,9号堆垛机 |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | public static <T> void addRoleWrapperByLocNo(Long userId, EntityWrapper<T> wrapper) { |
| | | // super账号 |
| | | if (userId == 9527) { |
| | | return; |
| | | } |
| | | |
| | | UserService userService = SpringUtils.getBean(UserService.class); |
| | | User user = userService.selectById(userId); |
| | | String roleName = user.getRoleName(); |
| | | |
| | | // 管理员角色 |
| | | if (Cools.isEmpty(roleName)) { |
| | | wrapper.eq("1", 0); |
| | | return; |
| | | } else if (roleName.equals("管理员")) { |
| | | return; |
| | | } |
| | | |
| | | // 其他角色看继承角色 |
| | | String roleLeaderCode = user.getRoleLeaderCode(); |
| | | if (Cools.isEmpty(roleLeaderCode)) { |
| | | wrapper.eq("1", 0); |
| | | } else if (roleLeaderCode.equals("stacker_hangar")) { // 堆垛机库 |
| | | wrapper.addFilter("LEFT(loc_no,2)<=16"); // 限制1~16排 |
| | | } else if (roleLeaderCode.equals("four_directional_library")) { // 四向库 |
| | | wrapper.addFilter("LEFT(loc_no,2)>=17 and LEFT(loc_no,2)<=37"); // 限制17~37排 |
| | | } else if (roleLeaderCode.equals("ctu_library")) { // ctu库 |
| | | wrapper.addFilter("LEFT(loc_no,2)>=38"); //限制38~53排 |
| | | } |
| | | // if (userId == 9527) { |
| | | // return; |
| | | // } |
| | | // |
| | | // UserService userService = SpringUtils.getBean(UserService.class); |
| | | // User user = userService.selectById(userId); |
| | | // String roleName = user.getRoleName(); |
| | | // |
| | | // // 管理员角色 |
| | | // if (Cools.isEmpty(roleName)) { |
| | | // wrapper.eq("1", 0); |
| | | // return; |
| | | // } else if (roleName.equals("管理员")) { |
| | | // return; |
| | | // } |
| | | // |
| | | // // 其他角色看继承角色 |
| | | // String roleLeaderCode = user.getRoleLeaderCode(); |
| | | // if (Cools.isEmpty(roleLeaderCode)) { |
| | | // wrapper.eq("1", 0); |
| | | // } else if (roleLeaderCode.equals("stacker_hangar")) { // 堆垛机库 |
| | | // wrapper.addFilter("LEFT(loc_no,2)<=16"); // 限制1~16排 |
| | | // } else if (roleLeaderCode.equals("four_directional_library")) { // 四向库 |
| | | // wrapper.addFilter("LEFT(loc_no,2)>=17 and LEFT(loc_no,2)<=37"); // 限制17~37排 |
| | | // } else if (roleLeaderCode.equals("ctu_library")) { // ctu库 |
| | | // wrapper.addFilter("LEFT(loc_no,2)>=38"); //限制38~53排 |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public static <T> void addRoleWrapperByBarcode(Long userId, EntityWrapper<T> wrapper) { |
| | | // super账号 |
| | | if (userId == 9527) { |
| | | return; |
| | | } |
| | | |
| | | UserService userService = SpringUtils.getBean(UserService.class); |
| | | User user = userService.selectById(userId); |
| | | String roleName = user.getRoleName(); |
| | | |
| | | // 管理员角色 |
| | | if (Cools.isEmpty(roleName)) { |
| | | wrapper.eq("1", 0); |
| | | return; |
| | | } else if (roleName.equals("管理员")) { |
| | | return; |
| | | } |
| | | |
| | | // 其他角色看继承角色 |
| | | String roleLeaderCode = user.getRoleLeaderCode(); |
| | | if (Cools.isEmpty(roleLeaderCode)) { |
| | | wrapper.eq("1", 0); |
| | | } else if (roleLeaderCode.equals("stacker_hangar")) { // 堆垛机库 |
| | | // TODO 堆垛机开头未确认 |
| | | // wrapper.addFilter("LEFT(zpallet,3) =''"); // 限制 |
| | | } else if (roleLeaderCode.equals("four_directional_library")) { // 四向库 |
| | | wrapper.addFilter("LEFT(zpallet,3) ='SXK'"); // 限制SXK |
| | | } else if (roleLeaderCode.equals("ctu_library")) { // ctu库 |
| | | wrapper.addFilter("LEFT(zpallet,3) ='CTU'"); //限制CTU |
| | | } |
| | | // if (userId == 9527) { |
| | | // return; |
| | | // } |
| | | // |
| | | // UserService userService = SpringUtils.getBean(UserService.class); |
| | | // User user = userService.selectById(userId); |
| | | // String roleName = user.getRoleName(); |
| | | // |
| | | // // 管理员角色 |
| | | // if (Cools.isEmpty(roleName)) { |
| | | // wrapper.eq("1", 0); |
| | | // return; |
| | | // } else if (roleName.equals("管理员")) { |
| | | // return; |
| | | // } |
| | | // |
| | | // // 其他角色看继承角色 |
| | | // String roleLeaderCode = user.getRoleLeaderCode(); |
| | | // if (Cools.isEmpty(roleLeaderCode)) { |
| | | // wrapper.eq("1", 0); |
| | | // } else if (roleLeaderCode.equals("stacker_hangar")) { // 堆垛机库 |
| | | // // TODO 堆垛机开头未确认 |
| | | //// wrapper.addFilter("LEFT(zpallet,3) =''"); // 限制 |
| | | // } else if (roleLeaderCode.equals("four_directional_library")) { // 四向库 |
| | | // wrapper.addFilter("LEFT(zpallet,3) ='SXK'"); // 限制SXK |
| | | // } else if (roleLeaderCode.equals("ctu_library")) { // ctu库 |
| | | // wrapper.addFilter("LEFT(zpallet,3) ='CTU'"); //限制CTU |
| | | // } |
| | | } |
| | | |
| | | } |