Commit 4630d47389ba084181c45cb4b746e30175c65b08
1 parent
3e0c5f08
空托盘组出库
Showing
6 changed files
with
130 additions
and
14 deletions
src/main/java/com/huaheng/pc/config/container/controller/ContainerController.java
... | ... | @@ -9,6 +9,7 @@ import com.huaheng.common.support.Convert; |
9 | 9 | import com.huaheng.common.utils.StringUtils; |
10 | 10 | import com.huaheng.common.utils.poi.ExcelUtil; |
11 | 11 | import com.huaheng.common.utils.security.ShiroUtils; |
12 | +import com.huaheng.framework.aspectj.lang.annotation.ApiLogger; | |
12 | 13 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
13 | 14 | import com.huaheng.framework.aspectj.lang.constant.BusinessType; |
14 | 15 | import com.huaheng.framework.web.controller.BaseController; |
... | ... | @@ -21,6 +22,8 @@ import com.huaheng.pc.config.container.domain.Container; |
21 | 22 | import com.huaheng.pc.config.container.service.ContainerService; |
22 | 23 | import com.huaheng.pc.config.location.domain.Location; |
23 | 24 | import com.huaheng.pc.config.location.service.LocationService; |
25 | +import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; | |
26 | +import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; | |
24 | 27 | import io.swagger.annotations.Api; |
25 | 28 | import io.swagger.annotations.ApiOperation; |
26 | 29 | import io.swagger.annotations.ApiParam; |
... | ... | @@ -48,6 +51,8 @@ public class ContainerController extends BaseController { |
48 | 51 | @Resource |
49 | 52 | private DataSource dataSource; |
50 | 53 | @Resource |
54 | + private InventoryHeaderService inventoryService; | |
55 | + @Resource | |
51 | 56 | private Print print; |
52 | 57 | @RequiresPermissions("config:container:view") |
53 | 58 | @GetMapping() |
... | ... | @@ -230,5 +235,30 @@ public class ContainerController extends BaseController { |
230 | 235 | { |
231 | 236 | print.jasperPrint(ids, prefix);// 不用返回json打印 |
232 | 237 | } |
238 | + @ApiLogger(apiName = "获取空托盘组") | |
239 | + @PostMapping( "/getEmptyContainerMany") | |
240 | + @ResponseBody | |
241 | + public AjaxResult getEmptyContainerMany() { | |
242 | + List<Container> list = containerService.list(new LambdaQueryWrapper<Container>() | |
243 | + .eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_MANY) | |
244 | + .ne(Container::getLocationCode,"") | |
245 | + .isNotNull(Container::getLocationCode) | |
246 | + ); | |
247 | + return AjaxResult.success(list); | |
248 | + } | |
249 | + | |
250 | + @ApiLogger(apiName = "空托盘组出库") | |
251 | + @PostMapping( "/EmptyContainerManyOut") | |
252 | + @ResponseBody | |
253 | + public AjaxResult EmptyContainerManyOut(Container container) { | |
254 | + if(StringUtils.isNotEmpty(container.getCode())){ | |
255 | + return AjaxResult.error("托盘号为空"); | |
256 | + } | |
257 | + if(StringUtils.isNotEmpty(container.getPort())){ | |
258 | + return AjaxResult.error("出库口为空"); | |
259 | + } | |
260 | + AjaxResult ajaxResult = inventoryService.createEmptyContainerManyOut(container); | |
261 | + return ajaxResult; | |
262 | + } | |
233 | 263 | |
234 | 264 | } |
... | ... |
src/main/java/com/huaheng/pc/config/container/domain/Container.java
... | ... | @@ -213,6 +213,9 @@ public class Container implements Serializable { |
213 | 213 | @TableField(value = "sendToMes") |
214 | 214 | @ApiModelProperty(value="") |
215 | 215 | private Integer sendToMes; |
216 | + @TableField(exist = false) | |
217 | + @ApiModelProperty(value="") | |
218 | + private String port; | |
216 | 219 | |
217 | 220 | /** |
218 | 221 | * 打印机名称 |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderService.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.inventory.inventoryHeader.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | 4 | import com.huaheng.framework.web.domain.AjaxResult; |
5 | +import com.huaheng.pc.config.container.domain.Container; | |
5 | 6 | import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader; |
6 | 7 | import org.springframework.stereotype.Service; |
7 | 8 | |
... | ... | @@ -70,6 +71,8 @@ public interface InventoryHeaderService extends IService<InventoryHeader> { |
70 | 71 | AjaxResult saveInventoryHeader(InventoryHeader inventoryHeader); |
71 | 72 | |
72 | 73 | AjaxResult removeInventory(String ids); |
74 | + | |
75 | + AjaxResult createEmptyContainerManyOut(Container container); | |
73 | 76 | } |
74 | 77 | |
75 | 78 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java
... | ... | @@ -25,6 +25,9 @@ import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHead |
25 | 25 | import com.huaheng.pc.receipt.receiptContainerHeader.service.ReceiptContainerHeaderService; |
26 | 26 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
27 | 27 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; |
28 | +import com.huaheng.pc.task.taskDetail.domain.TaskDetail; | |
29 | +import com.huaheng.pc.task.taskDetail.service.TaskDetailService; | |
30 | +import com.huaheng.pc.task.taskHeader.domain.TaskHeader; | |
28 | 31 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
29 | 32 | import com.huaheng.pc.task.taskHeader.service.TransferTaskService; |
30 | 33 | import com.huaheng.pc.task.taskHeader.service.WorkTaskService; |
... | ... | @@ -59,6 +62,10 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
59 | 62 | private ShipmentContainerHeaderService shipmentContainerHeaderService; |
60 | 63 | @Resource |
61 | 64 | private InventoryHeaderMapper inventoryHeaderMapper; |
65 | + @Resource | |
66 | + private TaskHeaderService taskHeaderService; | |
67 | + @Resource | |
68 | + private TaskDetailService taskDetailService; | |
62 | 69 | |
63 | 70 | |
64 | 71 | /** |
... | ... | @@ -504,6 +511,75 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
504 | 511 | } |
505 | 512 | return AjaxResult.success("删除成功"); |
506 | 513 | } |
514 | + | |
515 | + @Override | |
516 | + public AjaxResult createEmptyContainerManyOut(Container container) { | |
517 | + String containerCode = container.getCode(); | |
518 | + String locationCode = container.getLocationCode(); | |
519 | + //验证容器 | |
520 | + if (StringUtils.isNotEmpty(containerCode)) { | |
521 | + LambdaQueryWrapper<InventoryDetail> queryWrapper = Wrappers.lambdaQuery(); | |
522 | + queryWrapper.eq(InventoryDetail::getContainerCode, containerCode); | |
523 | + if (inventoryDetailService.count(queryWrapper) > 0) { | |
524 | + return AjaxResult.error("该容器上有库存,无法空托出库!"); | |
525 | + } | |
526 | + } | |
527 | + //验证库位 | |
528 | + if (StringUtils.isNotEmpty(locationCode)) { | |
529 | + Location location = locationService.getLocationByCode(locationCode); | |
530 | + if (StringUtils.isEmpty(location.getContainerCode())) { | |
531 | + return AjaxResult.error(location.getCode()+"库位上没有容器"); | |
532 | + } | |
533 | + if (StringUtils.isNotEmpty(containerCode)) { | |
534 | + if (!location.getContainerCode().equals(containerCode)) { | |
535 | + return AjaxResult.error("该库位上容器编码与输入容器编码不同"); | |
536 | + } | |
537 | + } | |
538 | + LambdaQueryWrapper<InventoryDetail> queryWrapper = Wrappers.lambdaQuery(); | |
539 | + queryWrapper.eq(InventoryDetail::getLocationCode, locationCode); | |
540 | + if (inventoryDetailService.count(queryWrapper) > 0) { | |
541 | + return AjaxResult.error("该库位上有库存,无法空托出库!"); | |
542 | + } | |
543 | + } | |
544 | + Location location = locationService.getLocationByCode(locationCode); | |
545 | + TaskHeader taskHeader = new TaskHeader(); | |
546 | + taskHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
547 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_EMPTYSHIPMENT); | |
548 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT); | |
549 | + taskHeader.setContainerCode(containerCode); | |
550 | + if(location != null) { | |
551 | + taskHeader.setZoneCode(location.getZoneCode()); | |
552 | + } | |
553 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
554 | + taskHeader.setFromLocation(locationCode); | |
555 | + taskHeader.setToLocation(""); | |
556 | + taskHeader.setPort(container.getPort()); | |
557 | + if(taskHeaderService.save(taskHeader)){ | |
558 | + //锁定库位状态 | |
559 | + locationService.updateStatus(locationCode,QuantityConstant.STATUS_LOCATION_LOCK); | |
560 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
561 | + containerLambdaQueryWrapper.eq(Container::getCode, containerCode); | |
562 | + Container container1 = containerService.getOne(containerLambdaQueryWrapper); | |
563 | + container1.setStatus(QuantityConstant.STATUS_CONTAINER_LOCK); | |
564 | + containerService.update(container1, containerLambdaQueryWrapper); | |
565 | + } else { | |
566 | + throw new ServiceException("空托出库主表生成失败!"); | |
567 | + } | |
568 | + //写入任务细表 | |
569 | + TaskDetail taskDetail = new TaskDetail(); | |
570 | + taskDetail.setTaskId(taskHeader.getId()); | |
571 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
572 | + taskDetail.setInternalTaskType(taskHeader.getInternalTaskType()); | |
573 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
574 | + taskDetail.setCompanyCode(ShiroUtils.getCompanyCodeList().get(0)); | |
575 | + taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
576 | + taskDetail.setToLocation(taskHeader.getToLocation()); | |
577 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
578 | + if(!taskDetailService.save(taskDetail)){ | |
579 | + throw new ServiceException("空托出库任务明细生成失败!"); | |
580 | + } | |
581 | + return AjaxResult.success(taskHeader.getId()); | |
582 | + } | |
507 | 583 | } |
508 | 584 | |
509 | 585 | |
... | ... |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... | ... | @@ -224,18 +224,18 @@ public class RyTask extends BaseController { |
224 | 224 | if(CollectionUtils.isNotEmpty(agvTasks)){ |
225 | 225 | for (AgvTask agvTask : agvTasks) { |
226 | 226 | try{ |
227 | - if(agvTask.getToPort().equals("Work 633")){ | |
228 | - List<AgvTask> list = acsService.list(new LambdaQueryWrapper<AgvTask>().eq(AgvTask::getToPort, "Work 633").ge(AgvTask::getStatus, 10).lt(AgvTask::getStatus, 100)); | |
229 | - if(CollectionUtils.isNotEmpty(list)&&list.size()>=2){ | |
230 | - continue; | |
231 | - } | |
232 | - } | |
233 | - if(agvTask.getToPort().equals("Work 776")){ | |
234 | - List<AgvTask> list = acsService.list(new LambdaQueryWrapper<AgvTask>().eq(AgvTask::getToPort, "Work 776").ge(AgvTask::getStatus, 10).lt(AgvTask::getStatus, 100)); | |
235 | - if(CollectionUtils.isNotEmpty(list)&&list.size()>=2){ | |
236 | - continue; | |
237 | - } | |
238 | - } | |
227 | +// if(agvTask.getToPort().equals("Work 633")){ | |
228 | +// List<AgvTask> list = acsService.list(new LambdaQueryWrapper<AgvTask>().eq(AgvTask::getToPort, "Work 633").ge(AgvTask::getStatus, 10).lt(AgvTask::getStatus, 100)); | |
229 | +// if(CollectionUtils.isNotEmpty(list)&&list.size()>=2){ | |
230 | +// continue; | |
231 | +// } | |
232 | +// } | |
233 | +// if(agvTask.getToPort().equals("Work 776")){ | |
234 | +// List<AgvTask> list = acsService.list(new LambdaQueryWrapper<AgvTask>().eq(AgvTask::getToPort, "Work 776").ge(AgvTask::getStatus, 10).lt(AgvTask::getStatus, 100)); | |
235 | +// if(CollectionUtils.isNotEmpty(list)&&list.size()>=2){ | |
236 | +// continue; | |
237 | +// } | |
238 | +// } | |
239 | 239 | acsService.sendTaskToAGV(Convert.toIntArray(agvTask.getId().toString())); |
240 | 240 | }catch (Exception e){ |
241 | 241 | e.printStackTrace(); |
... | ... |
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
... | ... | @@ -244,9 +244,13 @@ |
244 | 244 | field : 'materialName', |
245 | 245 | title : '物料名称' |
246 | 246 | }, |
247 | + // { | |
248 | + // field : 'materialSpec', | |
249 | + // title : '物料规格' | |
250 | + // }, | |
247 | 251 | { |
248 | - field : 'materialSpec', | |
249 | - title : '物料规格' | |
252 | + field : 'batch', | |
253 | + title : '批次' | |
250 | 254 | }, |
251 | 255 | { |
252 | 256 | field : 'supplierCode', |
... | ... |