| | |
| | | import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam; |
| | | import com.zy.asrs.wms.asrs.service.*; |
| | | import com.zy.asrs.wms.utils.LocUtils; |
| | | import com.zy.asrs.wms.utils.OrderUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private LocTypeService locTypeService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private OrderUtils orderUtils; |
| | | |
| | | @Override |
| | | public String generateTaskNo(Long taskType) { |
| | |
| | | //回滚订单 |
| | | for (TaskDetl taskDetl : taskDetls) { |
| | | if (taskDetl.getDetlId() != null) { |
| | | OrderDetl orderDetl = orderDetlService.getById(taskDetl.getDetlId()); |
| | | if(orderDetl == null){ |
| | | throw new CoolException("订单明细不存在"); |
| | | } |
| | | |
| | | //回滚工作数量 |
| | | orderDetl.setWorkQty(orderDetl.getWorkQty() - taskDetl.getAnfme()); |
| | | orderDetl.setUpdateTime(new Date()); |
| | | boolean orderDetlUpdate = orderDetlService.updateById(orderDetl); |
| | | if(!orderDetlUpdate){ |
| | | throw new CoolException("工作数量回滚失败"); |
| | | } |
| | | |
| | | orderUtils.updateWorkQty(taskDetl.getDetlId(), taskDetl.getAnfme(), false); |
| | | } |
| | | |
| | | //入库回滚组托通知档 |
| | |
| | | } |
| | | |
| | | //获取源库位高度 |
| | | LocTypeBind locTypeBind = locTypeBindService.getOne(new LambdaQueryWrapper<LocTypeBind>().eq(LocTypeBind::getLocId, originLoc.getId())); |
| | | LocTypeBind locTypeBind = locTypeBindService.getOne(new LambdaQueryWrapper<LocTypeBind>().eq(LocTypeBind::getLocId, originLoc.getId()).in(LocTypeBind::getTypeId, LocBindType.HEIGHT.list())); |
| | | if(locTypeBind == null){ |
| | | throw new CoolException("库位类型不存在"); |
| | | } |