Commit a760eebc589ba6b9e2b27bf6ea760317d3aef748

Authored by 房远帅
1 parent 5dd08028

发货计划整体模块:数据权限处理

... ... @@ -160,10 +160,18 @@ public class ShipmentsOrderInfoController extends DefaultBaseController {
160 160 return;
161 161 }
162 162
163   - boolean isYwy = roleCodes.contains("ywy");
  163 + // 1. 优先判断:是否拥有【办事处内勤】或【办事处主管】权限
  164 + boolean isNeiqinOrZhuguan = roleCodes.contains("bscnq") || roleCodes.contains("bsczg");
164 165
165   - if (isYwy) {
166   - // 业务员:有区域按区域过滤,没有则按办事处过滤
  166 + if (isNeiqinOrZhuguan) {
  167 + // 办事处内勤/办事处主管:始终按办事处过滤
  168 + if (StringUtils.isNotBlank(scope.getOfficeDeptId())) {
  169 + vo.setDeptId(scope.getOfficeDeptId());
  170 + vo.setRegion(null);
  171 + }
  172 + } else if (roleCodes.contains("ywy")) {
  173 + // 2. 次优先级:业务员权限
  174 + // 有区域按区域过滤,没有则按办事处过滤
167 175 if (StringUtils.isNotBlank(scope.getRegionId())) {
168 176 vo.setRegion(scope.getRegionId());
169 177 vo.setDeptId(null);
... ... @@ -171,12 +179,6 @@ public class ShipmentsOrderInfoController extends DefaultBaseController {
171 179 vo.setDeptId(scope.getOfficeDeptId());
172 180 vo.setRegion(null);
173 181 }
174   - } else {
175   - // 办事处内勤/办事处主管:始终按办事处过滤
176   - if (StringUtils.isNotBlank(scope.getOfficeDeptId())) {
177   - vo.setDeptId(scope.getOfficeDeptId());
178   - vo.setRegion(null);
179   - }
180 182 }
181 183 }
182 184
... ...