Commit 1b08575d4025c80c40e087c2161ddbbea9357e78
1 parent
ab35d508
完成任务时,重入情况下 WCS给目标库位,以WCS给的目标库位为实际入库库位,其他库位解锁
Showing
10 changed files
with
417 additions
and
274 deletions
ant-design-vue-jeecg/src/views/system/task/AllTaskHeaderList.vue
... | ... | @@ -171,7 +171,7 @@ |
171 | 171 | <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button></a> |
172 | 172 | <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button></a> |
173 | 173 | <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button></a> |
174 | - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
174 | + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:handleDoubleInTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
175 | 175 | <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> |
176 | 176 | <a-button type="danger">取消</a-button> |
177 | 177 | </a-popconfirm> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... | ... | @@ -164,7 +164,7 @@ |
164 | 164 | <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button></a> |
165 | 165 | <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button></a> |
166 | 166 | <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button></a> |
167 | - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1 && record.status == 100" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
167 | + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1 && record.status == 100" v-has="'taskHeader:handleDoubleInTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
168 | 168 | <a v-if="record.status < 20 && record.status > 1 " v-has="'taskHeader:priority'" @click="handlePriority(record)"><a-button type="danger">优先级</a-button></a> |
169 | 169 | <!-- <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)" >取消</a>--> |
170 | 170 | <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -164,7 +164,7 @@ |
164 | 164 | <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button></a> |
165 | 165 | <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button></a> |
166 | 166 | <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button></a> |
167 | - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
167 | + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:handleDoubleInTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
168 | 168 | <a v-if="record.status < 20 && record.status > 1" v-has="'taskHeader:priority'" @click="handlePriority(record)"><a-button type="danger">优先级</a-button></a> |
169 | 169 | <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> |
170 | 170 | <a-button type="danger">取消</a-button> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue
... | ... | @@ -164,7 +164,7 @@ |
164 | 164 | <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button></a> |
165 | 165 | <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button></a> |
166 | 166 | <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button></a> |
167 | - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
167 | + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:handleDoubleInTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button></a> | |
168 | 168 | <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)"><a-button type="danger">取消</a-button></a> |
169 | 169 | </span> |
170 | 170 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
1 | 1 | package org.jeecg.modules.wms.api.wcs.controller; |
2 | 2 | |
3 | -import javax.annotation.Resource; | |
4 | -import javax.servlet.http.HttpServletRequest; | |
5 | - | |
3 | +import io.swagger.annotations.Api; | |
4 | +import io.swagger.annotations.ApiOperation; | |
6 | 5 | import org.jeecg.common.api.vo.Result; |
7 | 6 | import org.jeecg.common.aspect.annotation.AutoLog; |
8 | 7 | import org.jeecg.modules.wms.api.wcs.entity.*; |
... | ... | @@ -16,8 +15,8 @@ import org.jeecg.utils.support.ApiLogger; |
16 | 15 | import org.springframework.cache.annotation.Cacheable; |
17 | 16 | import org.springframework.web.bind.annotation.*; |
18 | 17 | |
19 | -import io.swagger.annotations.Api; | |
20 | -import io.swagger.annotations.ApiOperation; | |
18 | +import javax.annotation.Resource; | |
19 | +import javax.servlet.http.HttpServletRequest; | |
21 | 20 | |
22 | 21 | /** |
23 | 22 | * @author 游杰 |
... | ... | @@ -35,7 +34,7 @@ public class WcsController extends HuahengBaseController { |
35 | 34 | private ILockStationService lockStationService; |
36 | 35 | |
37 | 36 | /** |
38 | - ** WCS给的长,宽,高,重在有不同规格库位才有用,destination是区域, locationType库位类型 | |
37 | + * * WCS给的长,宽,高,重在有不同规格库位才有用,destination是区域, locationType库位类型 | |
39 | 38 | */ |
40 | 39 | @AutoLog(value = "仓位分配") |
41 | 40 | @PostMapping("/warecellAllocation") |
... | ... | @@ -43,7 +42,7 @@ public class WcsController extends HuahengBaseController { |
43 | 42 | @ApiOperation("仓位分配") |
44 | 43 | @ApiLogger(apiName = "仓位分配", from = "WCS") |
45 | 44 | @Cacheable(cacheNames = "warecellAllocation#10", key = "#warecellDomain.taskNo + '_' + #warecellDomain.height + '_' + #warecellDomain.roadWays", |
46 | - unless = "#result == null ") | |
45 | + unless = "#result == null ") | |
47 | 46 | public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain, HttpServletRequest req) { |
48 | 47 | String warehouseCode = warecellDomain.getWarehouseCode(); |
49 | 48 | String taskNo = warecellDomain.getTaskNo(); |
... | ... | @@ -72,6 +71,7 @@ public class WcsController extends HuahengBaseController { |
72 | 71 | |
73 | 72 | /** |
74 | 73 | * WCS申请空托盘组入库 |
74 | + * | |
75 | 75 | * @return |
76 | 76 | */ |
77 | 77 | @AutoLog(value = "申请空托盘组入库") |
... | ... | @@ -108,6 +108,7 @@ public class WcsController extends HuahengBaseController { |
108 | 108 | |
109 | 109 | /** |
110 | 110 | * WCS申请空托盘组出库 |
111 | + * | |
111 | 112 | * @return |
112 | 113 | */ |
113 | 114 | @AutoLog(value = "申请空托盘组出库") |
... | ... | @@ -142,6 +143,7 @@ public class WcsController extends HuahengBaseController { |
142 | 143 | |
143 | 144 | /** |
144 | 145 | * WCS任务完成 |
146 | + * | |
145 | 147 | * @return |
146 | 148 | */ |
147 | 149 | @AutoLog(value = "WCS任务完成") |
... | ... | @@ -153,6 +155,7 @@ public class WcsController extends HuahengBaseController { |
153 | 155 | public Result completeTaskByWMS(@RequestBody TaskEntity taskEntity) { |
154 | 156 | String taskNo = taskEntity.getTaskNo(); |
155 | 157 | String lockKey = taskNo; |
158 | + String toLocationCode = taskEntity.getToLocationCode(); | |
156 | 159 | boolean foldFlag = taskEntity.isFoldFlag(); |
157 | 160 | if (StringUtils.isEmpty(taskNo)) { |
158 | 161 | return Result.error("WCS任务完成, 没有找到任务taskNo:" + taskNo); |
... | ... | @@ -160,7 +163,7 @@ public class WcsController extends HuahengBaseController { |
160 | 163 | Result result = handleMultiProcess("completeTaskByWMS", lockKey, new MultiProcessListener() { |
161 | 164 | @Override |
162 | 165 | public Result<?> doProcess() { |
163 | - return taskHeaderService.completeTaskByWMS(Integer.parseInt(taskNo), foldFlag); | |
166 | + return taskHeaderService.completeTaskByWMS(Integer.parseInt(taskNo), foldFlag, toLocationCode); | |
164 | 167 | } |
165 | 168 | }); |
166 | 169 | return result; |
... | ... | @@ -168,6 +171,7 @@ public class WcsController extends HuahengBaseController { |
168 | 171 | |
169 | 172 | /** |
170 | 173 | * 设置物料信息 |
174 | + * | |
171 | 175 | * @return |
172 | 176 | */ |
173 | 177 | @AutoLog(value = "WCS设置物料信息") |
... | ... | @@ -263,7 +267,7 @@ public class WcsController extends HuahengBaseController { |
263 | 267 | } |
264 | 268 | |
265 | 269 | /** |
266 | - ** 解锁站台 | |
270 | + * * 解锁站台 | |
267 | 271 | */ |
268 | 272 | @AutoLog(value = "解锁站台") |
269 | 273 | @PostMapping("/removeLockStation") |
... | ... | @@ -318,7 +322,7 @@ public class WcsController extends HuahengBaseController { |
318 | 322 | |
319 | 323 | |
320 | 324 | /** |
321 | - ** 自动生成空托入库任务 | |
325 | + * * 自动生成空托入库任务 | |
322 | 326 | */ |
323 | 327 | @AutoLog(value = "自动生成空托入库任务") |
324 | 328 | @PostMapping("/autoCreateEmptyIn") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/TaskEntity.java
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/impl/AgvTaskServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.task.agvTask.service.impl; |
2 | 2 | |
3 | -import javax.annotation.Resource; | |
4 | - | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
5 | 6 | import org.jeecg.common.api.vo.Result; |
6 | 7 | import org.jeecg.common.exception.JeecgBootException; |
7 | 8 | import org.jeecg.modules.wms.api.acs.service.IAcsService; |
... | ... | @@ -20,15 +21,13 @@ import org.jeecg.utils.constant.QuantityConstant; |
20 | 21 | import org.springframework.stereotype.Service; |
21 | 22 | import org.springframework.transaction.annotation.Transactional; |
22 | 23 | |
23 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
24 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
25 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
24 | +import javax.annotation.Resource; | |
26 | 25 | |
27 | 26 | /** |
28 | 27 | * @Description: AGV任务 |
29 | - * @Author: jeecg-boot | |
30 | - * @Date: 2023-02-01 | |
31 | - * @Version: V1.0 | |
28 | + * @Author: jeecg-boot | |
29 | + * @Date: 2023-02-01 | |
30 | + * @Version: V1.0 | |
32 | 31 | */ |
33 | 32 | @Service |
34 | 33 | public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> implements IAgvTaskService { |
... | ... | @@ -142,7 +141,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl |
142 | 141 | throw new JeecgBootException("完成AGV任务时, 更新AGV任务失败"); |
143 | 142 | } |
144 | 143 | if (taskHeader != null) { |
145 | - Result result = taskHeaderService.completeTaskByWMS(taskHeader.getId(), false); | |
144 | + Result result = taskHeaderService.completeTaskByWMS(taskHeader.getId(), false, null); | |
146 | 145 | if (!result.isSuccess()) { |
147 | 146 | throw new JeecgBootException("完成AGV任务时, 完成WCS任务失败"); |
148 | 147 | } |
... | ... | @@ -211,7 +210,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl |
211 | 210 | public AgvTask getAgvTaskBuContainerCode(String containerCode, String warehouseCode) { |
212 | 211 | LambdaQueryWrapper<AgvTask> agvTaskLambdaQueryWrapper = Wrappers.lambdaQuery(); |
213 | 212 | agvTaskLambdaQueryWrapper.eq(AgvTask::getContainerCode, containerCode).eq(AgvTask::getWarehouseCode, warehouseCode).lt(AgvTask::getStatus, |
214 | - QuantityConstant.AGV_TASK_STATUS_COMPLETED); | |
213 | + QuantityConstant.AGV_TASK_STATUS_COMPLETED); | |
215 | 214 | AgvTask agvTask = getOne(agvTaskLambdaQueryWrapper); |
216 | 215 | return agvTask; |
217 | 216 | } |
... | ... | @@ -220,7 +219,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl |
220 | 219 | public AgvTask getAgvTaskBuFromPort(String fromPortCode, String warehouseCode) { |
221 | 220 | LambdaQueryWrapper<AgvTask> agvTaskLambdaQueryWrapper = Wrappers.lambdaQuery(); |
222 | 221 | agvTaskLambdaQueryWrapper.eq(AgvTask::getFromPort, fromPortCode).eq(AgvTask::getWarehouseCode, warehouseCode).lt(AgvTask::getStatus, |
223 | - QuantityConstant.AGV_TASK_STATUS_COMPLETED); | |
222 | + QuantityConstant.AGV_TASK_STATUS_COMPLETED); | |
224 | 223 | AgvTask agvTask = getOne(agvTaskLambdaQueryWrapper); |
225 | 224 | return agvTask; |
226 | 225 | } |
... | ... | @@ -229,7 +228,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl |
229 | 228 | public AgvTask getAgvTaskBuToPort(String toPortCode, String warehouseCode) { |
230 | 229 | LambdaQueryWrapper<AgvTask> agvTaskLambdaQueryWrapper = Wrappers.lambdaQuery(); |
231 | 230 | agvTaskLambdaQueryWrapper.eq(AgvTask::getToPort, toPortCode).eq(AgvTask::getWarehouseCode, warehouseCode).lt(AgvTask::getStatus, |
232 | - QuantityConstant.AGV_TASK_STATUS_COMPLETED); | |
231 | + QuantityConstant.AGV_TASK_STATUS_COMPLETED); | |
233 | 232 | AgvTask agvTask = getOne(agvTaskLambdaQueryWrapper); |
234 | 233 | return agvTask; |
235 | 234 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
1 | 1 | package org.jeecg.modules.wms.task.taskHeader.controller; |
2 | 2 | |
3 | -import java.io.IOException; | |
4 | -import java.math.BigDecimal; | |
5 | -import java.util.Arrays; | |
6 | -import java.util.List; | |
7 | -import java.util.Map; | |
8 | -import java.util.stream.Collectors; | |
9 | - | |
10 | -import javax.annotation.Resource; | |
11 | -import javax.servlet.http.HttpServletRequest; | |
12 | -import javax.servlet.http.HttpServletResponse; | |
13 | - | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
5 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
6 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
7 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
8 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
9 | +import io.swagger.annotations.Api; | |
10 | +import io.swagger.annotations.ApiOperation; | |
11 | +import lombok.extern.slf4j.Slf4j; | |
14 | 12 | import org.apache.shiro.SecurityUtils; |
15 | 13 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
16 | 14 | import org.jeecg.common.api.vo.Result; |
... | ... | @@ -50,22 +48,21 @@ import org.springframework.web.multipart.MultipartFile; |
50 | 48 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
51 | 49 | import org.springframework.web.servlet.ModelAndView; |
52 | 50 | |
53 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
54 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
55 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
56 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
57 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
58 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
59 | - | |
60 | -import io.swagger.annotations.Api; | |
61 | -import io.swagger.annotations.ApiOperation; | |
62 | -import lombok.extern.slf4j.Slf4j; | |
51 | +import javax.annotation.Resource; | |
52 | +import javax.servlet.http.HttpServletRequest; | |
53 | +import javax.servlet.http.HttpServletResponse; | |
54 | +import java.io.IOException; | |
55 | +import java.math.BigDecimal; | |
56 | +import java.util.Arrays; | |
57 | +import java.util.List; | |
58 | +import java.util.Map; | |
59 | +import java.util.stream.Collectors; | |
63 | 60 | |
64 | 61 | /** |
65 | 62 | * @Description: 任务表 |
66 | - * @Author: jeecg-boot | |
67 | - * @Date: 2022-11-10 | |
68 | - * @Version: V1.0 | |
63 | + * @Author: jeecg-boot | |
64 | + * @Date: 2022-11-10 | |
65 | + * @Version: V1.0 | |
69 | 66 | */ |
70 | 67 | @Api(tags = "任务表") |
71 | 68 | @RestController |
... | ... | @@ -93,17 +90,18 @@ public class TaskHeaderController extends HuahengBaseController { |
93 | 90 | |
94 | 91 | /** |
95 | 92 | * 分页列表查询 |
96 | - * @param taskHeader | |
97 | - * @param pageNo | |
98 | - * @param pageSize | |
99 | - * @param req | |
93 | + * | |
94 | + * @param taskHeader | |
95 | + * @param pageNo | |
96 | + * @param pageSize | |
97 | + * @param req | |
100 | 98 | * @return |
101 | 99 | */ |
102 | 100 | // @AutoLog(value = "任务表-分页列表查询") |
103 | 101 | @ApiOperation(value = "任务表-分页列表查询", notes = "任务表-分页列表查询") |
104 | 102 | @GetMapping(value = "/list") |
105 | 103 | public Result<IPage<TaskHeader>> queryPageList(TaskHeader taskHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
106 | - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
104 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
107 | 105 | HuahengJwtUtil.setWarehouseCode(req, taskHeader); |
108 | 106 | QueryWrapper<TaskHeader> queryWrapper = QueryGenerator.initQueryWrapper(taskHeader, req.getParameterMap()); |
109 | 107 | queryWrapper.orderByDesc("id"); |
... | ... | @@ -136,7 +134,8 @@ public class TaskHeaderController extends HuahengBaseController { |
136 | 134 | |
137 | 135 | /** |
138 | 136 | * 添加 |
139 | - * @param taskHeader | |
137 | + * | |
138 | + * @param taskHeader | |
140 | 139 | * @return |
141 | 140 | */ |
142 | 141 | @AutoLog(value = "任务表-添加") |
... | ... | @@ -150,7 +149,8 @@ public class TaskHeaderController extends HuahengBaseController { |
150 | 149 | |
151 | 150 | /** |
152 | 151 | * 编辑 |
153 | - * @param taskHeader | |
152 | + * | |
153 | + * @param taskHeader | |
154 | 154 | * @return |
155 | 155 | */ |
156 | 156 | @AutoLog(value = "任务表-编辑") |
... | ... | @@ -164,7 +164,8 @@ public class TaskHeaderController extends HuahengBaseController { |
164 | 164 | |
165 | 165 | /** |
166 | 166 | * 通过id删除 |
167 | - * @param id | |
167 | + * | |
168 | + * @param id | |
168 | 169 | * @return |
169 | 170 | */ |
170 | 171 | @AutoLog(value = "任务表-通过id删除") |
... | ... | @@ -178,7 +179,8 @@ public class TaskHeaderController extends HuahengBaseController { |
178 | 179 | |
179 | 180 | /** |
180 | 181 | * 批量删除 |
181 | - * @param ids | |
182 | + * | |
183 | + * @param ids | |
182 | 184 | * @return |
183 | 185 | */ |
184 | 186 | @AutoLog(value = "任务表-批量删除") |
... | ... | @@ -210,15 +212,17 @@ public class TaskHeaderController extends HuahengBaseController { |
210 | 212 | /*---------------------------------主表处理-end-------------------------------------*/ |
211 | 213 | |
212 | 214 | /*--------------------------------子表处理-任务详情-begin----------------------------------------------*/ |
215 | + | |
213 | 216 | /** |
214 | 217 | * 通过主表ID查询 |
218 | + * | |
215 | 219 | * @return |
216 | 220 | */ |
217 | 221 | // @AutoLog(value = "任务详情-通过主表ID查询") |
218 | 222 | @ApiOperation(value = "任务详情-通过主表ID查询", notes = "任务详情-通过主表ID查询") |
219 | 223 | @GetMapping(value = "/listTaskDetailByMainId") |
220 | 224 | public Result<IPage<TaskDetail>> listTaskDetailByMainId(TaskDetail taskDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
221 | - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
225 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
222 | 226 | QueryWrapper<TaskDetail> queryWrapper = QueryGenerator.initQueryWrapper(taskDetail, req.getParameterMap()); |
223 | 227 | Page<TaskDetail> page = new Page<TaskDetail>(pageNo, pageSize); |
224 | 228 | IPage<TaskDetail> pageList = taskDetailService.page(page, queryWrapper); |
... | ... | @@ -227,7 +231,8 @@ public class TaskHeaderController extends HuahengBaseController { |
227 | 231 | |
228 | 232 | /** |
229 | 233 | * 添加 |
230 | - * @param taskDetail | |
234 | + * | |
235 | + * @param taskDetail | |
231 | 236 | * @return |
232 | 237 | */ |
233 | 238 | @AutoLog(value = "任务详情-添加") |
... | ... | @@ -241,7 +246,8 @@ public class TaskHeaderController extends HuahengBaseController { |
241 | 246 | |
242 | 247 | /** |
243 | 248 | * 编辑 |
244 | - * @param taskDetail | |
249 | + * | |
250 | + * @param taskDetail | |
245 | 251 | * @return |
246 | 252 | */ |
247 | 253 | @AutoLog(value = "任务详情-编辑") |
... | ... | @@ -255,7 +261,8 @@ public class TaskHeaderController extends HuahengBaseController { |
255 | 261 | |
256 | 262 | /** |
257 | 263 | * 通过id删除 |
258 | - * @param id | |
264 | + * | |
265 | + * @param id | |
259 | 266 | * @return |
260 | 267 | */ |
261 | 268 | @AutoLog(value = "任务详情-通过id删除") |
... | ... | @@ -269,7 +276,8 @@ public class TaskHeaderController extends HuahengBaseController { |
269 | 276 | |
270 | 277 | /** |
271 | 278 | * 批量删除 |
272 | - * @param ids | |
279 | + * | |
280 | + * @param ids | |
273 | 281 | * @return |
274 | 282 | */ |
275 | 283 | @AutoLog(value = "任务详情-批量删除") |
... | ... | @@ -283,13 +291,14 @@ public class TaskHeaderController extends HuahengBaseController { |
283 | 291 | |
284 | 292 | /** |
285 | 293 | * 导出 |
294 | + * | |
286 | 295 | * @return |
287 | 296 | */ |
288 | 297 | @RequestMapping(value = "/exportTaskDetail") |
289 | 298 | public ModelAndView exportTaskDetail(HttpServletRequest request, TaskDetail taskDetail) { |
290 | 299 | // Step.1 组装查询条件 |
291 | 300 | QueryWrapper<TaskDetail> queryWrapper = QueryGenerator.initQueryWrapper(taskDetail, request.getParameterMap()); |
292 | - LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); | |
301 | + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); | |
293 | 302 | |
294 | 303 | // Step.2 获取导出数据 |
295 | 304 | List<TaskDetail> pageList = taskDetailService.list(queryWrapper); |
... | ... | @@ -315,11 +324,12 @@ public class TaskHeaderController extends HuahengBaseController { |
315 | 324 | |
316 | 325 | /** |
317 | 326 | * 导入 |
327 | + * | |
318 | 328 | * @return |
319 | 329 | */ |
320 | 330 | @RequestMapping(value = "/importTaskDetail/{mainId}") |
321 | 331 | public Result<?> importTaskDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") Integer mainId) { |
322 | - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request; | |
332 | + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | |
323 | 333 | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
324 | 334 | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
325 | 335 | MultipartFile file = entity.getValue();// 获取上传文件对象 |
... | ... | @@ -367,7 +377,7 @@ public class TaskHeaderController extends HuahengBaseController { |
367 | 377 | Result result = handleMultiProcess("completeTaskByWMS", taskId + "", new MultiProcessListener() { |
368 | 378 | @Override |
369 | 379 | public Result<?> doProcess() { |
370 | - return taskHeaderService.completeTaskByWMS(taskId, false); | |
380 | + return taskHeaderService.completeTaskByWMS(taskId, false, null); | |
371 | 381 | } |
372 | 382 | }); |
373 | 383 | return result; |
... | ... | @@ -511,7 +521,7 @@ public class TaskHeaderController extends HuahengBaseController { |
511 | 521 | /** |
512 | 522 | * 创建移库任务 |
513 | 523 | */ |
514 | - @AutoLog(value = "任务表-创建移库任务",operateType = 2) | |
524 | + @AutoLog(value = "任务表-创建移库任务", operateType = 2) | |
515 | 525 | @ApiOperation(value = "任务表-创建移库任务", notes = "任务表-创建移库任务") |
516 | 526 | @RequiresPermissions("taskHeader:transfer") |
517 | 527 | @PostMapping("/createTransferTask") |
... | ... | @@ -640,6 +650,7 @@ public class TaskHeaderController extends HuahengBaseController { |
640 | 650 | |
641 | 651 | /** |
642 | 652 | * 选择整出口 |
653 | + * | |
643 | 654 | * @return |
644 | 655 | */ |
645 | 656 | @ApiOperation(value = "任务表-选择整出口", notes = "任务表-选择整出口") |
... | ... | @@ -681,6 +692,7 @@ public class TaskHeaderController extends HuahengBaseController { |
681 | 692 | |
682 | 693 | /** |
683 | 694 | * 选择整出口 |
695 | + * | |
684 | 696 | * @return |
685 | 697 | */ |
686 | 698 | @ApiOperation(value = "任务表-选择整出口", notes = "任务表-选择整出口") |
... | ... | @@ -705,6 +717,7 @@ public class TaskHeaderController extends HuahengBaseController { |
705 | 717 | |
706 | 718 | /** |
707 | 719 | * 选择空托盘组出库整出口 |
720 | + * | |
708 | 721 | * @return |
709 | 722 | */ |
710 | 723 | @ApiOperation(value = "任务表-选择空托盘组出库整出口", notes = "任务表-选择空托盘组出库整出口") |
... | ... | @@ -746,6 +759,7 @@ public class TaskHeaderController extends HuahengBaseController { |
746 | 759 | |
747 | 760 | /** |
748 | 761 | * 选择分拣口 |
762 | + * | |
749 | 763 | * @return |
750 | 764 | */ |
751 | 765 | @ApiOperation(value = "任务表-选择分拣口", notes = "任务表-选择分拣口") |
... | ... | @@ -787,6 +801,7 @@ public class TaskHeaderController extends HuahengBaseController { |
787 | 801 | |
788 | 802 | /** |
789 | 803 | * 选择站台 |
804 | + * | |
790 | 805 | * @return |
791 | 806 | */ |
792 | 807 | @ApiOperation(value = "任务表-选择站台", notes = "任务表-选择站台") |
... | ... | @@ -812,6 +827,7 @@ public class TaskHeaderController extends HuahengBaseController { |
812 | 827 | |
813 | 828 | /** |
814 | 829 | * 修复空出的数据 |
830 | + * | |
815 | 831 | * @return |
816 | 832 | */ |
817 | 833 | @AutoLog(value = "修复空出的数据", operateType = 3) |
... | ... | @@ -831,6 +847,7 @@ public class TaskHeaderController extends HuahengBaseController { |
831 | 847 | |
832 | 848 | /** |
833 | 849 | * 修复重入的数据 |
850 | + * | |
834 | 851 | * @return |
835 | 852 | */ |
836 | 853 | @AutoLog(value = "修复重入的数据", operateType = 3) |
... | ... | @@ -850,6 +867,7 @@ public class TaskHeaderController extends HuahengBaseController { |
850 | 867 | |
851 | 868 | /** |
852 | 869 | * 修复取货错的数据 |
870 | + * | |
853 | 871 | * @return |
854 | 872 | */ |
855 | 873 | @AutoLog(value = "修复取货错的数据", operateType = 3) |
... | ... | @@ -869,6 +887,7 @@ public class TaskHeaderController extends HuahengBaseController { |
869 | 887 | |
870 | 888 | /** |
871 | 889 | * 快速入库 |
890 | + * | |
872 | 891 | * @return |
873 | 892 | */ |
874 | 893 | @AutoLog(value = "快速入库", operateType = 2) |
... | ... | @@ -889,6 +908,7 @@ public class TaskHeaderController extends HuahengBaseController { |
889 | 908 | |
890 | 909 | /** |
891 | 910 | * 快速出库 |
911 | + * | |
892 | 912 | * @return |
893 | 913 | */ |
894 | 914 | @AutoLog(value = "快速出库", operateType = 3) |
... | ... | @@ -909,6 +929,7 @@ public class TaskHeaderController extends HuahengBaseController { |
909 | 929 | |
910 | 930 | /** |
911 | 931 | * 质检登记 |
932 | + * | |
912 | 933 | * @return |
913 | 934 | */ |
914 | 935 | @AutoLog(value = "质检登记", operateType = 3) |
... | ... | @@ -931,6 +952,7 @@ public class TaskHeaderController extends HuahengBaseController { |
931 | 952 | |
932 | 953 | /** |
933 | 954 | * 修改优先级 |
955 | + * | |
934 | 956 | * @return |
935 | 957 | */ |
936 | 958 | @AutoLog(value = "修改优先级", operateType = 3) |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
1 | 1 | package org.jeecg.modules.wms.task.taskHeader.service; |
2 | 2 | |
3 | -import java.io.Serializable; | |
4 | -import java.math.BigDecimal; | |
5 | -import java.util.Collection; | |
6 | -import java.util.List; | |
7 | - | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
8 | 4 | import org.jeecg.common.api.vo.Result; |
9 | 5 | import org.jeecg.modules.wms.config.location.entity.Location; |
10 | 6 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
... | ... | @@ -12,13 +8,16 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; |
12 | 8 | import org.jeecg.modules.wms.task.taskHeader.entity.QucikReceiptEntity; |
13 | 9 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
14 | 10 | |
15 | -import com.baomidou.mybatisplus.extension.service.IService; | |
11 | +import java.io.Serializable; | |
12 | +import java.math.BigDecimal; | |
13 | +import java.util.Collection; | |
14 | +import java.util.List; | |
16 | 15 | |
17 | 16 | /** |
18 | 17 | * @Description: 任务表 |
19 | - * @Author: jeecg-boot | |
20 | - * @Date: 2022-11-10 | |
21 | - * @Version: V1.0 | |
18 | + * @Author: jeecg-boot | |
19 | + * @Date: 2022-11-10 | |
20 | + * @Version: V1.0 | |
22 | 21 | */ |
23 | 22 | public interface ITaskHeaderService extends IService<TaskHeader> { |
24 | 23 | |
... | ... | @@ -34,7 +33,8 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
34 | 33 | |
35 | 34 | /** |
36 | 35 | * 判断旁边库位是否有未完成的任务,如果有 |
37 | - * @param location | |
36 | + * | |
37 | + * @param location | |
38 | 38 | * @return |
39 | 39 | */ |
40 | 40 | boolean haveUncompleteTaskInNear(Location location); |
... | ... | @@ -43,47 +43,53 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * 通过AGV任务ID,获取任务信息 |
46 | - * @param agvTaskId | |
46 | + * | |
47 | + * @param agvTaskId | |
47 | 48 | * @return |
48 | 49 | */ |
49 | 50 | TaskHeader getTaskHeaderByAgvTaskId(int agvTaskId); |
50 | 51 | |
51 | 52 | /** |
52 | 53 | * 通过起始库位编码,获取任务信息 |
53 | - * @param fromLocationCode | |
54 | - * @param warehouseCode | |
54 | + * | |
55 | + * @param fromLocationCode | |
56 | + * @param warehouseCode | |
55 | 57 | * @return |
56 | 58 | */ |
57 | 59 | TaskHeader getUnCompleteTaskByFromLocationCode(String fromLocationCode, String warehouseCode); |
58 | 60 | |
59 | 61 | /** |
60 | 62 | * 通过目标库位编码,获取任务信息 |
61 | - * @param toLocationCode | |
62 | - * @param warehouseCode | |
63 | + * | |
64 | + * @param toLocationCode | |
65 | + * @param warehouseCode | |
63 | 66 | * @return |
64 | 67 | */ |
65 | 68 | TaskHeader getUnCompleteTaskByToLocationCode(String toLocationCode, String warehouseCode); |
66 | 69 | |
67 | 70 | /** |
68 | 71 | * 通过库位编码,获取任务信息 |
69 | - * @param locationCode | |
70 | - * @param warehouseCode | |
72 | + * | |
73 | + * @param locationCode | |
74 | + * @param warehouseCode | |
71 | 75 | * @return |
72 | 76 | */ |
73 | 77 | TaskHeader getUnCompleteTaskByLocationCode(String locationCode, String warehouseCode); |
74 | 78 | |
75 | 79 | /** |
76 | 80 | * 通过托盘号,获取未完成任务信息 |
77 | - * @param containerCode | |
78 | - * @param warehouseCode | |
81 | + * | |
82 | + * @param containerCode | |
83 | + * @param warehouseCode | |
79 | 84 | * @return |
80 | 85 | */ |
81 | 86 | TaskHeader getUnCompleteTaskByContainerCode(String containerCode, String warehouseCode); |
82 | 87 | |
83 | 88 | /** |
84 | 89 | * 通过前置任务号,获取未完成任务信息 |
85 | - * @param preTaskNo | |
86 | - * @param warehouseCode | |
90 | + * | |
91 | + * @param preTaskNo | |
92 | + * @param warehouseCode | |
87 | 93 | * @return |
88 | 94 | */ |
89 | 95 | TaskHeader getUnCompleteTaskByPreTaskNo(int preTaskNo, String warehouseCode); |
... | ... | @@ -92,306 +98,356 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
92 | 98 | |
93 | 99 | List<TaskHeader> getUnCompleteListTaskByRoadWay(Integer roadWay, String warehouseCode); |
94 | 100 | |
101 | + | |
95 | 102 | /** |
96 | 103 | * 完成WMS任务 |
97 | - * @param taskId | |
104 | + * | |
105 | + * @param taskId | |
98 | 106 | * @return |
99 | 107 | */ |
100 | - Result completeTaskByWMS(Integer taskId, boolean foldFlag); | |
108 | + Result completeTaskByWMS(Integer taskId, boolean foldFlag, String toLocationCode); | |
101 | 109 | |
102 | 110 | /** |
103 | 111 | * 取消任务,恢复数据 |
104 | - * @param taskHeader | |
112 | + * | |
113 | + * @param taskHeader | |
105 | 114 | * @return |
106 | 115 | */ |
107 | 116 | Result cancelLocationAndContainerStatus(TaskHeader taskHeader); |
108 | 117 | |
109 | 118 | /** |
110 | 119 | * 取消WMS任务 |
111 | - * @param taskId | |
120 | + * | |
121 | + * @param taskId | |
112 | 122 | * @return |
113 | 123 | */ |
114 | 124 | Result cancelTask(Integer taskId); |
115 | 125 | |
116 | 126 | /** |
117 | 127 | * 取消WMS任务 |
118 | - * @param taskId | |
128 | + * | |
129 | + * @param taskId | |
119 | 130 | * @return |
120 | 131 | */ |
121 | 132 | Result cancelTaskByUpstreamTaskNo(String taskId); |
122 | 133 | |
123 | 134 | /** |
124 | 135 | * 下发任务给WCS |
125 | - * @param taskId | |
136 | + * | |
137 | + * @param taskId | |
126 | 138 | * @return |
127 | 139 | */ |
128 | 140 | Result sendTaskToWcs(Integer taskId); |
129 | 141 | |
130 | 142 | /** |
131 | 143 | * 创建空托盘入库任务 |
132 | - * @param containerCode | |
133 | - * @param toLocationCode | |
134 | - * @param warehouseCode | |
144 | + * | |
145 | + * @param containerCode | |
146 | + * @param toLocationCode | |
147 | + * @param warehouseCode | |
135 | 148 | * @return |
136 | 149 | */ |
137 | 150 | Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode, String toPortCode); |
138 | 151 | |
139 | 152 | /** |
140 | 153 | * 创建空托盘出库任务 |
141 | - * @param containerCode | |
142 | - * @param toPortCode | |
143 | - * @param warehouseCode | |
154 | + * | |
155 | + * @param containerCode | |
156 | + * @param toPortCode | |
157 | + * @param warehouseCode | |
144 | 158 | * @return |
145 | 159 | */ |
146 | 160 | Result createEmptyOut(String containerCode, String toPortCode, String warehouseCode); |
147 | 161 | |
148 | 162 | /** |
149 | 163 | * 批量创建空托盘出库任务 |
150 | - * @param zoneCode | |
151 | - * @param toPortCode | |
152 | - * @param warehouseCode | |
153 | - * @param num | |
164 | + * | |
165 | + * @param zoneCode | |
166 | + * @param toPortCode | |
167 | + * @param warehouseCode | |
168 | + * @param num | |
154 | 169 | * @return |
155 | 170 | */ |
156 | 171 | Result batchCreateEmptyOut(String zoneCode, String toPortCode, int num, String warehouseCode); |
157 | 172 | |
158 | 173 | /** |
159 | 174 | * 创建移库任务 |
160 | - * @param fromLocationCode | |
161 | - * @param toLocationCode | |
162 | - * @param warehouseCode | |
175 | + * | |
176 | + * @param fromLocationCode | |
177 | + * @param toLocationCode | |
178 | + * @param warehouseCode | |
163 | 179 | * @return |
164 | 180 | */ |
165 | 181 | Result<TaskHeader> createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode); |
166 | 182 | |
167 | 183 | |
168 | 184 | Result<TaskHeader> createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode, int priority); |
185 | + | |
169 | 186 | /** |
170 | 187 | * 创建出库查看任务 |
171 | - * @param containerCode | |
172 | - * @param toPortCode | |
173 | - * @param warehouseCode | |
188 | + * | |
189 | + * @param containerCode | |
190 | + * @param toPortCode | |
191 | + * @param warehouseCode | |
174 | 192 | * @return |
175 | 193 | */ |
176 | 194 | Result createCheckOutTask(String containerCode, String toPortCode, String warehouseCode); |
177 | 195 | |
178 | 196 | /** |
179 | 197 | * 创建质检任务 |
180 | - * @param containerCode | |
181 | - * @param toPortCode | |
182 | - * @param warehouseCode | |
198 | + * | |
199 | + * @param containerCode | |
200 | + * @param toPortCode | |
201 | + * @param warehouseCode | |
183 | 202 | * @return |
184 | 203 | */ |
185 | 204 | Result createQualityTask(String containerCode, String toPortCode, String warehouseCode); |
186 | 205 | |
187 | 206 | /** |
188 | 207 | * 创建跨站任务任务 |
189 | - * @param containerCode | |
190 | - * @param fromPortCode | |
191 | - * @param toPortCode | |
192 | - * @param warehouseCode | |
208 | + * | |
209 | + * @param containerCode | |
210 | + * @param fromPortCode | |
211 | + * @param toPortCode | |
212 | + * @param warehouseCode | |
193 | 213 | * @return |
194 | 214 | */ |
195 | 215 | Result createOverStationTask(String containerCode, String fromPortCode, String toPortCode, String warehouseCode); |
196 | 216 | |
197 | 217 | /** |
198 | 218 | * WCS申请空托盘组入库 |
199 | - * @param containerCode | |
200 | - * @param zoneCode | |
201 | - * @param roadWay | |
202 | - * @parap height | |
203 | - * @param warehouseCode | |
219 | + * | |
220 | + * @param containerCode | |
221 | + * @param zoneCode | |
222 | + * @param roadWay | |
223 | + * @param warehouseCode | |
204 | 224 | * @return |
225 | + * @parap height | |
205 | 226 | */ |
206 | 227 | Result createManyEmptyInTask(String containerCode, String zoneCode, String roadWay, String height, String warehouseCode); |
207 | 228 | |
208 | 229 | /** |
209 | 230 | * 创建空托盘组入库 |
210 | - * @param containerCode | |
211 | - * @param toLocationCode | |
212 | - * @param warehouseCode | |
231 | + * | |
232 | + * @param containerCode | |
233 | + * @param toLocationCode | |
234 | + * @param warehouseCode | |
213 | 235 | * @return |
214 | 236 | */ |
215 | 237 | Result createManyEmptyIn(String containerCode, String toLocationCode, String warehouseCode); |
216 | 238 | |
217 | 239 | /** |
218 | 240 | * 创建空托盘组出库 |
219 | - * @param containerCode | |
220 | - * @param toPortCode | |
221 | - * @param warehouseCode | |
241 | + * | |
242 | + * @param containerCode | |
243 | + * @param toPortCode | |
244 | + * @param warehouseCode | |
222 | 245 | * @return |
223 | 246 | */ |
224 | 247 | Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode); |
225 | 248 | |
226 | 249 | /** |
227 | 250 | * 增加MES次数,每次加一 |
228 | - * @param taskHeader | |
251 | + * | |
252 | + * @param taskHeader | |
229 | 253 | * @return |
230 | 254 | */ |
231 | 255 | Result addMesTryTimes(TaskHeader taskHeader); |
232 | 256 | |
233 | 257 | /** |
234 | 258 | * 处理空出 |
235 | - * @param taskNo | |
259 | + * | |
260 | + * @param taskNo | |
236 | 261 | * @return |
237 | 262 | */ |
238 | 263 | Result handleEmptyOut(String taskNo); |
239 | 264 | |
240 | 265 | /** |
241 | 266 | * 处理重入 |
242 | - * @param taskNo | |
267 | + * | |
268 | + * @param taskNo | |
243 | 269 | * @return |
244 | 270 | */ |
245 | 271 | Result handleDoubleIn(String taskNo); |
246 | 272 | |
247 | 273 | /** |
248 | 274 | * 处理取货错 |
249 | - * @param taskNo | |
275 | + * | |
276 | + * @param taskNo | |
250 | 277 | * @return |
251 | 278 | */ |
252 | 279 | Result handlePickupError(String taskNo); |
253 | 280 | |
254 | 281 | /** |
255 | 282 | * 完成入库 |
256 | - * @param taskHeader | |
283 | + * | |
284 | + * @param taskHeader | |
257 | 285 | * @return |
258 | 286 | */ |
259 | 287 | Result completeReceiptTask(TaskHeader taskHeader); |
260 | 288 | |
261 | 289 | /** |
262 | 290 | * 完成出库 |
263 | - * @param taskHeader | |
291 | + * | |
292 | + * @param taskHeader | |
264 | 293 | * @return |
265 | 294 | */ |
266 | 295 | Result completeShipmentTask(TaskHeader taskHeader); |
267 | 296 | |
268 | 297 | /** |
269 | 298 | * 完成整出出库,清空库存 |
270 | - * @param inventoryDetailList | |
299 | + * | |
300 | + * @param inventoryDetailList | |
271 | 301 | * @return |
272 | 302 | */ |
273 | 303 | Result completeWholeShipmentTaskClearInventory(InventoryHeader inventoryHeader, List<InventoryDetail> inventoryDetailList); |
274 | 304 | |
275 | 305 | /** |
276 | 306 | * 完成盘点 |
277 | - * @param taskHeader | |
307 | + * | |
308 | + * @param taskHeader | |
278 | 309 | * @return |
279 | 310 | */ |
280 | 311 | Result completeCycleCountTask(TaskHeader taskHeader); |
281 | 312 | |
282 | 313 | /** |
283 | 314 | * 完成空托盘入库 |
284 | - * @param taskHeader | |
315 | + * | |
316 | + * @param taskHeader | |
285 | 317 | * @return |
286 | 318 | */ |
287 | 319 | Result completeEmptyInTask(TaskHeader taskHeader); |
288 | 320 | |
289 | 321 | /** |
290 | 322 | * 完成空托盘出库 |
291 | - * @param taskHeader | |
323 | + * | |
324 | + * @param taskHeader | |
292 | 325 | * @return |
293 | 326 | */ |
294 | 327 | Result completeEmptyOutTask(TaskHeader taskHeader); |
295 | 328 | |
296 | 329 | /** |
297 | 330 | * 完成移库 |
298 | - * @param taskHeader | |
331 | + * | |
332 | + * @param taskHeader | |
299 | 333 | * @return |
300 | 334 | */ |
301 | 335 | Result completeTransferTask(TaskHeader taskHeader); |
302 | 336 | |
303 | 337 | /** |
304 | 338 | * 完成出库查看 |
305 | - * @param taskHeader | |
339 | + * | |
340 | + * @param taskHeader | |
306 | 341 | * @return |
307 | 342 | */ |
308 | 343 | Result completeCheckOutTask(TaskHeader taskHeader); |
309 | 344 | |
310 | 345 | /** |
311 | 346 | * 完成跨站 |
312 | - * @param taskHeader | |
347 | + * | |
348 | + * @param taskHeader | |
313 | 349 | * @return |
314 | 350 | */ |
315 | 351 | Result completeOverStationTask(TaskHeader taskHeader); |
316 | 352 | |
317 | 353 | /** |
318 | 354 | * 完成空托盘组入库 |
319 | - * @param taskHeader | |
355 | + * | |
356 | + * @param taskHeader | |
320 | 357 | * @return |
321 | 358 | */ |
322 | 359 | Result completeManyEmptyInTask(TaskHeader taskHeader); |
323 | 360 | |
324 | 361 | /** |
325 | 362 | * 完成空托盘组出库 |
326 | - * @param taskHeader | |
363 | + * | |
364 | + * @param taskHeader | |
327 | 365 | * @return |
328 | 366 | */ |
329 | 367 | Result completeManyEmptyOutTask(TaskHeader taskHeader); |
330 | 368 | |
331 | 369 | /** |
332 | 370 | * 完成质检任务 |
333 | - * @param taskHeader | |
371 | + * | |
372 | + * @param taskHeader | |
334 | 373 | * @return |
335 | 374 | */ |
336 | 375 | Result completeQualityTask(TaskHeader taskHeader); |
337 | 376 | |
338 | 377 | /** |
339 | 378 | * 取消入库 |
340 | - * @param taskHeader | |
379 | + * | |
380 | + * @param taskHeader | |
341 | 381 | * @return |
342 | 382 | */ |
343 | 383 | Result cancelReceiptTask(TaskHeader taskHeader); |
344 | 384 | |
345 | 385 | /** |
346 | 386 | * 取消出库 |
347 | - * @param taskHeader | |
387 | + * | |
388 | + * @param taskHeader | |
348 | 389 | * @return |
349 | 390 | */ |
350 | 391 | Result cancelShipmentTask(TaskHeader taskHeader); |
351 | 392 | |
352 | 393 | /** |
353 | 394 | * 修改盘点明细状态 |
354 | - * @param taskHeader | |
395 | + * | |
396 | + * @param taskHeader | |
355 | 397 | * @return |
356 | 398 | */ |
357 | 399 | Result updateCycleCountDetailByEnableStatus(TaskHeader taskHeader); |
358 | 400 | |
359 | 401 | /** |
360 | 402 | * 更新状态 |
361 | - * @param status | |
362 | - * @param id | |
403 | + * | |
404 | + * @param status | |
405 | + * @param id | |
363 | 406 | * @return |
364 | 407 | */ |
365 | 408 | boolean updateStatusById(int status, int id); |
366 | 409 | |
367 | 410 | /** |
368 | 411 | * 更新出库口 |
369 | - * @param toPortCode | |
370 | - * @param id | |
412 | + * | |
413 | + * @param toPortCode | |
414 | + * @param id | |
371 | 415 | * @return |
372 | 416 | */ |
373 | 417 | boolean updateToPortCodeById(String toPortCode, int id); |
374 | 418 | |
375 | 419 | /** |
420 | + * 更新目标库位 | |
421 | + * | |
422 | + * @param toLocationCode | |
423 | + * @param id | |
424 | + * @return | |
425 | + */ | |
426 | + boolean updateToLocationCodeById(String toLocationCode, int id); | |
427 | + | |
428 | + /** | |
376 | 429 | * 更新 |
377 | - * @param status | |
378 | - * @param id | |
430 | + * | |
431 | + * @param status | |
432 | + * @param id | |
379 | 433 | * @return |
380 | 434 | */ |
381 | 435 | boolean updateExceptionStateById(int status, int id); |
382 | 436 | |
383 | 437 | /** |
384 | 438 | * 更新状态 |
385 | - * @param preTaskNo | |
386 | - * @param id | |
439 | + * | |
440 | + * @param preTaskNo | |
441 | + * @param id | |
387 | 442 | * @return |
388 | 443 | */ |
389 | 444 | boolean updatePreTaskNoById(int preTaskNo, int id); |
390 | 445 | |
391 | 446 | /** |
392 | 447 | * 合并库存 |
393 | - * @param containerCode | |
394 | - * @param warehouseCode | |
448 | + * | |
449 | + * @param containerCode | |
450 | + * @param warehouseCode | |
395 | 451 | * @return |
396 | 452 | */ |
397 | 453 | boolean combineInventoryDetail(String containerCode, String warehouseCode); |
... | ... | @@ -400,50 +456,58 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
400 | 456 | |
401 | 457 | /** |
402 | 458 | * 根据任务区分,在生产任务的时候,锁定容器和库位 |
459 | + * | |
403 | 460 | * @param |
404 | 461 | */ |
405 | 462 | Result createTaskLockContainerAndLocation(int taskType, String containerCode, String fromLocationCode, String toLocationCode, String warehouseCode); |
406 | 463 | |
407 | 464 | /** |
408 | 465 | * 入库任务,在生产任务的时候,锁定容器和库位 |
466 | + * | |
409 | 467 | * @param |
410 | 468 | */ |
411 | 469 | Result createReceiptTaskLockContainerAndLocation(String containerCode, String toLocationCode, String warehouseCode); |
412 | 470 | |
413 | 471 | /** |
414 | 472 | * 出库任务,在生产任务的时候,锁定容器和库位 |
473 | + * | |
415 | 474 | * @param |
416 | 475 | */ |
417 | 476 | Result createShipmentTaskLockContainerAndLocation(String containerCode, String warehouseCode); |
418 | 477 | |
419 | 478 | /** |
420 | 479 | * 分拣任务,在生产任务的时候,锁定容器和库位 |
480 | + * | |
421 | 481 | * @param |
422 | 482 | */ |
423 | 483 | Result createSortTaskLockContainerAndLocation(String containerCode, String fromLocationCode, String toLocationCode, String warehouseCode); |
424 | 484 | |
425 | 485 | /** |
426 | 486 | * 跨站任务,在生产任务的时候,锁定容器和库位 |
487 | + * | |
427 | 488 | * @param |
428 | 489 | */ |
429 | 490 | Result createOverStationTaskLockContainer(String containerCode, String warehouseCode); |
430 | 491 | |
431 | 492 | /** |
432 | 493 | * 完成任务 解锁容器和库位 |
494 | + * | |
433 | 495 | * @param |
434 | 496 | */ |
435 | 497 | Result completeTaskUnLockContainerAndLocation(String containerFillStatus, int taskType, String containerCode, String fromLocationCode, String toLocationCode, |
436 | - String warehouseCode); | |
498 | + String warehouseCode); | |
437 | 499 | |
438 | 500 | /** |
439 | 501 | * add |
502 | + * | |
440 | 503 | * @return |
441 | 504 | */ |
442 | 505 | Result quickReceipt(QucikReceiptEntity qucikReceiptEntity); |
443 | 506 | |
444 | 507 | /** |
445 | 508 | * 切换任务 |
446 | - * @param id | |
509 | + * | |
510 | + * @param id | |
447 | 511 | * @return |
448 | 512 | */ |
449 | 513 | Result switchTask(int id); |
... | ... | @@ -464,6 +528,7 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
464 | 528 | |
465 | 529 | /** |
466 | 530 | * add |
531 | + * | |
467 | 532 | * @return |
468 | 533 | */ |
469 | 534 | Result quickShipment(QucikReceiptEntity qucikReceiptEntity); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.task.taskHeader.service.impl; |
2 | 2 | |
3 | -import java.io.Serializable; | |
4 | -import java.math.BigDecimal; | |
5 | -import java.util.*; | |
6 | -import java.util.stream.Collectors; | |
7 | - | |
8 | -import javax.annotation.Resource; | |
9 | - | |
3 | +import cn.monitor4all.logRecord.annotation.OperationLog; | |
4 | +import cn.monitor4all.logRecord.context.LogRecordContext; | |
5 | +import com.alibaba.fastjson.JSON; | |
6 | +import com.aliyun.oss.ServiceException; | |
7 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
8 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
9 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
10 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
11 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
12 | +import lombok.extern.slf4j.Slf4j; | |
10 | 13 | import org.jeecg.common.api.vo.Result; |
11 | 14 | import org.jeecg.common.exception.JeecgBootException; |
12 | 15 | import org.jeecg.modules.wms.api.wcs.entity.WcsTask; |
... | ... | @@ -77,23 +80,17 @@ import org.springframework.beans.factory.annotation.Autowired; |
77 | 80 | import org.springframework.stereotype.Service; |
78 | 81 | import org.springframework.transaction.annotation.Transactional; |
79 | 82 | |
80 | -import com.alibaba.fastjson.JSON; | |
81 | -import com.aliyun.oss.ServiceException; | |
82 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
83 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
84 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
85 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
86 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
87 | - | |
88 | -import cn.monitor4all.logRecord.annotation.OperationLog; | |
89 | -import cn.monitor4all.logRecord.context.LogRecordContext; | |
90 | -import lombok.extern.slf4j.Slf4j; | |
83 | +import javax.annotation.Resource; | |
84 | +import java.io.Serializable; | |
85 | +import java.math.BigDecimal; | |
86 | +import java.util.*; | |
87 | +import java.util.stream.Collectors; | |
91 | 88 | |
92 | 89 | /** |
93 | 90 | * @Description: 任务表 |
94 | - * @Author: jeecg-boot | |
95 | - * @Date: 2022-11-10 | |
96 | - * @Version: V1.0 | |
91 | + * @Author: jeecg-boot | |
92 | + * @Date: 2022-11-10 | |
93 | + * @Version: V1.0 | |
97 | 94 | */ |
98 | 95 | @Slf4j |
99 | 96 | @Service |
... | ... | @@ -222,7 +219,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
222 | 219 | |
223 | 220 | /** |
224 | 221 | * 如果库位是锁定的,那么这个库位一定是被某个任务占用。 |
225 | - * @param location | |
222 | + * | |
223 | + * @param location | |
226 | 224 | * @return |
227 | 225 | */ |
228 | 226 | @Override |
... | ... | @@ -332,11 +330,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
332 | 330 | } |
333 | 331 | |
334 | 332 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_TRANSFER, containerCode, fromLocationCode, toLocationCode, |
335 | - warehouseCode); | |
333 | + warehouseCode); | |
336 | 334 | if (!result.isSuccess()) { |
337 | 335 | throw new JeecgBootException(result.getMessage()); |
338 | 336 | } |
339 | - TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult(); | |
337 | + TaskLockEntity taskLockEntity = (TaskLockEntity) result.getResult(); | |
340 | 338 | String zoneCode = taskLockEntity.getZoneCode(); |
341 | 339 | // 4. 判断源库位旁边有托盘但是没有任务,那么不允许移库 |
342 | 340 | TaskHeader taskHeader = new TaskHeader(); |
... | ... | @@ -407,11 +405,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
407 | 405 | toLocationCode = fromLocationCode; |
408 | 406 | } |
409 | 407 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_CHECK_OUT, containerCode, fromLocationCode, toLocationCode, |
410 | - warehouseCode); | |
408 | + warehouseCode); | |
411 | 409 | if (!result.isSuccess()) { |
412 | 410 | throw new JeecgBootException(result.getMessage()); |
413 | 411 | } |
414 | - TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult(); | |
412 | + TaskLockEntity taskLockEntity = (TaskLockEntity) result.getResult(); | |
415 | 413 | String zoneCode = taskLockEntity.getZoneCode(); |
416 | 414 | Port port = portService.getPortByCode(toPortCode, QuantityConstant.PORT_TYPE_PICK, zoneCode, warehouseCode); |
417 | 415 | if (port == null) { |
... | ... | @@ -469,11 +467,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
469 | 467 | toLocationCode = fromLocationCode; |
470 | 468 | } |
471 | 469 | Result result = |
472 | - taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_QUALITY, containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
470 | + taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_QUALITY, containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
473 | 471 | if (!result.isSuccess()) { |
474 | 472 | throw new JeecgBootException(result.getMessage()); |
475 | 473 | } |
476 | - TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult(); | |
474 | + TaskLockEntity taskLockEntity = (TaskLockEntity) result.getResult(); | |
477 | 475 | String zoneCode = taskLockEntity.getZoneCode(); |
478 | 476 | Port port = portService.getPortByCode(toPortCode, QuantityConstant.PORT_TYPE_PICK, zoneCode, warehouseCode); |
479 | 477 | if (port == null) { |
... | ... | @@ -497,7 +495,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
497 | 495 | } |
498 | 496 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
499 | 497 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getContainerCode, containerCode).eq(InventoryDetail::getWarehouseCode, warehouseCode) |
500 | - .eq(InventoryDetail::getLocationCode, fromLocationCode); | |
498 | + .eq(InventoryDetail::getLocationCode, fromLocationCode); | |
501 | 499 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
502 | 500 | List<TaskDetail> taskDetailList = new ArrayList<>(); |
503 | 501 | if (inventoryDetailList.size() != 0) { |
... | ... | @@ -556,7 +554,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
556 | 554 | return Result.error("创建跨站任务时,起始站台和目标站台不能相同"); |
557 | 555 | } |
558 | 556 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_OVER_STATION, containerCode, QuantityConstant.EMPTY_STRING, |
559 | - QuantityConstant.EMPTY_STRING, warehouseCode); | |
557 | + QuantityConstant.EMPTY_STRING, warehouseCode); | |
560 | 558 | if (!result.isSuccess()) { |
561 | 559 | throw new JeecgBootException(result.getMessage()); |
562 | 560 | } |
... | ... | @@ -632,7 +630,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
632 | 630 | int high = locationHigh.getHigh(); |
633 | 631 | boolean bypass = false; |
634 | 632 | String toLocationCode = |
635 | - allocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, null, null, bypass); | |
633 | + allocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, null, null, bypass); | |
636 | 634 | if (StringUtils.isEmpty(toLocationCode)) { |
637 | 635 | throw new JeecgBootException("创建空托盘组入库任务时,目标库位为空"); |
638 | 636 | } |
... | ... | @@ -654,11 +652,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
654 | 652 | } |
655 | 653 | log.info("开始创建空托盘组入库任务,容器编码" + containerCode + ",库位编码" + toLocationCode); |
656 | 654 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT, containerCode, |
657 | - QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode); | |
655 | + QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode); | |
658 | 656 | if (!result.isSuccess()) { |
659 | 657 | throw new JeecgBootException(result.getMessage()); |
660 | 658 | } |
661 | - TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult(); | |
659 | + TaskLockEntity taskLockEntity = (TaskLockEntity) result.getResult(); | |
662 | 660 | String zoneCode = taskLockEntity.getZoneCode(); |
663 | 661 | TaskHeader taskHeader = new TaskHeader(); |
664 | 662 | taskHeader.setWarehouseCode(warehouseCode); |
... | ... | @@ -691,11 +689,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
691 | 689 | return Result.error("创建空托盘组出库任务时,仓库编码为空"); |
692 | 690 | } |
693 | 691 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT, containerCode, |
694 | - QuantityConstant.EMPTY_STRING, QuantityConstant.EMPTY_STRING, warehouseCode); | |
692 | + QuantityConstant.EMPTY_STRING, QuantityConstant.EMPTY_STRING, warehouseCode); | |
695 | 693 | if (!result.isSuccess()) { |
696 | 694 | throw new JeecgBootException(result.getMessage()); |
697 | 695 | } |
698 | - TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult(); | |
696 | + TaskLockEntity taskLockEntity = (TaskLockEntity) result.getResult(); | |
699 | 697 | String zoneCode = taskLockEntity.getZoneCode(); |
700 | 698 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); |
701 | 699 | String fromLocationCode = container.getLocationCode(); |
... | ... | @@ -771,13 +769,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
771 | 769 | } |
772 | 770 | // 5、删除容器上的库位编码,并设置状态为空闲,填充度状态为空盘 |
773 | 771 | boolean success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, |
774 | - QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); | |
772 | + QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); | |
775 | 773 | if (!success) { |
776 | 774 | throw new JeecgBootException("处理空出失败, 更新容器状态失败"); |
777 | 775 | } |
778 | 776 | // 6、删除库位上的容器编码,并设置状态为空闲 |
779 | 777 | success = |
780 | - locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
778 | + locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
781 | 779 | if (!success) { |
782 | 780 | throw new JeecgBootException("处理空出失败, 更新库位状态失败"); |
783 | 781 | } |
... | ... | @@ -792,7 +790,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
792 | 790 | // 8、删除库存详情失败 |
793 | 791 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); |
794 | 792 | if (inventoryDetailList.size() != 0) { |
795 | - List<Integer> idList = inventoryDetailList.stream().map(InventoryDetail::getId).collect(Collectors.toList());; | |
793 | + List<Integer> idList = inventoryDetailList.stream().map(InventoryDetail::getId).collect(Collectors.toList()); | |
794 | + ; | |
796 | 795 | success = inventoryDetailService.removeByIds(idList); |
797 | 796 | if (!success) { |
798 | 797 | throw new JeecgBootException("处理空出失败, 删除库存详情失败"); |
... | ... | @@ -850,7 +849,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
850 | 849 | } |
851 | 850 | } |
852 | 851 | } |
853 | - ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(taskHeader.getReceiptContainerHeaderId());; | |
852 | + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(taskHeader.getReceiptContainerHeaderId()); | |
853 | + ; | |
854 | 854 | if (receiptContainerHeader != null) { |
855 | 855 | success = receiptContainerHeaderService.updateStatusById(QuantityConstant.RECEIPT_CONTAINER_FINISHED, receiptContainerHeader.getId()); |
856 | 856 | if (!success) { |
... | ... | @@ -996,7 +996,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
996 | 996 | public TaskHeader getUnCompleteTaskByFromLocationCode(String fromLocationCode, String warehouseCode) { |
997 | 997 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
998 | 998 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getFromLocationCode, fromLocationCode).eq(TaskHeader::getWarehouseCode, warehouseCode).lt(TaskHeader::getStatus, |
999 | - QuantityConstant.TASK_STATUS_COMPLETED); | |
999 | + QuantityConstant.TASK_STATUS_COMPLETED); | |
1000 | 1000 | TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); |
1001 | 1001 | return taskHeader; |
1002 | 1002 | } |
... | ... | @@ -1005,7 +1005,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1005 | 1005 | public TaskHeader getUnCompleteTaskByToLocationCode(String toLocationCode, String warehouseCode) { |
1006 | 1006 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
1007 | 1007 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getToLocationCode, toLocationCode).eq(TaskHeader::getWarehouseCode, warehouseCode).lt(TaskHeader::getStatus, |
1008 | - QuantityConstant.TASK_STATUS_COMPLETED); | |
1008 | + QuantityConstant.TASK_STATUS_COMPLETED); | |
1009 | 1009 | TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); |
1010 | 1010 | return taskHeader; |
1011 | 1011 | } |
... | ... | @@ -1023,7 +1023,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1023 | 1023 | public TaskHeader getUnCompleteTaskByContainerCode(String containerCode, String warehouseCode) { |
1024 | 1024 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
1025 | 1025 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getContainerCode, containerCode).eq(TaskHeader::getWarehouseCode, warehouseCode).lt(TaskHeader::getStatus, |
1026 | - QuantityConstant.TASK_STATUS_COMPLETED); | |
1026 | + QuantityConstant.TASK_STATUS_COMPLETED); | |
1027 | 1027 | TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); |
1028 | 1028 | return taskHeader; |
1029 | 1029 | } |
... | ... | @@ -1032,7 +1032,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1032 | 1032 | public TaskHeader getUnCompleteTaskByPreTaskNo(int preTaskNo, String warehouseCode) { |
1033 | 1033 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
1034 | 1034 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getPreTaskNo, preTaskNo).eq(TaskHeader::getWarehouseCode, warehouseCode).lt(TaskHeader::getStatus, |
1035 | - QuantityConstant.TASK_STATUS_COMPLETED); | |
1035 | + QuantityConstant.TASK_STATUS_COMPLETED); | |
1036 | 1036 | TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); |
1037 | 1037 | return taskHeader; |
1038 | 1038 | } |
... | ... | @@ -1049,7 +1049,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1049 | 1049 | public List<TaskHeader> getUnCompleteListTaskByRoadWay(Integer roadWay, String warehouseCode) { |
1050 | 1050 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
1051 | 1051 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getRoadWay, roadWay).eq(TaskHeader::getWarehouseCode, warehouseCode).lt(TaskHeader::getStatus, |
1052 | - QuantityConstant.TASK_STATUS_COMPLETED); | |
1052 | + QuantityConstant.TASK_STATUS_COMPLETED); | |
1053 | 1053 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
1054 | 1054 | return taskHeaderList; |
1055 | 1055 | } |
... | ... | @@ -1059,7 +1059,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1059 | 1059 | */ |
1060 | 1060 | @Override |
1061 | 1061 | @Transactional(rollbackFor = Exception.class) |
1062 | - public Result completeTaskByWMS(Integer taskId, boolean foldFlag) { | |
1062 | + public Result completeTaskByWMS(Integer taskId, boolean foldFlag, String toLocationCode) { | |
1063 | 1063 | TaskHeader taskHeader = getById(taskId); |
1064 | 1064 | if (taskHeader == null) { |
1065 | 1065 | return Result.error("完成任务, 任务 " + taskId + " 未找到,执行中止"); |
... | ... | @@ -1073,6 +1073,29 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1073 | 1073 | return Result.error("完成任务, 任务" + taskId + "没有库位,执行中止"); |
1074 | 1074 | } |
1075 | 1075 | } |
1076 | + int isDoubleIn = taskHeader.getIsDoubleIn(); | |
1077 | + if (isDoubleIn == QuantityConstant.DOUBLE_IN) { | |
1078 | + if (StringUtils.isNotEmpty(toLocationCode)) { | |
1079 | + String originLocationCode = taskHeader.getOriginLocationCode(); | |
1080 | + String[] originLocation = originLocationCode.split(","); | |
1081 | + List<String> originLocationList = new ArrayList<>(Arrays.asList(originLocation)); | |
1082 | + String toLocation = taskHeader.getToLocationCode(); | |
1083 | + originLocationList.add(toLocation); | |
1084 | + if (!originLocationList.remove(toLocationCode)) { | |
1085 | + return Result.error("完成任务, WCS给的真实入库库位" + toLocationCode + ",不在历史分配列表中"); | |
1086 | + } | |
1087 | + for (String locationCode : originLocationList) { | |
1088 | + if (!locationService.updateStatus(locationCode, | |
1089 | + QuantityConstant.STATUS_LOCATION_EMPTY, taskHeader.getWarehouseCode())) { | |
1090 | + throw new JeecgBootException("完成任务, 解锁库位" + locationCode + " 失败"); | |
1091 | + } | |
1092 | + } | |
1093 | + taskHeader.setToLocationCode(toLocationCode); | |
1094 | + if (!taskHeaderService.updateToLocationCodeById(toLocationCode, taskId)) { | |
1095 | + throw new JeecgBootException("完成任务, 更新任务目标库位" + toLocationCode + " 失败"); | |
1096 | + } | |
1097 | + } | |
1098 | + } | |
1076 | 1099 | Result result = null; |
1077 | 1100 | switch (taskType) { |
1078 | 1101 | // 整盘入库、补充入库 |
... | ... | @@ -1116,7 +1139,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1116 | 1139 | } |
1117 | 1140 | if (foldFlag) { |
1118 | 1141 | String fromLocationCode = taskHeader.getFromLocationCode(); |
1119 | - String toLocationCode = taskHeader.getToLocationCode(); | |
1142 | + toLocationCode = taskHeader.getToLocationCode(); | |
1120 | 1143 | String containerCode = taskHeader.getContainerCode(); |
1121 | 1144 | String warehouseCode = taskHeader.getWarehouseCode(); |
1122 | 1145 | if (!containerService.updateLocationCode(containerCode, QuantityConstant.EMPTY_STRING, warehouseCode)) { |
... | ... | @@ -1239,9 +1262,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1239 | 1262 | * 创建空托盘入库 |
1240 | 1263 | * 1. 判断托盘号、库位编码是否满足要求 |
1241 | 1264 | * 2. 创建任务,锁定容器、库位 |
1242 | - * @param containerCode | |
1243 | - * @param toLocationCode | |
1244 | - * @param warehouseCode | |
1265 | + * | |
1266 | + * @param containerCode | |
1267 | + * @param toLocationCode | |
1268 | + * @param warehouseCode | |
1245 | 1269 | * @return |
1246 | 1270 | */ |
1247 | 1271 | @Override |
... | ... | @@ -1267,7 +1291,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1267 | 1291 | } |
1268 | 1292 | |
1269 | 1293 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_EMPTYRECEIPT, containerCode, QuantityConstant.EMPTY_STRING, |
1270 | - toLocationCode, warehouseCode); | |
1294 | + toLocationCode, warehouseCode); | |
1271 | 1295 | if (!result.isSuccess()) { |
1272 | 1296 | throw new JeecgBootException(result.getMessage()); |
1273 | 1297 | } |
... | ... | @@ -1298,9 +1322,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1298 | 1322 | |
1299 | 1323 | /** |
1300 | 1324 | * 创建空托盘出库 |
1301 | - * @param containerCode | |
1302 | - * @param toPortCode | |
1303 | - * @param warehouseCode | |
1325 | + * | |
1326 | + * @param containerCode | |
1327 | + * @param toPortCode | |
1328 | + * @param warehouseCode | |
1304 | 1329 | * @return |
1305 | 1330 | */ |
1306 | 1331 | @Override |
... | ... | @@ -1319,11 +1344,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1319 | 1344 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); |
1320 | 1345 | String fromLocationCode = container.getLocationCode(); |
1321 | 1346 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_EMPTYSHIPMENT, containerCode, QuantityConstant.EMPTY_STRING, |
1322 | - QuantityConstant.EMPTY_STRING, warehouseCode); | |
1347 | + QuantityConstant.EMPTY_STRING, warehouseCode); | |
1323 | 1348 | if (!result.isSuccess()) { |
1324 | 1349 | throw new JeecgBootException(result.getMessage()); |
1325 | 1350 | } |
1326 | - TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult(); | |
1351 | + TaskLockEntity taskLockEntity = (TaskLockEntity) result.getResult(); | |
1327 | 1352 | String zoneCode = taskLockEntity.getZoneCode(); |
1328 | 1353 | Port port = portService.getPortByCode(toPortCode, QuantityConstant.PORT_TYPE_OUT, zoneCode, warehouseCode); |
1329 | 1354 | if (port == null) { |
... | ... | @@ -1366,8 +1391,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1366 | 1391 | } |
1367 | 1392 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
1368 | 1393 | containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_EMPTY).ne(Container::getLocationCode, QuantityConstant.EMPTY_STRING) |
1369 | - .eq(Container::getFillStatus, QuantityConstant.STATUS_CONTAINER_FILL_EMPTY).eq(Container::getWarehouseCode, warehouseCode) | |
1370 | - .orderByAsc(Container::getUpdateTime); | |
1394 | + .eq(Container::getFillStatus, QuantityConstant.STATUS_CONTAINER_FILL_EMPTY).eq(Container::getWarehouseCode, warehouseCode) | |
1395 | + .orderByAsc(Container::getUpdateTime); | |
1371 | 1396 | List<Container> containerList = containerService.list(containerLambdaQueryWrapper); |
1372 | 1397 | List<Container> removeContainerList = new ArrayList<>(); |
1373 | 1398 | if (CollectionUtils.isNotEmpty(containerList)) { |
... | ... | @@ -1415,16 +1440,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1415 | 1440 | |
1416 | 1441 | /** |
1417 | 1442 | * 完成入库任务 |
1418 | - * @param taskHeader 任务 | |
1419 | - * @return AjaxResult 完成入库任务结果 | |
1443 | + * | |
1444 | + * @param taskHeader 任务 | |
1445 | + * @return AjaxResult 完成入库任务结果 | |
1420 | 1446 | */ |
1421 | 1447 | @Override |
1422 | 1448 | @Transactional(rollbackFor = Exception.class) |
1423 | 1449 | @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'入库任务完成'", extra = "#extraJsonString1", |
1424 | - msg = "#taskHeader == null ? '' : '任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1425 | - recordReturnValue = true) | |
1450 | + msg = "#taskHeader == null ? '' : '任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1451 | + recordReturnValue = true) | |
1426 | 1452 | @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务完成'", extra = "#extraJsonString1", |
1427 | - msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", recordReturnValue = true) | |
1453 | + msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", recordReturnValue = true) | |
1428 | 1454 | @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情入库完成'", extra = "#extraJsonString2", msg = "''", recordReturnValue = true) |
1429 | 1455 | public Result completeReceiptTask(TaskHeader taskHeader) { |
1430 | 1456 | if (taskHeader == null) { |
... | ... | @@ -1446,7 +1472,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1446 | 1472 | int allow = parameterConfigurationService.getIntValueByCode(QuantityConstant.RULE_CALL_BOX_ALLOW_EMPTY); |
1447 | 1473 | if (allow == QuantityConstant.RULE_ALLOW_EMPTY) { |
1448 | 1474 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, |
1449 | - fromLocationCode, toLocationCode, warehouseCode); | |
1475 | + fromLocationCode, toLocationCode, warehouseCode); | |
1450 | 1476 | if (!result.isSuccess()) { |
1451 | 1477 | throw new JeecgBootException(result.getMessage()); |
1452 | 1478 | } |
... | ... | @@ -1600,7 +1626,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1600 | 1626 | } |
1601 | 1627 | } |
1602 | 1628 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, |
1603 | - toLocationCode, warehouseCode); | |
1629 | + toLocationCode, warehouseCode); | |
1604 | 1630 | if (!result.isSuccess()) { |
1605 | 1631 | throw new JeecgBootException(result.getMessage()); |
1606 | 1632 | } |
... | ... | @@ -1618,17 +1644,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1618 | 1644 | |
1619 | 1645 | /** |
1620 | 1646 | * 完成出库任务 |
1621 | - * @param taskHeader 任务 | |
1622 | - * @return result 完成出库任务 | |
1647 | + * | |
1648 | + * @param taskHeader 任务 | |
1649 | + * @return result 完成出库任务 | |
1623 | 1650 | */ |
1624 | 1651 | @Override |
1625 | 1652 | @Transactional(rollbackFor = Exception.class) |
1626 | 1653 | @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'出库任务完成'", extra = "#extraJsonString1", |
1627 | - msg = "#taskHeader == null ? '' : '任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1628 | - recordReturnValue = true) | |
1654 | + msg = "#taskHeader == null ? '' : '任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1655 | + recordReturnValue = true) | |
1629 | 1656 | @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务完成'", extra = "#extraJsonString1", |
1630 | - msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getFromLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", | |
1631 | - recordReturnValue = true) | |
1657 | + msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getFromLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", | |
1658 | + recordReturnValue = true) | |
1632 | 1659 | @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情出库完成'", extra = "#extraJsonString2", msg = "''", recordReturnValue = true) |
1633 | 1660 | public Result completeShipmentTask(TaskHeader taskHeader) { |
1634 | 1661 | if (taskHeader == null) { |
... | ... | @@ -1668,7 +1695,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1668 | 1695 | } |
1669 | 1696 | } |
1670 | 1697 | List<ShipmentContainerAdvice> shipmentContainerAdviceList = |
1671 | - shipmentContainerAdviceService.getShipmentContainerAdviceListByShipmentContainerId(shipmentContainerHeader.getId()); | |
1698 | + shipmentContainerAdviceService.getShipmentContainerAdviceListByShipmentContainerId(shipmentContainerHeader.getId()); | |
1672 | 1699 | for (ShipmentContainerAdvice shipmentContainerAdvice : shipmentContainerAdviceList) { |
1673 | 1700 | if (!shipmentContainerAdviceService.updateStatusById(QuantityConstant.SHIPMENT_CONTAINER_FINISHED, shipmentContainerAdvice.getId())) { |
1674 | 1701 | throw new JeecgBootException("完成出库任务,更新出库预配盘失败"); |
... | ... | @@ -1692,7 +1719,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1692 | 1719 | } |
1693 | 1720 | } |
1694 | 1721 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, |
1695 | - fromLocationCode, toLocationCode, warehouseCode); | |
1722 | + fromLocationCode, toLocationCode, warehouseCode); | |
1696 | 1723 | if (!result.isSuccess()) { |
1697 | 1724 | throw new JeecgBootException(result.getMessage()); |
1698 | 1725 | } |
... | ... | @@ -1863,7 +1890,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1863 | 1890 | } |
1864 | 1891 | } |
1865 | 1892 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, |
1866 | - toLocationCode, warehouseCode); | |
1893 | + toLocationCode, warehouseCode); | |
1867 | 1894 | if (!result.isSuccess()) { |
1868 | 1895 | throw new JeecgBootException(result.getMessage()); |
1869 | 1896 | } |
... | ... | @@ -1938,8 +1965,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1938 | 1965 | InventoryDetail inventoryDetail1 = inventoryDetailList.get(i); |
1939 | 1966 | InventoryDetail inventoryDetail2 = inventoryDetailList.get(j); |
1940 | 1967 | if (inventoryDetail1.getMaterialCode().equals(inventoryDetail2.getMaterialCode()) && inventoryDetail1.getBatch().equals(inventoryDetail2.getBatch()) |
1941 | - && inventoryDetail1.getLot().equals(inventoryDetail2.getLot()) && inventoryDetail1.getProject().equals(inventoryDetail2.getProject()) | |
1942 | - && inventoryDetail1.getInventoryStatus().equals(inventoryDetail2.getInventoryStatus())) { | |
1968 | + && inventoryDetail1.getLot().equals(inventoryDetail2.getLot()) && inventoryDetail1.getProject().equals(inventoryDetail2.getProject()) | |
1969 | + && inventoryDetail1.getInventoryStatus().equals(inventoryDetail2.getInventoryStatus())) { | |
1943 | 1970 | // 属性一样的库存,相加合并。 |
1944 | 1971 | if (StringUtils.isNotEmpty(inventoryDetail1.getSn())) { |
1945 | 1972 | if (!inventoryDetail1.getSn().equals(inventoryDetail2.getSn())) { |
... | ... | @@ -2000,6 +2027,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2000 | 2027 | |
2001 | 2028 | /** |
2002 | 2029 | * 锁定容器和库位分4种情况,入库任务、出库任务、分拣任务、换站任务 |
2030 | + * | |
2003 | 2031 | * @param |
2004 | 2032 | */ |
2005 | 2033 | @Override |
... | ... | @@ -2216,7 +2244,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2216 | 2244 | @Override |
2217 | 2245 | @Transactional(rollbackFor = Exception.class) |
2218 | 2246 | public Result completeTaskUnLockContainerAndLocation(String containerFillStatus, int taskType, String containerCode, String fromLocationCode, |
2219 | - String toLocationCode, String warehouseCode) { | |
2247 | + String toLocationCode, String warehouseCode) { | |
2220 | 2248 | boolean success = false; |
2221 | 2249 | if (StringUtils.isEmpty(containerCode)) { |
2222 | 2250 | return Result.error("任务类型" + taskType + "完成任务时, 容器编码为空"); |
... | ... | @@ -2262,7 +2290,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2262 | 2290 | break; |
2263 | 2291 | case QuantityConstant.TASK_TYPE_OVER_STATION: |
2264 | 2292 | success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, |
2265 | - warehouseCode); | |
2293 | + warehouseCode); | |
2266 | 2294 | break; |
2267 | 2295 | } |
2268 | 2296 | if (!success) { |
... | ... | @@ -2274,7 +2302,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2274 | 2302 | return Result.error("任务类型" + taskType + "完成任务时," + toLocationCode + "目标库位不存在"); |
2275 | 2303 | } |
2276 | 2304 | success = |
2277 | - locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
2305 | + locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
2278 | 2306 | if (!success) { |
2279 | 2307 | throw new JeecgBootException("任务类型" + taskType + "完成任务时,更新源库位失败"); |
2280 | 2308 | } |
... | ... | @@ -2430,7 +2458,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2430 | 2458 | if (!result.isSuccess()) { |
2431 | 2459 | throw new JeecgBootException(result.getMessage()); |
2432 | 2460 | } |
2433 | - TaskHeader taskHeader = (TaskHeader)result.getResult(); | |
2461 | + TaskHeader taskHeader = (TaskHeader) result.getResult(); | |
2434 | 2462 | if (taskHeader.getTaskType() == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { |
2435 | 2463 | if (port == null) { |
2436 | 2464 | throw new JeecgBootException("快速入库, 生成补充任务时必须有入库口"); |
... | ... | @@ -2500,7 +2528,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2500 | 2528 | shipmentDetailList.add(shipmentDetail); |
2501 | 2529 | shipmentQtyList.add(qty); |
2502 | 2530 | List<InventoryDetail> inventoryDetailList = |
2503 | - inventoryDetailService.getInventoryDetailListByMaterialCodeToShipment(materialCode, zoneCode, qty, warehouseCode); | |
2531 | + inventoryDetailService.getInventoryDetailListByMaterialCodeToShipment(materialCode, zoneCode, qty, warehouseCode); | |
2504 | 2532 | List<InventoryDetail> removeInventoryDetailList = new ArrayList<>(); |
2505 | 2533 | for (InventoryDetail inventoryDetail : inventoryDetailList) { |
2506 | 2534 | if (roadWay.intValue() == inventoryDetail.getRoadWay().intValue()) { |
... | ... | @@ -2536,7 +2564,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2536 | 2564 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentDetailId); |
2537 | 2565 | BigDecimal shipQty = shipmentQtyList.get(i); |
2538 | 2566 | InventoryDetail inventoryDetail = |
2539 | - inventoryDetailService.getInventoryDetailByMaterialCodeToShipment(switchContainerCode, shipmentDetail.getMaterialCode(), shipQty, warehouseCode); | |
2567 | + inventoryDetailService.getInventoryDetailByMaterialCodeToShipment(switchContainerCode, shipmentDetail.getMaterialCode(), shipQty, warehouseCode); | |
2540 | 2568 | CombinationModel combinationModel = new CombinationModel(); |
2541 | 2569 | combinationModel.setShipmentDetail(shipmentDetail); |
2542 | 2570 | combinationModel.setInventoryDetail(inventoryDetail); |
... | ... | @@ -2629,8 +2657,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2629 | 2657 | |
2630 | 2658 | /** |
2631 | 2659 | * 完成空托盘入库任务 |
2632 | - * @param taskHeader 任务 | |
2633 | - * @return Result 完成入库任务结果 | |
2660 | + * | |
2661 | + * @param taskHeader 任务 | |
2662 | + * @return Result 完成入库任务结果 | |
2634 | 2663 | */ |
2635 | 2664 | @Override |
2636 | 2665 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -2649,7 +2678,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2649 | 2678 | return Result.error("完成空托盘入库任务时, 目标库位编码为空"); |
2650 | 2679 | } |
2651 | 2680 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYRECEIPT, |
2652 | - containerCode, QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode); | |
2681 | + containerCode, QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode); | |
2653 | 2682 | if (!result.isSuccess()) { |
2654 | 2683 | throw new JeecgBootException(result.getMessage()); |
2655 | 2684 | } |
... | ... | @@ -2664,7 +2693,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2664 | 2693 | /** |
2665 | 2694 | * 盘点完成 |
2666 | 2695 | * 盘点有差异完成时状态为105 |
2667 | - * @param taskHeader | |
2696 | + * | |
2697 | + * @param taskHeader | |
2668 | 2698 | * @return |
2669 | 2699 | */ |
2670 | 2700 | @Override |
... | ... | @@ -2953,7 +2983,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2953 | 2983 | cycleCountHeaderService.updataHeaderStatus(cycleCountDetail.getCycleCountHeadCode()); |
2954 | 2984 | |
2955 | 2985 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_CHECK_OUT, |
2956 | - containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
2986 | + containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
2957 | 2987 | if (!result.isSuccess()) { |
2958 | 2988 | throw new JeecgBootException(result.getMessage()); |
2959 | 2989 | } |
... | ... | @@ -2967,8 +2997,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2967 | 2997 | |
2968 | 2998 | /** |
2969 | 2999 | * 完成空托盘出库任务 |
2970 | - * @param taskHeader 任务 | |
2971 | - * @return Result 完成出库任务结果 | |
3000 | + * | |
3001 | + * @param taskHeader 任务 | |
3002 | + * @return Result 完成出库任务结果 | |
2972 | 3003 | */ |
2973 | 3004 | @Override |
2974 | 3005 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3004,7 +3035,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3004 | 3035 | return Result.error("完成空托盘出库任务时," + toPortCode + "目标出库口不存在"); |
3005 | 3036 | } |
3006 | 3037 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYSHIPMENT, |
3007 | - containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode); | |
3038 | + containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode); | |
3008 | 3039 | if (!result.isSuccess()) { |
3009 | 3040 | throw new JeecgBootException(result.getMessage()); |
3010 | 3041 | } |
... | ... | @@ -3018,8 +3049,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3018 | 3049 | |
3019 | 3050 | /** |
3020 | 3051 | * 完成移库任务 |
3021 | - * @param taskHeader 任务 | |
3022 | - * @return Result 完成移库任务结果 | |
3052 | + * | |
3053 | + * @param taskHeader 任务 | |
3054 | + * @return Result 完成移库任务结果 | |
3023 | 3055 | */ |
3024 | 3056 | @Override |
3025 | 3057 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3046,7 +3078,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3046 | 3078 | List<InventoryTransaction> inventoryTransactionList = new ArrayList<>(); |
3047 | 3079 | LambdaUpdateWrapper<InventoryDetail> inventoryDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
3048 | 3080 | inventoryDetailLambdaUpdateWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode).eq(InventoryDetail::getContainerCode, containerCode) |
3049 | - .eq(InventoryDetail::getLocationCode, fromLocationCode); | |
3081 | + .eq(InventoryDetail::getLocationCode, fromLocationCode); | |
3050 | 3082 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaUpdateWrapper); |
3051 | 3083 | for (InventoryDetail inventoryDetail : inventoryDetailList) { |
3052 | 3084 | inventoryDetail.setLocationCode(toLocationCode); |
... | ... | @@ -3077,7 +3109,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3077 | 3109 | } |
3078 | 3110 | } |
3079 | 3111 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_TRANSFER, |
3080 | - containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
3112 | + containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
3081 | 3113 | if (!result.isSuccess()) { |
3082 | 3114 | throw new JeecgBootException(result.getMessage()); |
3083 | 3115 | } |
... | ... | @@ -3091,8 +3123,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3091 | 3123 | |
3092 | 3124 | /** |
3093 | 3125 | * 完成出库查看任务 |
3094 | - * @param taskHeader 任务 | |
3095 | - * @return Result 完成出库查看任务结果 | |
3126 | + * | |
3127 | + * @param taskHeader 任务 | |
3128 | + * @return Result 完成出库查看任务结果 | |
3096 | 3129 | */ |
3097 | 3130 | @Override |
3098 | 3131 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3123,7 +3156,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3123 | 3156 | boolean success = false; |
3124 | 3157 | LambdaUpdateWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaUpdate(); |
3125 | 3158 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode).eq(InventoryDetail::getContainerCode, containerCode) |
3126 | - .eq(InventoryDetail::getLocationCode, fromLocationCode); | |
3159 | + .eq(InventoryDetail::getLocationCode, fromLocationCode); | |
3127 | 3160 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
3128 | 3161 | if (inventoryDetailList.size() != 0) { |
3129 | 3162 | List<InventoryDetail> inventoryDetailList1 = new ArrayList<>(); |
... | ... | @@ -3150,7 +3183,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3150 | 3183 | } |
3151 | 3184 | |
3152 | 3185 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_CHECK_OUT, |
3153 | - containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
3186 | + containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
3154 | 3187 | if (!result.isSuccess()) { |
3155 | 3188 | throw new JeecgBootException(result.getMessage()); |
3156 | 3189 | } |
... | ... | @@ -3165,8 +3198,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3165 | 3198 | |
3166 | 3199 | /** |
3167 | 3200 | * 完成跨站任务 |
3168 | - * @param taskHeader 任务 | |
3169 | - * @return Result 完成跨站任务结果 | |
3201 | + * | |
3202 | + * @param taskHeader 任务 | |
3203 | + * @return Result 完成跨站任务结果 | |
3170 | 3204 | */ |
3171 | 3205 | @Override |
3172 | 3206 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3201,7 +3235,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3201 | 3235 | return Result.error("创建跨站任务时,目标站台为空"); |
3202 | 3236 | } |
3203 | 3237 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_OVER_STATION, |
3204 | - containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.EMPTY_STRING, warehouseCode); | |
3238 | + containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.EMPTY_STRING, warehouseCode); | |
3205 | 3239 | if (!result.isSuccess()) { |
3206 | 3240 | throw new JeecgBootException(result.getMessage()); |
3207 | 3241 | } |
... | ... | @@ -3216,8 +3250,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3216 | 3250 | |
3217 | 3251 | /** |
3218 | 3252 | * 完成空托盘组入库任务 |
3219 | - * @param taskHeader 任务 | |
3220 | - * @return Result 完成空托盘组入库任务结果 | |
3253 | + * | |
3254 | + * @param taskHeader 任务 | |
3255 | + * @return Result 完成空托盘组入库任务结果 | |
3221 | 3256 | */ |
3222 | 3257 | @Override |
3223 | 3258 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3244,7 +3279,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3244 | 3279 | return Result.error("完成空托盘组入库任务时,没有找到库位" + toLocationCode); |
3245 | 3280 | } |
3246 | 3281 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT, |
3247 | - containerCode, QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode); | |
3282 | + containerCode, QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode); | |
3248 | 3283 | if (!result.isSuccess()) { |
3249 | 3284 | throw new JeecgBootException(result.getMessage()); |
3250 | 3285 | } |
... | ... | @@ -3259,8 +3294,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3259 | 3294 | |
3260 | 3295 | /** |
3261 | 3296 | * 完成空托盘组出库任务 |
3262 | - * @param taskHeader 任务 | |
3263 | - * @return Result 完成空托盘组出库任务结果 | |
3297 | + * | |
3298 | + * @param taskHeader 任务 | |
3299 | + * @return Result 完成空托盘组出库任务结果 | |
3264 | 3300 | */ |
3265 | 3301 | @Override |
3266 | 3302 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3305,7 +3341,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3305 | 3341 | throw new JeecgBootException("完成空托盘组出库任务时, 更新任务失败"); |
3306 | 3342 | } |
3307 | 3343 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT, |
3308 | - containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode); | |
3344 | + containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode); | |
3309 | 3345 | if (!result.isSuccess()) { |
3310 | 3346 | throw new JeecgBootException(result.getMessage()); |
3311 | 3347 | } |
... | ... | @@ -3444,7 +3480,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3444 | 3480 | } |
3445 | 3481 | } |
3446 | 3482 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_QUALITY, |
3447 | - containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
3483 | + containerCode, fromLocationCode, toLocationCode, warehouseCode); | |
3448 | 3484 | if (!result.isSuccess()) { |
3449 | 3485 | throw new JeecgBootException(result.getMessage()); |
3450 | 3486 | } |
... | ... | @@ -3458,8 +3494,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3458 | 3494 | |
3459 | 3495 | /** |
3460 | 3496 | * 取消入库任务 |
3461 | - * @param taskHeader 任务 | |
3462 | - * @return Result 取消入库任务结果 | |
3497 | + * | |
3498 | + * @param taskHeader 任务 | |
3499 | + * @return Result 取消入库任务结果 | |
3463 | 3500 | */ |
3464 | 3501 | @Override |
3465 | 3502 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3478,8 +3515,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3478 | 3515 | |
3479 | 3516 | /** |
3480 | 3517 | * 取消出库任务 |
3481 | - * @param taskHeader 任务 | |
3482 | - * @return Result 取消出库任务结果 | |
3518 | + * | |
3519 | + * @param taskHeader 任务 | |
3520 | + * @return Result 取消出库任务结果 | |
3483 | 3521 | */ |
3484 | 3522 | @Override |
3485 | 3523 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -3501,7 +3539,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3501 | 3539 | log.info("开始取消盘点任务"); |
3502 | 3540 | LambdaQueryWrapper<CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
3503 | 3541 | cycleCountDetailLambdaQueryWrapper.eq(CycleCountDetail::getContainerCode, taskHeader.getContainerCode()).ne(CycleCountDetail::getEnableStatus, |
3504 | - QuantityConstant.SHIPMENT_RECEIVE_SUCCESS); | |
3542 | + QuantityConstant.SHIPMENT_RECEIVE_SUCCESS); | |
3505 | 3543 | CycleCountDetail cycleCountDetail = cycleCountDetailService.getOne(cycleCountDetailLambdaQueryWrapper); |
3506 | 3544 | if (cycleCountDetail == null) { |
3507 | 3545 | throw new JeecgBootException("取消盘点任务,没有找到盘点明细"); |
... | ... | @@ -3538,6 +3576,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3538 | 3576 | } |
3539 | 3577 | |
3540 | 3578 | @Override |
3579 | + public boolean updateToLocationCodeById(String toLocationCode, int id) { | |
3580 | + TaskHeader taskHeader = new TaskHeader(); | |
3581 | + taskHeader.setToLocationCode(toLocationCode); | |
3582 | + taskHeader.setId(id); | |
3583 | + boolean success = taskHeaderService.updateById(taskHeader); | |
3584 | + return success; | |
3585 | + } | |
3586 | + | |
3587 | + @Override | |
3541 | 3588 | public boolean updateExceptionStateById(int exceptionState, int id) { |
3542 | 3589 | TaskHeader taskHeader = new TaskHeader(); |
3543 | 3590 | taskHeader.setExceptionState(exceptionState); |
... | ... | @@ -3557,7 +3604,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3557 | 3604 | |
3558 | 3605 | /** |
3559 | 3606 | * 取消任务,恢复容器和库位状态 |
3560 | - * @param taskHeader | |
3607 | + * | |
3608 | + * @param taskHeader | |
3561 | 3609 | * @return |
3562 | 3610 | */ |
3563 | 3611 | @Override |
... | ... | @@ -3609,7 +3657,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3609 | 3657 | public boolean updateById(TaskHeader taskHeader) { |
3610 | 3658 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
3611 | 3659 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getId, taskHeader.getId()).lt(taskHeader.getStatus() != null, TaskHeader::getStatus, |
3612 | - QuantityConstant.TASK_STATUS_COMPLETED); | |
3660 | + QuantityConstant.TASK_STATUS_COMPLETED); | |
3613 | 3661 | return super.update(taskHeader, taskHeaderLambdaQueryWrapper); |
3614 | 3662 | } |
3615 | 3663 | |
... | ... |