|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
package com.logpm.distribution.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
@ -73,6 +76,10 @@ import com.logpm.factory.mt.dto.MtReceiveDTO;
|
|
|
|
|
import com.logpm.factory.mt.dto.MtReceiveImagesDTO; |
|
|
|
|
import com.logpm.factory.mt.feign.IMtOrderMainClinet; |
|
|
|
|
import com.logpm.factory.oupai.feign.IOuPaiFactoryClinet; |
|
|
|
|
import com.logpm.factorydata.enums.BrandEnums; |
|
|
|
|
import com.logpm.factorydata.enums.NodeEnums; |
|
|
|
|
import com.logpm.factorydata.util.FactoryDataMessageSender; |
|
|
|
|
import com.logpm.factorydata.vo.NodePushMsg; |
|
|
|
|
import com.logpm.trunkline.dto.AddWaybillTrackDTO; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
@ -108,6 +115,7 @@ import org.springblade.common.constant.stockup.StockupStatusConstant;
|
|
|
|
|
import org.springblade.common.constant.stockup.StockupTypeConstant; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -170,6 +178,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
private final ITrunklineWaybillTrackClient trunklineWaybillTrackClient; |
|
|
|
|
private final IWarehouseWaybillClient waybillClient; |
|
|
|
|
private final FactoryDataMessageSender factoryDataMessageSender; |
|
|
|
|
|
|
|
|
|
// private final
|
|
|
|
|
|
|
|
|
@ -1527,10 +1536,10 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
@Async |
|
|
|
|
public void sendReviewFactory(Long signingId, String warehouseName, Long warehouseId) { |
|
|
|
|
String brands = "梦天,欧派";//可追加
|
|
|
|
|
String brands = "梦天,欧派,志邦";//可追加
|
|
|
|
|
log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:=" + signingId + "warehouseName:=" + warehouseName + "warehouseId:=" + warehouseId); |
|
|
|
|
//查询签收信息
|
|
|
|
|
DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signingId); |
|
|
|
@ -1635,10 +1644,30 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
// orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO);
|
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(brand.get("志邦"))) { |
|
|
|
|
List<MtReceiveContentDTO> zb = brand.get("志邦"); |
|
|
|
|
List<Object> contents = new ArrayList<>(); |
|
|
|
|
if (CollUtil.isNotEmpty(zb)) { |
|
|
|
|
for (MtReceiveContentDTO mtReceiveContentDTO : zb) { |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("packageCode", mtReceiveContentDTO.getUnitNo()); |
|
|
|
|
contents.add(jsonObject); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
NodePushMsg msg = new NodePushMsg(); |
|
|
|
|
msg.setNode(NodeEnums.CLERK_REVIEW); |
|
|
|
|
msg.setBrand(BrandEnums.ZB); |
|
|
|
|
msg.setOperator(AuthUtil.getUser().getNickName()); |
|
|
|
|
msg.setOperatorTime(new Date()); |
|
|
|
|
msg.setContent(contents); |
|
|
|
|
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg)); |
|
|
|
|
factoryDataMessageSender.sendNodeDataByBrand(msg); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//....工厂
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("sendReviewFactory ",e); |
|
|
|
|
log.error("sendReviewFactory ", e); |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1819,12 +1848,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public void releaseBillLadingResource(Long l,Long warehouseId) { |
|
|
|
|
public void releaseBillLadingResource(Long l, Long warehouseId) { |
|
|
|
|
List<DistrilbutionBillPackageEntity> list = billPackageService.list(Wrappers.<DistrilbutionBillPackageEntity>query().lambda() |
|
|
|
|
.eq(DistrilbutionBillPackageEntity::getBillLadingId, l) |
|
|
|
|
.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(list)){ |
|
|
|
|
if (Func.isNotEmpty(list)) { |
|
|
|
|
List<Long> ids = list.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList()); |
|
|
|
|
//查询包件
|
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(ids); |
|
|
|
@ -1844,7 +1873,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
String collect = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(",")); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(collect,warehouseId); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(collect, warehouseId); |
|
|
|
|
//维护自提单订单信息
|
|
|
|
|
distrilbutionBillStockService.maintenanceOrderInfo(l); |
|
|
|
|
} |
|
|
|
|