skyouc
2025-04-01 fd8c8f8facc58ce1d2dd45b738e8316172c99a85
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
@@ -98,14 +98,14 @@
    @Transactional(rollbackFor = Exception.class)
    public R update(@RequestBody Loc loc) {
        loc.setUpdateBy(getLoginUserId());
        String join = StringUtils.join(loc.getTypeIds(), ",");
        loc.setType(join);
        if (Objects.isNull(loc.getTypeIds())) {
            throw new CoolException("库位类型不能为空!!");
        }
        if (!locService.updateById(loc)) {
            return R.error("Update Fail");
        }
        if (!locService.updateLoc(loc)) {
            throw new CoolException("库位类型关联关系修改失败!@!");
        }
@@ -166,6 +166,8 @@
        if (Objects.isNull(locs)) {
            throw new CoolException("参数不能为空!!");
        }
        locs.setCreateBy(getLoginUserId());
        locs.setUpdateBy(getLoginUserId());
        return locService.batchBindLocs(locs);
    }
@@ -175,12 +177,36 @@
    @PostMapping("/loc/init")
    public R initLocInfo(@Valid @RequestBody LocMastInitParam param) {
        if (Objects.isNull(param)) {
            throw new CoolException("初始化信息不能为空!!");
            return R.error("初始化信息不能为空!!");
        }
        if (Objects.isNull(param.getTypeIds()) && param.getTypeIds().isEmpty()) {
            return R.error("库位类型不能为空!!");
        }
        if (Objects.isNull(param.getWarehouseId())) {
            return R.error("仓库ID不能为空!!");
        }
        if (Objects.isNull(param.getAreaId())) {
            throw new CoolException("库区ID不能为空!!");
            return R.error("库区ID不能为空!!");
        }
        return locService.initLocs(param);
        if (Objects.isNull(param.getStartRow())) {
            return R.error("起始排不能为空!!");
        }
        if (Objects.isNull(param.getEndRow())) {
            return R.error("终止排不能为空!!");
        }
        if (Objects.isNull(param.getStartBay())) {
            return R.error("起始列不能为空!!");
        }
        if (Objects.isNull(param.getEndBay())) {
            return R.error("终止列不能为空!!");
        }
        if (Objects.isNull(param.getStartLev())) {
            return R.error("起始层不能为空!!");
        }
        if (Objects.isNull(param.getEndLev())) {
            return R.error("终止层不能为空!!");
        }
        return locService.initLocs(param, getLoginUserId());
    }
}