| | |
| | | package com.zy.asrs.wms.asrs.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.Order;
|
| | | import com.zy.asrs.wms.asrs.entity.WaitPakin;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.LocTypeHeightType;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.OrderType;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.TaskStsType;
|
| | | import com.zy.asrs.wms.asrs.entity.param.BatchMergeOrdersParam;
|
| | | import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam;
|
| | | import com.zy.asrs.wms.asrs.service.MobileService;
|
| | | import com.zy.asrs.wms.asrs.service.OrderService;
|
| | | import com.zy.asrs.wms.asrs.service.WaitPakinService;
|
| | | import com.zy.asrs.wms.asrs.service.WorkService;
|
| | | import com.zy.asrs.wms.system.entity.Host;
|
| | | import com.zy.asrs.wms.system.service.HostService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Objects;
|
| | |
|
| | | @Service
|
| | | public class MobileServiceImpl implements MobileService {
|
| | |
|
| | | @Autowired
|
| | | private WaitPakinService waitPakinService;
|
| | |
|
| | | @Autowired
|
| | | private WorkService workService;
|
| | | @Autowired
|
| | | private HostService hostService;
|
| | |
|
| | | @Autowired
|
| | | private OrderService orderService;
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean batchMergeOrders(BatchMergeOrdersParam ordersParam) {
|
| | | Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, ordersParam.getOrderNo()));
|
| | | if (Objects.isNull(order)) {
|
| | | throw new CoolException("订单不存在!!");
|
| | | }
|
| | |
|
| | | ArrayList<WaitPakin> waitPakins = new ArrayList<>();
|
| | | ordersParam.getOrderDetls().forEach(orderdetl -> {
|
| | | WaitPakin waitPakin = new WaitPakin();
|
| | | waitPakin.setBatch(orderdetl.getBatch()).setAnfme(orderdetl.getMergeNum()).setBarcode(ordersParam.getMergeNo()).setMatnr(orderdetl.getMatnr()).setDetlId(orderdetl.getDetlId()).setIoStatus(0).setOrderNo(orderdetl.getOrderNo()).setOrderId(orderdetl.getOrderId()).setStatus(1);
|
| | | waitPakin.setBatch(orderdetl.getBatch())
|
| | | .setAnfme(orderdetl.getMergeNum())
|
| | | .setBarcode(ordersParam.getMergeNo())
|
| | | .setMatnr(orderdetl.getMatnr())
|
| | | .setDetlId(orderdetl.getDetlId())
|
| | | .setIoStatus(0)
|
| | | .setOrderNo(orderdetl.getOrderNo()).setOrderId(orderdetl.getOrderId()).setStatus(1);
|
| | | waitPakins.add(waitPakin);
|
| | | });
|
| | |
|
| | | /*** 项目下发流程 * 1. PDA组拖通知档* 2. 生成任务档* 3. 通过定时任务下发至ESS** */
|
| | | //组拖通知档
|
| | | waitPakins.forEach(pakin -> {
|
| | | waitPakinService.comb(pakin);
|
| | | });
|
| | |
|
| | | //生成任务档
|
| | | GeneratePakInParam generatePakInParam = new GeneratePakInParam();
|
| | | //当前没有起始站点,默认101, 高低位默认传低库位
|
| | | generatePakInParam.setBarcode(ordersParam.getMergeNo())
|
| | | .setOriginSite("101")
|
| | | .setTaskType(TaskStsType.GENERATE_IN.id).setLocTypeHeight(LocTypeHeightType.LOW.id);
|
| | | if (workService.generatePakIn(generatePakInParam)) {
|
| | | return true;
|
| | | // UTC入库单据(非平库入库单据)
|
| | | if (order.getOrderType() != OrderType.PK_IN_ORDER.id) {
|
| | | /*** 项目下发流程 * 1. PDA组拖通知档* 2. 生成任务档* 3. 通过定时任务下发至ESS** */
|
| | | //生成任务档
|
| | | GeneratePakInParam generatePakInParam = new GeneratePakInParam();
|
| | | //当前没有起始站点,默认101, 高低位默认传低库位
|
| | | generatePakInParam.setBarcode(ordersParam.getMergeNo())
|
| | | .setOriginSite("101")
|
| | | .setTaskType(TaskStsType.GENERATE_IN.id).setLocTypeHeight(LocTypeHeightType.LOW.id);
|
| | | if (workService.generatePakIn(generatePakInParam)) {
|
| | | return true;
|
| | | }
|
| | | } else {
|
| | | //fixme 平库是否需要预约入库
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Host> getHosts() {
|
| | | return hostService.list();
|
| | | }
|
| | | }
|