Browse Source

增加梦天的签收扫描接口

single_db
pref_mail@163.com 11 months ago
parent
commit
11d3b24121
  1. 18
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/feign/IMtOrderMainClinet.java
  2. 2
      blade-service/logpm-aftersales/src/main/resources/application-prod.yml
  3. 2
      blade-service/logpm-aftersales/src/main/resources/application-test.yml
  4. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/feign/MtOrderMainClinet.java
  5. 16
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java
  6. 40
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

18
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/feign/IMtOrderMainClinet.java

@ -1,29 +1,37 @@
package com.logpm.factory.snm.feign;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.security.NoSuchAlgorithmException;
import java.util.List;
/**
* 梦天工厂对外接口
*/
@FeignClient(
value = ModuleNameConstant.APPLICATION_FACTORY_NAME
)
public interface IMtOrderMainClinet {
String API_PREFIX = "/mtclient";
String TOP = API_PREFIX + "/top";
String API_PREFIX = "/mt/client";
String TOP = API_PREFIX + "/sendOrderPackageScan";
/**
* 获取梦天工厂订单 包件 主订单 的关系
*
* 司机签收扫描
* @return
*/
@GetMapping(TOP)
R<List<MTOrderPackageRelationVO>> mtOrderPackageRelation();
R sendOrderPackageScan(@RequestParam String orderPackageCode,
@RequestParam String operationTime,
@RequestParam String distributionContactId,
@RequestParam String destinationWarehouse) throws NoSuchAlgorithmException, JsonProcessingException;
}

2
blade-service/logpm-aftersales/src/main/resources/application-prod.yml

@ -1,6 +1,6 @@
#服务器端口
server:
port: 8200
port: 8900
#数据源配置
#spring:

2
blade-service/logpm-aftersales/src/main/resources/application-test.yml

@ -1,6 +1,6 @@
#服务器端口
server:
port: 8200
port: 8900
#数据源配置
#spring:

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/feign/MtOrderMainClinet.java

@ -1,14 +1,18 @@
package com.logpm.factory.mt.feign;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.snm.feign.IMtOrderMainClinet;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.security.NoSuchAlgorithmException;
import java.util.List;
@NonDS
@ -19,9 +23,11 @@ public class MtOrderMainClinet implements IMtOrderMainClinet {
private final IMtFactoryOrderMainService mtFactoryOrderMainService;
private final IMtFactoryDataService mtFactoryDataService;
@Override
public R<List<MTOrderPackageRelationVO>> mtOrderPackageRelation() {
List<MTOrderPackageRelationVO> data =mtFactoryOrderMainService.mtOrderPackageRelation();
return R.data(data);
@GetMapping(TOP)
public R sendOrderPackageScan(String orderPackageCode, String operationTime, String distributionContactId, String destinationWarehouse) throws NoSuchAlgorithmException, JsonProcessingException {
return mtFactoryDataService.qianshouScanForNewSystem(orderPackageCode,operationTime,distributionContactId,destinationWarehouse);
}
}

16
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java

@ -21,6 +21,22 @@ public interface IMtFactoryDataService {
R handleStatusData(OrderStatusDTO orderStatusDTO) throws JsonProcessingException, NoSuchAlgorithmException;
/**
* 梦天签收推送
* @param orderPackageCode 包条码
* @param operationTime 作业时间
* @param distributionContactId 签收任务
* @param destinationWarehouse 作业仓库
* @return
* @throws JsonProcessingException
* @throws NoSuchAlgorithmException
*/
R qianshouScanForNewSystem(String orderPackageCode,
String operationTime,
String distributionContactId,
String destinationWarehouse
) throws JsonProcessingException, NoSuchAlgorithmException;
R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException, NoSuchAlgorithmException;
/**

40
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

@ -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();//包件码

Loading…
Cancel
Save