Browse Source

修改移动端库存查询跳转到入库申请页面

lwx_dev
erdanergou 3 years ago
parent
commit
d4b1d85440
  1. 31
      src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java
  2. 25
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  3. 16
      src/main/resources/templates/pages/application/application-in_temporaryValue.html
  4. 14
      src/main/resources/templates/pages/application/application-out_temporaryValue.html
  5. 14
      src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html

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

@ -665,6 +665,37 @@ public class MaterialController {
}
}
@PostMapping("/getTemporaryValue")
public RestResponse getTemporaryValue(@RequestBody Map<String, Object> map, HttpServletRequest request) {
String token = request.getHeader("user-token");
if (token == null) {
token = (String) request.getSession().getAttribute("userToken");
}
UserByPort userByPort = AuthenticationTokenPool.getUserToken(token);
if (map.containsKey("type")) {
String type = map.get("type").toString();
String key = "WMS_temporaryValue_" + type + userByPort.getNumber();
List<String> range = redisTemplate.opsForList().range(key, 0, -1);
List<Inventory> result = new ArrayList<>();
if (range != null && range.size() > 0) {
for (String value :
range) {
if ("".equals(value)) {
continue;
}
Inventory inventoryById = materialService.findInventoryById(ObjectFormatUtil.toInteger(value));
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid());
inventoryById.setSplitInfoList(splitInfoByMid);
result.add(inventoryById);
}
}
return new RestResponse(result);
} else {
return CrudUtil.insertHandle(-1, 0);
}
}
@PostMapping("/delTemporaryValue")
public void delTemporaryValue(@RequestBody Map<String, Object> map, HttpServletRequest request) {
String token = request.getHeader("user-token");

25
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -2752,18 +2752,6 @@ public class PageController {
// 获取当前key值存储在redis中的值
List<String> range = redisTemplateForHash.opsForList().range("WMS_temporaryValue_In" + userByPort.getNumber(), 0, -1);
if( range != null && range.size() > 0){
List<Inventory> result = new ArrayList<>();
for (String value:
range ) {
if("".equals(value)){
continue;
}
Inventory inventoryById = materialService.findInventoryById(ObjectFormatUtil.toInteger(value));
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid());
inventoryById.setSplitInfoList(splitInfoByMid);
result.add(inventoryById);
}
mv.addObject("inventoryList", JSONObject.toJSONString(result));
mv.setViewName("pages/application/application-in_temporaryValue");
}else{
mv.setViewName("pages/application/application-in");
@ -2819,19 +2807,6 @@ public class PageController {
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
List<String> range = redisTemplateForHash.boundListOps("WMS_temporaryValue_Out" + userToken.getNumber()).range(0, -1);
if (range != null && range.size() > 0) {
List<Inventory> result = new ArrayList<>();
for (String value : range
) {
if ("".equals(value)) {
continue;
}
Inventory inventoryById = materialService.findInventoryById(ObjectFormatUtil.toInteger(value));
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid());
inventoryById.setSplitInfoList(splitInfoByMid);
result.add(inventoryById);
}
mv.addObject("inventoryList", JSONObject.toJSONString(result));
mv.setViewName("pages/application/application-out_temporaryValue");
Integer role = userToken.getIsadmin();
if (role == null) {

16
src/main/resources/templates/pages/application/application-in_temporaryValue.html

@ -46,7 +46,6 @@
<div class="layui-fluid">
<!-- 入库申请提交-->
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto; ">
<input th:value="${inventoryList}" style="display:none;" id="temporaryValue">
<div carousel-item style="overflow: inherit">
<div>
<form class="layui-form layui-form-pane"
@ -142,16 +141,27 @@
form = layui.form,
flow = layui.flow,
step = layui.step;
let scanValue = {};
// 页面初始化
$(function () {
let inventoryList = JSON.parse($("#temporaryValue").val());
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url:"/material/getTemporaryValue",
type: "post",
dataType: 'json',
data:JSON.stringify({"type":"In"}) ,
contentType: "application/json;charset=utf-8",
success: function (res) {
let inventoryList = res.data;
if (inventoryList.length > 0) {
for (let i = 0; i < inventoryList.length; i++) {
initForm(i, inventoryList[i]);
form.render()
}
}
layer.close(loading2);
}
})
});

14
src/main/resources/templates/pages/application/application-out_temporaryValue.html

@ -39,7 +39,6 @@
<div class="layui-fluid">
<!-- 出库申请-->
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
<input th:value="${inventoryList}" style="display: none" id="temporaryValue">
<div carousel-item style="overflow: inherit">
<div>
<form class="layui-form layui-form-pane" style="margin: 0 auto;max-width: 460px;">
@ -133,10 +132,21 @@
let temporaryValue = []; // 用于暂存扫描得到的结果
// 页面初始化
$(function () {
temporaryValue = JSON.parse($("#temporaryValue").val());
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/getTemporaryValue",
type: "post",
dataType: 'json',
data: JSON.stringify({"type": "Out"}),
contentType: "application/json;charset=utf-8",
success: function (res) {
let temporaryValue = res.data;
for (let i = 0; i < temporaryValue.length; i++) {
initForm(i, temporaryValue[i]);
}
layer.close(loading2);
}
})
});

14
src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html

@ -39,7 +39,6 @@
<div class="layui-fluid">
<!-- 出库申请-->
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
<input th:value="${inventoryList}" style="display: none" id="temporaryValue">
<div carousel-item style="overflow: inherit">
<div>
<form class="layui-form layui-form-pane" style="margin: 0 auto;max-width: 460px;">
@ -181,10 +180,21 @@
let temporaryValue = []; // 用于暂存扫描得到的结果
// 页面初始化
$(function () {
temporaryValue = JSON.parse($("#temporaryValue").val());
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/getTemporaryValue",
type: "post",
dataType: 'json',
data: JSON.stringify({"type": "Out"}),
contentType: "application/json;charset=utf-8",
success: function (res) {
let temporaryValue = res.data;
for (let i = 0; i < temporaryValue.length; i++) {
initForm(i, temporaryValue[i]);
}
layer.close(loading2);
}
})
});

Loading…
Cancel
Save