From 4a7ceec9af1fe3d5863d0536d58b25a7192bf0f6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 5 Aug 2023 10:21:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=90=8C=E6=AD=A5=E8=80=81=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=8F=8A=E8=B4=A7=E5=8C=BA=E3=80=81=E8=B4=A7?= =?UTF-8?q?=E6=9E=B6=E3=80=81=E8=B4=A7=E4=BD=8D=E3=80=81=E6=89=98=E7=9B=98?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=88=B0=E6=96=B0=E7=B3=BB=E7=BB=9F=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicdataGoodsAllocationEntity.java | 11 +- .../entity/BasicdataGoodsAreaEntity.java | 8 +- .../entity/BasicdataGoodsShelfEntity.java | 10 +- .../basicdata/entity/BasicdataTrayEntity.java | 9 +- .../entity/BasicdataWarehouseEntity.java | 18 +- .../IBasicdataGoodsAllocationClient.java | 4 + .../feign/IBasicdataGoodsAreaClient.java | 5 + .../feign/IBasicdataGoodsShelfClient.java | 4 + .../basicdata/feign/IBasicdataTrayClient.java | 4 + .../feign/IBasicdataWarehouseClient.java | 8 + .../logpm/oldproject/entity/CargoEntity.java | 47 +++ .../oldproject/entity/LocationEntity.java | 58 ++++ .../logpm/oldproject/entity/ShelfEntity.java | 48 ++++ .../logpm/oldproject/entity/TrayEntity.java | 70 +++++ .../oldproject/entity/WarehouseEntity.java | 2 +- .../logpm/oldproject/feign/ICargoClient.java | 43 +++ .../oldproject/feign/ILocationClient.java | 51 ++++ .../logpm/oldproject/feign/IShelfClient.java | 45 +++ .../logpm/oldproject/feign/ITrayClient.java | 48 ++++ .../oldproject/feign/IWarehouseClient.java | 8 + .../feign/BasicdataGoodsAllocationClient.java | 10 + .../feign/BasicdataGoodsAreaClient.java | 10 + .../feign/BasicdataGoodsShelfClient.java | 10 + .../basicdata/feign/BasicdataTrayClient.java | 10 + .../feign/BasicdataWarehouseClient.java | 17 ++ .../impl/BasicdataGoodsShelfServiceImpl.java | 10 +- .../jobhandler/SyncWarehouseDataToNew.java | 269 ++++++++++++++++++ .../impl/PanFactoryDataServiceImpl.java | 4 +- .../logpm/oldproject/feign/CargoClient.java | 22 ++ .../oldproject/feign/LocationClient.java | 29 ++ .../logpm/oldproject/feign/ShelfClient.java | 22 ++ .../logpm/oldproject/feign/TrayClient.java | 22 ++ .../oldproject/feign/WarehouseClient.java | 12 + .../logpm/oldproject/mapper/CargoMapper.java | 12 + .../logpm/oldproject/mapper/CargoMapper.xml | 5 + .../oldproject/mapper/LocationMapper.java | 14 + .../oldproject/mapper/LocationMapper.xml | 15 + .../logpm/oldproject/mapper/ShelfMapper.java | 12 + .../logpm/oldproject/mapper/ShelfMapper.xml | 5 + .../logpm/oldproject/mapper/TrayMapper.java | 9 + .../logpm/oldproject/mapper/TrayMapper.xml | 5 + .../oldproject/mapper/WarehouseMapper.java | 3 + .../oldproject/mapper/WarehouseMapper.xml | 6 + .../oldproject/service/ICargoService.java | 10 + .../oldproject/service/ILocationService.java | 14 + .../oldproject/service/IShelfService.java | 10 + .../oldproject/service/ITrayService.java | 12 + .../oldproject/service/IWarehouseService.java | 4 + .../service/impl/CargoServiceImpl.java | 26 ++ .../service/impl/LocationServiceImpl.java | 32 +++ .../service/impl/ShelfServiceImpl.java | 27 ++ .../service/impl/TrayServiceImpl.java | 26 ++ .../service/impl/WarehouseServiceImpl.java | 7 + 53 files changed, 1168 insertions(+), 34 deletions(-) create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/CargoEntity.java create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/LocationEntity.java create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ShelfEntity.java create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/TrayEntity.java create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ICargoClient.java create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ILocationClient.java create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IShelfClient.java create mode 100644 blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayClient.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/SyncWarehouseDataToNew.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/CargoClient.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/LocationClient.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ShelfClient.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayClient.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.xml create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.xml create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.xml create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.xml create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ICargoService.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ILocationService.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IShelfService.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayService.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/CargoServiceImpl.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/LocationServiceImpl.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ShelfServiceImpl.java create mode 100644 blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayServiceImpl.java diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java index 9341f92ba..6fff90181 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java @@ -17,10 +17,9 @@ package com.logpm.basicdata.entity; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; +import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; @@ -65,7 +64,7 @@ public class BasicdataGoodsAllocationEntity extends TenantEntity { * 货区编号 */ @ApiModelProperty(value = "货区编号") - private String goodsAreaId; + private Long goodsAreaId; /** * 货位名称 */ @@ -75,12 +74,12 @@ public class BasicdataGoodsAllocationEntity extends TenantEntity { * 仓库编号 */ @ApiModelProperty(value = "仓库编号") - private String warehouseId; + private Long warehouseId; /** * 货架编号 */ @ApiModelProperty(value = "货架编号") - private String goodsShelfId; + private Long goodsShelfId; /** * 所在列 */ @@ -123,7 +122,7 @@ public class BasicdataGoodsAllocationEntity extends TenantEntity { * 旧库ID */ @ApiModelProperty(value = "旧库ID") - private Long oldId; + private Integer oldId; /** * 旧库位码 diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAreaEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAreaEntity.java index a033de927..ec23c451d 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAreaEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAreaEntity.java @@ -18,10 +18,9 @@ package com.logpm.basicdata.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; +import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; @@ -66,7 +65,7 @@ public class BasicdataGoodsAreaEntity extends TenantEntity { * 仓库id */ @ApiModelProperty(value = "仓库id") - private String warehouseId; + private Long warehouseId; /** * 标题 */ @@ -89,4 +88,7 @@ public class BasicdataGoodsAreaEntity extends TenantEntity { @ApiModelProperty(value = "货区类型") private Integer areaType; + @ApiModelProperty(value = "老系统id") + private Integer oldId; + } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsShelfEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsShelfEntity.java index 97bf642b7..e8164f1f0 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsShelfEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsShelfEntity.java @@ -17,10 +17,9 @@ package com.logpm.basicdata.entity; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; +import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; @@ -65,7 +64,7 @@ public class BasicdataGoodsShelfEntity extends TenantEntity { * 货区编号 */ @ApiModelProperty(value = "货区编号") - private String goodsAreaId; + private Long goodsAreaId; /** * 货架名称 */ @@ -75,7 +74,7 @@ public class BasicdataGoodsShelfEntity extends TenantEntity { * 仓库编号 */ @ApiModelProperty(value = "仓库编号") - private String warehouseId; + private Long warehouseId; /** * 货架状态;1-已满;2-未满 */ @@ -127,4 +126,7 @@ public class BasicdataGoodsShelfEntity extends TenantEntity { @ApiModelProperty(value = "打印模板编号") private String templateId; + @ApiModelProperty(value = "老系统id") + private Integer oldId; + } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTrayEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTrayEntity.java index bdefe78f5..76eb1c3a5 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTrayEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTrayEntity.java @@ -17,10 +17,9 @@ package com.logpm.basicdata.entity; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; +import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; @@ -76,7 +75,7 @@ public class BasicdataTrayEntity extends TenantEntity { * 仓库编号 */ @ApiModelProperty(value = "仓库编号") - private String warehouseId; + private Long warehouseId; /** * 托盘状态;1-空闲;2-货物;3-损毁;4-流通;5 */ @@ -93,7 +92,7 @@ public class BasicdataTrayEntity extends TenantEntity { * 托盘旧ID */ @ApiModelProperty(value = "托盘旧ID") - private Long oldId; + private Integer oldId; /** @@ -102,5 +101,7 @@ public class BasicdataTrayEntity extends TenantEntity { @ApiModelProperty(value = "托盘旧托盘码") private String oldQrCode; + @ApiModelProperty(value = "目前所在仓库") + private Long nowWarehouseId; } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java index efd122f2f..2af689c76 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java @@ -16,19 +16,17 @@ */ package com.logpm.basicdata.entity; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; -import java.math.BigDecimal; -import java.util.List; - +import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; +import java.math.BigDecimal; +import java.util.Date; + /** * 仓库 实体类 * @@ -135,7 +133,7 @@ public class BasicdataWarehouseEntity extends TenantEntity { * 所属部门 */ @ApiModelProperty(value = "所属部门") - private String department; + private Long department; /** * 所属部门--部门回显 */ @@ -274,4 +272,10 @@ public class BasicdataWarehouseEntity extends TenantEntity { @ApiModelProperty(value = "收款码链接") private String paymentCodeUrl; + @ApiModelProperty(value = "启用状态(1-不启用,2-启用)") + private String enableStatus; + + @ApiModelProperty(value = "老系统id") + private Integer oldId; + } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java index e2c9544c8..703eef8d6 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java @@ -21,6 +21,8 @@ import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -47,4 +49,6 @@ public interface IBasicdataGoodsAllocationClient { @GetMapping(TOP) BladePage goodsAllocationTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + @PostMapping(API_PREFIX+"/addLocation") + Long addLocation(@RequestBody BasicdataGoodsAllocationEntity entity); } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAreaClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAreaClient.java index f5493cbcf..fd631e91f 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAreaClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAreaClient.java @@ -21,6 +21,8 @@ import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -47,4 +49,7 @@ public interface IBasicdataGoodsAreaClient { @GetMapping(TOP) BladePage goodsAreaTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + @PostMapping(API_PREFIX+"/addCargo") + Long addCargo(@RequestBody BasicdataGoodsAreaEntity goodsAreaEntity); + } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsShelfClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsShelfClient.java index c09cf0420..1aa560967 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsShelfClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsShelfClient.java @@ -21,6 +21,8 @@ import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -47,4 +49,6 @@ public interface IBasicdataGoodsShelfClient { @GetMapping(TOP) BladePage goodsShelfTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + @PostMapping(API_PREFIX+"/addShelf") + Long addShelf(@RequestBody BasicdataGoodsShelfEntity goodsShelfEntity); } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java index 5406f5b6f..10d48ffc3 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java @@ -21,6 +21,8 @@ import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -47,4 +49,6 @@ public interface IBasicdataTrayClient { @GetMapping(TOP) BladePage trayTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + @PostMapping(API_PREFIX+"/addTray") + Long addTray(@RequestBody BasicdataTrayEntity basicdataTrayEntity); } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java index 26db7453a..a48df2dd6 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java @@ -22,6 +22,8 @@ import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -60,4 +62,10 @@ public interface IBasicdataWarehouseClient { */ @GetMapping(GETWAREHOUSE) BasicdataWarehouseEntity getWarehouse(@RequestParam("name") String name,@RequestParam("warehouseCode") String warehouseCode); + + @GetMapping(API_PREFIX+"/getWarehouseByOldId") + BasicdataWarehouseEntity getWarehouseByOldId(@RequestParam Integer id); + + @PostMapping(API_PREFIX+"/addWarehouse") + Long addWarehouse(@RequestBody BasicdataWarehouseEntity newEntity); } diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/CargoEntity.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/CargoEntity.java new file mode 100644 index 000000000..e3cdad5ea --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/CargoEntity.java @@ -0,0 +1,47 @@ +package com.logpm.oldproject.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.mp.base.BaseEntity; + +import java.util.Date; + +@Data +@TableName("ht_cargo") +@ApiModel(value = "Cargo对象", description = "货区") +public class CargoEntity { + + @TableId( + value = "id", + type = IdType.AUTO + ) + @ApiModelProperty(name = "ID",notes = "") + private Integer id ; + /** 仓库id */ + @ApiModelProperty(name = "仓库id",notes = "") + private Integer warehouseId ; + /** 标题 */ + @ApiModelProperty(name = "标题",notes = "") + private String title ; + /** 状态:1=启用,0=禁用 */ + @ApiModelProperty(name = "状态:1=启用,0=禁用",notes = "") + private Integer status ; + /** 创建人 */ + @ApiModelProperty(name = "创建人",notes = "") + private Integer administratorsId ; + /** 创建时间 */ + @ApiModelProperty(name = "创建时间",notes = "") + private Date createTime ; + /** 修改时间 */ + @ApiModelProperty(name = "修改时间",notes = "") + private Date updateTime ; + /** 删除时间 */ + @ApiModelProperty(name = "删除时间",notes = "") + private Integer deleteTime ; + + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/LocationEntity.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/LocationEntity.java new file mode 100644 index 000000000..a033076d3 --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/LocationEntity.java @@ -0,0 +1,58 @@ +package com.logpm.oldproject.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("ht_location") +@ApiModel(value = "Location对象", description = "货位") +public class LocationEntity { + + /** ID */ + @TableId( + value = "id", + type = IdType.AUTO + ) + @ApiModelProperty(name = "ID",notes = "") + private Integer id ; + /** 标题 */ + @ApiModelProperty(name = "标题",notes = "") + private String title ; + /** 货区id */ + @ApiModelProperty(name = "货区id",notes = "") + private Integer shelfId ; + /** 创建人 */ + @ApiModelProperty(name = "创建人",notes = "") + private Integer administratorsId ; + /** 状态:1=启用,0=禁用 */ + @ApiModelProperty(name = "状态:1=启用,0=禁用",notes = "") + private Integer status ; + /** 创建时间 */ + @ApiModelProperty(name = "创建时间",notes = "") + private Date createTime ; + /** 修改时间 */ + @ApiModelProperty(name = "修改时间",notes = "") + private Date updateTime ; + /** 删除时间 */ + @ApiModelProperty(name = "删除时间",notes = "") + private Integer deleteTime ; + /** 货位状态:1=占用 0= 空 */ + @ApiModelProperty(name = "货位状态:1=占用 0= 空",notes = "") + private Integer isEmpty ; + /** 总层数 */ + @ApiModelProperty(name = "总层数",notes = "") + private Integer countFloor ; + /** 当前层数 */ + @ApiModelProperty(name = "当前层数",notes = "") + private Integer floor ; + /** 当前列 */ + @ApiModelProperty(name = "当前列",notes = "") + private Integer row ; + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ShelfEntity.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ShelfEntity.java new file mode 100644 index 000000000..c65e5e1d6 --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ShelfEntity.java @@ -0,0 +1,48 @@ +package com.logpm.oldproject.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("ht_shelf") +@ApiModel(value = "Shelf对象", description = "货架") +public class ShelfEntity { + + @TableId( + value = "id", + type = IdType.AUTO + ) + @ApiModelProperty(name = "ID",notes = "") + private Integer id ; + /** 标题 */ + @ApiModelProperty(name = "标题",notes = "") + private String title ; + /** 货区id */ + @ApiModelProperty(name = "货区id",notes = "") + private Integer cargoId ; + /** 创建人 */ + @ApiModelProperty(name = "创建人",notes = "") + private Integer administratorsId ; + /** 状态:1=启用,0=禁用 */ + @ApiModelProperty(name = "状态:1=启用,0=禁用",notes = "") + private Integer status ; + /** 创建时间 */ + @ApiModelProperty(name = "创建时间",notes = "") + private Date createTime ; + /** 修改时间 */ + @ApiModelProperty(name = "修改时间",notes = "") + private Date updateTime ; + /** 删除时间 */ + @ApiModelProperty(name = "删除时间",notes = "") + private Integer deleteTime ; + /** 货架状态:1=货架已满 0=未满 */ + @ApiModelProperty(name = "货架状态:1=货架已满 0=未满",notes = "") + private Integer isEmpty ; + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/TrayEntity.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/TrayEntity.java new file mode 100644 index 000000000..8ebb39781 --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/TrayEntity.java @@ -0,0 +1,70 @@ +package com.logpm.oldproject.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("ht_tray") +@ApiModel(value = "Tray对象", description = "托盘") +public class TrayEntity { + + @TableId( + value = "id", + type = IdType.AUTO + ) + @ApiModelProperty(name = "ID",notes = "") + private Integer id; + /** 托盘码 */ + @ApiModelProperty(name = "托盘码",notes = "") + private String trayNo ; + /** 数 */ + @ApiModelProperty(name = "数",notes = "") + private Integer number ; + /** 状态:1=空置,2=占用,3=报损 */ + @ApiModelProperty(name = "状态:1=空置,2=占用,3=报损",notes = "") + private Integer status ; + /** 报损原因 */ + @ApiModelProperty(name = "报损原因",notes = "") + private String badMsg ; + /** 创建人 */ + @ApiModelProperty(name = "创建人",notes = "") + private Integer administratorsId ; + /** 创建人 */ + @ApiModelProperty(name = "创建人",notes = "") + private String administratorsName ; + /** 所属仓库 */ + @ApiModelProperty(name = "所属仓库",notes = "") + private Integer warehouseId ; + /** 所属仓库 */ + @ApiModelProperty(name = "所属仓库",notes = "") + private String warehouseName ; + /** 当前所在仓库 */ + @ApiModelProperty(name = "当前所在仓库",notes = "") + private Integer nowWarehouseId ; + /** 操作人 */ + @ApiModelProperty(name = "操作人",notes = "") + private Integer nowPersonId ; + /** 创建时间 */ + @ApiModelProperty(name = "创建时间",notes = "") + private Date createTime ; + /** 修改时间 */ + @ApiModelProperty(name = "修改时间",notes = "") + private Date updateTime ; + /** 删除时间 */ + @ApiModelProperty(name = "删除时间",notes = "") + private Integer deleteTime ; + /** 打托时间 */ + @ApiModelProperty(name = "打托时间",notes = "") + private Date changeTime ; + /** */ + @ApiModelProperty(name = "",notes = "") + private Integer oldId ; + + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/WarehouseEntity.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/WarehouseEntity.java index ad3f5bc24..d6880dee1 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/WarehouseEntity.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/WarehouseEntity.java @@ -95,7 +95,7 @@ public class WarehouseEntity { * 仓库类型:1=基地仓,0=中心仓 */ @ApiModelProperty(value = "仓库类型:1=基地仓,0=中心仓") - private Byte isBase; + private Integer isBase; /** * 仓库地址 */ diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ICargoClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ICargoClient.java new file mode 100644 index 000000000..7ac1269da --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ICargoClient.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.oldproject.feign; + +import com.logpm.oldproject.entity.CargoEntity; +import org.springblade.common.constant.ModuleNameConstant; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * 订单 Feign接口类 + * + * @author zhy + * @since 2023-08-04 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_OLDPROJECT_NAME +) +public interface ICargoClient { + + String API_PREFIX = "/client"; + + @GetMapping(API_PREFIX + "/getAllByWarehouseId") + List getAllByWarehouseId(@RequestParam Integer oldWarehouseId); + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ILocationClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ILocationClient.java new file mode 100644 index 000000000..e3b6c01f3 --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ILocationClient.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.oldproject.feign; + +import com.logpm.oldproject.entity.LocationEntity; +import org.springblade.common.constant.ModuleNameConstant; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; + +/** + * 订单 Feign接口类 + * + * @author zhy + * @since 2023-08-04 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_OLDPROJECT_NAME +) +public interface ILocationClient { + + String API_PREFIX = "/client"; + + @GetMapping(API_PREFIX + "/getStoreyAndRowByShelfId") + Map getStoreyAndRowByShelfId(@RequestParam Integer oldShelfId); + + @GetMapping(API_PREFIX + "/getAllByShelfId") + List getAllByShelfId(@RequestParam Integer shelfId); + +// @GetMapping(API_PREFIX + "/getOrderByOrderSelfNum") +// List getOrderByOrderSelfNum(@RequestParam String orderSelfNum); + + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IShelfClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IShelfClient.java new file mode 100644 index 000000000..ac5546571 --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IShelfClient.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.oldproject.feign; + +import com.logpm.oldproject.entity.ShelfEntity; +import org.springblade.common.constant.ModuleNameConstant; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * 订单 Feign接口类 + * + * @author zhy + * @since 2023-08-04 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_OLDPROJECT_NAME +) +public interface IShelfClient { + + String API_PREFIX = "/client"; + + @GetMapping(API_PREFIX + "/getAllByWarehouseIdAndCargoId") + List getAllByWarehouseIdAndCargoId(@RequestParam Integer cargoId); + + + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayClient.java new file mode 100644 index 000000000..53ffa0851 --- /dev/null +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayClient.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.oldproject.feign; + +import com.logpm.oldproject.entity.TrayEntity; +import org.springblade.common.constant.ModuleNameConstant; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * 订单 Feign接口类 + * + * @author zhy + * @since 2023-08-04 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_OLDPROJECT_NAME +) +public interface ITrayClient { + + String API_PREFIX = "/client"; + + @GetMapping(API_PREFIX+"/getAllTrayByWarehouseId") + List getAllTrayByWarehouseId(@RequestParam Integer oldWarehouseId); + + +// @GetMapping(API_PREFIX + "/getOrderByOrderSelfNum") +// List getOrderByOrderSelfNum(@RequestParam String orderSelfNum); + + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWarehouseClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWarehouseClient.java index adf849dc9..233e04e0b 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWarehouseClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWarehouseClient.java @@ -22,6 +22,8 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.List; + /** * 仓库 Feign接口类 * @@ -57,4 +59,10 @@ public interface IWarehouseClient { @GetMapping("/findByCode") WarehouseEntity findByCode(String warehouseCode); + @GetMapping("/getAllWarehouseIds") + List getAllWarehouseIds(); + + @GetMapping("/selectEntityById") + WarehouseEntity selectEntityById(@RequestParam Integer warehouseId); + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java index b0ed0c37b..d0c047438 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java @@ -50,4 +50,14 @@ public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocation return BladePage.of(page); } + @Override + public Long addLocation(BasicdataGoodsAllocationEntity entity) { + boolean saveFlag = BasicdataGoodsAllocationService.save(entity); + if(saveFlag){ + return entity.getId(); + }else{ + return null; + } + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAreaClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAreaClient.java index 366d2af87..8a4bd5676 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAreaClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAreaClient.java @@ -50,4 +50,14 @@ public class BasicdataGoodsAreaClient implements IBasicdataGoodsAreaClient { return BladePage.of(page); } + @Override + public Long addCargo(BasicdataGoodsAreaEntity goodsAreaEntity) { + boolean saveflag = basicdataGoodsAreaService.save(goodsAreaEntity); + if(saveflag){ + return goodsAreaEntity.getId(); + }else{ + return null; + } + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsShelfClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsShelfClient.java index 59d6a691d..91d6f7df4 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsShelfClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsShelfClient.java @@ -50,4 +50,14 @@ public class BasicdataGoodsShelfClient implements IBasicdataGoodsShelfClient { return BladePage.of(page); } + @Override + public Long addShelf(BasicdataGoodsShelfEntity goodsShelfEntity) { + boolean saveFlag = basicdataGoodsShelfService.save(goodsShelfEntity); + if(saveFlag){ + return goodsShelfEntity.getId(); + }else{ + return null; + } + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java index 6676ffadb..5918f631e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java @@ -50,4 +50,14 @@ public class BasicdataTrayClient implements IBasicdataTrayClient { return BladePage.of(page); } + @Override + public Long addTray(BasicdataTrayEntity basicdataTrayEntity) { + boolean saveFlag = BasicdataTrayService.save(basicdataTrayEntity); + if(saveFlag){ + return basicdataTrayEntity.getId(); + }else { + return null; + } + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java index 45a0ed040..152fbf27e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java @@ -74,4 +74,21 @@ public class BasicdataWarehouseClient implements IBasicdataWarehouseClient { ); } + @Override + public BasicdataWarehouseEntity getWarehouseByOldId(Integer id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("old_id",id); + return warehouseWarehouseService.getOne(queryWrapper); + } + + @Override + public Long addWarehouse(BasicdataWarehouseEntity newEntity) { + boolean saveFlag = warehouseWarehouseService.save(newEntity); + if(saveFlag){ + return newEntity.getId(); + }else{ + return null; + } + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java index 6fe77aaad..a90dc8169 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java @@ -30,7 +30,6 @@ import com.logpm.basicdata.dto.BasicdataGoodsShelfDTO; import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity; import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity; import com.logpm.basicdata.excel.BasicdataGoodsShelfExcel; -import com.logpm.basicdata.mapper.BasicdataGoodsAllocationMapper; import com.logpm.basicdata.mapper.BasicdataGoodsShelfMapper; import com.logpm.basicdata.service.IBasicdataGoodsAllocationService; import com.logpm.basicdata.service.IBasicdataGoodsShelfService; @@ -55,10 +54,7 @@ import javax.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -115,7 +111,7 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl syncWarehouseToNew(String param) { + log.info("############syncWarehouseToNew: 同步仓库及货位托盘信息开始 param={}",param); + List warehouseIds = new ArrayList<>(); + if(StringUtil.hasLength(param)){ + String[] split = param.split(","); + for (String idstr:split){ + if(StringUtil.hasLength(idstr)){ + warehouseIds.add(Integer.parseInt(idstr)); + } + } + }else{ + //如果是没有指定仓库就去同步所有仓库 + warehouseIds = warehouseClient.getAllWarehouseIds(); + } + //根据仓库id 同步仓库下货位及托盘信息 + log.info("############syncWarehouseToNew: 此次同步的仓库有warehouseIds={}",warehouseIds); + + for (Integer oldWarehouseId:warehouseIds){ + log.info("############syncWarehouseToNew: 同步老系统id为{}的仓库信息开始",oldWarehouseId); + + //根据id查询仓库id + WarehouseEntity oldWarehouse = warehouseClient.selectEntityById(oldWarehouseId); + if(Objects.isNull(oldWarehouse)){ + log.warn("#################syncWarehouseToNew: id为{}的仓库信息不存在",oldWarehouseId); + return ReturnT.FAIL; + } + //保存仓库信息到新系统 + Long newWarehouseId = saveWarehouseData(oldWarehouse); + if(Objects.isNull(newWarehouseId)){ + log.warn("#################syncWarehouseToNew: 保存仓库信息失败id={}",oldWarehouseId); + return ReturnT.FAIL; + } + + //保存仓库中的货区,货架,货位信息 + boolean flag = saveOtherData(newWarehouseId,oldWarehouseId); + if(flag){ + log.info("###############syncWarehouseToNew: 保存数据成功"); + }else { + log.info("###############syncWarehouseToNew: 保存数据失败"); + return ReturnT.FAIL; + } + + //保存托盘信息 + log.info("###############syncWarehouseToNew: 保存仓库id为{}的托盘开始",oldWarehouseId); + boolean trayFlag = saveTrayData(newWarehouseId,oldWarehouseId); + if(trayFlag){ + log.info("###############syncWarehouseToNew: 保存仓库id为{}的托盘成功",oldWarehouseId); + }else { + log.info("###############syncWarehouseToNew: 保存仓库id为{}的托盘失败",oldWarehouseId); + return ReturnT.FAIL; + } + + } + return ReturnT.SUCCESS; + } + + private boolean saveTrayData(Long newWarehouseId, Integer oldWarehouseId) { + //通过老系统仓库id查询所有托盘信息 + List trayEntityList = trayClient.getAllTrayByWarehouseId(oldWarehouseId); + for(TrayEntity trayEntity:trayEntityList){ + Integer trayId = trayEntity.getId(); +// Integer nowOldWarehouseId = trayEntity.getNowWarehouseId(); +// BasicdataWarehouseEntity nowWarehouse = basicdataWarehouseClient.getWarehouseByOldId(nowOldWarehouseId); +// Long nowNewWarehouseId = nowWarehouse.getId(); + BasicdataTrayEntity basicdataTrayEntity = new BasicdataTrayEntity(); + basicdataTrayEntity.setTenantId("627683"); + basicdataTrayEntity.setCreateUser(1649331096967450625L); + basicdataTrayEntity.setUpdateUser(1649331096967450625L); + basicdataTrayEntity.setCreateDept(1649331096241836033L); + basicdataTrayEntity.setPalletName(trayEntity.getTrayNo()); + basicdataTrayEntity.setPalletCode(trayEntity.getTrayNo()); + basicdataTrayEntity.setWarehouseId(newWarehouseId); + basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+""); + basicdataTrayEntity.setType(1); + basicdataTrayEntity.setOldId(trayId); +// basicdataTrayEntity.setNowWarehouseId(nowNewWarehouseId); + Long newTrayId = basicdataTrayClient.addTray(basicdataTrayEntity); + if(Objects.isNull(newTrayId)){ + log.warn("#################saveTrayData: 保存托盘信息失败trayId={},oldWarehouseId={}",trayId,oldWarehouseId); + return false; + } + } + return true; + } + + private boolean saveOtherData(Long newWarehouseId, Integer oldWarehouseId) { + //通过老系统仓库id去查有哪些货区 + List cargoEntityList = cargoClient.getAllByWarehouseId(oldWarehouseId); + for (CargoEntity cargoEntity:cargoEntityList){ + //货区数据存储 + Integer cargoId = cargoEntity.getId();//老系统货区id + BasicdataGoodsAreaEntity goodsAreaEntity = new BasicdataGoodsAreaEntity(); + goodsAreaEntity.setTenantId("627683"); + goodsAreaEntity.setCreateUser(1649331096967450625L); + goodsAreaEntity.setUpdateUser(1649331096967450625L); + goodsAreaEntity.setCreateDept(1649331096241836033L); + goodsAreaEntity.setWarehouseId(newWarehouseId); + goodsAreaEntity.setHeadline(cargoEntity.getTitle()); + goodsAreaEntity.setEnableStatus(1); + goodsAreaEntity.setAreaType(2); + goodsAreaEntity.setOldId(cargoId); + Long newAreaId = basicdataGoodsAreaClient.addCargo(goodsAreaEntity); + if(Objects.isNull(newAreaId)){ + log.warn("#################saveOtherData: 保存货区信息失败cargoId={},oldWarehouseId={}",cargoId,oldWarehouseId); + return false; + }else{ + //货架数据存储 + //通过老系统货区id查询所有货架 + Map shelfIsEmptyMap = new HashMap<>(); + shelfIsEmptyMap.put(1,1); + shelfIsEmptyMap.put(0,2); + List shelfEntityList = shelfClient.getAllByWarehouseIdAndCargoId(cargoId); + for (ShelfEntity shelfEntity:shelfEntityList){ + Integer oldShelfId = shelfEntity.getId(); + //通过货架id查询最大行数和列数 + Map storeyAndRow = locationClient.getStoreyAndRowByShelfId(oldShelfId); + //存入新系统货架信息 + BasicdataGoodsShelfEntity goodsShelfEntity = new BasicdataGoodsShelfEntity(); + goodsShelfEntity.setTenantId("627683"); + goodsShelfEntity.setCreateUser(1649331096967450625L); + goodsShelfEntity.setUpdateUser(1649331096967450625L); + goodsShelfEntity.setCreateDept(1649331096241836033L); + goodsShelfEntity.setGoodsAreaId(newAreaId); + goodsShelfEntity.setGoodsShelfName(shelfEntity.getTitle()); + goodsShelfEntity.setWarehouseId(newWarehouseId); + goodsShelfEntity.setGoodsShelfStatus(shelfIsEmptyMap.get(shelfEntity.getIsEmpty())); + goodsShelfEntity.setEnableStatus(1); + goodsShelfEntity.setStoreyNum(storeyAndRow.get("storey")); + goodsShelfEntity.setRowNum(storeyAndRow.get("row")); + goodsShelfEntity.setRemarks(""); + goodsShelfEntity.setOldId(oldShelfId); + Long newShelfId = basicdataGoodsShelfClient.addShelf(goodsShelfEntity); + if(Objects.isNull(newShelfId)){ + log.warn("#################saveOtherData: 保存货架信息失败oldShelfId={},oldWarehouseId={}",oldShelfId,oldWarehouseId); + return false; + }else{ + //货位数据存储 + Map locationIsEmptyMap = new HashMap<>(); + locationIsEmptyMap.put(1,2); + locationIsEmptyMap.put(0,1); + List locationEntities = locationClient.getAllByShelfId(oldShelfId); +// List newLocations = new ArrayList<>(); + for (LocationEntity locationEntity:locationEntities){ + String title = locationEntity.getTitle(); + Integer locationId = locationEntity.getId(); + String[] split = title.split("-"); + BasicdataGoodsAllocationEntity entity = new BasicdataGoodsAllocationEntity(); + entity.setTenantId("627683"); + entity.setCreateUser(1649331096967450625L); + entity.setUpdateUser(1649331096967450625L); + entity.setCreateDept(1649331096241836033L); + entity.setGoodsAreaId(newAreaId); + entity.setGoodsAllocationName(locationEntity.getTitle()); + entity.setWarehouseId(newWarehouseId); + entity.setGoodsShelfId(newShelfId); + entity.setEnableStatus("1"); + entity.setAllocationStatuc(locationIsEmptyMap.get(locationEntity.getIsEmpty())+""); + entity.setLayerNum(Integer.parseInt(split[0])); + entity.setColumnNum(Integer.parseInt(split[1])); + entity.setOldId(locationId); + Long newLocationId = basicdataGoodsAllocationClient.addLocation(entity); + if(Objects.isNull(newLocationId)){ + log.warn("#################saveOtherData: 保存货位信息失败locationId={},oldWarehouseId={}",locationId,oldWarehouseId); + return false; + } + } + } + } + } + } + return true; + } + + private Long saveWarehouseData(WarehouseEntity oldWarehouse) { + //先查询新系统是否已经有同步过的仓库信息 + Integer id = oldWarehouse.getId(); + Map typeMapping = new HashMap<>(); + typeMapping.put(0,2); + typeMapping.put(1,1); + typeMapping.put(2,4); + Long newId = null; + BasicdataWarehouseEntity newEntity = basicdataWarehouseClient.getWarehouseByOldId(id); + if (Objects.isNull(newEntity)){ + newEntity = new BasicdataWarehouseEntity(); + newEntity.setTenantId("627683"); + newEntity.setCreateUser(1649331096967450625L); + newEntity.setUpdateUser(1649331096967450625L); + newEntity.setCreateDept(1649331096241836033L); + newEntity.setName(oldWarehouse.getTitle());//仓库名称 + newEntity.setWarehouseCode(oldWarehouse.getNo());//仓库编码 + newEntity.setAbbreviation(oldWarehouse.getShortTitle());//简称 + newEntity.setLinkman(oldWarehouse.getContactName());//仓库联系人 + newEntity.setContactNumber(oldWarehouse.getPhone());//联系人电话 + newEntity.setBusinessLine("");//事业线 + newEntity.setFunctionType(typeMapping.get(oldWarehouse.getIsBase()));//仓库类型 + newEntity.setRemarks(oldWarehouse.getRemark());//备注 + newEntity.setWarehouseAddress(oldWarehouse.getAddress());//仓库地址 + newEntity.setLongitude(new BigDecimal(oldWarehouse.getLng()));//经度 + newEntity.setLatitude(new BigDecimal(oldWarehouse.getLat()));//维度 + newEntity.setDepartment(1657995112128450561L); + newEntity.setDepartmentName("龙泉营业部"); + newEntity.setWarehouseType("2"); + newEntity.setFireGrade("1"); + newEntity.setFireRatingNot("2"); + newEntity.setWarehouseStructure("1"); + newEntity.setElevatedNot("1"); + newEntity.setStoreyHeight(new BigDecimal("20.42")); + newEntity.setPowerCondition("1"); + newEntity.setAcreage(new BigDecimal("3500.25")); + newEntity.setUnitPrice(new BigDecimal("120000.00")); + newEntity.setAdministrativeFee(new BigDecimal("5000.00")); + newEntity.setSeating(100000); + newEntity.setGrade("甲"); + newEntity.setRentType("1"); + newEntity.setStartDate(new Date()); + newEntity.setEndDate(new Date()); + newEntity.setProvinceCode(""); + newEntity.setCityCode(""); + newEntity.setCode(""); + newEntity.setAdministrativeAreas(oldWarehouse.getAreaId());//管理区域 + newEntity.setPaymentCodeUrl(oldWarehouse.getPaymentCode());//收款码链接 + newEntity.setEnableStatus("2"); + newEntity.setOldId(oldWarehouse.getId());//老系统id + newId = basicdataWarehouseClient.addWarehouse(newEntity); + }else{ + newId = newEntity.getId(); + } + return newId; + } + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index 25ae348e4..280e7b8ee 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -392,7 +392,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } if (!Objects.isNull(basicdataWarehouseEntity)) { - distributionStockArticleEntity.setCreateDept(Long.parseLong(basicdataWarehouseEntity.getDepartment())); + distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment()); } String customerName = advanceEntity.getCustomerName();//客户名称 @@ -488,7 +488,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { entity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.daibeihuo.getValue()); // 绑定部门--仓库 if (!Objects.isNull(basicdataWarehouseEntity)) { - entity.setCreateDept(Long.parseLong(basicdataWarehouseEntity.getDepartment())); + entity.setCreateDept(basicdataWarehouseEntity.getDepartment()); } entity.setCreateUser(1123598821738675201L); entity.setTenantId(TenantNum.HUITONGCODE); diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/CargoClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/CargoClient.java new file mode 100644 index 000000000..6744344c2 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/CargoClient.java @@ -0,0 +1,22 @@ +package com.logpm.oldproject.feign; + +import com.logpm.oldproject.entity.CargoEntity; +import com.logpm.oldproject.service.ICargoService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; + +@ApiIgnore() +@RestController +@AllArgsConstructor +public class CargoClient implements ICargoClient{ + + private final ICargoService cargoService; + + @Override + public List getAllByWarehouseId(Integer oldWarehouseId) { + return cargoService.getAllByWarehouseId(oldWarehouseId); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/LocationClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/LocationClient.java new file mode 100644 index 000000000..a4364a994 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/LocationClient.java @@ -0,0 +1,29 @@ +package com.logpm.oldproject.feign; + + +import com.logpm.oldproject.entity.LocationEntity; +import com.logpm.oldproject.service.ILocationService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +@ApiIgnore() +@RestController +@AllArgsConstructor +public class LocationClient implements ILocationClient{ + + private final ILocationService locationService; + + @Override + public Map getStoreyAndRowByShelfId(Integer oldShelfId) { + return locationService.getStoreyAndRowByShelfId(oldShelfId); + } + + @Override + public List getAllByShelfId(Integer shelfId) { + return locationService.getAllByShelfId(shelfId); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ShelfClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ShelfClient.java new file mode 100644 index 000000000..927012c60 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ShelfClient.java @@ -0,0 +1,22 @@ +package com.logpm.oldproject.feign; + +import com.logpm.oldproject.entity.ShelfEntity; +import com.logpm.oldproject.service.IShelfService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; + +@ApiIgnore() +@RestController +@AllArgsConstructor +public class ShelfClient implements IShelfClient{ + + private final IShelfService shelfService; + + @Override + public List getAllByWarehouseIdAndCargoId(Integer cargoId) { + return shelfService.getAllByWarehouseIdAndCargoId(cargoId); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayClient.java new file mode 100644 index 000000000..571a69cc5 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayClient.java @@ -0,0 +1,22 @@ +package com.logpm.oldproject.feign; + +import com.logpm.oldproject.entity.TrayEntity; +import com.logpm.oldproject.service.ITrayService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; + +@ApiIgnore() +@RestController +@AllArgsConstructor +public class TrayClient implements ITrayClient{ + + private final ITrayService trayService; + + @Override + public List getAllTrayByWarehouseId(Integer oldWarehouseId) { + return trayService.getAllByWarehouseId(oldWarehouseId); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WarehouseClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WarehouseClient.java index df8df4dad..4a88133ce 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WarehouseClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WarehouseClient.java @@ -23,6 +23,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; +import java.util.List; + /** * 仓库 Feign实现类 * @@ -60,4 +62,14 @@ public class WarehouseClient implements IWarehouseClient { public WarehouseEntity findByCode(String warehouseCode) { return warehouseService.findByCode(warehouseCode); } + + @Override + public List getAllWarehouseIds() { + return warehouseService.getAllWarehouseIds(); + } + + @Override + public WarehouseEntity selectEntityById(Integer warehouseId) { + return warehouseService.getById(warehouseId); + } } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.java new file mode 100644 index 000000000..2d88e29b8 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.java @@ -0,0 +1,12 @@ +package com.logpm.oldproject.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.oldproject.entity.CargoEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface CargoMapper extends BaseMapper { + + + +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.xml new file mode 100644 index 000000000..5321c22bf --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/CargoMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.java new file mode 100644 index 000000000..25027d39d --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.java @@ -0,0 +1,14 @@ +package com.logpm.oldproject.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.oldproject.entity.LocationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Map; + +@Mapper +public interface LocationMapper extends BaseMapper { + + Map getStoreyAndRowByShelfId(@Param("shelfId") Integer oldShelfId); +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.xml new file mode 100644 index 000000000..415aca879 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.java new file mode 100644 index 000000000..4a3c338b2 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.java @@ -0,0 +1,12 @@ +package com.logpm.oldproject.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.oldproject.entity.ShelfEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ShelfMapper extends BaseMapper { + + + +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.xml new file mode 100644 index 000000000..b4ae310db --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/ShelfMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.java new file mode 100644 index 000000000..31d429c73 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.java @@ -0,0 +1,9 @@ +package com.logpm.oldproject.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.oldproject.entity.TrayEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface TrayMapper extends BaseMapper { +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.xml new file mode 100644 index 000000000..b0507f8ea --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.java index 105620f5b..4873e018c 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.java @@ -41,4 +41,7 @@ public interface WarehouseMapper extends BaseMapper { List selectWarehousePage(IPage page, WarehouseVO warehouse); Integer selectIdByName(String siteName); + + List getAllWarehouseIds(); + } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.xml index d06741f73..44dd0663d 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.xml @@ -42,5 +42,11 @@ select id from ht_warehouse where short_title like concat('%',#{siteName},'%') limit 1 + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ICargoService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ICargoService.java new file mode 100644 index 000000000..ff54d86fd --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ICargoService.java @@ -0,0 +1,10 @@ +package com.logpm.oldproject.service; + +import com.logpm.oldproject.entity.CargoEntity; + +import java.util.List; + +public interface ICargoService { + + List getAllByWarehouseId(Integer oldWarehouseId); +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ILocationService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ILocationService.java new file mode 100644 index 000000000..59bff329c --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ILocationService.java @@ -0,0 +1,14 @@ +package com.logpm.oldproject.service; + +import com.logpm.oldproject.entity.LocationEntity; + +import java.util.List; +import java.util.Map; + +public interface ILocationService { + + + Map getStoreyAndRowByShelfId(Integer oldShelfId); + + List getAllByShelfId(Integer shelfId); +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IShelfService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IShelfService.java new file mode 100644 index 000000000..854f18aa0 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IShelfService.java @@ -0,0 +1,10 @@ +package com.logpm.oldproject.service; + +import com.logpm.oldproject.entity.ShelfEntity; + +import java.util.List; + +public interface IShelfService { + List getAllByWarehouseIdAndCargoId(Integer cargoId); + +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayService.java new file mode 100644 index 000000000..becfea212 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayService.java @@ -0,0 +1,12 @@ +package com.logpm.oldproject.service; + +import com.logpm.oldproject.entity.TrayEntity; + +import java.util.List; + +public interface ITrayService { + + + List getAllByWarehouseId(Integer warehouseId); + +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWarehouseService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWarehouseService.java index c73f92ef3..355a6b597 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWarehouseService.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWarehouseService.java @@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.oldproject.entity.WarehouseEntity; import com.logpm.oldproject.vo.WarehouseVO; +import java.util.List; + /** * 仓库 服务类 * @@ -44,6 +46,8 @@ public interface IWarehouseService { WarehouseEntity findByCode(String warehouseCode); + List getAllWarehouseIds(); + } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/CargoServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/CargoServiceImpl.java new file mode 100644 index 000000000..007a8ff1f --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/CargoServiceImpl.java @@ -0,0 +1,26 @@ +package com.logpm.oldproject.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.oldproject.entity.CargoEntity; +import com.logpm.oldproject.mapper.CargoMapper; +import com.logpm.oldproject.service.ICargoService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@AllArgsConstructor +public class CargoServiceImpl implements ICargoService { + + private final CargoMapper cargoMapper; + + @Override + public List getAllByWarehouseId(Integer oldWarehouseId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("warehouse_id",oldWarehouseId) + .eq("delete_time",0) + .eq("status",1); + return cargoMapper.selectList(queryWrapper); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/LocationServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/LocationServiceImpl.java new file mode 100644 index 000000000..b40ba6904 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/LocationServiceImpl.java @@ -0,0 +1,32 @@ +package com.logpm.oldproject.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.oldproject.entity.LocationEntity; +import com.logpm.oldproject.mapper.LocationMapper; +import com.logpm.oldproject.service.ILocationService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +@AllArgsConstructor +public class LocationServiceImpl implements ILocationService { + + private final LocationMapper locationMapper; + + @Override + public Map getStoreyAndRowByShelfId(Integer oldShelfId) { + return locationMapper.getStoreyAndRowByShelfId(oldShelfId); + } + + @Override + public List getAllByShelfId(Integer shelfId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("shelf_id",shelfId) + .eq("delete_time",0) + .eq("status",1); + return locationMapper.selectList(queryWrapper); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ShelfServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ShelfServiceImpl.java new file mode 100644 index 000000000..12f346e31 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ShelfServiceImpl.java @@ -0,0 +1,27 @@ +package com.logpm.oldproject.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.oldproject.entity.ShelfEntity; +import com.logpm.oldproject.mapper.ShelfMapper; +import com.logpm.oldproject.service.IShelfService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@AllArgsConstructor +public class ShelfServiceImpl implements IShelfService { + + private final ShelfMapper shelfMapper; + + + @Override + public List getAllByWarehouseIdAndCargoId(Integer cargoId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("cargo_id",cargoId) + .eq("status",1) + .eq("delete_time",0); + return shelfMapper.selectList(queryWrapper); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayServiceImpl.java new file mode 100644 index 000000000..deec2c876 --- /dev/null +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayServiceImpl.java @@ -0,0 +1,26 @@ +package com.logpm.oldproject.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.oldproject.entity.TrayEntity; +import com.logpm.oldproject.mapper.TrayMapper; +import com.logpm.oldproject.service.ITrayService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@AllArgsConstructor +public class TrayServiceImpl implements ITrayService { + + private final TrayMapper trayMapper; + + @Override + public List getAllByWarehouseId(Integer warehouseId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("warehouse_id",warehouseId) + .eq("delete_time",0); + + return trayMapper.selectList(queryWrapper); + } +} diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WarehouseServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WarehouseServiceImpl.java index 83078757c..eac65f9cf 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WarehouseServiceImpl.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WarehouseServiceImpl.java @@ -26,6 +26,8 @@ import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Service; +import java.util.List; + /** * 仓库 服务实现类 * @@ -70,5 +72,10 @@ public class WarehouseServiceImpl implements IWarehouseService { return warehouseMapper.selectOne(queryWrapper); } + @Override + public List getAllWarehouseIds() { + return warehouseMapper.getAllWarehouseIds(); + } + }