Commit e48ad5de2a767e1ad29f82e4effc0ea44db6d37f
1 parent
e8ac79ea
1. 双伸位出库查看
2. fix 库区问题
Showing
8 changed files
with
38 additions
and
22 deletions
src/main/java/com/huaheng/api/wcs/service/taskAssignService/TaskAssignServiceImpl.java
... | ... | @@ -70,18 +70,18 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
70 | 70 | //1、判断taskHeader是否为空 |
71 | 71 | Integer preTaskNo = 0; |
72 | 72 | if(taskHeader == null){ |
73 | - throw new ServiceException("wms任务为空"); | |
73 | + return AjaxResult.error("wms任务为空"); | |
74 | 74 | } |
75 | 75 | |
76 | 76 | //2、判断必填字段是否满足 |
77 | 77 | if(taskHeader.getId() == null){ |
78 | - throw new ServiceException("wms任务号Id为空"); | |
78 | + return AjaxResult.error("wms任务号Id为空"); | |
79 | 79 | } |
80 | 80 | if(taskHeader.getTaskType() == null){ |
81 | - throw new ServiceException("wms任务类型为空"); | |
81 | + return AjaxResult.error("wms任务类型为空"); | |
82 | 82 | } |
83 | 83 | if(StringUtils.isEmpty(taskHeader.getContainerCode())){ |
84 | - throw new ServiceException("wms任务中容器为空"); | |
84 | + return AjaxResult.error("wms任务中容器为空"); | |
85 | 85 | } |
86 | 86 | |
87 | 87 | |
... | ... | @@ -89,7 +89,7 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
89 | 89 | if(taskHeader.getTaskType()==100 || taskHeader.getTaskType()==200 |
90 | 90 | || taskHeader.getTaskType()==500 || taskHeader.getTaskType()==800) { |
91 | 91 | if (taskHeader.getFromLocation() == null) { |
92 | - throw new ServiceException("源库位为空"); | |
92 | + return AjaxResult.error("源库位为空"); | |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
... | ... | @@ -99,7 +99,7 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
99 | 99 | || taskHeader.getTaskType()==800 || taskHeader.getTaskType()==900) |
100 | 100 | { |
101 | 101 | if (taskHeader.getToLocation() == null) { |
102 | - throw new ServiceException("目的库位为空"); | |
102 | + return AjaxResult.error("目的库位为空"); | |
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
... | ... | @@ -121,7 +121,7 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
121 | 121 | location = locationService.findLocationByCode(taskHeader.getToLocation()); |
122 | 122 | } |
123 | 123 | |
124 | - if ("200".equals(wcsTask.getTaskType()) || "300".equals(wcsTask.getTaskType()) || "400".equals(wcsTask.getTaskType()) || "600".equals(wcsTask.getTaskType())) { | |
124 | + if ("200".equals(wcsTask.getTaskType()) || "300".equals(wcsTask.getTaskType()) || "400".equals(wcsTask.getTaskType()) || "600".equals(wcsTask.getTaskType()) || "900".equals(wcsTask.getTaskType())) { | |
125 | 125 | int rowFlag = location.getRowFlag().intValue(); |
126 | 126 | if(rowFlag == 1) { |
127 | 127 | Location insideLocation = locationService.getInsideNear(location); |
... | ... | @@ -136,12 +136,12 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
136 | 136 | } else { |
137 | 137 | Location destinationLocation = locationService.getEmptyInsideLocation(insideLocation); |
138 | 138 | if (destinationLocation == null) { |
139 | - throw new ServiceException("移库没有剩余库位"); | |
139 | + return AjaxResult.error("移库没有剩余库位"); | |
140 | 140 | } |
141 | 141 | AjaxResult ajaxResult = transferTaskService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode()); |
142 | 142 | preTaskNo = (Integer) ajaxResult.getData(); |
143 | 143 | if (ajaxResult.hasErr()) { |
144 | - throw new ServiceException("创建移库任务失败"); | |
144 | + return AjaxResult.error("创建移库任务失败"); | |
145 | 145 | } |
146 | 146 | taskHeaderService.sendTaskToWcs(Convert.toIntArray(String.valueOf(preTaskNo))); |
147 | 147 | } |
... | ... | @@ -151,7 +151,7 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
151 | 151 | lambdaWrapper.lt(TaskHeader::getStatus, 100); |
152 | 152 | TaskHeader taskHeader1 = taskHeaderService.getOne(lambdaWrapper); |
153 | 153 | if(taskHeader1 != null) { |
154 | - throw new ServiceException("执行外侧库位出库时,相应的内侧库位有任务,请先执行完内侧库位任务"); | |
154 | + return AjaxResult.error("执行外侧库位出库时,相应的内侧库位有任务,请先执行完内侧库位任务"); | |
155 | 155 | } |
156 | 156 | } |
157 | 157 | } |
... | ... | @@ -167,10 +167,10 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
167 | 167 | lambdaWrapper.eq(TaskHeader::getFromLocation, nearLocationCode) |
168 | 168 | .lt(TaskHeader::getStatus, 100) |
169 | 169 | .in(TaskHeader::getTaskType, 200, 400 , 900) |
170 | - .ge(TaskHeader::getStatus, 1); | |
170 | + .ge(TaskHeader::getStatus, 10); | |
171 | 171 | TaskHeader taskHeader2 = taskHeaderService.getOne(lambdaWrapper); |
172 | 172 | if(taskHeader2 != null) { |
173 | - throw new ServiceException("执行任务出库时,相应的旁边库位有分拣出库或者补充入库任务,请先执行完旁边库位任务"); | |
173 | + return AjaxResult.error("执行任务出库时,相应的旁边库位有分拣出库或者补充入库任务,请先执行完旁边库位任务"); | |
174 | 174 | } |
175 | 175 | |
176 | 176 | wcsTask.setPreTaskNo(String.valueOf(preTaskNo)); |
... | ... | @@ -199,7 +199,7 @@ public class TaskAssignServiceImpl implements TaskAssignService { |
199 | 199 | taskDetailLam.eq(TaskDetail::getTaskId,taskHeader.getId()); |
200 | 200 | List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLam); |
201 | 201 | if(taskDetailList == null){ |
202 | - throw new ServiceException("没有子任务"); | |
202 | + return AjaxResult.error("没有子任务"); | |
203 | 203 | } |
204 | 204 | List<TaskDetails> taskDetails =new ArrayList<>(); |
205 | 205 | for(TaskDetail item : taskDetailList){ |
... | ... |
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
... | ... | @@ -123,7 +123,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
123 | 123 | .gt(LocationType::getWidth, wcsTask.getWidth()) |
124 | 124 | .gt(LocationType::getHeight, wcsTask.getHeight()) |
125 | 125 | .gt(LocationType::getMaxWeight, wcsTask.getWidth()) |
126 | - .gt(LocationType::getWarehouseCode, ShiroUtils.getWarehouseCode()); | |
126 | + .eq(LocationType::getWarehouseCode, ShiroUtils.getWarehouseCode()); | |
127 | 127 | List<LocationType> locationTypeList = locationTypeService.list(lambdaQueryWrapper); |
128 | 128 | List<String> codeList = new ArrayList<>(); |
129 | 129 | for (LocationType locationType: locationTypeList) { |
... | ... |
src/main/java/com/huaheng/framework/aspectj/ApiLogAspect.java
... | ... | @@ -109,7 +109,9 @@ public class ApiLogAspect |
109 | 109 | setApiLogException(log, e); |
110 | 110 | throw e; |
111 | 111 | }finally{ |
112 | - finishApiLog(log, connection, ret.toString()); | |
112 | + if(ret != null) { | |
113 | + finishApiLog(log, connection, ret.toString()); | |
114 | + } | |
113 | 115 | return ret; |
114 | 116 | } |
115 | 117 | } |
... | ... |
src/main/java/com/huaheng/framework/config/ShiroConfig.java
... | ... | @@ -261,6 +261,7 @@ public class ShiroConfig { |
261 | 261 | filterChainDefinitionMap.put("/getWarehouseByUserCode", "anon"); |
262 | 262 | filterChainDefinitionMap.put("/API/WMS/v2/login", "anon"); |
263 | 263 | filterChainDefinitionMap.put("/api/**", "anon"); |
264 | + filterChainDefinitionMap.put("/manager/**", "anon"); | |
264 | 265 | // 系统权限列表 |
265 | 266 | // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll()); |
266 | 267 | |
... | ... |
src/main/java/com/huaheng/pc/config/zone/domain/Zone.java
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... | ... | @@ -125,6 +125,9 @@ public class ReceiptTaskService { |
125 | 125 | String locationCode = receiptContainerHeader.getToLocation(); |
126 | 126 | if(StringUtils.isNotEmpty(locationCode)) { |
127 | 127 | Location desLocation = locationService.findLocationByCode(locationCode); |
128 | + if(desLocation.getWarehouseCode().equals(ShiroUtils.getWarehouseCode())) { | |
129 | + return AjaxResult.error("库位对应仓库不对"); | |
130 | + } | |
128 | 131 | if (taskHeaderService.getUncompleteTaskInNear(desLocation) > 0) { |
129 | 132 | return AjaxResult.error("目标库位:" + desLocation + "旁边存在任务,请完成任务以后再分配"); |
130 | 133 | } |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -275,7 +275,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
275 | 275 | } |
276 | 276 | |
277 | 277 | // 给wcs传递任务 |
278 | - taskAssignService.wcsTaskAssign(task); | |
278 | + | |
279 | + AjaxResult ajaxResult = taskAssignService.wcsTaskAssign(task); | |
280 | + if(ajaxResult != null && ajaxResult.hasErr()) { | |
281 | + return AjaxResult.error(ajaxResult.getMsg()); | |
282 | + } | |
279 | 283 | |
280 | 284 | |
281 | 285 | //修改任务头表 |
... | ... |
src/main/resources/templates/config/zone/add.html
... | ... | @@ -29,12 +29,12 @@ |
29 | 29 | <input id="name" name="name" class="form-control" type="text"> |
30 | 30 | </div> |
31 | 31 | </div> |
32 | -<!-- <div class="form-group">--> | |
33 | -<!-- <label class="col-sm-3 control-label">库位类型:</label>--> | |
34 | -<!-- <div class="col-sm-8">--> | |
35 | -<!-- <input id="locationType" name="locationType" class="form-control" type="text">--> | |
36 | -<!-- </div>--> | |
37 | -<!-- </div>--> | |
32 | + <div class="form-group"> | |
33 | + <label class="col-sm-3 control-label">库位类型:</label> | |
34 | + <div class="col-sm-8"> | |
35 | + <input id="locationType" name="locationType" class="form-control" type="text"> | |
36 | + </div> | |
37 | + </div> | |
38 | 38 | <!--<div class="form-group"> --> |
39 | 39 | <!--<label class="col-sm-3 control-label">创建时间:</label>--> |
40 | 40 | <!--<div class="col-sm-8">--> |
... | ... |