Browse Source

1.同步托盘信息接口

single_db
zhenghaoyu 1 year ago
parent
commit
8e94984c43
  1. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java
  2. 15
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/OrderPackageInfoVO.java
  3. 7
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseTrayTypeVO.java
  4. 71
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  5. 64
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java
  6. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayInfoDTO.java
  7. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.java
  8. 32
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml
  9. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IAsyncDataService.java
  10. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java
  11. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  12. 181
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java
  13. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  14. 88
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java

@ -58,7 +58,7 @@ public interface IWarehouseTrayTypeClient {
@PostMapping(API_PREFIX+"/orderScanOrderPackageCode")
boolean orderScanOrderPackageCode(@RequestBody Map<String, Object> map);
@PostMapping(API_PREFIX+"/orderScanOrderPackageCode")
@PostMapping(API_PREFIX+"/orderScanOrderPackageCodeReturnR")
R orderScanOrderPackageCodeReturnR(@RequestBody Map<String, Object> map);
@PostMapping(API_PREFIX+"/enterZeroOrderByTrayCode")

15
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/OrderPackageInfoVO.java

@ -0,0 +1,15 @@
package com.logpm.warehouse.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrderPackageInfoVO implements Serializable {
private String waybillNo;
private String orderCode;
private String orderPackageCode;
private Integer num;
}

7
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseTrayTypeVO.java

@ -4,6 +4,9 @@ import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class WarehouseTrayTypeVO extends WarehouseTrayTypeEntity {
@ -12,4 +15,8 @@ public class WarehouseTrayTypeVO extends WarehouseTrayTypeEntity {
private String trayName;
private List<OrderPackageInfoVO> packageList = new ArrayList<>();
}

71
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java

@ -1196,4 +1196,75 @@ public class WarehouseTrayTypeApiController {
}
//--------------------------------------------同步托盘数据
@ResponseBody
@PostMapping("/findSyncTrayData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询同步托盘数据", notes = "传入trayTypeDTO")
public R findSyncTrayData(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########findSyncTrayData: ";
log.info(method + "移托包件 trayTypeDTO={}", trayTypeDTO);
String trayCode = trayTypeDTO.getTrayCode();
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
return warehouseTrayTypeService.findSyncTrayData(trayCode,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/findSyncOldTrayData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询同步老系统托盘数据", notes = "传入trayTypeDTO")
public R findSyncOldTrayData(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########findSyncOldTrayData: ";
log.info(method + "移托包件 trayTypeDTO={}", trayTypeDTO);
String trayCode = trayTypeDTO.getTrayCode();
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
return warehouseTrayTypeService.findSyncOldTrayData(trayCode,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
}

64
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java

@ -3,13 +3,11 @@ package com.logpm.warehouse.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.warehouse.dto.TrayInfoDTO;
import com.logpm.warehouse.dto.WaybillDTO;
import com.logpm.warehouse.entity.WarehouseLog;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.service.IWarehouseLogService;
import com.logpm.warehouse.service.IWarehouseTaryAllocationService;
import com.logpm.warehouse.service.IWarehouseTrayTypeService;
import com.logpm.warehouse.service.IWarehouseUpdownTypeService;
import com.logpm.warehouse.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -18,6 +16,7 @@ import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -41,11 +40,13 @@ public class OldSystemPushController {
private final IWarehouseTaryAllocationService taryAllocationService;
private final IWarehouseLogService warehouseLogService;
private final RabbitTemplate rabbitTemplate;
private final IAsyncDataService asyncDataService;
// private final IWarehouseWaybillService warehouseWaybillService;
//
// private final IDistributionStockArticleClient distributionStockArticleClient;
/**
* 该接口需老系统判断这个运单的开单为 当前仓和始发仓为相同才进行推送
* @param waybillDTOS
@ -137,7 +138,60 @@ public class OldSystemPushController {
}
@ResponseBody
@PostMapping("/sendTrayInfoByOrderPackageCode")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "老系统推送打托数据", notes = "传入waybillDTO")
public R sendTrayInfoByOrderPackageCode(@RequestBody TrayInfoDTO trayInfoDTO) {
log.info("############sendTrayInfoByOrderPackageCode: 请求参数{}",trayInfoDTO);
try{
Integer trayId = trayInfoDTO.getTrayId();
Integer oldWarehouseId = trayInfoDTO.getWarehouseId();
String orderPackageCode = trayInfoDTO.getOrderPackageCode();
Integer type = trayInfoDTO.getType();
if(Objects.isNull(trayId)){
log.warn("##############sendTrayInfoByOrderPackageCode: 托盘id不存在 trayId={}",trayId);
return R.fail(405,"托盘id不存在");
}
if(Objects.isNull(oldWarehouseId)){
log.warn("##############sendTrayInfoByOrderPackageCode: 老系统仓库id不存在 oldWarehouseId={}",oldWarehouseId);
return R.fail(405,"老系统仓库id不存在");
}
if(StringUtil.isBlank(orderPackageCode)){
log.warn("##############sendTrayInfoByOrderPackageCode: 包件码不存在 orderPackageCode={}",orderPackageCode);
return R.fail(405,"包件码不存在");
}
if(Objects.isNull(type)){
log.warn("##############sendTrayInfoByOrderPackageCode: 打托方式不存在 type={}",type);
return R.fail(405,"打托方式不存在");
}
//先保存原始请求数据
WarehouseLog warehouseLog = new WarehouseLog();
warehouseLog.setArgs(JSONObject.toJSONString(trayInfoDTO));
warehouseLog.setStatus(0);
warehouseLog.setType(2);
warehouseLogService.save(warehouseLog);
asyncDataService.sendTrayInfoByOrderPackageCode(trayInfoDTO);
warehouseLog.setStatus(1);
warehouseLogService.updateById(warehouseLog);
return R.success("操作成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}

15
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayInfoDTO.java

@ -0,0 +1,15 @@
package com.logpm.warehouse.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class TrayInfoDTO implements Serializable {
private Integer trayId;
private Integer warehouseId;
private String orderPackageCode;
private Integer type;
}

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.java

@ -74,4 +74,10 @@ public interface WarehouseTrayGoodsMapper extends BaseMapper<WarehouseTrayGoodsE
* @return
*/
String getTrayInfoByInventory(@Param("marketId") Long marketId,@Param("cargoNumber") String cargoNumber);
List<OrderPackageInfoVO> findOrderPackageCodeInfoList(@Param("trayCode") String trayCode);
List<OrderPackageInfoVO> findZeroOrderInfoList(@Param("trayCode") String trayCode);
List<OrderPackageInfoVO> findStockInfoList(@Param("trayCode") String trayCode);
}

32
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml

@ -349,5 +349,37 @@
where tray_type_id = #{trayTypeId}
</update>
<select id="findOrderPackageCodeInfoList" resultType="com.logpm.warehouse.vo.OrderPackageInfoVO">
select lwtg.association_value orderPackageCode,
ldpl.waybill_number waybillNo,
ldpl.order_code orderCode,
lwtg.num num
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_parcel_list ldpl on ldpl.order_package_code = lwtg.association_value
where lwtg.tray_code = #{tray_code}
and lwtg.association_type = '3'
</select>
<select id="findZeroOrderInfoList" resultType="com.logpm.warehouse.vo.OrderPackageInfoVO">
select lwtg.association_value orderCode,
ldsa.waybill_number waybillNo,
lwtg.num num
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_stock_article ldsa on ldsa.order_code = lwtg.association_value
where lwtg.tray_code = #{tray_code}
and lwtg.association_type = '1'
</select>
<select id="findStockInfoList" resultType="com.logpm.warehouse.vo.OrderPackageInfoVO">
select lwtg.association_value orderCode,
lwtg.market_name waybillNo,
lwtg.association_value orderPackageCode,
lwtg.num num
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_stock_list ldsl on ldsl.incoming_batch = lwtg.incoming_batch and ldsl.cargo_number = lwtg.association_value and ldsl.market_name = lwtg.market_name
where lwtg.tray_code = #{tray_code}
and lwtg.association_type = '4'
</select>
</mapper>

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IAsyncDataService.java

@ -1,7 +1,11 @@
package com.logpm.warehouse.service;
import com.logpm.warehouse.dto.TrayInfoDTO;
public interface IAsyncDataService {
void syncTaskData(String questNum, Long warehouseId);
void sendTrayInfoByOrderPackageCode(TrayInfoDTO trayInfoDTO);
}

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java

@ -100,4 +100,10 @@ public interface IWarehouseTrayGoodsService extends BaseService<WarehouseTrayGoo
* @return
*/
String getTrayInfoByInventory(Long marketId, String cargoNumber);
List<OrderPackageInfoVO> findOrderPackageCodeInfoList(String trayCode);
List<OrderPackageInfoVO> findZeroOrderInfoList(String trayCode);
List<OrderPackageInfoVO> findStockInfoList(String trayCode);
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -96,4 +96,8 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
List<JSONObject> findAllGoodsByTrayCodeAndWarehouseId(String trayCode, Long warehouseId);
void changeTrayWarehouseInfo(String trayCode, Long warehouseId);
R findSyncTrayData(String trayCode, Long warehouseId);
R findSyncOldTrayData(String trayCode, Long warehouseId);
}

181
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java

@ -4,16 +4,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.basicdata.feign.IBasicdataGoodsShelfClient;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.feign.IDistributionStockListClient;
import com.logpm.warehouse.dto.UpShelfPackageDTO;
import com.logpm.warehouse.dto.UpShelfStockDTO;
import com.logpm.warehouse.dto.UpShelfZeroOrderDTO;
import com.logpm.warehouse.dto.ZeroOrderVO;
import com.logpm.oldproject.entity.TrayEntity;
import com.logpm.oldproject.feign.ITrayClient;
import com.logpm.oldproject.feign.ITrayScanClient;
import com.logpm.oldproject.feign.ITrayScanDesClient;
import com.logpm.warehouse.dto.*;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.service.*;
@ -60,6 +65,16 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
private IDistributionStockArticleClient distributionStockArticleClient;
@Autowired
private IDistributionStockListClient distributionStockListClient;
@Autowired
private IBasicdataWarehouseClient basicdataWarehouseClient;
@Autowired
private IBasicdataTrayClient basicdataTrayClient;
@Autowired
private ITrayClient trayClient;
@Autowired
private ITrayScanClient trayScanClient;
@Autowired
private ITrayScanDesClient trayScanDesClient;
@Override
@Async
@ -298,6 +313,164 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
log.info("################syncTaskData: 处理完成");
}
@Override
public void sendTrayInfoByOrderPackageCode(TrayInfoDTO trayInfoDTO) {
Integer trayId = trayInfoDTO.getTrayId();
String orderPackageCode = trayInfoDTO.getOrderPackageCode();
Integer oldWarehouseId = trayInfoDTO.getWarehouseId();
Integer type = trayInfoDTO.getType();
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(oldWarehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("####################sendTrayInfoByOrderPackageCode: 仓库信息为空 basicdataWarehouseEntity={}",basicdataWarehouseEntity);
throw new CustomerException(405,"仓库信息为空");
}
Long newWarehouseId = basicdataWarehouseEntity.getId();
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode("T" + trayId);
if(Objects.isNull(basicdataTrayEntity)){
log.info("############sendTrayInfoByOrderPackageCode: 托盘信息不存在 同步");
//如果托盘不存在就去同步该托盘
TrayEntity trayEntity = trayClient.getTrayById(trayId);
basicdataTrayEntity = new BasicdataTrayEntity();
basicdataTrayEntity.setTenantId("627683");
basicdataTrayEntity.setCreateUser(1714696768639311873L);
basicdataTrayEntity.setUpdateUser(1714696768639311873L);
basicdataTrayEntity.setCreateDept(1649331096241836033L);
basicdataTrayEntity.setPalletName(trayEntity.getTrayNo());
basicdataTrayEntity.setPalletCode("T"+trayEntity.getId());
basicdataTrayEntity.setWarehouseId(newWarehouseId);
basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+"");
basicdataTrayEntity.setType(1);
basicdataTrayEntity.setOldId(trayId);
// basicdataTrayEntity.setNowWarehouseId(nowNewWarehouseId);
Long aLong = basicdataTrayClient.addTray(basicdataTrayEntity);
basicdataTrayEntity.setId(aLong);
}
// TrayScanDesEntity trayScanDesEntity = trayScanDesClient.findScanTypeId(trayId, orderPackageCode, oldWarehouseId);
// if(Objects.isNull(trayScanDesEntity)){
// log.warn("####################sendTrayInfoByOrderPackageCode: 没有打托数据 trayId={}",trayId);
// throw new CustomerException(405,"没有打托数据");
// }
// Integer trayScanId = trayScanDesEntity.getTrayScanId();
// TrayScanEntity trayScanEntity = trayScanClient.getEntityByTrayScanId(trayScanId);
// if(Objects.isNull(trayScanEntity)){
// log.warn("####################sendTrayInfoByOrderPackageCode: 没有打托方式数据 trayScanId={}",trayScanId);
// throw new CustomerException(405,"没有打托方式数据");
// }
// Integer trayType = trayScanEntity.getType();
String newTrayType = "100";
if(1==type){
newTrayType = "60";
}else if(2==type){
newTrayType = "30";
}else if(3==type){
newTrayType = "50";
}else if(4==type){
newTrayType = "100";
}else if(5==type){
newTrayType = "10";
}else if(6==type){
newTrayType = "20";
}
//判断托盘是否有上架
Long allocationId = taryAllocationService.getAllocationIdByTrayId(basicdataTrayEntity.getId());
if(Objects.isNull(allocationId)){
//没有上架就直接打托
R response = trayTypeService.orderScanOrderPackageCode(newTrayType,"T"+trayId,orderPackageCode,newWarehouseId);
int code = response.getCode();
String msg = response.getMsg();
if(code == 4001){
log.info("####################sendTrayInfoByOrderPackageCode: 包件已在当前托盘打托 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId);
}else if(code == 4002){
log.info("####################sendTrayInfoByOrderPackageCode: 包件已在其他托盘打托 orderPackageCode={} ",orderPackageCode);
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsEntityQueryWrapper = new QueryWrapper<>();
trayGoodsEntityQueryWrapper.eq("association_value",orderPackageCode);
WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getOne(trayGoodsEntityQueryWrapper);
if(Objects.isNull(trayGoodsEntity)){
log.warn("####################sendTrayInfoByOrderPackageCode: 包件未打托 orderPackageCode={}",orderPackageCode);
}else{
String oldTrayCode = trayGoodsEntity.getTrayCode();
Long trayGoodsId = trayGoodsEntity.getId();
Long wid = trayGoodsEntity.getWarehouseId();
BasicdataTrayEntity oldTrayEntity = basicdataTrayClient.getTrayByTrayCode(oldTrayCode);
Long oldTrayId = oldTrayEntity.getId();
//判断托盘是否有上架
Long oldAllocationId = taryAllocationService.getAllocationIdByTrayId(oldTrayId);
if (Objects.isNull(oldAllocationId)){
//没有上架
//直接解绑托盘
trayGoodsService.deleteByTrayGoodsId(trayGoodsId,wid);
}else{
//有上架
//下架
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.downPackage(upShelfPackageList,wid);
}
}
R r = trayTypeService.orderScanOrderPackageCode(newTrayType,"T"+trayId,orderPackageCode,newWarehouseId);
int code1 = r.getCode();
if(code1 != 200){
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId);
}else{
log.info("####################orderStatusHandler: 二次打托成功 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId);
}
}else if(code == 4003){
log.info("####################orderStatusHandler: 包件未打托已上架 orderPackageCode={} ",orderPackageCode);
QueryWrapper<WarehouseUpdownGoodsEntity> updownGoodsEntityQueryWrapper = new QueryWrapper<>();
updownGoodsEntityQueryWrapper.eq("association_value", orderPackageCode);
WarehouseUpdownGoodsEntity updownGoodsEntity = updownGoodsService.getOne(updownGoodsEntityQueryWrapper);
if(Objects.isNull(updownGoodsEntity)){
log.warn("####################orderStatusHandler: 包件未上架 orderPackageCode={}",orderPackageCode);
}else{
Long wid = updownGoodsEntity.getWarehouseId();
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.downPackage(upShelfPackageList,wid);
}
R r = trayTypeService.orderScanOrderPackageCode(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId);
int code1 = r.getCode();
if(code1 != 200){
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId);
}else{
log.info("####################orderStatusHandler: 二次打托成功 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId);
}
}else if(code == 4004){
log.info("####################orderStatusHandler: 包件打托方式不正确 orderPackageCode={} ",orderPackageCode);
//先去空置托盘再打托
trayTypeService.trayToNull("T"+trayId);
R r = trayTypeService.orderScanOrderPackageCode(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId);
int code1 = r.getCode();
if(code1 != 200){
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId);
}
}else{
log.warn("######################orderStatusHandler: 打托失败 msg={} code={}",msg,code);
log.warn("######################orderStatusHandler: 打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId);
}
}else{
//有上架就上架
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.upShelfPackage(upShelfPackageList,allocationId,newWarehouseId);
}
}
private void dealWithStockTray(String materialCode, String marketName, String incomingBatch, Integer stockNum, String trayCode, String trayType, Long warehouseId) {
log.info("#############dealWithStockTray: 处理库存品的打托");

15
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java

@ -292,6 +292,21 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
return baseMapper.getTrayInfoByInventory(marketId,cargoNumber);
}
@Override
public List<OrderPackageInfoVO> findOrderPackageCodeInfoList(String trayCode) {
return baseMapper.findOrderPackageCodeInfoList(trayCode);
}
@Override
public List<OrderPackageInfoVO> findZeroOrderInfoList(String trayCode) {
return baseMapper.findZeroOrderInfoList(trayCode);
}
@Override
public List<OrderPackageInfoVO> findStockInfoList(String trayCode) {
return baseMapper.findStockInfoList(trayCode);
}
@Override
public Boolean deleteByMasterId(Long masterId) {
int delete = baseMapper.delete(new QueryWrapper<WarehouseTrayGoodsEntity>().lambda()

88
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -16,10 +16,16 @@ import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.feign.IDistributionStockListClient;
import com.logpm.oldproject.entity.TrayScanDesEntity;
import com.logpm.oldproject.feign.ITrayScanClient;
import com.logpm.oldproject.feign.ITrayScanDesClient;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.TrayTypeDTO;
import com.logpm.warehouse.dto.ZeroOrderVO;
import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseTrayGoodsLogEntity;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.mapper.WarehouseTrayTypeMapper;
import com.logpm.warehouse.service.*;
import com.logpm.warehouse.vo.*;
@ -66,6 +72,10 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
private IWarehouseUpdownGoodsService warehouseUpdownGoodsService;
@Autowired
private IBasicdataWarehouseClient basicdataWarehouseClient;
@Autowired
private ITrayScanDesClient trayScanDesClient;
@Autowired
private ITrayScanClient trayScanClient;
@Override
public IPage<WarehouseTrayTypeVO> orderPageList(TrayTypeDTO trayTypeDTO,Long warehouseId) {
@ -2740,6 +2750,82 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
@Override
public R findSyncTrayData(String trayCode, Long warehouseId) {
WarehouseTrayTypeVO trayTypeVO = new WarehouseTrayTypeVO();
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
log.warn("###########findSyncTrayData: 托盘信息不存在 trayCode={}",trayCode);
return R.fail(405,"托盘信息不存在");
}
Long trayId = trayEntity.getId();
Long allocationId = warehouseTaryAllocationService.getAllocationIdByTrayId(trayId);
if(!Objects.isNull(allocationId)){
log.warn("###########findSyncTrayData: 托盘还未下架 trayCode={}",trayCode);
return R.fail(405,"托盘还未下架");
}
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectOne(queryWrapper);
if(Objects.isNull(trayTypeEntity)){
trayTypeVO.setTrayName(trayEntity.getPalletName());
trayTypeVO.setTrayCode(trayCode);
trayTypeVO.setTotalNum(0);
trayTypeVO.setOrderTotalNum(0);
trayTypeVO.setStockNum(0);
trayTypeVO.setStockTotalNum(0);
}else{
BeanUtil.copy(trayTypeEntity,trayTypeVO);
trayTypeVO.setTrayName(trayEntity.getPalletName());
}
List<OrderPackageInfoVO> packageList = warehouseTrayGoodsService.findOrderPackageCodeInfoList(trayCode);
List<OrderPackageInfoVO> zeroList = warehouseTrayGoodsService.findZeroOrderInfoList(trayCode);
List<OrderPackageInfoVO> stockList = warehouseTrayGoodsService.findStockInfoList(trayCode);
packageList.addAll(zeroList);
packageList.addAll(stockList);
trayTypeVO.setPackageList(packageList);
return R.data(trayTypeVO);
}
@Override
public R findSyncOldTrayData(String trayCode, Long warehouseId) {
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("###########findSyncTrayData: 仓库信息不存在 warehouseId={}",warehouseId);
return R.fail(405,"仓库信息不存在");
}
Integer oldWarehouseId = basicdataWarehouseEntity.getOldId();
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
log.warn("###########findSyncTrayData: 托盘信息不存在 trayCode={}",trayCode);
return R.fail(405,"托盘信息不存在");
}
Integer oldTrayId = trayEntity.getOldId();
//查询所有托盘包件信息
Set<String> set = new TreeSet<>();
List<TrayScanDesEntity> trayScanDesEntityList = trayScanDesClient.findListByTrayId(oldTrayId, oldWarehouseId);
for (TrayScanDesEntity trayScanDesEntity : trayScanDesEntityList) {
String orderPackageCode = trayScanDesEntity.getUnitNo();
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if(Objects.isNull(parcelListEntity)){
set.add(trayScanDesEntity.getOrderSelfNum());
}
}
return null;
}
private R moveTrayOrderPackageCode(WarehouseTrayTypeEntity trayTypeEntity, String orderPackageCode) {
Long wid = trayTypeEntity.getWarehouseId();

Loading…
Cancel
Save