53 changed files with 1168 additions and 34 deletions
@ -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 ; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -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 ; |
||||||
|
|
||||||
|
} |
@ -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 ; |
||||||
|
|
||||||
|
} |
@ -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 ; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -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<CargoEntity> getAllByWarehouseId(@RequestParam Integer oldWarehouseId); |
||||||
|
|
||||||
|
} |
@ -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<String, Integer> getStoreyAndRowByShelfId(@RequestParam Integer oldShelfId); |
||||||
|
|
||||||
|
@GetMapping(API_PREFIX + "/getAllByShelfId") |
||||||
|
List<LocationEntity> getAllByShelfId(@RequestParam Integer shelfId); |
||||||
|
|
||||||
|
// @GetMapping(API_PREFIX + "/getOrderByOrderSelfNum")
|
||||||
|
// List<OrderEntity> getOrderByOrderSelfNum(@RequestParam String orderSelfNum);
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -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<ShelfEntity> getAllByWarehouseIdAndCargoId(@RequestParam Integer cargoId); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -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<TrayEntity> getAllTrayByWarehouseId(@RequestParam Integer oldWarehouseId); |
||||||
|
|
||||||
|
|
||||||
|
// @GetMapping(API_PREFIX + "/getOrderByOrderSelfNum")
|
||||||
|
// List<OrderEntity> getOrderByOrderSelfNum(@RequestParam String orderSelfNum);
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,269 @@ |
|||||||
|
package com.logpm.factory.jobhandler; |
||||||
|
|
||||||
|
import com.logpm.basicdata.entity.*; |
||||||
|
import com.logpm.basicdata.feign.*; |
||||||
|
import com.logpm.oldproject.entity.*; |
||||||
|
import com.logpm.oldproject.feign.*; |
||||||
|
import com.xxl.job.core.biz.model.ReturnT; |
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.log4j.Log4j2; |
||||||
|
import org.springblade.core.tool.utils.StringUtil; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.*; |
||||||
|
|
||||||
|
@Log4j2 |
||||||
|
@AllArgsConstructor |
||||||
|
@Component |
||||||
|
public class SyncWarehouseDataToNew { |
||||||
|
|
||||||
|
//-----------------新系统
|
||||||
|
private final IBasicdataWarehouseClient basicdataWarehouseClient;//仓库
|
||||||
|
private final IBasicdataGoodsAreaClient basicdataGoodsAreaClient;//货区
|
||||||
|
private final IBasicdataGoodsShelfClient basicdataGoodsShelfClient;//货架
|
||||||
|
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;//货位
|
||||||
|
private final IBasicdataTrayClient basicdataTrayClient;//托盘
|
||||||
|
|
||||||
|
//-----------------老系统
|
||||||
|
private final IWarehouseClient warehouseClient;//仓库
|
||||||
|
private final ICargoClient cargoClient;//货区
|
||||||
|
private final IShelfClient shelfClient;//货架
|
||||||
|
private final ILocationClient locationClient;//货位
|
||||||
|
private final ITrayClient trayClient;//托盘
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@XxlJob("syncWarehouseToNew") |
||||||
|
public ReturnT<String> syncWarehouseToNew(String param) { |
||||||
|
log.info("############syncWarehouseToNew: 同步仓库及货位托盘信息开始 param={}",param); |
||||||
|
List<Integer> 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<TrayEntity> 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<CargoEntity> 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<Integer,Integer> shelfIsEmptyMap = new HashMap<>(); |
||||||
|
shelfIsEmptyMap.put(1,1); |
||||||
|
shelfIsEmptyMap.put(0,2); |
||||||
|
List<ShelfEntity> shelfEntityList = shelfClient.getAllByWarehouseIdAndCargoId(cargoId); |
||||||
|
for (ShelfEntity shelfEntity:shelfEntityList){ |
||||||
|
Integer oldShelfId = shelfEntity.getId(); |
||||||
|
//通过货架id查询最大行数和列数
|
||||||
|
Map<String,Integer> 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<Integer,Integer> locationIsEmptyMap = new HashMap<>(); |
||||||
|
locationIsEmptyMap.put(1,2); |
||||||
|
locationIsEmptyMap.put(0,1); |
||||||
|
List<LocationEntity> locationEntities = locationClient.getAllByShelfId(oldShelfId); |
||||||
|
// List<BasicdataGoodsAllocationEntity> 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<Integer,Integer> 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; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -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<CargoEntity> getAllByWarehouseId(Integer oldWarehouseId) { |
||||||
|
return cargoService.getAllByWarehouseId(oldWarehouseId); |
||||||
|
} |
||||||
|
} |
@ -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<String, Integer> getStoreyAndRowByShelfId(Integer oldShelfId) { |
||||||
|
return locationService.getStoreyAndRowByShelfId(oldShelfId); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<LocationEntity> getAllByShelfId(Integer shelfId) { |
||||||
|
return locationService.getAllByShelfId(shelfId); |
||||||
|
} |
||||||
|
} |
@ -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<ShelfEntity> getAllByWarehouseIdAndCargoId(Integer cargoId) { |
||||||
|
return shelfService.getAllByWarehouseIdAndCargoId(cargoId); |
||||||
|
} |
||||||
|
} |
@ -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<TrayEntity> getAllTrayByWarehouseId(Integer oldWarehouseId) { |
||||||
|
return trayService.getAllByWarehouseId(oldWarehouseId); |
||||||
|
} |
||||||
|
} |
@ -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<CargoEntity> { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.logpm.oldproject.mapper.CargoMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -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<LocationEntity> { |
||||||
|
|
||||||
|
Map<String, Integer> getStoreyAndRowByShelfId(@Param("shelfId") Integer oldShelfId); |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.logpm.oldproject.mapper.LocationMapper"> |
||||||
|
|
||||||
|
|
||||||
|
<select id="getStoreyAndRowByShelfId" resultType="java.util.Map"> |
||||||
|
select max(l.floor) storey, |
||||||
|
max(l.`row`) row |
||||||
|
from ht_location l |
||||||
|
where l.shelf_id = #{shelfId} |
||||||
|
and l.delete_time = 0 |
||||||
|
and l.`status` = 1 |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
@ -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<ShelfEntity> { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.logpm.oldproject.mapper.ShelfMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -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<TrayEntity> { |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.logpm.oldproject.mapper.TrayMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,10 @@ |
|||||||
|
package com.logpm.oldproject.service; |
||||||
|
|
||||||
|
import com.logpm.oldproject.entity.CargoEntity; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface ICargoService { |
||||||
|
|
||||||
|
List<CargoEntity> getAllByWarehouseId(Integer oldWarehouseId); |
||||||
|
} |
@ -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<String, Integer> getStoreyAndRowByShelfId(Integer oldShelfId); |
||||||
|
|
||||||
|
List<LocationEntity> getAllByShelfId(Integer shelfId); |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
package com.logpm.oldproject.service; |
||||||
|
|
||||||
|
import com.logpm.oldproject.entity.ShelfEntity; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface IShelfService { |
||||||
|
List<ShelfEntity> getAllByWarehouseIdAndCargoId(Integer cargoId); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
package com.logpm.oldproject.service; |
||||||
|
|
||||||
|
import com.logpm.oldproject.entity.TrayEntity; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface ITrayService { |
||||||
|
|
||||||
|
|
||||||
|
List<TrayEntity> getAllByWarehouseId(Integer warehouseId); |
||||||
|
|
||||||
|
} |
@ -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<CargoEntity> getAllByWarehouseId(Integer oldWarehouseId) { |
||||||
|
QueryWrapper<CargoEntity> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("warehouse_id",oldWarehouseId) |
||||||
|
.eq("delete_time",0) |
||||||
|
.eq("status",1); |
||||||
|
return cargoMapper.selectList(queryWrapper); |
||||||
|
} |
||||||
|
} |
@ -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<String, Integer> getStoreyAndRowByShelfId(Integer oldShelfId) { |
||||||
|
return locationMapper.getStoreyAndRowByShelfId(oldShelfId); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<LocationEntity> getAllByShelfId(Integer shelfId) { |
||||||
|
QueryWrapper<LocationEntity> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("shelf_id",shelfId) |
||||||
|
.eq("delete_time",0) |
||||||
|
.eq("status",1); |
||||||
|
return locationMapper.selectList(queryWrapper); |
||||||
|
} |
||||||
|
} |
@ -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<ShelfEntity> getAllByWarehouseIdAndCargoId(Integer cargoId) { |
||||||
|
QueryWrapper<ShelfEntity> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("cargo_id",cargoId) |
||||||
|
.eq("status",1) |
||||||
|
.eq("delete_time",0); |
||||||
|
return shelfMapper.selectList(queryWrapper); |
||||||
|
} |
||||||
|
} |
@ -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<TrayEntity> getAllByWarehouseId(Integer warehouseId) { |
||||||
|
QueryWrapper<TrayEntity> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("warehouse_id",warehouseId) |
||||||
|
.eq("delete_time",0); |
||||||
|
|
||||||
|
return trayMapper.selectList(queryWrapper); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue