|
|
|
@ -19,9 +19,7 @@ import com.logpm.factory.mt.service.*;
|
|
|
|
|
import com.logpm.factory.props.MtFactoryProperties; |
|
|
|
|
import com.logpm.factory.snm.bean.Resp; |
|
|
|
|
import com.logpm.oldproject.entity.NewDistributionContactEntity; |
|
|
|
|
import com.logpm.oldproject.feign.IAdvanceDetailClient; |
|
|
|
|
import com.logpm.oldproject.feign.INewDistributionContactClient; |
|
|
|
|
import com.logpm.oldproject.feign.IWarehouseClient; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
@ -30,7 +28,6 @@ import org.springblade.common.exception.CustomerException;
|
|
|
|
|
import org.springblade.core.redis.cache.BladeRedis; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.api.ResultCode; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -308,16 +305,29 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private R qianshouScan(OrderStatusDTO orderStatusDTO) throws JsonProcessingException, NoSuchAlgorithmException { |
|
|
|
|
String unitNo = orderStatusDTO.getUnitNo(); |
|
|
|
|
String orderNo = orderStatusDTO.getOrderNo(); |
|
|
|
|
QueryWrapper<MtPackageInfo> packageInfoQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
packageInfoQueryWrapper.eq("package_code", unitNo); |
|
|
|
|
/** |
|
|
|
|
* 梦天签收推送 |
|
|
|
|
* @param orderPackageCode 包条码 |
|
|
|
|
* @param operationTime 作业时间 |
|
|
|
|
* @param distributionContactId 签收任务 |
|
|
|
|
* @param destinationWarehouse 作业仓库 |
|
|
|
|
* @return |
|
|
|
|
* @throws JsonProcessingException |
|
|
|
|
* @throws NoSuchAlgorithmException |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public R qianshouScanForNewSystem(String orderPackageCode, |
|
|
|
|
String operationTime, |
|
|
|
|
String distributionContactId, |
|
|
|
|
String destinationWarehouse |
|
|
|
|
) throws JsonProcessingException, NoSuchAlgorithmException { |
|
|
|
|
QueryWrapper<MtPackageInfo> packageInfoQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
packageInfoQueryWrapper.eq("package_code", orderPackageCode); |
|
|
|
|
MtPackageInfo one = mtPackageInfoService.getOne(packageInfoQueryWrapper); |
|
|
|
|
logger.info("#############one: {}", one); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(one)) { |
|
|
|
|
logger.info("#############qianshouScan: 当前包条码未找到对应数据unitNo={}", unitNo); |
|
|
|
|
logger.info("#############qianshouScan: 当前包条码未找到对应数据unitNo={}", orderPackageCode); |
|
|
|
|
return Resp.fail(400, "未找到包件数据"); |
|
|
|
|
} |
|
|
|
|
Long orderId = one.getOrderId(); |
|
|
|
@ -340,12 +350,9 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String distributionContactId = orderStatusDTO.getDistributionContactId();//送货任务ID
|
|
|
|
|
String invoiceOrderCode = mtFactoryOrderMain.getInvoiceOrderCode();//发货单编号
|
|
|
|
|
String orderCode = mtFactoryOrder.getOrderCode();//订单编号
|
|
|
|
|
String centerWarehouseCode = mtFactoryOrderMain.getCenterWarehouseCode();//仓库编号
|
|
|
|
|
String destinationWarehouse = orderStatusDTO.getDestinationWarehouse();//作业仓库
|
|
|
|
|
String operationTime = orderStatusDTO.getOperationTime();//签收时间
|
|
|
|
|
|
|
|
|
|
//拼接参数
|
|
|
|
|
MtQianShouStatusDTO mtQianShouStatusDTO = new MtQianShouStatusDTO(); |
|
|
|
@ -354,17 +361,22 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
|
|
|
|
|
mtQianShouStatusDTO.setOrderCode(orderCode); |
|
|
|
|
mtQianShouStatusDTO.setCenterWarehouseCode(centerWarehouseCode); |
|
|
|
|
mtQianShouStatusDTO.setDestinationWarehouse(destinationWarehouse); |
|
|
|
|
mtQianShouStatusDTO.setUnitNo(unitNo); |
|
|
|
|
mtQianShouStatusDTO.setUnitNo(orderPackageCode); |
|
|
|
|
mtQianShouStatusDTO.setOperationTime(operationTime); |
|
|
|
|
|
|
|
|
|
ObjectMapper objectMapper = new JsonMapper(); |
|
|
|
|
|
|
|
|
|
String s = objectMapper.writeValueAsString(mtQianShouStatusDTO); |
|
|
|
|
|
|
|
|
|
R rd = sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QianShouScan", s, 6,unitNo); |
|
|
|
|
R rd = sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QianShouScan", s, 6, orderPackageCode); |
|
|
|
|
return rd; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private R qianshouScan(OrderStatusDTO orderStatusDTO) throws JsonProcessingException, NoSuchAlgorithmException { |
|
|
|
|
|
|
|
|
|
return this.qianshouScanForNewSystem(orderStatusDTO.getUnitNo(),orderStatusDTO.getOperationTime(),orderStatusDTO.getDistributionContactId(),orderStatusDTO.getDestinationWarehouse()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private R shouhuoruku(OrderStatusDTO orderStatusDTO) throws JsonProcessingException, NoSuchAlgorithmException { |
|
|
|
|
//通过包件码查询是否是要推送的订单
|
|
|
|
|
String unitNo = orderStatusDTO.getUnitNo();//包件码
|
|
|
|
|