zjj
5 天以前 a4112a5d31fa3a66daafdc009ff3b3047bb98f67
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -138,6 +138,10 @@
                    throw new CoolException("库存信息不存在!");
                }
                if (locItem.getOutQty().compareTo(0.0) < 0) {
                    throw new CoolException("出库数里不能小于0!!");
                }
                if (locItem.getAnfme().compareTo(qty) < 0) {
                    Double minusQty = Math.round((locItem.getAnfme() - locItem.getWorkQty()) * 10000) / 10000.0;
                    item.setWorkQty(minusQty);
@@ -165,10 +169,10 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R genMoveTask(Map<String, Object> map) {
        if (Objects.isNull(map.get("targetLoc")) && StringUtils.isNotBlank(map.get("targetLoc").toString())) {
            throw new CoolException("目标库位不能为空!1");
        if (Objects.isNull(map.get("tarLoc")) || StringUtils.isBlank(map.get("tarLoc").toString())) {
            throw new CoolException("目标库位不能为空!");
        }
        if (Objects.isNull(map.get("orgLoc")) && StringUtils.isNotBlank(map.get("orgLoc").toString())) {
        if (Objects.isNull(map.get("orgLoc")) || StringUtils.isBlank(map.get("orgLoc").toString())) {
            throw new CoolException("源库位不能为空!");
        }
@@ -177,12 +181,19 @@
            throw new CoolException("源库位不存在!!");
        }
        Loc targetLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, map.get("targetLoc").toString()));
        orgLoc.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
        if (!locService.updateById(orgLoc)) {
            throw new CoolException("目标库位预约失败!!");
        }
        Loc targetLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, map.get("tarLoc").toString()));
        if (Objects.isNull(targetLoc)) {
            throw new CoolException("目标库位不存在!!");
        }
        targetLoc.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
        targetLoc.setUseStatus(LocStsType.LOC_STS_TYPE_S.type);
        if (!locService.updateById(targetLoc)) {
            throw new CoolException("目标库位预约失败!!");
@@ -197,6 +208,10 @@
                .setTaskStatus(TaskStsType.GENERATE_IN.id)
                .setBarcode(orgLoc.getBarcode());
        if (!taskService.save(task)) {
            throw new CoolException("新建移库任务失败!!");
        }
        List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, orgLoc.getId()));
        if (locItems.isEmpty()) {
            throw new CoolException("库位明细不存在!!");