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 637353b4..1701bf85 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -1438,8 +1438,7 @@ public class DepositoryRecordController { // 遍历当前物料存储的库位 for (int j = 1; j < s.length; j++) { // 获取当前库位 - for (int k = 0; k < placeByDid.size(); k++) { - Place place1 = placeByDid.get(k); + for (Place place1 : placeByDid) { if (s[j].equals(place1.getCode())) { // 如果当前物料存放在当前库位 // 获取当前物料在当前库位中的数目 @@ -1473,6 +1472,7 @@ public class DepositoryRecordController { outRecord.put("placeId", place); outRecord.put("unit", unit); outRecord.put("applyRemark", applyRemark); + outRecord.put("adminorgId",userToken.getMaindeparment()); success += depositoryRecordService.insertApplicationOutMin(outRecord); } else { // 获取失败的物料信息 diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java b/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java index f52b0fc1..23b1127b 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java @@ -858,6 +858,20 @@ public class GroupController { } map.put("params", params); } + if (map.containsKey("constructionUnitId")) { + String constructionUnitId = map.get("constructionUnitId").toString(); + if ("".equals(constructionUnitId)) { + map.remove("constructionUnitId"); + } + } + if (map.containsKey("adminorgId")) { + String adminorgId = map.get("adminorgId").toString(); + if ("".equals(adminorgId)) { + map.put("adminorgId", userToken.getMaindeparment()); + } + } else { + map.put("adminorgId", userToken.getMaindeparment()); + } try { integer += groupService.insertApplicationOutRecord(map, userToken); // 插入主订单 } catch (Exception e) { diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index 5eafec39..dc5a623a 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -648,7 +648,7 @@ public class PageController { public ModelAndView selectPost(String id) { ModelAndView mv = new ModelAndView(); mv.setViewName("pages/post/selectPost"); - mv.addObject("id",id); + mv.addObject("id", id); return mv; } @@ -657,7 +657,7 @@ public class PageController { public ModelAndView selectConstructionUnit(String id) { ModelAndView mv = new ModelAndView(); mv.setViewName("pages/post/selectConstructionUnit"); - mv.addObject("id",id); + mv.addObject("id", id); return mv; } @@ -1820,18 +1820,18 @@ public class PageController { // 获取处理人 UserByPort userByPort = LinkInterfaceUtil.FindUserById(recordMinP.getCheckId(), userToken); - if(recordMinP.getAdminorgId() != null){ + if (recordMinP.getAdminorgId() != null) { Administration company = LinkInterfaceUtil.getCompany(recordMinP.getAdminorgId(), userToken); recordMinP.setAdminorgName(company.getName()); mv.addObject("adisplay", "table-row"); - }else{ + } else { mv.addObject("adisplay", "none"); } - if(recordMinP.getConstructionUnitId() != null){ + if (recordMinP.getConstructionUnitId() != null) { ConstructionUnit constructionUnitById = constructionUnitService.findConstructionUnitById(recordMinP.getConstructionUnitId()); recordMinP.setConstructionUnitName(constructionUnitById.getName()); mv.addObject("cdisplay", "table-row"); - }else{ + } else { mv.addObject("cdisplay", "none"); } @@ -2038,15 +2038,24 @@ public class PageController { @GetMapping("/applicationOutForGroup") - public ModelAndView applicationOutForGroup(Integer gid, String type) { + public ModelAndView applicationOutForGroup(Integer gid, String type, HttpServletRequest request) { + String token = request.getHeader("user-token"); + if (token == null) { + token = (String) request.getSession().getAttribute("userToken"); + } + UserByPort userToken = AuthenticationTokenPool.getUserToken(token); ModelAndView mv = new ModelAndView(); List gidList = new ArrayList<>(); if ("one".equals(type)) { gidList.add(gid); } else if ("more".equals(type)) { } + mv.addObject("gidList", gidList); mv.setViewName("pages/group/applicationOutForGroup"); + if (Integer.compare(userToken.getMaindeparment(), 361) == 0) { + mv.setViewName("pages/applicationForStorageCenter/applicationOutForGroup"); + } return mv; } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java index 00eeef6b..09964fe1 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java @@ -693,6 +693,20 @@ public class GroupServiceImpl implements GroupService { quantityForTotal += quantityForGroup * groupInfo.getQuantity(); priceForTotal += inventory.get(0).getPrice() * 100 * quantityForGroup; } + if (map.containsKey("constructionUnitId" + temp)) { + String constructionUnitId = map.get("constructionUnitId"+ temp).toString(); + if ("".equals(constructionUnitId)) { + map.remove("constructionUnitId"+ temp); + } + } + if (map.containsKey("adminorgId"+ temp)) { + String adminorgId = map.get("adminorgId"+ temp).toString(); + if ("".equals(adminorgId)) { + map.put("adminorgId", userToken.getMaindeparment()); + } + } else { + map.put("adminorgId", userToken.getMaindeparment()); + } result += insertApplicationOutMinRecord(map, code, parentId, gid, quantityForGroup, depositoryIdList); } diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/applicationOutForGroup.html b/src/main/resources/templates/pages/applicationForStorageCenter/applicationOutForGroup.html new file mode 100644 index 00000000..affc92c3 --- /dev/null +++ b/src/main/resources/templates/pages/applicationForStorageCenter/applicationOutForGroup.html @@ -0,0 +1,898 @@ + + + + + 分步表单 + + + + + + + + + + +
+
+
+ + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/pages/group/applicationOutForGroup.html b/src/main/resources/templates/pages/group/applicationOutForGroup.html index f05d5648..c487d3a0 100644 --- a/src/main/resources/templates/pages/group/applicationOutForGroup.html +++ b/src/main/resources/templates/pages/group/applicationOutForGroup.html @@ -481,49 +481,56 @@ let gnameItem = gnameParent.childNodes[1].childNodes[1]; let req = {}; req.code = code; - $.ajax({ - url: "/group/findGroupByCode", - type: "post", - dataType: 'json', - data: JSON.stringify(req), - contentType: "application/json;charset=utf-8", - success: function (d) { - var data = d.data; - if (data === null) { - layer.msg(d.statusInfo.detail, { - icon: 0, - time: 1500 - }, function () { - obj.value = ''; - gidItem.value = ''; - gnameItem.value = ''; + if(code !== ""){ + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/group/findGroupByCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + if (data === null) { + layer.msg(d.statusInfo.detail, { + icon: 0, + time: 1500 + }, function () { + obj.value = ''; + gidItem.value = ''; + gnameItem.value = ''; + let childNodes = parent.childNodes; + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + layer.close(loading2); + + }) + } else { let childNodes = parent.childNodes; - for (let i = 0; i < childNodes.length; i++) { - if (childNodes[i].className === "layui-collapse") { - childNodes[i].remove() + if (childNodes.length > 9) { + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } } } - }) - } else { - let childNodes = parent.childNodes; - if (childNodes.length > 9) { - for (let i = 0; i < childNodes.length; i++) { - if (childNodes[i].className === "layui-collapse") { - childNodes[i].remove() - } + // 赋值给gname + gnameItem.value = data[0].gname; + gidItem.value = data[0].gid; + for (let i = 0; i < data.length; i++) { + CoverpageForGroupInfo(pid, data[i]); } - } - // 赋值给gname - gnameItem.value = data[0].gname; - gidItem.value = data[0].gid; - for (let i = 0; i < data.length; i++) { - CoverpageForGroupInfo(pid, data[i]); - } - element.init(); + element.init(); + layer.close(loading2); + } } - } - }); + }); + } + }; // 用于实现点击搜索按钮(组合) @@ -570,6 +577,8 @@ if (gid !== '') { let req = {}; req.gid = gid; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ url: "/group/findGroupInfoByGid", data: JSON.stringify(req), @@ -592,6 +601,7 @@ childNodes[i].remove() } } + layer.close(loading2); }) } else { let childNodes = parent.childNodes; @@ -608,7 +618,7 @@ CoverpageForGroupInfo(pid, data[i]); } element.init(); - + layer.close(loading2); } } }) @@ -637,6 +647,8 @@ if (gname !== '') { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + var req = {}; req.gname = gname; $.ajax({ @@ -661,6 +673,7 @@ childNodes[i].remove() } } + layer.close(loading2); }); } else if (d.count === 0) { // 如果当前组合名称不存在 @@ -677,6 +690,7 @@ childNodes[i].remove() } } + layer.close(loading2); }); } else { // 正常 @@ -696,7 +710,7 @@ CoverpageForGroupInfo(pid, data[i]); } element.init(); - + layer.close(loading2); } } }) @@ -727,6 +741,7 @@ var req = {}; req.gid = gid; req.quantity = val; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/group/groupQuantityIsTrue", type: "post", @@ -742,8 +757,11 @@ time: 500 }, function () { $("#quantityForGroup" + id).val(""); + layer.close(loading2); }); + }else{ + layer.close(loading2); } } }); diff --git a/target/classes/templates/pages/group/applicationOutForGroup.html b/target/classes/templates/pages/group/applicationOutForGroup.html index f05d5648..c487d3a0 100644 --- a/target/classes/templates/pages/group/applicationOutForGroup.html +++ b/target/classes/templates/pages/group/applicationOutForGroup.html @@ -481,49 +481,56 @@ let gnameItem = gnameParent.childNodes[1].childNodes[1]; let req = {}; req.code = code; - $.ajax({ - url: "/group/findGroupByCode", - type: "post", - dataType: 'json', - data: JSON.stringify(req), - contentType: "application/json;charset=utf-8", - success: function (d) { - var data = d.data; - if (data === null) { - layer.msg(d.statusInfo.detail, { - icon: 0, - time: 1500 - }, function () { - obj.value = ''; - gidItem.value = ''; - gnameItem.value = ''; + if(code !== ""){ + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/group/findGroupByCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + if (data === null) { + layer.msg(d.statusInfo.detail, { + icon: 0, + time: 1500 + }, function () { + obj.value = ''; + gidItem.value = ''; + gnameItem.value = ''; + let childNodes = parent.childNodes; + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } + } + layer.close(loading2); + + }) + } else { let childNodes = parent.childNodes; - for (let i = 0; i < childNodes.length; i++) { - if (childNodes[i].className === "layui-collapse") { - childNodes[i].remove() + if (childNodes.length > 9) { + for (let i = 0; i < childNodes.length; i++) { + if (childNodes[i].className === "layui-collapse") { + childNodes[i].remove() + } } } - }) - } else { - let childNodes = parent.childNodes; - if (childNodes.length > 9) { - for (let i = 0; i < childNodes.length; i++) { - if (childNodes[i].className === "layui-collapse") { - childNodes[i].remove() - } + // 赋值给gname + gnameItem.value = data[0].gname; + gidItem.value = data[0].gid; + for (let i = 0; i < data.length; i++) { + CoverpageForGroupInfo(pid, data[i]); } - } - // 赋值给gname - gnameItem.value = data[0].gname; - gidItem.value = data[0].gid; - for (let i = 0; i < data.length; i++) { - CoverpageForGroupInfo(pid, data[i]); - } - element.init(); + element.init(); + layer.close(loading2); + } } - } - }); + }); + } + }; // 用于实现点击搜索按钮(组合) @@ -570,6 +577,8 @@ if (gid !== '') { let req = {}; req.gid = gid; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ url: "/group/findGroupInfoByGid", data: JSON.stringify(req), @@ -592,6 +601,7 @@ childNodes[i].remove() } } + layer.close(loading2); }) } else { let childNodes = parent.childNodes; @@ -608,7 +618,7 @@ CoverpageForGroupInfo(pid, data[i]); } element.init(); - + layer.close(loading2); } } }) @@ -637,6 +647,8 @@ if (gname !== '') { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + var req = {}; req.gname = gname; $.ajax({ @@ -661,6 +673,7 @@ childNodes[i].remove() } } + layer.close(loading2); }); } else if (d.count === 0) { // 如果当前组合名称不存在 @@ -677,6 +690,7 @@ childNodes[i].remove() } } + layer.close(loading2); }); } else { // 正常 @@ -696,7 +710,7 @@ CoverpageForGroupInfo(pid, data[i]); } element.init(); - + layer.close(loading2); } } }) @@ -727,6 +741,7 @@ var req = {}; req.gid = gid; req.quantity = val; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/group/groupQuantityIsTrue", type: "post", @@ -742,8 +757,11 @@ time: 500 }, function () { $("#quantityForGroup" + id).val(""); + layer.close(loading2); }); + }else{ + layer.close(loading2); } } });