zhou zhou
13 小时以前 2f8e173048d22c5b40612c3538b9c1aa5a5397f6
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -27,6 +27,7 @@
import com.vincent.rsf.server.api.utils.LocUtils;
import com.vincent.rsf.server.api.utils.SlaveProperties;
import com.vincent.rsf.server.manager.entity.*;
import com.vincent.rsf.server.manager.mapper.LocItemMapper;
import com.vincent.rsf.server.manager.service.*;
import com.vincent.rsf.server.manager.service.impl.LocServiceImpl;
import com.vincent.rsf.server.system.constant.SerialRuleCode;
@@ -67,7 +68,7 @@
    @Autowired
    private LocServiceImpl locService;
    @Autowired
    private LocItemService locItemService;
    private LocItemMapper locItemMapper;
    @Autowired
    private SlaveProperties slaveProperties;
    @Autowired
@@ -233,10 +234,17 @@
     * 更新库位状态
     */
    private void updateLocStatus(String locCode, String barcode) {
        boolean updated = locService.update(new LambdaUpdateWrapper<Loc>()
                .eq(Loc::getCode, locCode)
                .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type)
                .set(Loc::getBarcode, barcode));
        Loc current = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, locCode));
        if (Objects.isNull(current)) {
            throw new CoolException("库位预约失败!!");
        }
        Loc update = new Loc();
        update.setId(current.getId());
        update.setVersion(current.getVersion());
        update.setUseStatus(LocStsType.LOC_STS_TYPE_S.type);
        update.setBarcode(barcode);
        boolean updated = locService.update(update, new LambdaUpdateWrapper<Loc>()
                .eq(Loc::getId, current.getId()));
        if (!updated) {
            throw new CoolException("库位预约失败!!");
        }
@@ -283,11 +291,19 @@
     * 更新组托状态
     */
    private void updateWaitPakinStatus(String barcode, Long loginUserId) {
        boolean updated = waitPakinService.update(new LambdaUpdateWrapper<WaitPakin>()
                .eq(WaitPakin::getBarcode, barcode)
                .set(WaitPakin::getUpdateBy, loginUserId)
                .set(WaitPakin::getCreateBy, loginUserId)
                .set(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_TASK_EXCE.val));
        WaitPakin current = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>()
                .eq(WaitPakin::getBarcode, barcode));
        if (Objects.isNull(current)) {
            throw new CoolException("组托状态修改失败!!");
        }
        WaitPakin update = new WaitPakin();
        update.setId(current.getId());
        update.setVersion(current.getVersion());
        update.setUpdateBy(loginUserId);
        update.setCreateBy(loginUserId);
        update.setIoStatus(PakinIOStatus.PAKIN_IO_STATUS_TASK_EXCE.val);
        boolean updated = waitPakinService.update(update, new LambdaUpdateWrapper<WaitPakin>()
                .eq(WaitPakin::getId, current.getId()));
        if (!updated) {
            throw new CoolException("组托状态修改失败!!");
@@ -694,7 +710,7 @@
        //入库靠近摆放
        if (ioType == 1 && deviceBind.getBeSimilar().equals("1") && !Cools.isEmpty(matnr) && Cools.isEmpty(orgLoc)) {
            if (nearRow != curRow) {
                List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr));
                List<LocItem> locItems = locItemMapper.selectList(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr));
                for (LocItem locItem : locItems) {
                    Loc loc1 = locService.getById(locItem.getLocId());
                    if (LocUtils.isShallowLoc(loc1.getCode())) {
@@ -1204,3 +1220,4 @@
//        return R.ok(JSONObject.toJSONString(params));
    }
}