Browse Source

1.增加装车时间

2.增加改单的删除原推送数据
3.
dist.1.3.0
pref_mail@163.com 9 months ago
parent
commit
549d93a73d
  1. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java
  2. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java
  3. 94
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java
  5. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  6. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  7. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java
  8. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  9. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.java
  10. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml
  11. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPacakgeMapper.xml
  12. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPackageMapper.java
  13. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.java
  14. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml
  15. 52
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenWaybillToBusinessListener.java
  16. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java
  17. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  18. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  19. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillOrderService.java
  20. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillPackageService.java
  21. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillTrackService.java
  22. 237
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java
  23. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  24. 23
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  25. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  26. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  27. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillOrderServiceImpl.java
  28. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java
  29. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java
  30. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java
  31. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java
  32. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailMapper.java
  33. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillDetailMapper.xml
  34. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  35. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  36. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailService.java
  37. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  38. 18
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailServiceImpl.java
  39. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

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

@ -92,5 +92,7 @@ public interface IWarehouseWaybillClient {
@GetMapping(API_PREFIX+"/findWaybillEntityByOrderPackageCode")
WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(@RequestParam String orderPackageCode);
@GetMapping(API_PREFIX+"/deleteByWaybillNo")
void deleteByWaybillNo(String waybillNo);
}

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

@ -67,4 +67,6 @@ public interface IWarehouseWaybillDetailClient {
void addEntity(@RequestBody WarehouseWayBillDetail warehouseWayBillDetail);
@PostMapping(API_PREFIX+"/findByWaybillIds")
List<WarehouseWayBillDetail> findByWaybillIds(@RequestBody List<Long> waybillIds);
@PostMapping(API_PREFIX+"/deleteByWaybillNo")
void deleteByWaybillNo(String waybillNo);
}

94
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -58,19 +58,17 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
private final IDistributionDeliveryListClient distributionDeliveryListClient;
@Override
public Boolean inOrder(String ids) throws ServiceException {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
throw new CustomerException("仓库信息不能为空");
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException("仓库信息不能为空");
}
// 查询出来需要处理的包条码
List<String> idArray = Arrays.asList(ids.split(","));
QueryWrapper wrapper = new QueryWrapper();
@ -99,13 +97,13 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
if (r.isSuccess()) {
// 更新成功
// 更新入库状态
distributionBusinessPreOrderEntity.setInWarehouse(1);
baseMapper.updateById(distributionBusinessPreOrderEntity);
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber());
if (!Objects.isNull(o)) {
bladeRedis.set(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber(), null);
}
distributionBusinessPreOrderEntity.setInWarehouse(1);
baseMapper.updateById(distributionBusinessPreOrderEntity);
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber());
if (!Objects.isNull(o)) {
bladeRedis.set(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber(), null);
}
}
}
@ -224,6 +222,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
Resp a = handleExceptionalWarehourse(businessSanDTO, list, orderPackageCode, distrCarNumber);
if (a != null) return a;
} else {
//正常入口
Resp scanFail = handleNormalWarehourse(businessSanDTO, orderPackageCode, list, distrCarNumber);
if (scanFail != null) return scanFail;
@ -269,16 +268,13 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
// 全仓查询
if (!list2.isEmpty()) {
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list2) {
if (distributionBusinessPreOrderEntity.getOrderPackageCode().equals(orderPackageCode)&& "20".equals(distributionBusinessPreOrderEntity.getOrderPackageLoadingStatus())) {
if (distributionBusinessPreOrderEntity.getOrderPackageCode().equals(orderPackageCode) && "20".equals(distributionBusinessPreOrderEntity.getOrderPackageLoadingStatus())) {
return Resp.scanSuccessWithData("已装车", "当前包件已在其它车次装车,请切换后在进行扫描", distributionBusinessPreOrderEntity.getDistrCarNumber());
}else if(distributionBusinessPreOrderEntity.getOrderPackageCode().equals(orderPackageCode) && "10".equals(distributionBusinessPreOrderEntity.getOrderPackageLoadingStatus())){
} else if (distributionBusinessPreOrderEntity.getOrderPackageCode().equals(orderPackageCode) && "10".equals(distributionBusinessPreOrderEntity.getOrderPackageLoadingStatus())) {
return Resp.scanSuccessWithData("是否切换车次", "当前包件不在当前车次,是否切换车次?", distributionBusinessPreOrderEntity.getDistrCarNumber());
}
selectD = distributionBusinessPreOrderEntity;
break;
}
@ -302,9 +298,9 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
this.updateById(selectD);
int a = 0;
if(StringUtil.isBlank(businessSanDTO.getTrayCode())){
if (StringUtil.isBlank(businessSanDTO.getTrayCode())) {
//记录当前车次的异常件数
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber();
String key = RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber();
Object o = bladeRedis.get(key);
if (Objects.isNull(o)) {
@ -326,21 +322,21 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
a = a + 1;
bladeRedis.setEx(key, a, 60 * 60 * 24L);
}
}else{
} else {
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER +businessSanDTO.getTrayCode();
String key = RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getTrayCode();
Object o = bladeRedis.get(key);
if (Objects.isNull(o)) {
// 获取托盘上的数量
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(businessSanDTO.getTrayCode());
o = 1;
if(!Objects.isNull(trayTypeDataVO)){
o=trayTypeDataVO.getTrayNum();
a= (int) o;
if (!Objects.isNull(trayTypeDataVO)) {
o = trayTypeDataVO.getTrayNum();
a = (int) o;
}
bladeRedis.setEx(key, o, 60 * 60 * 24L);
}else{
} else {
a = (int) o;
a = a + 1;
bladeRedis.setEx(key, a, 60 * 60 * 24L);
@ -391,36 +387,36 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
this.save(t);
}
R r = inOrderWarehourseByFeign(businessSanDTO);
if (r.isSuccess() && t!=null) {
if (r.isSuccess() && t != null) {
t.setInWarehouse(1);
this.updateById(t);
int a = 0;
if(StringUtil.isNotBlank(businessSanDTO.getTrayCode())){
if (StringUtil.isNotBlank(businessSanDTO.getTrayCode())) {
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER +businessSanDTO.getTrayCode();
String key = RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getTrayCode();
Object o = bladeRedis.get(key);
if (Objects.isNull(o)) {
// 获取托盘上的数量
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(businessSanDTO.getTrayCode());
o = 1;
if(!Objects.isNull(trayTypeDataVO)){
o=trayTypeDataVO.getTrayNum();
if (!Objects.isNull(trayTypeDataVO)) {
o = trayTypeDataVO.getTrayNum();
}
a= (int) o;
bladeRedis.setEx(key, o, 60 * 60 * 24L);
}else{
a = (int) o;
bladeRedis.setEx(key, o, 60 * 60 * 24L);
} else {
a = (int) o;
a = a + 1;
bladeRedis.setEx(key, a, 60 * 60 * 24L);
}
}else{
} else {
//记录当前车次的异常件数
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber());
String key =RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER +businessSanDTO.getTrayCode();
String key = RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getTrayCode();
if (Objects.isNull(o)) {
// 查询当前车次的异常入库数量
@ -525,30 +521,28 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
return R.fail(403,"仓库信息为空");
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "仓库信息为空");
}
inComingDTO.setWarehouseId(myCurrentWarehouse.getId());
inComingDTO.setWarehouseName(myCurrentWarehouse.getName());
if(StringUtil.isBlank(inComingDTO.getOrderPackageCode())){
return R.fail(405,"包件码不能为空");
if (StringUtil.isBlank(inComingDTO.getOrderPackageCode())) {
return R.fail(405, "包件码不能为空");
}
// 调用feign 进行托盘半固定入库
R r = inComingClient.incomingPackageByTaryCode(inComingDTO);
if(r.isSuccess()){
if (r.isSuccess()) {
// 入库成功
//
//
}
return r;
}
@ -557,7 +551,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
@Override
public R scanOrderPackageCodeByMaster(String orderPackageCode,
String reservationCode,
String distrCarNumber,
String distrCarNumber,
String vehicleName,
String driverName,
String userName,
@ -568,7 +562,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.findByName(tenantName + "仓");
if(ObjectUtils.isNull(warehouseEntity)){
if (ObjectUtils.isNull(warehouseEntity)) {
return R.fail("仓库信息不存在");
}
@ -578,7 +572,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
queryWrapper1.eq(BusinessPreOrderEntity::getOrderPackageCode, orderPackageCode);
queryWrapper1.eq(BusinessPreOrderEntity::getIsDeleted, 0);
List<BusinessPreOrderEntity> list1 = baseMapper.selectList(queryWrapper1);
BusinessPreOrderEntity data =null;
BusinessPreOrderEntity data = null;
if (list1.isEmpty()) {
// 新增改车次的预入库信息
TrunklineAdvanceDetailEntity entityByOrderPackageCode = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(orderPackageCode);
@ -605,19 +599,19 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
} else {
// 判断当前的包条码是否和当前作业的预约单号相同
for (int i = 0; i < list1.size(); i++) {
if(list1.get(i).getDistrCarNumber().equals(distrCarNumber)){
data=list1.get(i);
if (list1.get(i).getDistrCarNumber().equals(distrCarNumber)) {
data = list1.get(i);
data.setInWarehouse(1);
}
}
if(data==null){
if (data == null) {
// 如果没有找到 则标识当前的车次和作业车次不一致
data=list1.get(0);
data = list1.get(0);
data.setDistrCarNumber(distrCarNumber);
}
baseMapper.updateById(data);
baseMapper.updateById(data);
}
}
// 通过目标租户确认 目标租户对应的仓库

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java

@ -116,6 +116,7 @@ public class BusinessPreOrderDataQueueHandler {
data.setId(null);
data.setTenantId(null);
data.setReservationCode(distributionReservationEntity.getReservationCode());
data.setTaskTime(distributionDeliveryListEntity.getTaskTime());
dataResult.add(data);
}
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java

@ -71,4 +71,5 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
@Delete("delete from trunkline_advance_detail where order_code = #{orderCode}")
void deletedAdvanceByOrderCode(String orderCode);
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -163,6 +163,10 @@
delete from logpm_trunkline_advance_detail
where id = #{advanceDetailId}
</delete>
<delete id="deleteByWaybillNo">
delete from logpm_trunkline_advance_detail
where waybill_no = #{waybillNo}
</delete>
<select id="findTotalNumByOrderCode" resultType="int">
select count(*)

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java

@ -43,4 +43,6 @@ public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntit
@Delete("delete from trunkline_advance where order_code = #{orderCode}")
void deletedAdvanceByOrderCode(String orderCode);
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -126,6 +126,10 @@
</if>
</where>
</delete>
<delete id="deleteByWaybillNo">
delete from logpm_trunkline_advance
where waybill_no = #{waybillNo}
</delete>
<update id="subTotalNumByAdvanceId" >
update logpm_trunkline_advance

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.java

@ -24,4 +24,6 @@ public interface TrunklineWaybillOrderMapper extends BaseMapper<TrunklineWaybill
List<Long> findAdvanceIdsByWaybillIds(@Param("waybillIds") List<Long> waybillIds);
Integer findTotalNumByWaybillAndOrderCode(@Param("waybillNo") String waybillNo, @Param("orderCode") String orderCode);
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml

@ -1,6 +1,10 @@
<?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.trunkline.mapper.TrunklineWaybillOrderMapper">
<delete id="deleteByWaybillNo">
delete from logpm_trunkline_waybill_order
where waybill_no = #{waybillNo}
</delete>
<select id="getTotalNumByWaybillId" resultType="int">
select sum(ltwo.total_number)

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPacakgeMapper.xml

@ -1,6 +1,9 @@
<?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.trunkline.mapper.TrunklineWaybillPackageMapper">
<delete id="deleteByWaybillNo">
delete from logpm_trunkline_waybill_package where waybill_no = #{waybillNo}
</delete>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPackageMapper.java

@ -3,10 +3,11 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TrunklineWaybillPackageMapper extends BaseMapper<TrunklineWaybillPackageEntity> {
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.java

@ -17,4 +17,5 @@ public interface TrunklineWaybillTrackMapper extends BaseMapper<TrunklineWaybill
IPage<TrunklineWaybillTrackVO> findUpdateWaybillList(IPage<Object> page, @Param("param") OpenOrderDTO openOrderDTO);
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml

@ -1,6 +1,9 @@
<?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.trunkline.mapper.TrunklineWaybillTrackMapper">
<delete id="deleteByWaybillNo">
delete from logpm_trunkline_waybill_track where waybill_no = #{waybillNo}
</delete>
<select id="findWaybillLog" resultType="com.logpm.trunkline.entity.TrunklineWaybillTrackEntity">
select *

52
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenWaybillToBusinessListener.java

@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
@ -75,49 +76,60 @@ OpenWaybillToBusinessListener {
@RabbitHandler
public void openWaybillToBusinessDataHandler(Map map, Message message, Channel channel) {
extracted(map);
}
private void extracted(Map map) {
Long waybillId = (Long) map.get("messageData");
if (ObjectUtil.isEmpty(waybillId)) {
log.warn("运单ID为null");
return;
}
// 获取运单关联的暂存单信息
WarehouseWaybillEntity byWaybillId = warehouseWaybillClient.findByWaybillId(waybillId);
String oldConsignee = (String) map.get("oldConsignee");
R<List<Tenant>> tenantList = sysClient.getTenantList();
Tenant tenant = null;
Tenant oldTenant = null;
if (tenantList.isSuccess()) {
List<Tenant> data = tenantList.getData();
for (Tenant datum : data) {
if (datum.getTenantType() == 2 && datum.getTenantName().equals(byWaybillId.getConsignee().trim())) {
tenant = datum;
break;
}
if (datum.getTenantType() == 2 && datum.getTenantName().equals(oldConsignee.trim())) {
oldTenant = datum;
}
}
}
if (ObjectUtil.isEmpty(tenant)) {
log.warn(">>>>> 租户不存在");
return;
if (!StringUtil.isBlank(oldConsignee)) {
// 证明存在之前的推送数据
if (!byWaybillId.getConsignee().equals(oldConsignee)) {
// 证明修改的商家和之前推送的不一致
// 需要去删除之前 推送的商家
if (oldTenant != null) {
// 删除之前的推送的商家基础数据
Tenant finalOldTenant = oldTenant;
CompletableFuture.supplyAsync(() -> {
asyncService.deleteWaybillData(finalOldTenant.getTenantId(), byWaybillId.getWaybillNo(), oldConsignee);
return null;
});
}
}
}
if (tenant != null) {
extractedTenant(tenant, byWaybillId);
}
List<WarehouseWaybillEntity> waybillBilllByWaybillNos = new ArrayList<>();
waybillBilllByWaybillNos.add(byWaybillId);
}
private void extractedTenant(Tenant tenant, WarehouseWaybillEntity byWaybillId) {
List<Long> waybillIds = new ArrayList<>();
waybillIds.add(waybillId);
waybillIds.add(byWaybillId.getId());
List<WarehouseWayBillDetail> warehouseWayBillDetails = warehouseWaybillDetailClient.findByWaybillId(waybillId);
List<WarehouseWayBillDetail> warehouseWayBillDetails = warehouseWaybillDetailClient.findByWaybillId(byWaybillId.getId());
List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities = trunklineWaybillOrderClient.findListByWaybillIds(waybillIds);
@ -133,13 +145,13 @@ OpenWaybillToBusinessListener {
LambdaQueryWrapper<TrunklineWaybillTrackEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TrunklineWaybillTrackEntity::getWaybillId, waybillId);
queryWrapper.eq(TrunklineWaybillTrackEntity::getWaybillId, byWaybillId.getId());
queryWrapper.eq(TrunklineWaybillTrackEntity::getTrackType, "10");
List<TrunklineWaybillTrackEntity> list = trunklineWaybillTrackService.list(queryWrapper);
TrunklineWaybillTrackEntity trunklineWaybillTrackEntity = list.get(0);
Tenant finalTenant = tenant;
CompletableFuture.supplyAsync(() -> {
asyncService.saveOtherData(finalTenant.getTenantId(), waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails,trunklineWaybillTrackEntity);
asyncService.saveOtherData(finalTenant.getTenantId(), byWaybillId, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, trunklineWaybillTrackEntity);
return null;
});
}

14
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java

@ -19,5 +19,17 @@ public interface IAsyncService {
CompletableFuture<Boolean> updateAdvanceEntity(List<TrunklineAdvanceEntity> list, int queryType);
void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, TrunklineWaybillTrackEntity trunklineWaybillTrackEntity );
void saveOtherData(String tenantId,WarehouseWaybillEntity byWaybillId, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, TrunklineWaybillTrackEntity trunklineWaybillTrackEntity );
/**
* 根据租户ID 删除该租户下基于运单号的相关数
* <li>1.运单表</li>
* <li>2.暂存单</li>
* <li>3.暂存但明细</li>
* <li>4.运单和暂存单关联表</li>
* @param tenantId 租户ID
* @param waybillNo 运单号
* @param consignee 收货单位
*/
void deleteWaybillData(String tenantId, String waybillNo,String consignee);
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -83,4 +83,5 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
void deletedAdvanceByOrderCode(String orderCode);
void deleteByWaybillNo(String waybillNo);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java

@ -44,4 +44,6 @@ public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEn
boolean saveOrderAndPackages(List<TrunklineAdvanceDetailEntity> advanceDetailEntities, Long warehouseId);
Boolean cancelOrder(String orderCode);
void deleteByWaybillNo(String waybillNo);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillOrderService.java

@ -23,4 +23,6 @@ public interface ITrunklineWaybillOrderService extends BaseService<TrunklineWayb
List<Long> findAdvanceIdsByWaybillIds(List<Long> waybillIds);
void deleteByWaybillNo(String waybillNo);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillPackageService.java

@ -17,4 +17,6 @@ public interface ITrunklineWaybillPackageService extends BaseService<TrunklineWa
void updatePackageStatus(List<String> orderPackageCodes, Integer workNode, Long warehouseId, Map<String, JSONObject> map);
void deleteByWaybillNo(String waybillNo);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillTrackService.java

@ -12,4 +12,6 @@ public interface ITrunklineWaybillTrackService extends BaseService<TrunklineWayb
List<TrunklineWaybillTrackEntity> findWaybillLog(Long waybillId, String trackType);
IPage<TrunklineWaybillTrackVO> findUpdateWaybillList(IPage<Object> page, OpenOrderDTO openOrderDTO);
void deleteByWaybillNo(String waybillNo);
}

237
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java

@ -85,7 +85,9 @@ public class AsyncServiceImpl implements IAsyncService {
@ChangeAsync()
@Override
public void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, TrunklineWaybillTrackEntity trunklineWaybillTrackEntity) {
public void saveOtherData(String tenantId, WarehouseWaybillEntity waybillBilllByWaybillNo, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, TrunklineWaybillTrackEntity trunklineWaybillTrackEntity) {
log.info(">>> 执行保存数据到商家数据的功能 ");
// 保存暂存单
Tenant tenant = null;
R<Tenant> tenantFeign = sysClient.getTenant(tenantId);
@ -94,10 +96,11 @@ public class AsyncServiceImpl implements IAsyncService {
tenant = tenantFeign.getData();
}
String mallName = tenant.getTenantName();
log.info(">>> 执行保存数据到商家数据的功能 商家名称{}",tenant.getTenantName());
for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) {
TrunklineAdvanceEntity finalTrunklineAdvanceEntity = trunklineAdvanceEntity;
List<TrunklineAdvanceDetailEntity> t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(finalTrunklineAdvanceEntity.getId())).collect(Collectors.toList());
List<TrunklineAdvanceDetailEntity> t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(trunklineAdvanceEntity.getId())).collect(Collectors.toList());
saveTrunklineAdvanceEntity(trunklineAdvanceEntity, mallName);
@ -111,154 +114,186 @@ public class AsyncServiceImpl implements IAsyncService {
// 保存运单
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
for (WarehouseWaybillEntity waybillBilllByWaybillNo : waybillBilllByWaybillNos) {
List<TrunklineWaybillOrderEntity> collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
List<WarehouseWayBillDetail> t = warehouseWayBillDetails.stream().filter(warehouseWayBillDetail -> warehouseWayBillDetail.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
// 修改运单的起始仓库 和末端仓
waybillBilllByWaybillNo.setDepartureWarehouseName(waybillBilllByWaybillNo.getDestinationWarehouseName());
waybillBilllByWaybillNo.setDepartureWarehouseId(null);
List<TrunklineWaybillOrderEntity> collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
List<WarehouseWayBillDetail> t = warehouseWayBillDetails.stream().filter(warehouseWayBillDetail -> warehouseWayBillDetail.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
// 目的仓
if (basicdataWarehouseEntity != null) {
waybillBilllByWaybillNo.setDestinationWarehouseId(basicdataWarehouseEntity.getId());
waybillBilllByWaybillNo.setDestinationWarehouseName(basicdataWarehouseEntity.getName());
}
// 修改运单的起始仓库 和末端仓
waybillBilllByWaybillNo.setDepartureWarehouseName(waybillBilllByWaybillNo.getDestinationWarehouseName());
waybillBilllByWaybillNo.setDepartureWarehouseId(null);
waybillBilllByWaybillNo.setTenantId(tenant.getTenantId());
// 目的仓
if (basicdataWarehouseEntity != null) {
waybillBilllByWaybillNo.setDestinationWarehouseId(basicdataWarehouseEntity.getId());
waybillBilllByWaybillNo.setDestinationWarehouseName(basicdataWarehouseEntity.getName());
}
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillBilllByWaybillNo.getWaybillNo());
if (byWaybillNo == null) {
Long l = warehouseWaybillClient.addEnntity(waybillBilllByWaybillNo);
waybillBilllByWaybillNo.setId(l);
} else {
waybillBilllByWaybillNo.setId(byWaybillNo.getId());
}
waybillBilllByWaybillNo.setTenantId(tenant.getTenantId());
List<WarehouseWayBillDetail> byWaybillId = warehouseWaybillDetailClient.findByWaybillId(waybillBilllByWaybillNo.getId());
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillBilllByWaybillNo.getWaybillNo());
if (byWaybillNo == null) {
Long l = warehouseWaybillClient.addEnntity(waybillBilllByWaybillNo);
waybillBilllByWaybillNo.setId(l);
} else {
waybillBilllByWaybillNo.setId(byWaybillNo.getId());
}
for (WarehouseWayBillDetail warehouseWayBillDetail : t) {
warehouseWayBillDetail.setId(null);
for (WarehouseWayBillDetail wayBillDetail : byWaybillId) {
List<WarehouseWayBillDetail> byWaybillId = warehouseWaybillDetailClient.findByWaybillId(waybillBilllByWaybillNo.getId());
if (wayBillDetail.getProductName().equals(warehouseWayBillDetail.getProductName())) {
// 不执行
warehouseWayBillDetail.setId(wayBillDetail.getId());
break;
}
}
for (WarehouseWayBillDetail warehouseWayBillDetail : t) {
warehouseWayBillDetail.setId(null);
for (WarehouseWayBillDetail wayBillDetail : byWaybillId) {
if (warehouseWayBillDetail.getId() == null) {
warehouseWayBillDetail.setWaybillId(waybillBilllByWaybillNo.getId());
warehouseWaybillDetailClient.addEntity(warehouseWayBillDetail);
if (wayBillDetail.getProductName().equals(warehouseWayBillDetail.getProductName())) {
// 不执行
warehouseWayBillDetail.setId(wayBillDetail.getId());
break;
}
}
if (warehouseWayBillDetail.getId() == null) {
warehouseWayBillDetail.setWaybillId(waybillBilllByWaybillNo.getId());
warehouseWaybillDetailClient.addEntity(warehouseWayBillDetail);
}
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no", waybillBilllByWaybillNo.getWaybillNo());
List<TrunklineWaybillOrderEntity> listByWaybillNo = waybillOrderService.list(queryWrapper);
}
for (TrunklineWaybillOrderEntity trunklineWaybillOrderEntity : collect1) {
trunklineWaybillOrderEntity.setId(null);
List<TrunklineWaybillPackageEntity> collect3 = trunklineWaybillPackageEntities.stream().filter(ts -> {
return ts.getWaybillNo().equals(trunklineWaybillOrderEntity.getWaybillNo()) && ts.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId());
}).collect(Collectors.toList());
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no", waybillBilllByWaybillNo.getWaybillNo());
List<TrunklineWaybillOrderEntity> listByWaybillNo = waybillOrderService.list(queryWrapper);
trunklineWaybillOrderEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillOrderEntity.setTenantId(tenant.getTenantId());
for (TrunklineWaybillOrderEntity trunklineWaybillOrderEntity : collect1) {
Optional<TrunklineAdvanceEntity> entityWithOrderNumber1123 = trunklineAdvanceEntities.stream()
.filter(entity -> trunklineWaybillOrderEntity.getOrderCode().equals(entity.getOrderCode())) // 过滤出订单号为"1123"的实体
.findFirst(); // 获取第一个匹配的实体
trunklineWaybillOrderEntity.setId(null);
List<TrunklineWaybillPackageEntity> collect3 = trunklineWaybillPackageEntities.stream().filter(ts -> {
return ts.getWaybillNo().equals(trunklineWaybillOrderEntity.getWaybillNo()) && ts.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId());
}).collect(Collectors.toList());
if (entityWithOrderNumber1123.isPresent()) {
TrunklineAdvanceEntity foundEntity = entityWithOrderNumber1123.get();
// 使用找到的实体
trunklineWaybillOrderEntity.setAdvanceId(foundEntity.getId());
trunklineWaybillOrderEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillOrderEntity.setTenantId(tenant.getTenantId());
}
Optional<TrunklineAdvanceEntity> entityWithOrderNumber1123 = trunklineAdvanceEntities.stream()
.filter(entity -> trunklineWaybillOrderEntity.getOrderCode().equals(entity.getOrderCode())) // 过滤出订单号为"1123"的实体
.findFirst(); // 获取第一个匹配的实体
if (entityWithOrderNumber1123.isPresent()) {
TrunklineAdvanceEntity foundEntity = entityWithOrderNumber1123.get();
// 使用找到的实体
trunklineWaybillOrderEntity.setAdvanceId(foundEntity.getId());
for (TrunklineWaybillOrderEntity waybillOrderEntity : listByWaybillNo) {
}
if (waybillOrderEntity.getOrderCode().equals(trunklineWaybillOrderEntity.getOrderCode())) {
trunklineWaybillOrderEntity.setId(waybillOrderEntity.getId());
}
for (TrunklineWaybillOrderEntity waybillOrderEntity : listByWaybillNo) {
if (waybillOrderEntity.getOrderCode().equals(trunklineWaybillOrderEntity.getOrderCode())) {
trunklineWaybillOrderEntity.setId(waybillOrderEntity.getId());
}
if (trunklineWaybillOrderEntity.getId() == null) {
waybillOrderService.save(trunklineWaybillOrderEntity);
}
if (trunklineWaybillOrderEntity.getId() == null) {
}
waybillOrderService.save(trunklineWaybillOrderEntity);
}
List<Long> ids = Collections.singletonList(waybillBilllByWaybillNo.getId());
LambdaQueryWrapper<TrunklineWaybillPackageEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(TrunklineWaybillPackageEntity::getWaybillId, ids);
List<TrunklineWaybillPackageEntity> listByWaybillIds = trunklineWaybillPackageService.list(lambdaQueryWrapper);
List<Long> ids = Collections.singletonList(waybillBilllByWaybillNo.getId());
for (TrunklineWaybillPackageEntity trunklineWaybillPackageEntity : collect3) {
trunklineWaybillPackageEntity.setId(null);
trunklineWaybillPackageEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillPackageEntity.setTenantId(tenant.getTenantId());
LambdaQueryWrapper<TrunklineWaybillPackageEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(TrunklineWaybillPackageEntity::getWaybillId, ids);
List<TrunklineWaybillPackageEntity> listByWaybillIds = trunklineWaybillPackageService.list(lambdaQueryWrapper);
trunklineWaybillPackageEntity.setAdvanceId(trunklineWaybillOrderEntity.getAdvanceId());
for (TrunklineWaybillPackageEntity trunklineWaybillPackageEntity : collect3) {
trunklineWaybillPackageEntity.setId(null);
trunklineWaybillPackageEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillPackageEntity.setTenantId(tenant.getTenantId());
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if (listByAdvanceId.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId())) {
trunklineWaybillPackageEntity.setAdvanceId(trunklineWaybillOrderEntity.getAdvanceId());
if (listByAdvanceId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setAdvanceDetailId(listByAdvanceId.getId());
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if (listByAdvanceId.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId())) {
if (listByAdvanceId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setAdvanceDetailId(listByAdvanceId.getId());
}
}
}
}
for (TrunklineWaybillPackageEntity listByWaybillId : listByWaybillIds) {
for (TrunklineWaybillPackageEntity listByWaybillId : listByWaybillIds) {
if (listByWaybillId.getWaybillId().equals(trunklineWaybillPackageEntity.getWaybillId())) {
if (listByWaybillId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setId(listByWaybillId.getId());
break;
}
if (listByWaybillId.getWaybillId().equals(trunklineWaybillPackageEntity.getWaybillId())) {
if (listByWaybillId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setId(listByWaybillId.getId());
break;
}
}
if (trunklineWaybillPackageEntity.getId() == null) {
trunklineWaybillPackageService.save(trunklineWaybillPackageEntity);
}
}
if (trunklineWaybillPackageEntity.getId() == null) {
trunklineWaybillPackageService.save(trunklineWaybillPackageEntity);
}
}
}
// 查询运单作业节点数据
LambdaQueryWrapper<TrunklineWaybillTrackEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(TrunklineWaybillTrackEntity::getWaybillNo, waybillBilllByWaybillNo.getWaybillNo());
lambdaQueryWrapper.eq(TrunklineWaybillTrackEntity::getTrackType, "10");
List<TrunklineWaybillTrackEntity> list = trunklineWaybillTrackService.list(lambdaQueryWrapper);
if (list.isEmpty()) {
trunklineWaybillTrackEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillTrackEntity.setTenantId(tenant.getTenantId());
BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(mallName);
trunklineWaybillTrackEntity.setWarehouseId(basicdataWarehouseEntity1.getId());
trunklineWaybillTrackEntity.setWarehouseName(basicdataWarehouseEntity1.getName());
trunklineWaybillTrackService.save(trunklineWaybillTrackEntity);
}
// 查询运单作业节点数据
LambdaQueryWrapper<TrunklineWaybillTrackEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(TrunklineWaybillTrackEntity::getWaybillNo, waybillBilllByWaybillNo.getWaybillNo());
lambdaQueryWrapper.eq(TrunklineWaybillTrackEntity::getTrackType, "10");
List<TrunklineWaybillTrackEntity> list = trunklineWaybillTrackService.list(lambdaQueryWrapper);
if (list.isEmpty()) {
trunklineWaybillTrackEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillTrackEntity.setTenantId(tenant.getTenantId());
BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(mallName);
trunklineWaybillTrackEntity.setWarehouseId(basicdataWarehouseEntity1.getId());
trunklineWaybillTrackEntity.setWarehouseName(basicdataWarehouseEntity1.getName());
trunklineWaybillTrackService.save(trunklineWaybillTrackEntity);
}
}
@ChangeAsync()
@Override
public void deleteWaybillData(String tenantId, String waybillNo,String consignee) {
try{
log.info("执行删除商场推送数据清理动作 商场名称:{}",consignee);
// 根据运单号删除运单logpm_trunkline_waybill_package 的数据
trunklineWaybillPackageService.deleteByWaybillNo(waybillNo);
// 根据运单号删除 logpm_trunkline_waybill_order 的数据
waybillOrderService.deleteByWaybillNo(waybillNo);
// 根据运单号删除 logpm_warehouse_waybill_detail
warehouseWaybillDetailClient.deleteByWaybillNo(waybillNo);
// 根据运单号删除 logpm_warehouse_waybill
warehouseWaybillClient.deleteByWaybillNo(waybillNo);
// 根据运单号删除 logpm_trunkline_advance_detail
advanceService.deleteByWaybillNo(waybillNo);
// 根据运单号删除 logpm_trunkline_advance
advanceDetailService.deleteByWaybillNo(waybillNo);
// 根据运单号 删除 logpm_trunkline_waybill_track
trunklineWaybillTrackService.deleteByWaybillNo(waybillNo);
}catch (Exception e){
e.printStackTrace();
}
}
private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) {
@ -316,12 +351,12 @@ public class AsyncServiceImpl implements IAsyncService {
// 查找商户的暂存单是否存在改制
QueryWrapper<TrunklineAdvanceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_code", trunklineAdvanceEntity.getOrderCode())
queryWrapper.eq("order_code", trunklineAdvanceEntity.getOrderCode());
queryWrapper.eq("waybill_no", trunklineAdvanceEntity.getWaybillNo())
.last("limit 1");
TrunklineAdvanceEntity trunklineAdvanceEntity1 = advanceService.getOne(queryWrapper);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) {
// 保存对象
if (basicdataWarehouseEntity != null) {
trunklineAdvanceEntity.setWarehouseId(basicdataWarehouseEntity.getId());

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

@ -646,6 +646,9 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
BigDecimal otherFee = waybillEntity.getOtherFee();
BigDecimal otherPrice = otherFee.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal rebate = waybillEntity.getRebate();
if(rebate==null){
rebate = BigDecimal.ZERO;
}
BigDecimal rebatePrice = rebate.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal thirdOperationFee = waybillEntity.getThirdOperationFee();
BigDecimal thirdOperationPrice = thirdOperationFee.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
@ -736,8 +739,12 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
});
int otherNum = atomicOtherNum.get();
if(otherNum==0){
otherNum=1;
}
//otherTotalPriceList元素求和
BigDecimal otherTotalPrice = otherTotalPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal p = otherTotalPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
BigDecimal otherTotalDeliveryPrice = otherTotalDeliveryPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal dp = otherTotalDeliveryPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);

23
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -2112,6 +2112,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
@Override
public R updateWaybill(OpenOrderDTO openOrderDTO) {
String oldConsignee = null;
Long waybillId = openOrderDTO.getWaybillId();
String waybillNo = openOrderDTO.getWaybillNo();
Long warehouseId = openOrderDTO.getWarehouseId();
@ -2119,15 +2120,19 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String editReson = openOrderDTO.getEditReson();
String refer = openOrderDTO.getRefer();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
if (Objects.isNull(waybillEntity)) {
log.warn("#############updateWaybill: 运单信息不存在 waybillId={}", waybillId);
return R.fail(405, "运单信息不存在");
}
Integer abolishStatus = waybillEntity.getAbolishStatus();
if(abolishStatus.equals(1)){
log.warn("#############updateWaybill: 运单已作废 waybillId={}", waybillId);
return R.fail(405, "运单已作废");
}
// 得到改单之前的收货单位
oldConsignee = waybillEntity.getConsignee();
String updateMsg = verifyUpdateData(openOrderDTO, waybillEntity);
@ -2199,6 +2204,24 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
}
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("messageData", waybillId);
mapState.put("oldConsignee", oldConsignee);
mapState.put("createTime", System.currentTimeMillis());
try {
rabbitTemplate.convertAndSend(RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_EXCHANGE, RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_ROUTING, mapState, message -> {
message.getMessageProperties()
.setHeader("x-delay", 5000);
return message;
});
} catch (Exception customerException) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", customerException);
}
return R.success("改单成功");
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -331,4 +331,9 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
baseMapper.deletedAdvanceByOrderCode(orderCode);
}
}
@Override
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -1317,4 +1317,8 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
return Boolean.TRUE;
}
@Override
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillOrderServiceImpl.java

@ -49,4 +49,9 @@ public class TrunklineWaybillOrderServiceImpl extends BaseServiceImpl<TrunklineW
public List<Long> findAdvanceIdsByWaybillIds(List<Long> waybillIds) {
return baseMapper.findAdvanceIdsByWaybillIds(waybillIds);
}
@Override
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java

@ -147,6 +147,11 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
warehouseWaybillClient.updateEntity(updateWaybillEntity);
}
@Override
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
@Override
public void updatePackageStatus(List<String> orderPackageCodes, Integer workNode, Long warehouseId, Map<String, JSONObject> map) {

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

@ -26,4 +26,9 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
public IPage<TrunklineWaybillTrackVO> findUpdateWaybillList(IPage<Object> page, OpenOrderDTO openOrderDTO) {
return baseMapper.findUpdateWaybillList(page,openOrderDTO);
}
@Override
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java

@ -114,4 +114,9 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient {
public WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(String orderPackageCode) {
return warehouseWaybillService.findWaybillEntityByOrderPackageCode(orderPackageCode);
}
@Override
public void deleteByWaybillNo(String waybillNo) {
warehouseWaybillService.deleteByWaybillNo(waybillNo);
}
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java

@ -54,4 +54,9 @@ public class WarehouseWaybillDetailClient implements IWarehouseWaybillDetailClie
public List<WarehouseWayBillDetail> findByWaybillIds(List<Long> waybillIds) {
return warehouseWayBillDetailService.findByWaybillIds(waybillIds);
}
@Override
public void deleteByWaybillNo(String waybillNo) {
warehouseWayBillDetailService.deleteByWaybillNo(waybillNo);
}
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailMapper.java

@ -3,10 +3,13 @@ package com.logpm.warehouse.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface WarehouseWayBillDetailMapper extends BaseMapper<WarehouseWayBillDetail> {
List<WarehouseWayBillDetail> findByWaybillIds(List<Long> ids);
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillDetailMapper.xml

@ -1,6 +1,11 @@
<?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.warehouse.mapper.WarehouseWayBillDetailMapper">
<delete id="deleteByWaybillNo">
delete
from logpm_warehouse_waybill_detail
where waybill_no = #{waybillNo}
</delete>
<select id="findByWaybillIds" resultType="com.logpm.warehouse.entity.WarehouseWayBillDetail">
select *

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java

@ -69,4 +69,5 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
List<ExportWarehouseWaybillVO> exportWaybillList(@Param("param") WarehouseWaybillDTO waybillDTO);
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -55,6 +55,9 @@
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
</resultMap>
<delete id="deleteByWaybillNo">
delete from logpm_warehouse_waybill where waybill_no = #{waybillNo}
</delete>
<select id="selectWarehouseWaybillPage" resultMap="warehouseWaybillResultMap">

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailService.java

@ -21,4 +21,6 @@ public interface IWarehouseWayBillDetailService extends BaseService<WarehouseWay
void deleteByWaybillDetailId(Long waybillDetailId);
List<WarehouseWayBillDetail> findByWaybillIds(List<Long> ids);
void deleteByWaybillNo(String waybillNo);
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java

@ -81,4 +81,6 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
List<ExportWarehouseWaybillVO> exportWaybillList(WarehouseWaybillDTO waybillDTO);
void deleteByWaybillNo(String waybillNo);
}

18
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailServiceImpl.java

@ -16,13 +16,12 @@ import java.util.List;
@Service
public class WarehouseWayBillDetailServiceImpl extends BaseServiceImpl<WarehouseWayBillDetailMapper,WarehouseWayBillDetail> implements IWarehouseWayBillDetailService {
private final WarehouseWayBillDetailMapper warehouseWayBillDetailMapper;
@Override
public WarehouseWayBillDetail findByProductName(String productName) {
QueryWrapper<WarehouseWayBillDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("product_name",productName);
return warehouseWayBillDetailMapper.selectOne(queryWrapper);
return baseMapper.selectOne(queryWrapper);
}
@ -30,7 +29,7 @@ public class WarehouseWayBillDetailServiceImpl extends BaseServiceImpl<Warehouse
public List<WarehouseWayBillDetail> findByWaybillId(Long waybillId) {
QueryWrapper<WarehouseWayBillDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_id",waybillId);
return warehouseWayBillDetailMapper.selectList(queryWrapper);
return baseMapper.selectList(queryWrapper);
}
@Override
@ -49,21 +48,26 @@ public class WarehouseWayBillDetailServiceImpl extends BaseServiceImpl<Warehouse
public List<WarehouseWayBillDetail> findListByWaybillNo(String waybillNo) {
QueryWrapper<WarehouseWayBillDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no",waybillNo);
return warehouseWayBillDetailMapper.selectList(queryWrapper);
return baseMapper.selectList(queryWrapper);
}
@Override
public WarehouseWayBillDetail findEntityByWaybillDetailId(Long waybillDetailId) {
return warehouseWayBillDetailMapper.selectById(waybillDetailId);
return baseMapper.selectById(waybillDetailId);
}
@Override
public void deleteByWaybillDetailId(Long waybillDetailId) {
warehouseWayBillDetailMapper.deleteById(waybillDetailId);
baseMapper.deleteById(waybillDetailId);
}
@Override
public List<WarehouseWayBillDetail> findByWaybillIds(List<Long> ids) {
return warehouseWayBillDetailMapper.findByWaybillIds(ids);
return baseMapper.findByWaybillIds(ids);
}
@Override
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -1081,5 +1081,8 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
return payWayString;
}
@Override
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
}

Loading…
Cancel
Save