| | |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.common.web.WcsController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private RowLastnoService rowLastnoService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private AgvWaitPakinService agvWaitPakinService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | sourceStaNo = staDesc.getStnNo(); |
| | | } |
| | | |
| | | int lev = Utils.getLev(dto.getLocNo()); |
| | | if (lev == 1 || lev == 2) { |
| | | if (!(stnNo == 100 || stnNo == 103 || stnNo == 105)) { |
| | | throw new CoolException("1、2层货物仅允许在一楼进行出库"); |
| | | } |
| | | } |
| | | |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | |
| | | sourceStaNo = staDesc.getStnNo(); |
| | | } |
| | | |
| | | int lev = Utils.getLev(taskDto.getLocNo()); |
| | | if (lev == 1 || lev == 2) { |
| | | if (!(stnNo == 100 || stnNo == 103 || stnNo == 105)) { |
| | | throw new CoolException("1、2层货物仅允许在一楼进行出库"); |
| | | } |
| | | } |
| | | |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | //补货单则生成AGV入库通知档 |
| | | generateAgvWaitpakin(wrkDetl); |
| | | |
| | | // 修改订单明细 |
| | | if (!BaseController.isJSON(locDto.getOrderNo())) { |
| | | OrderDetl orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch()); |
| | |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | throw new CoolException(workNo+"工作档不存在"); |
| | | } |
| | | |
| | | if (wrkMast.getIoType() == 200) { |
| | | //小车移库任务,直接删除工作档 |
| | | wrkMastService.deleteById(wrkMast); |
| | | return; |
| | | } |
| | | |
| | | if (wrkMast.getWrkSts() == 9 || wrkMast.getWrkSts() == 29) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | |
| | | throw new CoolException(workNo+"工作档不存在"); |
| | | } |
| | | |
| | | if (wrkMast.getWrkSts() == 200) { |
| | | if (wrkMast.getIoType() == 200) { |
| | | //小车移库任务,直接删除工作档 |
| | | wrkMastService.deleteById(wrkMast); |
| | | return; |
| | |
| | | return ""; |
| | | } |
| | | |
| | | private void generateAgvWaitpakin(WrkDetl wrkDetl){ |
| | | Order order = orderService.selectByNo(wrkDetl.getOrderNo()); |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if("人工补货单".equals(docType.getDocName())){ |
| | | AgvWaitPakin agvWaitPakin = new AgvWaitPakin(); |
| | | BeanUtils.copyProperties(wrkDetl,agvWaitPakin); |
| | | agvWaitPakinService.insert(agvWaitPakin); |
| | | } |
| | | } |
| | | |
| | | } |