|
|
|
@ -13,6 +13,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.fasterxml.jackson.databind.json.JsonMapper; |
|
|
|
|
import com.logpm.factory.comfac.constant.FactoryConstant; |
|
|
|
|
import com.logpm.factory.comfac.dto.*; |
|
|
|
|
import com.logpm.factory.dto.mt.MtReceiveContentDTO; |
|
|
|
|
import com.logpm.factory.dto.mt.MtReceiveDTO; |
|
|
|
|
import com.logpm.factory.dto.mt.MtReceiveImagesDTO; |
|
|
|
|
import com.logpm.factory.mt.dto.*; |
|
|
|
|
import com.logpm.factory.mt.entity.*; |
|
|
|
|
import com.logpm.factory.mt.service.*; |
|
|
|
@ -465,6 +468,66 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R sendReceiveInfoByNewSystem(MtReceiveDTO mtReceiveDTO) throws JsonProcessingException, NoSuchAlgorithmException { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MtReceiveContentDTO> receiveContentList = mtReceiveDTO.getReceiveContentList(); |
|
|
|
|
for (MtReceiveContentDTO mtReceiveContentDTO : receiveContentList) { |
|
|
|
|
String unitNo = mtReceiveContentDTO.getUnitNo(); |
|
|
|
|
//通过订单编号查询总单信息
|
|
|
|
|
QueryWrapper<MtPackageInfo> packageInfoQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
packageInfoQueryWrapper.eq("package_code", unitNo); |
|
|
|
|
MtPackageInfo one = mtPackageInfoService.getOne(packageInfoQueryWrapper); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(one)) { |
|
|
|
|
logger.info("#############sendReceiveInfo: 当前包条码未找到对应数据unitNo={}", unitNo); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
Long orderId = one.getOrderId(); |
|
|
|
|
MtFactoryOrder mtFactoryOrder = mtFactoryOrderService.getById(orderId); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(mtFactoryOrder)) { |
|
|
|
|
logger.info("#############sendReceiveInfo: 未找到对应订单orderId={}", orderId); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
Long mainId = mtFactoryOrder.getMainId(); |
|
|
|
|
|
|
|
|
|
MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(mtFactoryOrderMain)) { |
|
|
|
|
logger.info("#############sendReceiveInfo: 未找到对应订单mainId={}", mainId); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// 需要判断本次任务是否为中心仓的订单
|
|
|
|
|
if("转运仓".equals(mtFactoryOrderMain.getWarehouseType())){ |
|
|
|
|
// 转运仓的订单和签收不进行推送
|
|
|
|
|
logger.info("############# 转运仓的数据不进行推送 mtFactoryOrderMain={}", mtFactoryOrderMain); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
mtReceiveContentDTO.setInvoiceOrderCode(mtFactoryOrderMain.getInvoiceOrderCode()); |
|
|
|
|
mtReceiveContentDTO.setWarehouseCode(mtFactoryOrderMain.getCenterWarehouseCode()); |
|
|
|
|
mtReceiveContentDTO.setWarehouse(mtFactoryOrderMain.getCenterWarehouseName()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
|
|
|
|
|
|
String s = objectMapper.writeValueAsString(mtReceiveDTO); |
|
|
|
|
log.info("###########sendReceiveInfo: 处理签收返回数据完成 {}",s); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QianShouDanNew", s, 5,mtReceiveDTO.getSendTaskId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException, NoSuchAlgorithmException { |
|
|
|
|