Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
caoyizhong 1 year ago
parent
commit
f0e705d7d7
  1. 48
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/InventoryEntity.java
  2. 22
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IInventoryClient.java
  3. 6
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IInventoryDetailClient.java
  4. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayScanDesClient.java
  5. 5
      blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java
  6. 1
      blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/OrderSyncRecordEntity.java
  7. 17
      blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/SyncInventoryEntity.java
  8. 2
      blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/WarehouseMappingDataEntity.java
  9. 70
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  10. 20
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/InventoryClient.java
  11. 12
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/InventoryDetailClient.java
  12. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayScanDesClient.java
  13. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/InventoryDetailMapper.java
  14. 8
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/InventoryDetailMapper.xml
  15. 12
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/InventoryMapper.java
  16. 7
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IInventoryDetailService.java
  17. 7
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IInventoryService.java
  18. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayScanDesService.java
  19. 13
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/InventoryDetailServiceImpl.java
  20. 25
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/InventoryServiceImpl.java
  21. 9
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayScanDesServiceImpl.java
  22. 89
      blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncInventoryController.java
  23. 3
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  24. 5
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncInventoryMapper.java
  25. 17
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncInventoryMapper.xml
  26. 10
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IAsyncDataService.java
  27. 8
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncInventoryService.java
  28. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java
  29. 139
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java
  30. 81
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncInventoryServiceImpl.java
  31. 56
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

48
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/InventoryEntity.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 lombok.Data;
import java.util.Date;
@Data
@TableName("ht_inventory")
@ApiModel(value = "Inventory对象", description = "盘点任务")
public class InventoryEntity {
@TableId(
value = "id",
type = IdType.AUTO
)
private Integer id;
private String no;
private Integer storeId;
private String storeName;
private String brandId;
private String brand;
private Date startDate;
private Date endDate;
private Integer administratorsId;
private Integer warehouseId;
private Integer status;
private Date createTime;
private Date updateTime;
private Integer deleteTime;
}

22
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IInventoryClient.java

@ -0,0 +1,22 @@
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.InventoryEntity;
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;
@FeignClient(
value = ModuleNameConstant.APPLICATION_OLDPROJECT_NAME
)
public interface IInventoryClient {
String API_PREFIX = "/inventory/client";
@GetMapping(API_PREFIX + "/findEntityByWarehouseIdAndNo")
InventoryEntity findEntityByWarehouseIdAndNo(@RequestParam Integer oldId, @RequestParam String inventoryNo);
// @GetMapping(API_PREFIX + "/getEntityByOrderCode")
// OrderCountEntity getEntityByOrderCode(@RequestParam String orderCode, @RequestParam Integer oldWarehouseId);
}

6
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IInventoryDetailClient.java

@ -16,13 +16,13 @@ public interface IInventoryDetailClient {
String API_PREFIX = "/inventoryDetail/client";
@GetMapping(API_PREFIX + "/findOrderIsExist")
InventoryDetailEntity findOrderIsExist(@RequestParam String orderCode);
InventoryDetailEntity findOrderIsExist(@RequestParam String orderCode,@RequestParam Integer inventoryId);
@GetMapping(API_PREFIX + "/findUnitNoIsExist")
InventoryDetailEntity findUnitNoIsExist(@RequestParam String unitNo);
InventoryDetailEntity findUnitNoIsExist(@RequestParam String unitNo,@RequestParam Integer inventoryId);
@GetMapping(API_PREFIX + "/findAllTrayType")
List<InventoryDetailEntity> findAllTrayType();
List<InventoryDetailEntity> findAllTrayType(@RequestParam String orderCode,@RequestParam Integer inventoryId);
// @GetMapping(API_PREFIX + "/getEntityByOrderCode")

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayScanDesClient.java

@ -24,6 +24,9 @@ public interface ITrayScanDesClient {
@GetMapping(API_PREFIX + "/findScanTypeId")
TrayScanDesEntity findScanTypeId(@RequestParam Integer trayId, @RequestParam String unitNo, @RequestParam Integer oldWarehouseId);
@GetMapping(API_PREFIX + "/findEntityByUnitNoAndWarehouseId")
TrayScanDesEntity findEntityByUnitNoAndWarehouseId(@RequestParam String unitNo, @RequestParam Integer oldWarehouseId);
// @GetMapping(API_PREFIX + "/getEntityByOrderCode")
// OrderCountEntity getEntityByOrderCode(@RequestParam String orderCode, @RequestParam Integer oldWarehouseId);
}

5
blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java

@ -7,6 +7,11 @@ import java.io.Serializable;
@Data
public class SyncInventoryDTO implements Serializable {
private Integer pageNum;
private Integer pageSize;
private String inventoryNo;//盘点任务编码
private Long warehouseId;
}

1
blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/OrderSyncRecordEntity.java

@ -17,5 +17,6 @@ public class OrderSyncRecordEntity extends BaseEntity {
private Integer finishNum;
private Integer syncStatus;
private Integer type;
private Integer inventoryId;
}

17
blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/SyncInventoryEntity.java

@ -1,11 +1,13 @@
package com.logpm.patch.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -50,9 +52,21 @@ public class SyncInventoryEntity extends TenantEntity {
private Integer inventoryId;
@ApiModelProperty(value = "同步开始时间")
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private Date syncStartDate;
@ApiModelProperty(value = "同步结束时间")
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private Date syncEndDate;
@ApiModelProperty(value = "同步状态 0未开始 1同步中 2同步完成 3同步异常")
@ -64,4 +78,7 @@ public class SyncInventoryEntity extends TenantEntity {
@ApiModelProperty(value = "老系统仓库id")
private Integer oldWarehouseId;
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
}

2
blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/WarehouseMappingDataEntity.java

@ -21,4 +21,6 @@ public class WarehouseMappingDataEntity {
private Long newWarehouseId;
private Integer inventoryId;
}

70
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -35,12 +35,11 @@ import com.logpm.factory.snm.entity.OrderStatusLog;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.entity.PanPackageInfo;
import com.logpm.factory.snm.entity.PanPackageList;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.entity.AdvanceEntity;
import com.logpm.oldproject.entity.WayBillEntity;
import com.logpm.oldproject.entity.*;
import com.logpm.oldproject.feign.*;
import com.logpm.oldproject.vo.DistributionParcelListEntityVO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
@ -90,6 +89,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private final IBasicMaterialClient basicMaterialClient;
private final ITrayScanDesClient trayScanDesClient;
private final ITrayScanClient trayScanClient;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
// @Override
// public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException {
//
@ -365,6 +368,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// 查询数据对应的仓库名称
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse);
if(Objects.isNull(basicdataWarehouseEntity)){
logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse);
throw new CustomerException(405, "仓库信息不存在");
}
//判断新系统是否有这条订单数据
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findByAdvanceId(advanceId);
@ -507,6 +514,15 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//保存包件信息
saveOrderPackage(unitNo, distributionStockArticleEntity, basicdataWarehouseEntity, waybillNoNum,operationTime);
//---------------------2023-10-20 17:23:00 增加打托数据
Integer oldId = basicdataWarehouseEntity.getOldId();
Long warehouseEntityId = basicdataWarehouseEntity.getId();
try{
saveTrayTypeInfoPackage(unitNo,oldId,warehouseEntityId);
}catch (Exception e){
logger.error("################handleDataToPlatform: unitNo={} 打托失败",unitNo);
}
String waybillNumber = distributionStockArticleEntity.getWaybillNumber();
if(!waybillNumber.contains(waybillNoNum)){
waybillNumber = waybillNumber+","+waybillNoNum;
@ -538,6 +554,54 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
}
}
private void saveTrayTypeInfoPackage(String unitNo,Integer oldWarehouseId,Long newWarehouseId) {
//如果是订制品就先查询该订单有哪些包件打了托
TrayScanDesEntity entity = trayScanDesClient.findEntityByUnitNoAndWarehouseId(unitNo,oldWarehouseId);
Integer trayScanId = entity.getTrayScanId();
//查询打托方式信息
TrayScanEntity trayScanEntity = trayScanClient.getEntityByTrayScanId(trayScanId);
Integer type = trayScanEntity.getType();
Integer trayId = trayScanEntity.getTrayId();
String customerName = trayScanEntity.getCustomerName();
String customerPhone = trayScanEntity.getCustomerPhone();
//方式:1=仓,2=商场,3=客户,4=其他,5=服务号,6=合同号
//方式:60=仓,30=商场,50=客户,100=其他,10=服务号,20=合同号
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";
}
Map<String,Object> map = new HashMap<>();
map.put("trayType",newTrayType);
map.put("trayCode","T"+trayId);
map.put("warehouseId",newWarehouseId);
map.put("orderPackageCode",unitNo);
//新系统保存打托方式
boolean b = warehouseTrayTypeClient.orderScanOrderPackageCode(map);
if(!b){
logger.error("################saveTrayTypeInfoPackage: 包件打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
// throw new CustomerException(403,"包件打托失败");
}
}
/**
* 根据订单的在库数联返回订单的状态
* @param distributionStockArticleEntity 订单对象

20
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/InventoryClient.java

@ -0,0 +1,20 @@
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.InventoryEntity;
import com.logpm.oldproject.service.IInventoryService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class InventoryClient implements IInventoryClient{
private final IInventoryService inventoryService;
@Override
public InventoryEntity findEntityByWarehouseIdAndNo(Integer oldId, String inventoryNo) {
return inventoryService.findEntityByWarehouseIdAndNo(oldId,inventoryNo);
}
}

12
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/InventoryDetailClient.java

@ -16,17 +16,17 @@ public class InventoryDetailClient implements IInventoryDetailClient{
private final IInventoryDetailService inventoryDetailService;
@Override
public InventoryDetailEntity findOrderIsExist(String orderCode) {
return inventoryDetailService.findOrderIsExist(orderCode);
public InventoryDetailEntity findOrderIsExist(String orderCode,Integer inventoryId) {
return inventoryDetailService.findOrderIsExist(orderCode,inventoryId);
}
@Override
public InventoryDetailEntity findUnitNoIsExist(String unitNo) {
return inventoryDetailService.findUnitNoIsExist(unitNo);
public InventoryDetailEntity findUnitNoIsExist(String unitNo,Integer inventoryId) {
return inventoryDetailService.findUnitNoIsExist(unitNo,inventoryId);
}
@Override
public List<InventoryDetailEntity> findAllTrayType() {
return inventoryDetailService.findAllTrayType();
public List<InventoryDetailEntity> findAllTrayType(String orderCode,Integer inventoryId) {
return inventoryDetailService.findAllTrayType(orderCode,inventoryId);
}
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayScanDesClient.java

@ -29,4 +29,9 @@ public class TrayScanDesClient implements ITrayScanDesClient {
public TrayScanDesEntity findScanTypeId(Integer trayId, String unitNo, Integer oldWarehouseId) {
return trayScanDesService.findScanTypeId(trayId,unitNo,oldWarehouseId);
}
@Override
public TrayScanDesEntity findEntityByUnitNoAndWarehouseId(String unitNo, Integer oldWarehouseId) {
return trayScanDesService.findEntityByUnitNoAndWarehouseId(unitNo,oldWarehouseId);
}
}

6
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/InventoryDetailMapper.java

@ -9,9 +9,9 @@ import java.util.List;
@Mapper
public interface InventoryDetailMapper extends BaseMapper<InventoryDetailEntity> {
InventoryDetailEntity findOrderIsExist(@Param("orderCode") String orderCode);
InventoryDetailEntity findOrderIsExist(@Param("orderCode") String orderCode,@Param("inventoryId") Integer inventoryId);
InventoryDetailEntity findUnitNoIsExist(@Param("unitNo") String unitNo);
InventoryDetailEntity findUnitNoIsExist(@Param("unitNo") String unitNo,@Param("inventoryId") Integer inventoryId);
List<InventoryDetailEntity> findAllTrayType();
List<InventoryDetailEntity> findAllTrayType(@Param("orderCode") String orderCode,@Param("inventoryId") Integer inventoryId);
}

8
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/InventoryDetailMapper.xml

@ -5,7 +5,7 @@
<select id="findOrderIsExist" resultType="com.logpm.oldproject.entity.InventoryDetailEntity">
select *
from ht_inventory_detail
where inventory_id in (185,187,188,189)
where inventory_id = #{inventoryId}
and orderSelfNum = #{orderCode}
and status = 2
and delete_time = 0
@ -15,7 +15,7 @@
<select id="findUnitNoIsExist" resultType="com.logpm.oldproject.entity.InventoryDetailEntity">
select *
from ht_inventory_detail
where inventory_id in (185,187,188,189)
where inventory_id = #{inventoryId}
and unitNo = #{unitNo}
and status = 2
and delete_time = 0
@ -27,14 +27,14 @@
select unitNo unitNo,
tray_id trayId
from ht_inventory_detail
where inventory_id in (185,187,188,189)
where inventory_id = #{inventoryId}
and orderSelfNum = #{orderCode}
and tray_id != 0
and unitNo != '10215486=027916'
and status = 2
and delete_time = 0
group by unitNo,
tray_id
</select>
</mapper>

12
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/InventoryMapper.java

@ -0,0 +1,12 @@
package com.logpm.oldproject.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.oldproject.entity.InventoryEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface InventoryMapper extends BaseMapper<InventoryEntity> {
}

7
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IInventoryDetailService.java

@ -7,9 +7,10 @@ import java.util.List;
public interface IInventoryDetailService {
InventoryDetailEntity findOrderIsExist(String orderCode);
InventoryDetailEntity findOrderIsExist(String orderCode,Integer inventoryId);
InventoryDetailEntity findUnitNoIsExist(String unitNo);
InventoryDetailEntity findUnitNoIsExist(String unitNo,Integer inventoryId);
List<InventoryDetailEntity> findAllTrayType(String orderCode,Integer inventoryId);
List<InventoryDetailEntity> findAllTrayType();
}

7
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IInventoryService.java

@ -0,0 +1,7 @@
package com.logpm.oldproject.service;
import com.logpm.oldproject.entity.InventoryEntity;
public interface IInventoryService {
InventoryEntity findEntityByWarehouseIdAndNo(Integer oldId, String inventoryNo);
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayScanDesService.java

@ -10,4 +10,6 @@ public interface ITrayScanDesService {
List<TrayScanDesEntity> findZeroListByOrderCodeAndWarehouseId(String orderCode, Integer oldWarehouseId);
TrayScanDesEntity findScanTypeId(Integer trayId, String unitNo, Integer oldWarehouseId);
TrayScanDesEntity findEntityByUnitNoAndWarehouseId(String unitNo, Integer oldWarehouseId);
}

13
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/InventoryDetailServiceImpl.java

@ -15,17 +15,18 @@ public class InventoryDetailServiceImpl implements IInventoryDetailService {
private final InventoryDetailMapper inventoryDetailMapper;
@Override
public InventoryDetailEntity findOrderIsExist(String orderCode) {
return inventoryDetailMapper.findOrderIsExist(orderCode);
public InventoryDetailEntity findOrderIsExist(String orderCode,Integer inventoryId) {
return inventoryDetailMapper.findOrderIsExist(orderCode,inventoryId);
}
@Override
public InventoryDetailEntity findUnitNoIsExist(String unitNo) {
return inventoryDetailMapper.findUnitNoIsExist(unitNo);
public InventoryDetailEntity findUnitNoIsExist(String unitNo,Integer inventoryId) {
return inventoryDetailMapper.findUnitNoIsExist(unitNo,inventoryId);
}
@Override
public List<InventoryDetailEntity> findAllTrayType() {
return inventoryDetailMapper.findAllTrayType();
public List<InventoryDetailEntity> findAllTrayType(String orderCode,Integer inventoryId) {
return inventoryDetailMapper.findAllTrayType(orderCode,inventoryId);
}
}

25
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/InventoryServiceImpl.java

@ -0,0 +1,25 @@
package com.logpm.oldproject.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.oldproject.entity.InventoryEntity;
import com.logpm.oldproject.mapper.InventoryMapper;
import com.logpm.oldproject.service.IInventoryService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class InventoryServiceImpl implements IInventoryService {
private final InventoryMapper inventoryMapper;
@Override
public InventoryEntity findEntityByWarehouseIdAndNo(Integer oldId, String inventoryNo) {
QueryWrapper<InventoryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("warehouse_id",oldId)
.eq("no",inventoryNo)
.eq("delete_time",0);
return inventoryMapper.selectOne(queryWrapper);
}
}

9
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayScanDesServiceImpl.java

@ -38,4 +38,13 @@ public class TrayScanDesServiceImpl implements ITrayScanDesService {
.eq("unitNo",unitNo);
return trayScanDesMapper.selectOne(queryWrapper);
}
@Override
public TrayScanDesEntity findEntityByUnitNoAndWarehouseId(String unitNo, Integer oldWarehouseId) {
QueryWrapper<TrayScanDesEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("now_warehouse_id",oldWarehouseId)
.eq("type",1)
.eq("unitNo",unitNo);
return trayScanDesMapper.selectOne(queryWrapper);
}
}

89
blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncInventoryController.java

@ -16,12 +16,24 @@
*/
package com.logpm.patch.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.patch.dto.SyncInventoryDTO;
import com.logpm.patch.entity.SyncInventoryEntity;
import com.logpm.patch.service.ISyncInventoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
/**
* 库存品条码记录表 控制器
@ -29,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author zhy
* @since 2023-10-20
*/
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/syncInventory")
@ -36,39 +49,61 @@ import org.springframework.web.bind.annotation.RestController;
public class SyncInventoryController extends BladeController {
private final ISyncInventoryService syncInventoryService;
private final IBasicdataWarehouseClient warehouseClient;
/**
* 库存品条码记录表 详情
*/
// @GetMapping("/detail")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "详情", notes = "传入disStockListDetail")
// public R<DisStockListDetailEntity> detail(DisStockListDetailEntity disStockListDetail) {
// DisStockListDetailEntity detail = disStockListDetailService.getOne(Condition.getQueryWrapper(disStockListDetail));
// return R.data(detail);
// }
/**
* 库存品条码记录表 分页
* 同步老系统盘点数据 分页
*/
// @PostMapping("/list")
// @ApiOperationSupport(order = 2)
// @ApiOperation(value = "分页", notes = "传入disStockListDetail")
// public R<IPage<SyncInventoryEntity>> list(@RequestParam SyncInventoryDTO syncInventoryDTO) {
// IPage<SyncInventoryEntity> pages = syncInventoryService.page(Condition.getPage(query), Condition.getQueryWrapper(disStockListDetail, DisStockListDetailEntity.class));
// return R.data(pages);
// }
@ResponseBody
@PostMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入disStockListDetail")
public R<IPage<SyncInventoryEntity>> list(@RequestBody SyncInventoryDTO syncInventoryDTO) {
String method = "############list: ";
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
syncInventoryDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<SyncInventoryEntity> pages = syncInventoryService.pageList(syncInventoryDTO);
return R.data(pages);
}
/**
* 库存品条码记录表 新增或修改
* 同步老系统盘点数据 新增或修改
*/
// @PostMapping("/submit")
// @ApiOperationSupport(order = 6)
// @ApiOperation(value = "新增或修改", notes = "传入disStockListDetail")
// public R submit(@Valid @RequestBody DisStockListDetailEntity disStockListDetail) {
// return R.status(disStockListDetailService.saveOrUpdate(disStockListDetail));
// }
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入disStockListDetail")
public R submit(@RequestBody SyncInventoryDTO syncInventoryDTO) {
String method = "##############submit: ";
String inventoryNo = syncInventoryDTO.getInventoryNo();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
if(StringUtil.isBlank(inventoryNo)){
log.warn(method+"盘点编码为空 inventoryNo={}",inventoryNo);
return R.fail(403,"盘点编码为空");
}
return syncInventoryService.addSyncTask(inventoryNo,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,"系统异常,联系管理员");
}
}
}

3
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -50,6 +50,7 @@ public class SyncOrderInfoToPlatform {
for (WarehouseMappingDataEntity mappingDataEntity:warehouseMappingDataEntityList){
Integer oldWarehouseId = mappingDataEntity.getOldWarehouseId();//老系统仓库id
Long newWarehouseId = mappingDataEntity.getNewWarehouseId();//新系统仓库id
Integer inventoryId = mappingDataEntity.getInventoryId();
//查询新系统是否已有仓库信息
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId);
@ -104,7 +105,7 @@ public class SyncOrderInfoToPlatform {
try{
List<String> orderCodeList = orderClient.findOrderCodeListByPage(param,oldWarehouseId,j,pageSize);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId,inventoryId);
log.info("################syncOrderInfo: 同步成功{}个订单",orderCodeList.size());
one.setCurrentPage(j+1);

5
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncInventoryMapper.java

@ -1,9 +1,14 @@
package com.logpm.patch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.patch.entity.SyncInventoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SyncInventoryMapper extends BaseMapper<SyncInventoryEntity> {
IPage<SyncInventoryEntity> pageList(IPage<Object> page, @Param("inventoryNo") String inventoryNo, @Param("warehouseId") Long warehouseId);
}

17
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncInventoryMapper.xml

@ -0,0 +1,17 @@
<?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.patch.mapper.SyncInventoryMapper">
<select id="pageList" resultType="com.logpm.patch.entity.SyncInventoryEntity">
select *
from logpm_patch_sync_inventory
where 1=1
<if test="inventoryNo != null and inventoryNo != ''">
and inventory_no like concat('%',#{inventoryNo},'%')
</if>
and warehouse_id = #{warehouseId}
</select>
</mapper>

10
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IAsyncDataService.java

@ -0,0 +1,10 @@
package com.logpm.patch.service;
import com.logpm.patch.entity.SyncInventoryEntity;
public interface IAsyncDataService {
void syncInventoryToPlatform(SyncInventoryEntity syncInventoryEntity);
}

8
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncInventoryService.java

@ -1,7 +1,15 @@
package com.logpm.patch.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.patch.dto.SyncInventoryDTO;
import com.logpm.patch.entity.SyncInventoryEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface ISyncInventoryService extends BaseService<SyncInventoryEntity> {
IPage<SyncInventoryEntity> pageList(SyncInventoryDTO syncInventoryDTO);
R addSyncTask(String inventoryNo, Long id);
}

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java

@ -3,7 +3,7 @@ package com.logpm.patch.service;
import java.util.List;
public interface ISyncOrderInfoService {
void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId);
void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,Integer inventoryId);
void handleDataZero(List<String> orderCodeList, Integer oldWarehouseId, Long newWarehouseId);

139
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java

@ -0,0 +1,139 @@
package com.logpm.patch.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.oldproject.feign.IOrderClient;
import com.logpm.patch.entity.OrderSyncRecordEntity;
import com.logpm.patch.entity.SyncInventoryEntity;
import com.logpm.patch.mapper.SyncInventoryMapper;
import com.logpm.patch.service.IAsyncDataService;
import com.logpm.patch.service.IOrderSyncRecordService;
import com.logpm.patch.service.ISyncOrderInfoService;
import com.logpm.patch.service.IWarehouseMappingDataService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 异步线程处理
*/
@Log4j2
@Service
@AllArgsConstructor
public class AsyncDataServiceImpl implements IAsyncDataService {
private final IWarehouseMappingDataService warehouseMappingDataService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;//新系统仓库
private final IOrderClient orderClient;//老系统订单client
private final IOrderSyncRecordService orderSyncRecordService;
private final ISyncOrderInfoService syncOrderInfoService;
private final SyncInventoryMapper syncInventoryMapper;
@Override
@Async
public void syncInventoryToPlatform(SyncInventoryEntity syncInventoryEntity) {
Integer pageSize = 500;//处理的每页条数
Integer oldWarehouseId = syncInventoryEntity.getOldWarehouseId();//老系统仓库id
Long newWarehouseId = syncInventoryEntity.getWarehouseId();//新系统仓库id
Integer inventoryId = syncInventoryEntity.getInventoryId();
//查询新系统是否已有仓库信息
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("###############syncOrderInfo: 新系统没有仓库信息");
throw new CustomerException(403,"新系统没有仓库信息");
}
Integer totalPage = 0;
Integer currentPage = 0;
//查询该仓库是否有未完成的同步数据
QueryWrapper<OrderSyncRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("old_warehouse_id",oldWarehouseId)
.eq("inventory_id",inventoryId)
.eq("type",1)
.ne("sync_status",2);
OrderSyncRecordEntity one = orderSyncRecordService.getOne(queryWrapper);
if(!Objects.isNull(one)){
//因为该仓库有未完成的同步,继续执行
totalPage = one.getTotalPage();
currentPage = one.getCurrentPage();
}else{
//查询本次同步一共多少的个订单
Integer totalNum = orderClient.getTotalCountBy(null,oldWarehouseId);
if(totalNum == 0){
log.info("################syncOrderInfo: 暂无需要执行的数据");
throw new CustomerException(403,"暂无需要执行的数据");
}
log.info("##################syncOrderInfo: 一共需要同步{}条数据",totalNum);
syncInventoryEntity.setSyncStartDate(new Date());
syncInventoryEntity.setSyncStatus(1);
syncInventoryMapper.updateById(syncInventoryEntity);
//计算出需要多少页
int i = totalNum % pageSize;
if(i == 0){
totalPage = totalNum/pageSize;
}else{
totalPage = totalNum/pageSize + 1;
}
currentPage = 0;
log.info("##################syncOrderInfo: 一共需要同步{}页size为{}的数据",totalPage,pageSize);
one = new OrderSyncRecordEntity();
one.setOldWarehouseId(oldWarehouseId);
one.setTotalNum(totalNum);
one.setTotalPage(totalPage);
one.setType(1);
one.setCurrentPage(0);
one.setFinishNum(0);
one.setSyncStatus(0);
one.setInventoryId(inventoryId);
orderSyncRecordService.save(one);
}
for (int j = currentPage; j < totalPage; j++) {
log.info("##################syncOrderInfo: 当前同步的第{}页的数据",j+1);
try{
List<String> orderCodeList = orderClient.findOrderCodeListByPage(null,oldWarehouseId,j,pageSize);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId,inventoryId);
log.info("################syncOrderInfo: 同步成功{}个订单",orderCodeList.size());
one.setCurrentPage(j+1);
one.setFinishNum(one.getFinishNum() + orderCodeList.size());
if((j+1) == totalPage){
one.setSyncStatus(2);
syncInventoryEntity.setSyncEndDate(new Date());
syncInventoryEntity.setSyncStatus(2);
syncInventoryMapper.updateById(syncInventoryEntity);
}else{
one.setSyncStatus(1);
}
orderSyncRecordService.saveOrUpdate(one);
}catch (CustomerException e){
log.error(e.message,e);
syncInventoryEntity.setSyncEndDate(new Date());
syncInventoryEntity.setSyncStatus(3);
syncInventoryMapper.updateById(syncInventoryEntity);
throw new CustomerException(e.code,e.message);
}catch (Exception e){
log.error("#############syncOrderInfo: 同步数据失败",e);
syncInventoryEntity.setSyncEndDate(new Date());
syncInventoryEntity.setSyncStatus(3);
syncInventoryMapper.updateById(syncInventoryEntity);
throw new CustomerException(403,"同步数据失败");
}
}
}
}

81
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncInventoryServiceImpl.java

@ -1,15 +1,96 @@
package com.logpm.patch.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.oldproject.entity.InventoryEntity;
import com.logpm.oldproject.feign.IInventoryClient;
import com.logpm.patch.dto.SyncInventoryDTO;
import com.logpm.patch.entity.SyncInventoryEntity;
import com.logpm.patch.mapper.SyncInventoryMapper;
import com.logpm.patch.service.IAsyncDataService;
import com.logpm.patch.service.ISyncInventoryService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@AllArgsConstructor
@Service
public class SyncInventoryServiceImpl extends BaseServiceImpl<SyncInventoryMapper, SyncInventoryEntity> implements ISyncInventoryService {
private final IInventoryClient inventoryClient;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IAsyncDataService asyncDataService;
@Override
public IPage<SyncInventoryEntity> pageList(SyncInventoryDTO syncInventoryDTO) {
Integer pageNum = syncInventoryDTO.getPageNum();
Integer pageSize = syncInventoryDTO.getPageSize();
String inventoryNo = syncInventoryDTO.getInventoryNo();
Long warehouseId = syncInventoryDTO.getWarehouseId();
if(Objects.isNull(pageNum)){
pageNum = 1;
}
if(Objects.isNull(pageSize)){
pageSize = 30;
}
IPage<Object> page = new Page<>();
page.setCurrent(pageNum);
page.setSize(pageSize);
QueryWrapper<SyncInventoryEntity> queryWrapper = new QueryWrapper<>();
if(!StringUtil.isBlank(inventoryNo)){
queryWrapper.like("inventory_no",inventoryNo);
}
return baseMapper.pageList(page,inventoryNo,warehouseId);
}
@Override
public R addSyncTask(String inventoryNo, Long warehouseId) {
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("############addSyncTask: 仓库信息不存在 warehouseId={}",warehouseId);
return R.fail(403,"仓库信息不存在");
}
Integer oldId = basicdataWarehouseEntity.getOldId();
String name = basicdataWarehouseEntity.getName();
//判断盘点编码是否存在
InventoryEntity inventoryEntity = inventoryClient.findEntityByWarehouseIdAndNo(oldId,inventoryNo);
if(Objects.isNull(inventoryEntity)){
log.warn("############addSyncTask: 盘点任务不存在 inventoryNo={} oldId={}",inventoryNo,oldId);
return R.fail(403,"盘点任务不存在");
}
Integer status = inventoryEntity.getStatus();
if(4 != status){
log.warn("############addSyncTask: 盘点任务还未完成 status={}",status);
return R.fail(403,"盘点任务还未完成");
}
//创建同步信息
SyncInventoryEntity syncInventoryEntity = new SyncInventoryEntity();
syncInventoryEntity.setInventoryId(inventoryEntity.getId());
syncInventoryEntity.setInventoryNo(inventoryNo);
syncInventoryEntity.setSyncStatus(0);
syncInventoryEntity.setWarehouseId(warehouseId);
syncInventoryEntity.setOldWarehouseId(oldId);
syncInventoryEntity.setWarehouseName(name);
save(syncInventoryEntity);
//开启异步线程,同步数据
asyncDataService.syncInventoryToPlatform(syncInventoryEntity);
return R.success("添加成功");
}
}

56
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -68,24 +68,34 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
@Transactional(rollbackFor = Exception.class)
@Override
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId) {
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,Integer inventoryId) {
log.info("#############handleData: 处理订单开始");
for (String orderCode:orderCodeList){
log.info("#############handleData: 当前处理orderCode={}的订单",orderCode);
log.info("#############handleData: 当前处理orderCode={}的订单 盘点任务 inventoryId={}",orderCode,inventoryId);
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
// if(!Objects.isNull(stockArticleEntity)){
// log.info("#############handleData: 订单orderCode={}已存在",orderCode);
// continue;
// }
//查询订单是否在盘点任务中有被盘点到
// InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findOrderIsExist(orderCode);
// if(!Objects.isNull(inventoryDetailEntity)){
//定单
saveOrderInfo(orderCode,oldWarehouseId,newWarehouseId);
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findOrderIsExist(orderCode,inventoryId);
if(!Objects.isNull(inventoryDetailEntity)){
try{
//定单
saveOrderInfo(orderCode,oldWarehouseId,newWarehouseId,inventoryId);
//存入打托信息
saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId);
// }
//存入打托信息
// saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId);
saveTrayTypeInfoPackageNew(orderCode,oldWarehouseId,newWarehouseId,inventoryId);
}catch (CustomerException e){
log.error("同步订单"+orderCode+"失败: "+e.message,e);
}catch (Exception e){
log.error("同步订单"+orderCode+"失败",e);
}
}
}
}
@ -125,7 +135,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
@Override
public void syncTrayType(Integer oldWarehouseId,Long newWarehouseId) {
saveTrayTypeInfoPackageNew(oldWarehouseId,newWarehouseId);
saveTrayTypeInfoPackageNew(null,oldWarehouseId,newWarehouseId,null);
}
@ -662,7 +672,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
private void saveOrderInfo(String orderCode, Integer oldWarehouseId, Long newWarehouseId) {
private void saveOrderInfo(String orderCode, Integer oldWarehouseId, Long newWarehouseId,Integer inventoryId) {
//通过订单号查询暂存单
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderCode);
@ -862,11 +872,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
//保存包件信息
saveOrderPackage(distributionStockArticleEntity,basicdataWarehouseEntity,wayBillNo,CommonUtil.dateToString(new Date()),oldWarehouseId);
saveOrderPackage(distributionStockArticleEntity,basicdataWarehouseEntity,wayBillNo,CommonUtil.dateToString(new Date()),oldWarehouseId,inventoryId);
}
private void saveOrderPackage(DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId) {
private void saveOrderPackage(DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId,Integer inventoryId) {
String orderCode = distributionStockArticleEntity.getOrderCode();
@ -874,17 +884,18 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
List<OrderDetailEntity> orderDetailList = orderDetailClient.findByOrderCode(orderCode,oldWarehouseId);
for (OrderDetailEntity orderDetailEntity:orderDetailList){
String unitNo = orderDetailEntity.getUnitNo();
// InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo);
// if(Objects.isNull(inventoryDetailEntity)){
// log.info("###########saveOrderPackage: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
// continue;
// }
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCode(unitNo);
if(!Objects.isNull(parcelListEntity)){
log.info("###########saveOrderPackage: 包条已存在,不同步 unitNo={}",unitNo);
continue;
}
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
if(Objects.isNull(inventoryDetailEntity)){
log.info("###########saveOrderPackage: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
continue;
}
Integer status = orderDetailEntity.getStatus();
Integer carsType = orderDetailEntity.getCarsType();
Integer signState = orderDetailEntity.getSignState();
@ -961,10 +972,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
boolean b = distributionParcelListClient.add(entity);
if (!b) {
log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode());
throw new CustomerException(405, "保存包件信息失败");
}
}
}
@ -1112,10 +1121,10 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
return wayBillEntity;
}
private void saveTrayTypeInfoPackageNew(Integer oldWarehouseId, Long newWarehouseId) {
private void saveTrayTypeInfoPackageNew(String orderCode,Integer oldWarehouseId, Long newWarehouseId,Integer inventoryId) {
List<InventoryDetailEntity> ls = inventoryDetailClient.findAllTrayType();
List<InventoryDetailEntity> ls = inventoryDetailClient.findAllTrayType(orderCode,inventoryId);
for (InventoryDetailEntity entity:ls){
Integer trayId = entity.getTrayId();
@ -1130,8 +1139,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
type = trayScanEntity.getType();
}
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo);
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
if(Objects.isNull(inventoryDetailEntity)){
log.info("###########saveTrayTypeInfoPackage: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
continue;

Loading…
Cancel
Save