Commit 250829eae3892cc7d15d20a3aeba16e4d62b0c95
1 parent
12008f99
token加日记,空托出库要求没有库存
Showing
2 changed files
with
17 additions
and
8 deletions
src/main/java/com/huaheng/framework/token/TokenService.java
1 | 1 | package com.huaheng.framework.token; |
2 | 2 | |
3 | -import com.alibaba.fastjson.JSONArray; | |
4 | -import com.alibaba.fastjson.JSONObject; | |
5 | -import com.fasterxml.jackson.annotation.JsonFormat; | |
6 | -import com.google.gson.JsonObject; | |
3 | + | |
7 | 4 | import com.huaheng.common.exception.service.ServiceException; |
8 | 5 | import com.huaheng.framework.redis.RedisCache; |
9 | 6 | import com.huaheng.pc.system.user.domain.User; |
... | ... | @@ -11,8 +8,8 @@ import io.jsonwebtoken.Claims; |
11 | 8 | import io.jsonwebtoken.Jws; |
12 | 9 | import io.jsonwebtoken.Jwts; |
13 | 10 | import io.jsonwebtoken.SignatureAlgorithm; |
14 | -import jdk.nashorn.internal.parser.JSONParser; | |
15 | -import org.springframework.boot.autoconfigure.cache.CacheProperties; | |
11 | +import org.slf4j.Logger; | |
12 | +import org.slf4j.LoggerFactory; | |
16 | 13 | import org.springframework.stereotype.Service; |
17 | 14 | |
18 | 15 | import javax.annotation.Resource; |
... | ... | @@ -32,6 +29,9 @@ public class TokenService { |
32 | 29 | @Resource |
33 | 30 | private RedisCache redisCache; |
34 | 31 | |
32 | + | |
33 | + private static final Logger log = LoggerFactory.getLogger(TokenService.class); | |
34 | + | |
35 | 35 | /** |
36 | 36 | * 有效期7天 |
37 | 37 | */ |
... | ... | @@ -42,6 +42,7 @@ public class TokenService { |
42 | 42 | */ |
43 | 43 | private static final String signingKey = "secret"; |
44 | 44 | |
45 | + | |
45 | 46 | /** |
46 | 47 | * 创建token |
47 | 48 | * @param user 用户 |
... | ... | @@ -74,6 +75,7 @@ public class TokenService { |
74 | 75 | Jws<Claims> jws = Jwts.parser().setSigningKey(signingKey).parseClaimsJws(token); |
75 | 76 | Claims claims = jws.getBody(); |
76 | 77 | Map<String,String> header = jws.getHeader(); |
77 | - System.out.println("parse"); | |
78 | + System.out.println("parse" + header); | |
79 | + log.warn("Token:"+ header); | |
78 | 80 | } |
79 | 81 | } |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java
... | ... | @@ -215,12 +215,19 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
215 | 215 | if(!"empty".equals(loc.getStatus())){ |
216 | 216 | return AjaxResult.error("源货位非空闲"); |
217 | 217 | } |
218 | + //检查库存,有库存不给生成任务。 | |
219 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
220 | + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode,loc.getWarehouseCode()) | |
221 | + .eq(InventoryDetail::getLocationCode, loc.getCode()); | |
222 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | |
223 | + if(inventoryDetailList != null || inventoryDetailList.size() > 0){ | |
224 | + return AjaxResult.error("该容器上有库存,无法空托出库!"); | |
225 | + } | |
218 | 226 | //判断托盘是否已经存在任务 |
219 | 227 | Integer taskCount = taskHeaderService.UncompleteCount(containerCode); |
220 | 228 | if (taskCount != null && taskCount.intValue() > 0) { |
221 | 229 | return AjaxResult.error("容器已存在任务"); |
222 | 230 | } |
223 | - | |
224 | 231 | //生成任务 |
225 | 232 | TaskHeader taskHeader = new TaskHeader(); |
226 | 233 | taskHeader.setWarehouseCode(loc.getWarehouseCode()); |
... | ... |