|
|
@ -1,5 +1,6 @@ |
|
|
package com.dreamchaser.depository_manage.controller; |
|
|
package com.dreamchaser.depository_manage.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.dreamchaser.depository_manage.config.PortConfig; |
|
|
import com.dreamchaser.depository_manage.config.PortConfig; |
|
|
@ -2734,7 +2735,7 @@ public class PageController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取扫描结果并跳转到入库
|
|
|
// 获取扫描结果并跳转到入库
|
|
|
@GetMapping("/application_in_scanQrCode") |
|
|
@GetMapping("/application_In_temporaryValue") |
|
|
public ModelAndView applicationInScanQrCode(HttpServletRequest request) { |
|
|
public ModelAndView applicationInScanQrCode(HttpServletRequest request) { |
|
|
ModelAndView mv = new ModelAndView(); |
|
|
ModelAndView mv = new ModelAndView(); |
|
|
String token = request.getHeader("user-token"); |
|
|
String token = request.getHeader("user-token"); |
|
|
@ -2742,23 +2743,25 @@ public class PageController { |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
} |
|
|
} |
|
|
UserByPort userByPort = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userByPort = AuthenticationTokenPool.getUserToken(token); |
|
|
String scanQrCodeValue = redisTemplate.opsForValue().get("scanQrCodeValue" + userByPort.getNumber()).toString(); |
|
|
// 获取当前key值存储在redis中的值
|
|
|
redisTemplate.delete("scanQrCodeValue" + userByPort.getNumber()); |
|
|
List<String> range = redisTemplateForHash.opsForList().range("WMS_temporaryValue_In" + userByPort.getNumber(), 0, -1); |
|
|
JSONObject jsonObject = JSONObject.parseObject(scanQrCodeValue); |
|
|
if( range != null && range.size() > 0){ |
|
|
JSONObject depository = (JSONObject) jsonObject.get("depository"); |
|
|
List<Inventory> result = new ArrayList<>(); |
|
|
JSONObject place = (JSONObject) jsonObject.get("place"); |
|
|
for (String value: |
|
|
JSONArray materialList = (JSONArray) jsonObject.get("materialList"); |
|
|
range ) { |
|
|
if (depository == null && place == null) { |
|
|
if("".equals(value)){ |
|
|
// 如果库位与仓库都未选中
|
|
|
continue; |
|
|
} else if (depository != null && place == null) { |
|
|
} |
|
|
// 如果选中仓库未选中库位
|
|
|
Inventory inventoryById = materialService.findInventoryById(ObjectFormatUtil.toInteger(value)); |
|
|
mv.addObject("depository", depository); |
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid()); |
|
|
} else if (place != null && depository == null) { |
|
|
inventoryById.setSplitInfoList(splitInfoByMid); |
|
|
// 如果选中库位未选中仓库
|
|
|
result.add(inventoryById); |
|
|
mv.addObject("place", place); |
|
|
} |
|
|
|
|
|
mv.addObject("inventoryList", JSONObject.toJSONString(result)); |
|
|
|
|
|
mv.setViewName("pages/application/application-in_temporaryValue"); |
|
|
|
|
|
}else{ |
|
|
|
|
|
mv.setViewName("pages/application/application-in"); |
|
|
} |
|
|
} |
|
|
mv.addObject("materialList", materialList); |
|
|
|
|
|
mv.setViewName("pages/application/application-in_scanQrCode"); |
|
|
|
|
|
return mv; |
|
|
return mv; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -2800,7 +2803,7 @@ public class PageController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 获取扫描结果并跳转到出库
|
|
|
// 获取扫描结果并跳转到出库
|
|
|
@GetMapping("/application_Out_scanQrCode") |
|
|
@GetMapping("/application_Out_temporaryValue") |
|
|
public ModelAndView applicationOutScanQrCode(HttpServletRequest request) { |
|
|
public ModelAndView applicationOutScanQrCode(HttpServletRequest request) { |
|
|
ModelAndView mv = new ModelAndView(); |
|
|
ModelAndView mv = new ModelAndView(); |
|
|
String token = request.getHeader("user-token"); |
|
|
String token = request.getHeader("user-token"); |
|
|
@ -2809,7 +2812,7 @@ public class PageController { |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
List<String> range = redisTemplateForHash.boundListOps("WMS_temporaryValue_Out" + userToken.getNumber()).range(0, -1); |
|
|
List<String> range = redisTemplateForHash.boundListOps("WMS_temporaryValue_Out" + userToken.getNumber()).range(0, -1); |
|
|
if (range.size() > 0) { |
|
|
if (range != null && range.size() > 0) { |
|
|
List<Inventory> result = new ArrayList<>(); |
|
|
List<Inventory> result = new ArrayList<>(); |
|
|
for (String value : range |
|
|
for (String value : range |
|
|
) { |
|
|
) { |
|
|
|