|
|
|
@ -651,12 +651,12 @@ public class MaterialController { |
|
|
|
if (map.containsKey("id")) { |
|
|
|
String s = map.get("id").toString(); |
|
|
|
String type = map.get("type").toString(); |
|
|
|
String key = "WMS_temporaryValue_"+type+ userByPort.getNumber(); |
|
|
|
String key = "WMS_temporaryValue_" + type + userByPort.getNumber(); |
|
|
|
List<String> range = redisTemplate.opsForList().range(key, 0, -1); |
|
|
|
if (range != null) { |
|
|
|
if (!range.contains(s)) { |
|
|
|
redisTemplate.opsForList().rightPush(key,s); |
|
|
|
redisTemplate.expire(key,DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS); |
|
|
|
redisTemplate.opsForList().rightPush(key, s); |
|
|
|
redisTemplate.expire(key, DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS); |
|
|
|
} |
|
|
|
} |
|
|
|
return new RestResponse(); |
|
|
|
@ -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"); |
|
|
|
@ -675,7 +706,7 @@ public class MaterialController { |
|
|
|
if (map.containsKey("id")) { |
|
|
|
String s = map.get("id").toString(); |
|
|
|
String type = map.get("type").toString(); |
|
|
|
redisTemplate.opsForList().remove("WMS_temporaryValue_"+type + userByPort.getNumber(), 0, s); |
|
|
|
redisTemplate.opsForList().remove("WMS_temporaryValue_" + type + userByPort.getNumber(), 0, s); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|