Browse Source

修改仓储中心人员的权限范围

lwx_dev
erdanergou 3 years ago
parent
commit
85d84e0773
  1. 19
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 11
      src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java

19
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -710,7 +710,17 @@ public class DepositoryRecordController {
public RestResponse findApplicationOutRecordByCondition(@RequestParam Map<String, Object> map, HttpServletRequest request) { public RestResponse findApplicationOutRecordByCondition(@RequestParam Map<String, Object> map, HttpServletRequest request) {
UserByPort userByPort = (UserByPort) request.getAttribute("userToken"); UserByPort userByPort = (UserByPort) request.getAttribute("userToken");
// 获取对应主订单 // 获取对应主订单
List<ApplicationOutRecordP> list = depositoryRecordService.findApplicationOutRecordPByUser(userByPort, map); List<ApplicationOutRecordP> list = new ArrayList<>();
Integer countBy = 0;
if(Integer.compare(userByPort.getMaindeparment(),361)==0){
list = depositoryRecordService.findApplicationOutRecordPByCondition(map,userByPort);
countBy = depositoryRecordService.findApplicationOutRecordPCountByCondition(map);
}else{
list = depositoryRecordService.findApplicationOutRecordPByUser(userByPort, map);
countBy = depositoryRecordService.findApplicationOutRecordPCountByUser(userByPort, map);
}
for (ApplicationOutRecordP outRecordP : list) { for (ApplicationOutRecordP outRecordP : list) {
// 根据主订单获取所有子订单 // 根据主订单获取所有子订单
List<ApplicationOutRecordMin> applicationOutMinByParentId = depositoryRecordService.findApplicationOutMinByParentId(outRecordP.getId()); List<ApplicationOutRecordMin> applicationOutMinByParentId = depositoryRecordService.findApplicationOutMinByParentId(outRecordP.getId());
@ -718,10 +728,9 @@ public class DepositoryRecordController {
StringBuilder mcode = new StringBuilder(); StringBuilder mcode = new StringBuilder();
StringBuilder depositoryName = new StringBuilder(); StringBuilder depositoryName = new StringBuilder();
Integer sumQuantity = 0; Integer sumQuantity = 0;
Double sumPrice = 0.0; double sumPrice = 0.0;
for (int j = 0; j < applicationOutMinByParentId.size(); j++) { for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutMinByParentId) {
// 获取子订单信息 // 获取子订单信息
ApplicationOutRecordMin applicationOutRecordMin = applicationOutMinByParentId.get(j);
// 获取出库物料信息 // 获取出库物料信息
Inventory inventory = materialService.findInventoryById(applicationOutRecordMin.getMid()); Inventory inventory = materialService.findInventoryById(applicationOutRecordMin.getMid());
// 获取出库物料仓库信息 // 获取出库物料仓库信息
@ -738,7 +747,7 @@ public class DepositoryRecordController {
outRecordP.setQuantity(sumQuantity); outRecordP.setQuantity(sumQuantity);
outRecordP.setPrice(sumPrice); outRecordP.setPrice(sumPrice);
} }
return new RestResponse(list, depositoryRecordService.findApplicationOutRecordPCountByUser(userByPort, map), 200); return new RestResponse(list, countBy, 200);
} }

11
src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java

@ -116,6 +116,9 @@ public class MaterialController {
@GetMapping("/findInventory") @GetMapping("/findInventory")
public RestResponse findInventory(@RequestParam Map<String, Object> map, HttpServletRequest request) { public RestResponse findInventory(@RequestParam Map<String, Object> map, HttpServletRequest request) {
UserByPort userToken = (UserByPort) request.getAttribute("userToken"); UserByPort userToken = (UserByPort) request.getAttribute("userToken");
List<InventoryP> list = new ArrayList<>();
Integer total = 0;
if(Integer.compare(userToken.getMaindeparment(),361) != 0){
// 查询当前用户管理的仓库 // 查询当前用户管理的仓库
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId()); List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId());
// 查询当前用户部门拥有的仓库 // 查询当前用户部门拥有的仓库
@ -123,8 +126,7 @@ public class MaterialController {
// 定义仓库编号列表 // 定义仓库编号列表
List<Integer> didList = new ArrayList<>(); List<Integer> didList = new ArrayList<>();
List<InventoryP> list = new ArrayList<>();
Integer total = 0;
Integer size = 10, page = 1; // 定义每页展示数量 Integer size = 10, page = 1; // 定义每页展示数量
if (map.containsKey("size")) { if (map.containsKey("size")) {
size = ObjectFormatUtil.toInteger(map.get("size")); size = ObjectFormatUtil.toInteger(map.get("size"));
@ -202,6 +204,11 @@ public class MaterialController {
) { ) {
inventoryP.setSplitInfoList(splitUnitService.findSplitInfoByMid(inventoryP.getMid())); inventoryP.setSplitInfoList(splitUnitService.findSplitInfoByMid(inventoryP.getMid()));
} }
}else{
list = materialService.findInventory(map);
total = materialService.findInventoryCount(map);
}
return new RestResponse(list, total, 200); return new RestResponse(list, total, 200);
} }

Loading…
Cancel
Save