Browse Source

Merge branch 'dev' into pre-production

newStockUp
pref_mail@163.com 1 year ago
parent
commit
690c1f41ff
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java
  2. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtReceiveContentDTO.java
  3. 21
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  4. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java

@ -126,6 +126,9 @@ public class DistrilbutionBillLadingEntity extends TenantEntity {
@ApiModelProperty("提货批次")
private String pickupBatch;
@ApiModelProperty(value = "仓库Id")
private Long warehouseId;

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtReceiveContentDTO.java

@ -21,7 +21,7 @@ public class MtReceiveContentDTO {
@JsonProperty("作业仓库")
private String warehouse;//仓库编码
@JsonProperty("发单编号")
private String invoiceOrderCode;//发单编号
@JsonProperty("发单编号")
private String invoiceOrderCode;//发单编号
}

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

@ -260,14 +260,12 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
jsonObject1.put("USERID", userid);
jsonObject1.put("USERPWD", pwd);
jsonObject1.put("Timestamp", time);
logger.info("##############getMengtianToken: 获取梦天token请求参数 {}", jsonObject1);
String result = HttpRequest.post(mtFactoryProperties.getUrl() + "/Auth/Validate")
.header("Content-Type", "application/json").body(jsonObject1.toJSONString()).timeout(5 * 1000)
.execute()
.body();
//获取的结果转成json对象
JSONObject jsonObject = JSONObject.parseObject(result);
logger.info("##############getMengtianToken: 获取梦天token返回参数 {}", result);
Integer code = jsonObject.getInteger("Result");
String access_token = jsonObject.getString("Data");
@ -389,16 +387,13 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException, NoSuchAlgorithmException {
log.info("###########sendReceiveInfo: 处理签收图片数据开始");
logger.info("#############sendReceiveInfo:tag{}", 1);
Integer newDistributionContactId = receiveInfoDTO.getNewDistributionContactId();
List<ReceiveBodyDTO> receiveBodyList = receiveInfoDTO.getReceiveBodyList();
List<ReceivePhotoDTO> receivePhotoList = receiveInfoDTO.getReceivePhotoList();
logger.info("#############sendReceiveInfo:tag{}", 2);
//查询签收人
NewDistributionContactEntity newDistributionContactEntity = newDistributionContactClient.fingByNewDistributionContactId(newDistributionContactId);
logger.info("#############sendReceiveInfo:tag{}", 3);
String receiver = null;
if (!Objects.isNull(newDistributionContactEntity)) {
@ -414,7 +409,6 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
//循环处理签收信息
List<MtReceiveContentDTO> mtReceiveContentDTOList = new ArrayList<>();
logger.info("#############sendReceiveInfo:tag{}", 4);
for (ReceiveBodyDTO receiveBodyDTO : receiveBodyList) {
String unitNo = receiveBodyDTO.getUnitNo();//包条码
@ -422,7 +416,6 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
QueryWrapper<MtPackageInfo> packageInfoQueryWrapper = new QueryWrapper<>();
packageInfoQueryWrapper.eq("package_code", unitNo);
MtPackageInfo one = mtPackageInfoService.getOne(packageInfoQueryWrapper);
logger.info("#############sendReceiveInfo:tag{}", 5);
if (Objects.isNull(one)) {
logger.info("#############sendReceiveInfo: 当前包条码未找到对应数据unitNo={}", unitNo);
@ -430,17 +423,14 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
}
Long orderId = one.getOrderId();
MtFactoryOrder mtFactoryOrder = mtFactoryOrderService.getById(orderId);
logger.info("#############sendReceiveInfo:tag{}", 6);
if (Objects.isNull(mtFactoryOrder)) {
logger.info("#############sendReceiveInfo: 未找到对应订单orderId={}", orderId);
continue;
}
Long mainId = mtFactoryOrder.getMainId();
logger.info("#############sendReceiveInfo:tag{}", 7);
MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId);
logger.info("#############sendReceiveInfo:tag{}", 8);
if (Objects.isNull(mtFactoryOrderMain)) {
logger.info("#############sendReceiveInfo: 未找到对应订单mainId={}", mainId);
@ -455,7 +445,6 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
mtReceiveContentDTO.setUnitNo(unitNo);
mtReceiveContentDTO.setOperateDate(receiveBodyDTO.getOperateDate());
mtReceiveContentDTOList.add(mtReceiveContentDTO);
logger.info("#############sendReceiveInfo:tag{}", 9);
}
logger.info("#############sendReceiveInfo:tag{}", 10);
@ -476,7 +465,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
ObjectMapper objectMapper = new ObjectMapper();
String s = objectMapper.writeValueAsString(mtReceiveDTO);
logger.info("#############sendReceiveInfo:tag{}", 11);
log.info("###########sendReceiveInfo: 处理签收返回数据完成 {}",s);
return sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QianShouDan", s, 5,mtReceiveDTO.getSendTaskId());
@ -499,13 +488,11 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
//请求参数
R r =sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QueRenShouHuo", s, 4,unloadCarNum);
if (r.getCode() == ResultCode.SUCCESS.getCode()) {
log.info("##################{} 梦天确认签收数据推送2", unloadCarNum);
MtPushData mtPushData = new MtPushData();
mtPushData.setPushTime(new Date());
mtPushData.setPushStatus(1);// 推送状态
mtPushData.setRefCode(unloadCarNum);
mtPushData.setRefType(1);// 订单主表
// todo 这里需要查询主推送单的 ID
List<MtFactoryOrderMain> mtFactoryOrderMainList = mtFactoryOrderMainService.findMtFactoryOrderMainByInvoiceOrderCode(unloadCarNum);
if (mtFactoryOrderMainList.size() > 0) {
mtFactoryOrderMainList.get(0);
@ -529,6 +516,10 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
* @throws NoSuchAlgorithmException
*/
private R sendMtFactoryData(String url, String data, Integer type,String refCode) throws NoSuchAlgorithmException {
logger.info("##############sendMtFactoryData 发送数据: {}", data);
//先获取token
String token = getMtToken();
//处理逻辑
@ -541,7 +532,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
.body(data).timeout(5 * 1000)
.execute().body();
logger.info("##############sendMtFactoryData: {}", result);
logger.info("##############sendMtFactoryData 接受数据: {}", result);
// 保存数据到数据库
MtOrderLogEntity mtOrderLogEntity = new MtOrderLogEntity();
mtOrderLogEntity.setReqArgs(data);

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -504,6 +504,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// 修改收货
if(distributionStockArticleEntity.getOrderStatus().equals(OrderStatusConstant.ruku.getValue())){
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
// 更新齐套状态
// todo 这里需要多仓齐套的查询条件
distributionStockArticleEntity.setCompleteSet(1);
}
// 修改最新的入库时间
distributionStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
@ -511,7 +514,6 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// //包件保存成功去修改订单的数量
// distributionStockArticleClient.addHandQuantity(id, 1);
// todo 这里需要根据包件状态修改状态
logger.info("#################handleDataToPlatform: 数据处理完成");
} else {
//已存在包件信息那就不处理

Loading…
Cancel
Save