| | |
| | |
|
| | | 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.*;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.*;
|
| | | 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.asrs.entity.param.PakinOnShelvesParams;
|
| | | import com.zy.asrs.wms.asrs.service.*;
|
| | | 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.transaction.annotation.Transactional;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Objects;
|
| | |
|
| | |
| | | private WorkService workService;
|
| | | @Autowired
|
| | | private HostService hostService;
|
| | |
|
| | | @Autowired
|
| | | private OrderService orderService;
|
| | | @Autowired
|
| | | private LocService locService;
|
| | | @Autowired
|
| | | private LocDetlService locDetlService;
|
| | | @Autowired
|
| | | private LocAreaService locAreaService;
|
| | | @Autowired
|
| | | private LocAreaTypeService locAreaTypeService;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | public List<Host> getHosts() {
|
| | | return hostService.list();
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean pakinToStock(PakinOnShelvesParams shelvesParams) {
|
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, shelvesParams.getLoc()));
|
| | | if (Objects.isNull(loc)) {
|
| | | throw new CoolException("库位不存在!!");
|
| | | }
|
| | | if (loc.getLocStsId() != LocStsType.O.val()) {
|
| | | throw new CoolException("当前库位状态不是空库状态." + LocStsType.O.val());
|
| | | }
|
| | |
|
| | | //判断当前仓库是否为平库位
|
| | | List<LocArea> locAreas = locAreaService.list(new LambdaQueryWrapper<LocArea>().eq(LocArea::getLocId, loc.getId()));
|
| | | locAreas.forEach(locArea -> {
|
| | | LocAreaType typeServiceOne = locAreaTypeService.getOne(new LambdaQueryWrapper<LocAreaType>().eq(LocAreaType::getId, locArea.getTypeId()), false);
|
| | | if (typeServiceOne.getParentId() != LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id && typeServiceOne.getId() != LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id) {
|
| | | throw new CoolException("请选择平库区库位,再操作!!");
|
| | | }
|
| | | });
|
| | |
|
| | | loc.setBarcode(shelvesParams.getBarcode());
|
| | | loc.setUpdateTime(new Date());
|
| | | //库存状态修改为在库状态
|
| | | loc.setLocStsId(LocStsType.F.val());
|
| | | if (!locService.save(loc)) {
|
| | | throw new CoolException("库位更新失败!!");
|
| | | }
|
| | |
|
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, shelvesParams.getBarcode()));
|
| | | waitPakins.forEach(pakin -> {
|
| | | LocDetl locDetl = new LocDetl();
|
| | | locDetl.setAnfme(pakin.getAnfme());
|
| | | locDetl.setBatch(pakin.getBatch());
|
| | | locDetl.setMatnr(pakin.getMatnr());
|
| | | locDetl.setCreateTime(new Date());
|
| | | locDetl.setOrderNo(pakin.getOrderNo());
|
| | | locDetl.setLocNo(loc.getLocNo());
|
| | | locDetl.setLocId(loc.getLocStsId());
|
| | | locDetl.setMatnr(pakin.getMatnr());
|
| | | locDetl.setMemo(pakin.getMemo());
|
| | | locDetl.setUpdateTime(new Date());
|
| | | if (!locDetlService.save(locDetl)) {
|
| | | throw new CoolException("库存明细更新失败!!");
|
| | | }
|
| | | });
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | // /**
|
| | | // * 获取当前库位是否存在
|
| | | // * @param shelvesParams
|
| | | // * @return
|
| | | // */
|
| | | // @Override
|
| | | // public Loc selectPakinLocs(PakinOnShelvesParams shelvesParams) {
|
| | | // return locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, shelvesParams.getLoc()));
|
| | | // }
|
| | |
|
| | |
|
| | | }
|