rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
@@ -166,6 +166,8 @@ if (Objects.isNull(locs)) { throw new CoolException("参数不能为空!!"); } locs.setCreateBy(getLoginUser().getId()); locs.setUpdateBy(getLoginUser().getId()); return locService.batchBindLocs(locs); } @@ -177,9 +179,31 @@ if (Objects.isNull(param)) { throw new CoolException("初始化信息不能为空!!"); } if (Objects.isNull(param.getWarehouseId())) { throw new CoolException("仓库ID不能为空!!"); } if (Objects.isNull(param.getAreaId())) { throw new CoolException("库区ID不能为空!!"); } if (Objects.isNull(param.getStartRow())) { throw new CoolException("起始排不能为空!!"); } if (Objects.isNull(param.getEndRow())) { throw new CoolException("终止排不能为空!!"); } if (Objects.isNull(param.getStartBay())) { throw new CoolException("起始列不能为空!!"); } if (Objects.isNull(param.getEndBay())) { throw new CoolException("终止列不能为空!!"); } if (Objects.isNull(param.getStartLev())) { throw new CoolException("起始层不能为空!!"); } if (Objects.isNull(param.getEndLev())) { throw new CoolException("终止层不能为空!!"); } return locService.initLocs(param); } rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/params/LocMastInitParam.java
@@ -15,6 +15,9 @@ @Accessors(chain = true) public class LocMastInitParam implements Serializable { @ApiModelProperty("仓库ID") private Long warehouseId; @ApiModelProperty("库区ID") private Long areaId; @@ -46,7 +49,5 @@ @NotBlank(message = "库位类型") private String type; @ApiModelProperty("宽窄类型") private String locType; } rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/params/LocModifyParams.java
@@ -28,4 +28,8 @@ @ApiModelProperty("库位信息") private Loc loc; private Long createBy; private Long updateBy; } rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocServiceImpl.java
@@ -79,11 +79,12 @@ if (this.baseMapper.delete(new LambdaUpdateWrapper<>()) < 0) { throw new CoolException("数据库初始化失败:老数据删除失败!!"); } WarehouseAreas warehouseAreas = warehouseAreasService.getById(param.getAreaId()); WarehouseAreas warehouseAreas = warehouseAreasService.getOne(new LambdaQueryWrapper<WarehouseAreas>() .eq(WarehouseAreas::getWarehouseId, param.getWarehouseId()) .eq(WarehouseAreas::getId, param.getAreaId())); if (Objects.isNull(warehouseAreas)) { throw new CoolException("库区不存在!!"); } List<Loc> list = new ArrayList<>(); for (int r = param.getStartRow(); r <= param.getEndRow(); r++) { for (int b = param.getStartBay(); b <= param.getEndBay(); b++) { @@ -99,7 +100,6 @@ .setAreaId(param.getAreaId()) .setWarehouseId(warehouseAreas.getWarehouseId()) .setType(param.getType()); list.add(loc); } } @@ -146,8 +146,7 @@ if (locs.getId().isEmpty()) { throw new CoolException("库位ID不能为空!!"); } Loc loc = locs.getLoc(); if (Objects.isNull(loc)) { if (Objects.isNull(locs.getLocAreaId())) { throw new CoolException("修改库位信息不能为空!!"); } List<LocArea> locAreas = locAreaService.list(new LambdaQueryWrapper<LocArea>().eq(LocArea::getId, locs.getLocAreaId())); @@ -157,7 +156,8 @@ List<LocAreaRela> relas = new ArrayList<>(); locs.getId().forEach(id -> { LocAreaRela locAreaRela = new LocAreaRela(); locAreaRela.setLocId(id).setLocAreaId(locs.getLocAreaId()); locAreaRela.setLocId(id) .setLocAreaId(locs.getLocAreaId()); relas.add(locAreaRela); }); if (!locAreaRelaService.saveBatch(relas)) { rsf-server/src/main/resources/application-dev.yml
@@ -12,7 +12,7 @@ matching-strategy: ANT_PATH_MATCHER datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mysql://192.168.4.24:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai username: root # url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai # username: rsf