diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java index 455d3c20..33a2ce15 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -224,11 +224,11 @@ public class DepositoryRecordController { Integer placeId = ObjectFormatUtil.toInteger(map.get("placeId")); if (placeId == 0) {// 如果插入到仓库 map.put("placeId", 0); // 到默认库位 - integer += depositoryRecordService.applicationInPlace(map,false); + integer += depositoryRecordService.applicationInPlace(map, false); recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId"))); depositoryIds.add(ObjectFormatUtil.toInteger(map.get("depositoryId"))); } else { // 如果具体到库位 - Integer flag = depositoryRecordService.applicationInPlace(map,false); + Integer flag = depositoryRecordService.applicationInPlace(map, false); if (flag != -1) { integer += flag; recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId"))); @@ -236,8 +236,7 @@ public class DepositoryRecordController { } } } - } - else { + } else { List errMsg = new ArrayList<>(); List successMsg = new ArrayList<>(); for (Integer param : params) { @@ -270,7 +269,7 @@ public class DepositoryRecordController { } else { if (placeId == -1) { // 如果插入到仓库 insert.put("placeId", 0); - Integer add = depositoryRecordService.applicationInPlace(insert,false); + Integer add = depositoryRecordService.applicationInPlace(insert, false); if (add == -1) { errMsg.add(integer); } else { @@ -282,7 +281,7 @@ public class DepositoryRecordController { } } else {// 如果具体到库位 insert.put("placeId", placeId); - Integer flag = depositoryRecordService.applicationInPlace(insert,false); + Integer flag = depositoryRecordService.applicationInPlace(insert, false); if (flag == -1) { insert.put("err", "存储失败,请重新选择存储位"); errMsg.add(insert); @@ -312,7 +311,7 @@ public class DepositoryRecordController { if (placeId != null) { if (placeId == -1) {// 如果插入到仓库 map.put("placeId", 0); - Integer add = depositoryRecordService.applicationInPlace(map,false); + Integer add = depositoryRecordService.applicationInPlace(map, false); if (add == -1) { errMsg.add(map); } else { @@ -323,7 +322,7 @@ public class DepositoryRecordController { } } else { // 如果具体到库位 - Integer flag = depositoryRecordService.applicationInPlace(map,false); + Integer flag = depositoryRecordService.applicationInPlace(map, false); if (flag == -1) { map.put("err", "存储失败,请重新选择存储位"); errMsg.add(map); @@ -562,7 +561,16 @@ public class DepositoryRecordController { @GetMapping("/applicationInView") public RestResponse findApplicationInRecordByCondition(@RequestParam Map map, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); - List list = depositoryRecordService.findApplicationInRecordPByUser(userToken, map); + List list = new ArrayList<>(); + Integer recordPCount = 0; + if (Integer.compare(userToken.getMaindeparment(), 361) == 0) { + list = depositoryRecordService.findApplicationInRecordPByCondition(map, userToken); + recordPCount = depositoryRecordService.findApplicationInRecordPCountByCondition(map); + } else { + + list = depositoryRecordService.findApplicationInRecordPByUser(userToken, map); + recordPCount = depositoryRecordService.findApplicationInRecordPCountByUser(userToken, map); + } for (ApplicationInRecordP applicationInRecordP : list) { if (applicationInRecordP.getPrice() != null) { applicationInRecordP.setPrice(applicationInRecordP.getPrice() / 100); @@ -570,7 +578,7 @@ public class DepositoryRecordController { applicationInRecordP.setPrice(0.0); } } - return new RestResponse(list, depositoryRecordService.findApplicationInRecordPCountByUser(userToken, map), 200); + return new RestResponse(list, recordPCount, 200); } // 当前仓库中该用户的子订单详情 @@ -1095,7 +1103,7 @@ public class DepositoryRecordController { success += addSplitInventory; } } else { - success += depositoryRecordService.applicationInPlace(map,false); + success += depositoryRecordService.applicationInPlace(map, false); } } else if ("out".equals(type)) { // 获取部门负责人 @@ -1216,7 +1224,7 @@ public class DepositoryRecordController { inRecord.put("depositoryId", depositoryId); inRecord.put("quantity", quantity); inRecord.put("applyRemark", applyRemark); - inRecord.put("unit",unit); + inRecord.put("unit", unit); if (!"-1".equals(unit)) { map.put("type", "in"); Integer addSplitInventory = splitUnitService.addSplitInventory(inRecord); @@ -1224,7 +1232,7 @@ public class DepositoryRecordController { success += addSplitInventory; } } else { - success += depositoryRecordService.applicationInPlace(inRecord,false); + success += depositoryRecordService.applicationInPlace(inRecord, false); } } } else if ("out".equals(type)) { @@ -1307,8 +1315,8 @@ public class DepositoryRecordController { outRecord.put("parentId", mainRecord.get("id")); outRecord.put("code", mainRecord.get("code")); outRecord.put("placeId", place); - outRecord.put("unit",unit); - outRecord.put("applyRemark",applyRemark); + outRecord.put("unit", unit); + outRecord.put("applyRemark", applyRemark); success += depositoryRecordService.insertApplicationOutMin(outRecord); } else { // 获取失败的物料信息