Browse Source

组合入库审批完成

lwx_dev
erdanergou 3 years ago
parent
commit
c6ee62e459
  1. 38
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

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

@ -224,11 +224,11 @@ public class DepositoryRecordController {
Integer placeId = ObjectFormatUtil.toInteger(map.get("placeId")); Integer placeId = ObjectFormatUtil.toInteger(map.get("placeId"));
if (placeId == 0) {// 如果插入到仓库 if (placeId == 0) {// 如果插入到仓库
map.put("placeId", 0); // 到默认库位 map.put("placeId", 0); // 到默认库位
integer += depositoryRecordService.applicationInPlace(map,false); integer += depositoryRecordService.applicationInPlace(map, false);
recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId"))); recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId")));
depositoryIds.add(ObjectFormatUtil.toInteger(map.get("depositoryId"))); depositoryIds.add(ObjectFormatUtil.toInteger(map.get("depositoryId")));
} else { // 如果具体到库位 } else { // 如果具体到库位
Integer flag = depositoryRecordService.applicationInPlace(map,false); Integer flag = depositoryRecordService.applicationInPlace(map, false);
if (flag != -1) { if (flag != -1) {
integer += flag; integer += flag;
recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId"))); recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId")));
@ -236,8 +236,7 @@ public class DepositoryRecordController {
} }
} }
} }
} } else {
else {
List<Object> errMsg = new ArrayList<>(); List<Object> errMsg = new ArrayList<>();
List<Object> successMsg = new ArrayList<>(); List<Object> successMsg = new ArrayList<>();
for (Integer param : params) { for (Integer param : params) {
@ -270,7 +269,7 @@ public class DepositoryRecordController {
} else { } else {
if (placeId == -1) { // 如果插入到仓库 if (placeId == -1) { // 如果插入到仓库
insert.put("placeId", 0); insert.put("placeId", 0);
Integer add = depositoryRecordService.applicationInPlace(insert,false); Integer add = depositoryRecordService.applicationInPlace(insert, false);
if (add == -1) { if (add == -1) {
errMsg.add(integer); errMsg.add(integer);
} else { } else {
@ -282,7 +281,7 @@ public class DepositoryRecordController {
} }
} else {// 如果具体到库位 } else {// 如果具体到库位
insert.put("placeId", placeId); insert.put("placeId", placeId);
Integer flag = depositoryRecordService.applicationInPlace(insert,false); Integer flag = depositoryRecordService.applicationInPlace(insert, false);
if (flag == -1) { if (flag == -1) {
insert.put("err", "存储失败,请重新选择存储位"); insert.put("err", "存储失败,请重新选择存储位");
errMsg.add(insert); errMsg.add(insert);
@ -312,7 +311,7 @@ public class DepositoryRecordController {
if (placeId != null) { if (placeId != null) {
if (placeId == -1) {// 如果插入到仓库 if (placeId == -1) {// 如果插入到仓库
map.put("placeId", 0); map.put("placeId", 0);
Integer add = depositoryRecordService.applicationInPlace(map,false); Integer add = depositoryRecordService.applicationInPlace(map, false);
if (add == -1) { if (add == -1) {
errMsg.add(map); errMsg.add(map);
} else { } else {
@ -323,7 +322,7 @@ public class DepositoryRecordController {
} }
} else { // 如果具体到库位 } else { // 如果具体到库位
Integer flag = depositoryRecordService.applicationInPlace(map,false); Integer flag = depositoryRecordService.applicationInPlace(map, false);
if (flag == -1) { if (flag == -1) {
map.put("err", "存储失败,请重新选择存储位"); map.put("err", "存储失败,请重新选择存储位");
errMsg.add(map); errMsg.add(map);
@ -562,7 +561,16 @@ public class DepositoryRecordController {
@GetMapping("/applicationInView") @GetMapping("/applicationInView")
public RestResponse findApplicationInRecordByCondition(@RequestParam Map<String, Object> map, HttpServletRequest request) { public RestResponse findApplicationInRecordByCondition(@RequestParam Map<String, Object> map, HttpServletRequest request) {
UserByPort userToken = (UserByPort) request.getAttribute("userToken"); UserByPort userToken = (UserByPort) request.getAttribute("userToken");
List<ApplicationInRecordP> list = depositoryRecordService.findApplicationInRecordPByUser(userToken, map); List<ApplicationInRecordP> 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) { for (ApplicationInRecordP applicationInRecordP : list) {
if (applicationInRecordP.getPrice() != null) { if (applicationInRecordP.getPrice() != null) {
applicationInRecordP.setPrice(applicationInRecordP.getPrice() / 100); applicationInRecordP.setPrice(applicationInRecordP.getPrice() / 100);
@ -570,7 +578,7 @@ public class DepositoryRecordController {
applicationInRecordP.setPrice(0.0); 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; success += addSplitInventory;
} }
} else { } else {
success += depositoryRecordService.applicationInPlace(map,false); success += depositoryRecordService.applicationInPlace(map, false);
} }
} else if ("out".equals(type)) { } else if ("out".equals(type)) {
// 获取部门负责人 // 获取部门负责人
@ -1216,7 +1224,7 @@ public class DepositoryRecordController {
inRecord.put("depositoryId", depositoryId); inRecord.put("depositoryId", depositoryId);
inRecord.put("quantity", quantity); inRecord.put("quantity", quantity);
inRecord.put("applyRemark", applyRemark); inRecord.put("applyRemark", applyRemark);
inRecord.put("unit",unit); inRecord.put("unit", unit);
if (!"-1".equals(unit)) { if (!"-1".equals(unit)) {
map.put("type", "in"); map.put("type", "in");
Integer addSplitInventory = splitUnitService.addSplitInventory(inRecord); Integer addSplitInventory = splitUnitService.addSplitInventory(inRecord);
@ -1224,7 +1232,7 @@ public class DepositoryRecordController {
success += addSplitInventory; success += addSplitInventory;
} }
} else { } else {
success += depositoryRecordService.applicationInPlace(inRecord,false); success += depositoryRecordService.applicationInPlace(inRecord, false);
} }
} }
} else if ("out".equals(type)) { } else if ("out".equals(type)) {
@ -1307,8 +1315,8 @@ public class DepositoryRecordController {
outRecord.put("parentId", mainRecord.get("id")); outRecord.put("parentId", mainRecord.get("id"));
outRecord.put("code", mainRecord.get("code")); outRecord.put("code", mainRecord.get("code"));
outRecord.put("placeId", place); outRecord.put("placeId", place);
outRecord.put("unit",unit); outRecord.put("unit", unit);
outRecord.put("applyRemark",applyRemark); outRecord.put("applyRemark", applyRemark);
success += depositoryRecordService.insertApplicationOutMin(outRecord); success += depositoryRecordService.insertApplicationOutMin(outRecord);
} else { } else {
// 获取失败的物料信息 // 获取失败的物料信息

Loading…
Cancel
Save