Browse Source

Merge branch 'replay_no_push_logs' into dev

dev-warehouse
pref_mail@163.com 2 years ago
parent
commit
99489a0456
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  3. 12
      blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java
  4. 2
      blade-gateway/src/main/resources/bootstrap.yml
  5. 1
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataBasicCostVO.java
  6. 1
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataCategoryVO.java
  7. 2
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtFactoryOrder.java
  8. 16
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtFactoryOrderMain.java
  9. 55
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtOrderLogEntity.java
  10. 2
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtPackageInfo.java
  11. 1
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPrintTemplateService.java
  12. 5
      blade-service/logpm-basicdata/pom.xml
  13. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java
  14. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCustomerBaseServiceImpl.java
  15. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java
  16. 2
      blade-service/logpm-distribution/Dockerfile
  17. 2
      blade-service/logpm-distribution/src/main/resources/application-prod.yml
  18. 2
      blade-service/logpm-distribution/src/main/resources/application-test.yml
  19. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java
  20. 3
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  21. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java
  22. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java
  23. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java
  24. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.java
  25. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMapper.java
  26. 46
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtOrderLogMapper.java
  27. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPackageInfoMapper.java
  28. 30
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/OrderLogMapper.xml
  29. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderMainService.java
  30. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderService.java
  31. 32
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtOrderLogService.java
  32. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtPackageInfoService.java
  33. 132
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  34. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java
  35. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderServiceImpl.java
  36. 40
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtOrderLogServiceImpl.java
  37. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtPackageInfoServiceImpl.java
  38. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java
  39. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java
  40. 31
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java
  41. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderLogMapper.java
  42. 163
      blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java

4
blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@ -56,7 +56,7 @@ public interface LauncherConstant {
/**
* nacos test 地址
*/
String NACOS_TEST_ADDR = "192.168.2.110:8848";
String NACOS_TEST_ADDR = "172.16.128.146:8848";
/**
@ -88,7 +88,7 @@ public interface LauncherConstant {
/**
* seata test 地址
*/
String SEATA_TEST_ADDR = "192.168.2.110:8091";
String SEATA_TEST_ADDR = "172.16.128.146:8091";
/**

1
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -10,7 +10,6 @@ public interface ModuleNameConstant {
*/
public static final String DEVAUTH ="";
/**
* 工厂对接服务名称
*/

12
blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

@ -39,9 +39,21 @@ public class LauncherServiceImpl implements LauncherService {
// 通用注册
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
// PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true");
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123");
// dubbo注册
PropsUtil.setProperty(props, "dubbo.application.name", appName);
PropsUtil.setProperty(props, "dubbo.application.qos.enable", "false");

2
blade-gateway/src/main/resources/bootstrap.yml

@ -1,5 +1,5 @@
server:
port: 8888
port: 9999
spring:
cloud:
gateway:

1
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataBasicCostVO.java

@ -17,7 +17,6 @@
package com.logpm.basicdata.vo;
import com.logpm.basicdata.entity.BasicdataBasicCostEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;

1
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataCategoryVO.java

@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.logpm.basicdata.entity.BasicdataCategoryEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;

2
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrder.java → blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtFactoryOrder.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.entity;
package com.logpm.factory.mt.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;

16
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrderMain.java → blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtFactoryOrderMain.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.entity;
package com.logpm.factory.mt.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -60,11 +60,11 @@ public class MtFactoryOrderMain extends BaseEntity {
@ApiModelProperty(value = "备注")
private String remark;
@JsonProperty("反馈梦天状态")
@ApiModelProperty(value = "反馈梦天状态")
private Integer pushStatus;
@JsonProperty("推送时间")
@ApiModelProperty(value = "推送时间")
private Date pushTime;
// @JsonProperty("反馈梦天状态")
// @ApiModelProperty(value = "反馈梦天状态")
// private Integer pushStatus;
//
// @JsonProperty("推送时间")
// @ApiModelProperty(value = "推送时间")
// private Date pushTime;
}

55
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtOrderLogEntity.java

@ -0,0 +1,55 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.mt.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
* 梦天接口日志 实体类
*
* @author BladeX
* @since 2023-03-28
*/
@Data
@TableName("mt_order_log")
@ApiModel(value = "OrderLog对象", description = "梦天接口日志")
@EqualsAndHashCode(callSuper = true)
public class MtOrderLogEntity extends BaseEntity {
/**
* 请求参数
*/
@ApiModelProperty(value = "请求参数")
private String reqArgs;
/**
* 相应内容
*/
@ApiModelProperty(value = "相应内容")
private String resBody;
/**
* 请求数据类型1 标识请求订单信息 ...
*/
@ApiModelProperty(value = "请求数据类型:1 收货入库 2.入库 4.卸车确认")
private Integer type;
}

2
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java → blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtPackageInfo.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.entity;
package com.logpm.factory.mt.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;

1
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPrintTemplateService.java

@ -26,7 +26,6 @@ import com.logpm.basic.vo.BasicPrintTemplateVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
import java.util.Map;
/**
* 打印模板信息 服务类

5
blade-service/logpm-basicdata/pom.xml

@ -55,6 +55,11 @@
<version>3.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-user-api</artifactId>
<version>${bladex.project.version}</version>
</dependency>
</dependencies>

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java

@ -46,7 +46,6 @@ public interface BasicdataDriverArteryMapper extends BaseMapper<BasicdataDriverA
/**
* 获取导出数据
*
* @param queryWrapper
* @return
*/

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCustomerBaseServiceImpl.java

@ -21,10 +21,7 @@ import com.logpm.basicdata.vo.BasicdataCustomerBaseVO;
import com.logpm.basicdata.excel.BasicdataCustomerBaseExcel;
import com.logpm.basicdata.mapper.BasicdataCustomerBaseMapper;
import com.logpm.basicdata.service.IBasicdataCustomerBaseService;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.system.entity.UserOauth;
import org.springblade.system.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java

@ -20,8 +20,9 @@ package com.logpm.basicdata.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.google.zxing.WriterException;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basic.feign.IBasicTenantCodeClient;
@ -45,20 +46,19 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageOutputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

2
blade-service/logpm-distribution/Dockerfile

@ -6,7 +6,7 @@ RUN mkdir -p /logpm/distribution
WORKDIR /logpm/distribution
EXPOSE 8500
EXPOSE 8600
ADD ./target/logpm-distribution.jar ./app.jar

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

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

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

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

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java

@ -161,7 +161,7 @@ public class FactoryCommonController {
try {
if (StringUtil.isBlank(receiveInfoDTO.getCompleteDate())) {
String data = DateUtil.format(new Date(), "yyyy-mm-dd HH:mm:ss");
String data = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
receiveInfoDTO.setCompleteDate(data);
}

3
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.logpm.factory.comfac.constant.FactoryConstant;
import com.logpm.factory.comfac.service.IAsyncDataService;
import com.logpm.factory.mt.entity.MtFactoryOrder;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtPackageInfo;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.mt.service.IMtFactoryOrderService;
import com.logpm.factory.mt.service.IMtPackageInfoService;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java

@ -1,7 +1,7 @@
package com.logpm.factory.mt.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import lombok.Data;
import lombok.EqualsAndHashCode;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java

@ -1,7 +1,7 @@
package com.logpm.factory.mt.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import com.logpm.factory.mt.entity.MtFactoryOrder;
import lombok.Data;
import lombok.EqualsAndHashCode;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java

@ -1,6 +1,6 @@
package com.logpm.factory.mt.dto;
import com.logpm.factory.snm.entity.MtPackageInfo;
import com.logpm.factory.mt.entity.MtPackageInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.java

@ -1,7 +1,7 @@
package com.logpm.factory.mt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import java.util.List;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMapper.java

@ -1,7 +1,7 @@
package com.logpm.factory.mt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import com.logpm.factory.mt.entity.MtFactoryOrder;
public interface MtFactoryOrderMapper extends BaseMapper<MtFactoryOrder> {
}

46
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtOrderLogMapper.java

@ -0,0 +1,46 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.mt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.factory.mt.entity.MtOrderLogEntity;
import com.logpm.factory.snm.entity.OrderLogEntity;
import com.logpm.factory.snm.vo.OrderLogVO;
import java.util.List;
/**
* 诗尼曼接口日志 Mapper 接口
*
* @author BladeX
* @since 2023-03-28
*/
public interface MtOrderLogMapper extends BaseMapper<MtOrderLogEntity> {
/**
* 自定义分页
*
* @param page
* @param orderLog
* @return
*/
List<OrderLogVO> selectOrderLogPage(IPage page, OrderLogVO orderLog);
OrderLogEntity selectOrderLogLastOne();
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPackageInfoMapper.java

@ -1,7 +1,7 @@
package com.logpm.factory.mt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.MtPackageInfo;
import com.logpm.factory.mt.entity.MtPackageInfo;
public interface MtPackageInfoMapper extends BaseMapper<MtPackageInfo> {
}

30
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/OrderLogMapper.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factory.mt.mapper.MtOrderLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="orderLogResultMap" type="com.logpm.factory.mt.entity.MtOrderLogEntity">
<result column="id" property="id"/>
<result column="req_args" property="reqArgs"/>
<result column="res_body" property="resBody"/>
<result column="type" property="type"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
</resultMap>
<select id="selectOrderLogPage" resultMap="orderLogResultMap">
select * from mt_order_log where is_deleted = 0
</select>
<select id="selectOrderLogLastOne" resultMap="orderLogResultMap">
select * from mt_order_log where type=1 order by create_time desc limit 1
</select>
</mapper>

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderMainService.java

@ -1,6 +1,6 @@
package com.logpm.factory.mt.service;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderService.java

@ -1,6 +1,6 @@
package com.logpm.factory.mt.service;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import com.logpm.factory.mt.entity.MtFactoryOrder;
import org.springblade.core.mp.base.BaseService;
public interface IMtFactoryOrderService extends BaseService<MtFactoryOrder> {

32
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtOrderLogService.java

@ -0,0 +1,32 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.mt.service;
import com.logpm.factory.mt.entity.MtOrderLogEntity;
import org.springblade.core.mp.base.BaseService;
/**
* 梦天接口日志 服务类
*
* @author pref
* @since 2023-03-28
*/
public interface IMtOrderLogService extends BaseService<MtOrderLogEntity> {
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtPackageInfoService.java

@ -1,6 +1,6 @@
package com.logpm.factory.mt.service;
import com.logpm.factory.snm.entity.MtPackageInfo;
import com.logpm.factory.mt.entity.MtPackageInfo;
import org.springblade.core.mp.base.BaseService;
import java.util.List;

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

@ -12,19 +12,19 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.logpm.factory.comfac.dto.*;
import com.logpm.factory.mt.dto.*;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.mt.service.IMtFactoryOrderService;
import com.logpm.factory.mt.service.IMtPackageInfoService;
import com.logpm.factory.mt.entity.MtFactoryOrder;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtOrderLogEntity;
import com.logpm.factory.mt.entity.MtPackageInfo;
import com.logpm.factory.mt.service.*;
import com.logpm.factory.props.MtFactoryProperties;
import com.logpm.factory.snm.bean.Resp;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.snm.entity.MtPackageInfo;
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 io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
@ -38,7 +38,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.*;
@ -61,6 +60,8 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
private final INewDistributionContactClient newDistributionContactClient;
private final IMtOrderLogService mtOrderLogService;
@Transactional
@Override
public R dealWithData(MtFactoryDataDTO mtFactoryDataDTO) {
@ -283,10 +284,11 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
@Override
public R handleStatusData(OrderStatusDTO orderStatusDTO) throws CustomerException, JsonProcessingException, NoSuchAlgorithmException {
logger.info("#############handleStatusData: orderStatusDTO={}",orderStatusDTO);
String status = orderStatusDTO.getStatus();
String orderNo = orderStatusDTO.getOrderNo();
if("2".equals(status)||"3".equals(status)||"5".equals(status)||"6".equals(status)||"7".equals(status)||"8".equals(status)||"9".equals(status)){
if("1".equals(status)||"2".equals(status)||"3".equals(status)||"5".equals(status)||"6".equals(status)||"7".equals(status)||"8".equals(status)||"9".equals(status)){
logger.info("#############handleStatusData: 当前数据的状态不推送 status={}",status);
return Resp.fail(400,"当前数据的状态不推送");
}
@ -295,13 +297,20 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
//继续判断是否到达目的仓
String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id
//查询destinationWarehouse logiBillNo plantId数据
logger.info("#############tag{}",1);
Map<String,String> supplyData = advanceDetailClient.getSupplyData(orderStatusDTO.getUnitNo());
logger.info("#############tag{}",2);
String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id
logger.info("#############tag{}",3);
if(StringUtil.isBlank(currentWarehouseId)||StringUtil.isBlank(destinationWarehouseId)){
logger.info("#############tag{}",4);
log.warn("##############dealWithDataHandler: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}",currentWarehouseId,destinationWarehouseId);
throw new CustomerException(400,"仓库数据有误");
}else{
logger.info("#############tag{}",5);
if(!currentWarehouseId.equals(destinationWarehouseId)){
logger.info("#############tag{}",6);
log.info("##############dealWithDataHandler: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}",currentWarehouseId,destinationWarehouseId);
throw new CustomerException(400,"仓库数据有误");
}
@ -313,6 +322,8 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
QueryWrapper<MtPackageInfo> packageInfoQueryWrapper = new QueryWrapper<>();
packageInfoQueryWrapper.eq("package_code",unitNo);
MtPackageInfo one = mtPackageInfoService.getOne(packageInfoQueryWrapper);
logger.info("#############one: {}",one);
if(Objects.isNull(one)){
logger.info("#############handleStatusData: 当前包条码未找到对应数据unitNo={}",unitNo);
return Resp.fail(400,"未找到包件数据");
@ -343,38 +354,8 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
String s = objectMapper.writeValueAsString(mtOrderStatusDTO);
//先获取token
String token = getMtToken();
//请求参数
logger.info("##############handleStatusData: 推送包件状态请求参数 {}",s);
return sendMtFactoryData(mtFactoryProperties.getUrl()+"/ZXCFaHuoDan/ShouHuoRuKu",s,1);
//处理逻辑
String result = HttpRequest.post(mtFactoryProperties.getUrl()+"/ZXCFaHuoDan/ShouHuoRuKu")
.header("APPKEY",mtFactoryProperties.getAppkey())
.header("Authorization",token)
.header("USERID",mtFactoryProperties.getUserid())
.header("USERPWD",MD5Utils.md5Hex(mtFactoryProperties.getUserpwd().getBytes(StandardCharsets.UTF_8)))
.header("Content-Type","application/json")
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############handleStatusData: 推送包件状态返回参数 {}",result);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
if(!Objects.isNull(jsonObject)){
Integer code = jsonObject.getInteger("Result");
String message = jsonObject.getString("Message");
if(code.equals(0)){
logger.info("##########handleStatusData: 物流状态传递成功");
}else{
return Resp.fail(405,message);
}
}else{
return Resp.fail(405,"返回格式有误:"+result);
}
return Resp.success("SUCCESS");
}
@ -449,39 +430,9 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
String s = objectMapper.writeValueAsString(mtReceiveDTO);
//推送数据到梦天
//先获取token
String token = getMtToken();
//请求参数
logger.info("##############sendReceiveInfo: 推送包件状态请求参数 {}",s);
//处理逻辑
String result = HttpRequest.post(mtFactoryProperties.getUrl()+"/ZXCFaHuoDan/QianShouDan")
.header("APPKEY",mtFactoryProperties.getAppkey())
.header("Authorization",token)
.header("USERID",mtFactoryProperties.getUserid())
.header("USERPWD",MD5Utils.md5Hex(mtFactoryProperties.getUserpwd().getBytes(StandardCharsets.UTF_8)))
.header("Content-Type","application/json")
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############sendReceiveInfo: 推送包件状态返回参数 {}",result);
return sendMtFactoryData(mtFactoryProperties.getUrl()+"/ZXCFaHuoDan/QianShouDan",s,5);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
if(!Objects.isNull(jsonObject)){
Integer code = jsonObject.getInteger("Result");
String message = jsonObject.getString("Message");
if(code.equals(0)){
logger.info("##########sendReceiveInfo: 物流状态传递成功");
}else{
return Resp.fail(405,message);
}
}else{
return Resp.fail(405,"返回格式有误:"+result);
}
return R.success("处理签收数据完成");
}
@ -497,31 +448,49 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
String s = objectMapper.writeValueAsString(unLoadCarNumDTO);
//推送数据到梦天
//先获取token
String token = getMtToken();
//请求参数
logger.info("##############sendReceiveInfo: 推送包件状态请求参数 {}",s);
return sendMtFactoryData(mtFactoryProperties.getUrl()+"/ZXCFaHuoDan/QueRenShouHuo",s,4);
}
/**
* 封装梦天数据对接接口
* @param url
* @param data
* @return
* @throws NoSuchAlgorithmException
*/
private R sendMtFactoryData(String url, String data, Integer type) throws NoSuchAlgorithmException {
//先获取token
String token = getMtToken();
//处理逻辑
String result = HttpRequest.post(mtFactoryProperties.getUrl()+"/ZXCFaHuoDan/QueRenShouHuo")
String result = HttpRequest.post(url)
.header("APPKEY",mtFactoryProperties.getAppkey())
.header("Authorization",token)
.header("USERID",mtFactoryProperties.getUserid())
.header("USERPWD",MD5Utils.md5Hex(mtFactoryProperties.getUserpwd().getBytes(StandardCharsets.UTF_8)))
.header("Content-Type","application/json")
.body(s).timeout(5 * 1000)
.body(data).timeout(5 * 1000)
.execute().body();
logger.info("##############sendReceiveInfo: 车次作业确认完成 {}",result);
logger.info("##############sendMtFactoryData: {}",result);
// 保存数据到数据库
MtOrderLogEntity mtOrderLogEntity = new MtOrderLogEntity();
mtOrderLogEntity.setReqArgs(data);
mtOrderLogEntity.setResBody(result);
mtOrderLogEntity.setType(type);
mtOrderLogService.save(mtOrderLogEntity);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
if(!Objects.isNull(jsonObject)){
Integer code = jsonObject.getInteger("Result");
String message = jsonObject.getString("Message");
if(code.equals(0)){
logger.info("##########sendReceiveInfo: 物流状态传递成功");
logger.info("##########sendMtFactoryData: 物流状态传递成功");
return Resp.success("物流状态传递成功");
}else{
return Resp.fail(405,message);
}
@ -530,9 +499,6 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
}
return R.success("处理签收数据完成");
}
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java

@ -1,6 +1,6 @@
package com.logpm.factory.mt.service.impl;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.mapper.MtFactoryOrderMainMapper;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderServiceImpl.java

@ -1,8 +1,8 @@
package com.logpm.factory.mt.service.impl;
import com.logpm.factory.mt.entity.MtFactoryOrder;
import com.logpm.factory.mt.mapper.MtFactoryOrderMapper;
import com.logpm.factory.mt.service.IMtFactoryOrderService;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

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

@ -0,0 +1,40 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.mt.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.factory.mt.entity.MtOrderLogEntity;
import com.logpm.factory.mt.mapper.MtOrderLogMapper;
import com.logpm.factory.mt.service.IMtOrderLogService;
import com.logpm.factory.snm.entity.OrderLogEntity;
import com.logpm.factory.snm.mapper.OrderLogMapper;
import com.logpm.factory.snm.service.IOrderLogService;
import com.logpm.factory.snm.vo.OrderLogVO;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 梦天接口日志 服务实现类
*
* @author BladeX
* @since 2023-03-28
*/
@Service
public class MtOrderLogServiceImpl extends BaseServiceImpl<MtOrderLogMapper, MtOrderLogEntity> implements IMtOrderLogService {
}

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtPackageInfoServiceImpl.java

@ -1,8 +1,8 @@
package com.logpm.factory.mt.service.impl;
import com.logpm.factory.mt.entity.MtPackageInfo;
import com.logpm.factory.mt.mapper.MtPackageInfoMapper;
import com.logpm.factory.mt.service.IMtPackageInfoService;
import com.logpm.factory.snm.entity.MtPackageInfo;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@ -11,7 +11,7 @@ import java.util.List;
@AllArgsConstructor
@Service
public class MtPackageInfoServiceImpl extends BaseServiceImpl<MtPackageInfoMapper,MtPackageInfo> implements IMtPackageInfoService {
public class MtPackageInfoServiceImpl extends BaseServiceImpl<MtPackageInfoMapper, MtPackageInfo> implements IMtPackageInfoService {
@Override
public void updateDeleteByIds(List<Long> updateList) {
baseMapper.deleteBatchIds(updateList);

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java

@ -73,7 +73,14 @@ public class OrderStatusHandler {
}
break;
case FactoryConstant.MENGT:
r = mtFactoryDataService.handleStatusData(orderStatusDTO);
try{
r = mtFactoryDataService.handleStatusData(orderStatusDTO);
}catch (CustomerException rc){
if(200!=rc.code||400!=rc.code){
throw new CustomerException("程序异常,需要重试");
}
}
code = r.getCode();
if(code == 400 || code == 200){
log.info("##################orderStatusHandler: 该条数据不用处理 orderNo={}",orderNo);

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java

@ -74,7 +74,7 @@ public class ReceiveInfoHandler {
int code = r.getCode();
if(code == 400 || code == 200){
log.info("##################receiveInfoHandler: 该条数据不用处理 orderNo={}",orderCode);
channel.basicAck(deliveryTag,true);
// channel.basicAck(deliveryTag,true);
}else{
throw new CustomerException(code,r.getMsg());
}

31
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java

@ -1,21 +1,20 @@
package com.logpm.factory.receiver;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.comfac.dto.OrderInfoDTO;
import com.logpm.factory.comfac.dto.UnloadCarDTO;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.feign.IAdvanceClient;
import com.logpm.oldproject.feign.IAdvanceDetailClient;
import com.rabbitmq.client.Channel;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
@ -24,7 +23,6 @@ import org.springframework.stereotype.Component;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -114,19 +112,26 @@ public class UnloadCarComHandler {
break;
}
}
if (isPush) {
try {
R r = mtFactoryDataService.sendUnloadCarNum(carNum, unloadCarDTO.getCompleteDate());
if(r.isSuccess()){
log.info("##################{} 梦天确认签收数据推送1",carNum);
if(r.getCode()== ResultCode.SUCCESS.getCode()){
log.info("##################{} 梦天确认签收数据推送2",carNum);
// 更新订单状态
UpdateChainWrapper<MtFactoryOrderMain> updateChainWrapper =new UpdateChainWrapper<MtFactoryOrderMain>(MtFactoryOrderMain.class);
updateChainWrapper.set("push_status","1");
updateChainWrapper.set("push_time",new Date());
updateChainWrapper.eq("invoice_order_code",carNum);
mtFactoryOrderMainService.update(updateChainWrapper);
}
List<MtFactoryOrderMain> res =mtFactoryOrderMainService.lambdaQuery().eq(MtFactoryOrderMain::getInvoiceOrderCode,carNum).list();
if(res.size()>0){
MtFactoryOrderMain mtFactoryOrderMain = res.get(0);
mtFactoryOrderMain.setPushStatus(1);
mtFactoryOrderMain.setPushTime(new Date());
mtFactoryOrderMainService.getBaseMapper().updateById(mtFactoryOrderMain);
}
}
} catch (ParseException e) {
e.printStackTrace();

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderLogMapper.java

@ -16,6 +16,7 @@
*/
package com.logpm.factory.snm.mapper;
import com.logpm.factory.mt.entity.MtOrderLogEntity;
import com.logpm.factory.snm.entity.OrderLogEntity;
import com.logpm.factory.snm.vo.OrderLogVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

163
blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java

@ -4,10 +4,10 @@
//import com.fasterxml.jackson.core.JsonProcessingException;
//import com.logpm.factory.comfac.controller.FactoryCommonController;
//import com.logpm.factory.comfac.dto.UnloadCarDTO;
//import com.logpm.factory.mt.entity.MtFactoryOrderMain;
//import com.logpm.factory.mt.service.IMtFactoryDataService;
//import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
//import com.logpm.factory.mt.service.impl.MtFactoryDataServiceImpl;
//import com.logpm.factory.snm.entity.MtFactoryOrderMain;
//import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
//import com.logpm.oldproject.entity.AdvanceDetailEntity;
//import com.logpm.oldproject.feign.IAdvanceDetailClient;
@ -44,6 +44,19 @@
//
// @Autowired
// private IMtFactoryDataService mtFactoryDataService;
//
//
// @Test
// public void testUpdate(){
//
//// UpdateChainWrapper<MtFactoryOrderMain> updateChainWrapper =new UpdateChainWrapper<MtFactoryOrderMain>(MtFactoryOrderMain.class);
//// updateChainWrapper.set("push_status","1");
//// updateChainWrapper.set("push_time",new Date());
//// updateChainWrapper.eq("invoice_order_code","HYLEJIA-230730");
//// mtFactoryOrderMainService.update(updateChainWrapper);
// }
//
//
// @Test
// public void contextLoads() {
//
@ -52,80 +65,80 @@
// 2. 需要判断这个车次是否市梦天的
// 3. 查询这个车次上的运单是否市梦天的
//
// 4.查询包间对应的梦天发给我们的批次号
// */
// UnloadCarDTO unloadCarDTO = new UnloadCarDTO();
// unloadCarDTO.setUnloadCarNum("LQGX230719001");
// unloadCarDTO.setCompleteDate("2023-07-19 16:48:45");
//
// /*
// 2.通过车次查询来系统中车次绑定的运单
// 3.通过运单查询货物上的包件
// 4.需要过滤出来 只要梦天的
// */
// List<AdvanceDetailEntity> carNumList = advanceDetailClient.getByCarNum(unloadCarDTO.getUnloadCarNum());
//
//
// /**
// * 安装品类进行分组
// */
// Map<String, List<AdvanceDetailEntity>> carNumMapList = carNumList.stream().collect(Collectors.groupingBy(AdvanceDetailEntity::getType));
//
// List<AdvanceDetailEntity> mtListdata = carNumMapList.get("梦天");
//
// if (mtListdata == null || mtListdata.size() == 0) {
// return;
// }
//
// // 得到车次下面梦天的包条码集合
// List<String> mtStrs = mtListdata.stream().map(AdvanceDetailEntity::getUnitNo).collect(Collectors.toList());
// if (mtStrs == null || mtStrs.size() == 0) {
// return;
// }
//
// List<MTOrderPackageRelationVO> allMtData = mtFactoryOrderMainService.mtOrderPackageRelation();
// // 对这个集合内进行分组
// Map<String, List<MTOrderPackageRelationVO>> stringListMap = allMtData.stream().collect(Collectors.groupingBy(MTOrderPackageRelationVO::getInvoiceOrderCode));
// Set<String> set = stringListMap.keySet();
// boolean isPush = false;
// for (String s : set) {
// // 得到某个工厂运输批次的集合
// List<MTOrderPackageRelationVO> t = stringListMap.get(s);
// //得到这个批次下面所有的包间
// List<String> strs = t.stream().map(MTOrderPackageRelationVO::getPackageCode).collect(Collectors.toList());
// // 当前批次的包间 在 这个配载计划中存在一个 则进行通知
// for (String mtStr : mtStrs) {
// if (strs.contains(mtStr)) {
// isPush = true;
// break;
// }
// }
// if (isPush) {
// break;
// }
// }
// if (isPush) {
// try {
//
// Date data = new SimpleDateFormat().parse(unloadCarDTO.getCompleteDate());
// R r = mtFactoryDataService.sendUnloadCarNum(unloadCarDTO.getUnloadCarNum(), data);
// // 更新订单状态
// UpdateChainWrapper<MtFactoryOrderMain> updateChainWrapper =new UpdateChainWrapper<MtFactoryOrderMain>(MtFactoryOrderMain.class);
// updateChainWrapper.set("push_status","1");
// updateChainWrapper.set("push_time",data);
// updateChainWrapper.eq("invoice_order_code",unloadCarDTO.getUnloadCarNum());
// mtFactoryOrderMainService.update(updateChainWrapper);
//
// } catch (ParseException e) {
// e.printStackTrace();
// } catch (JsonProcessingException e) {
// e.printStackTrace();
// } catch (NoSuchAlgorithmException e) {
// e.printStackTrace();
// }
//
//
// }
//// 4.查询包间对应的梦天发给我们的批次号
//// */
//// UnloadCarDTO unloadCarDTO = new UnloadCarDTO();
//// unloadCarDTO.setUnloadCarNum("LQGX230719001");
//// unloadCarDTO.setCompleteDate("2023-07-19 16:48:45");
////
//// /*
//// 2.通过车次查询来系统中车次绑定的运单
//// 3.通过运单查询货物上的包件
//// 4.需要过滤出来 只要梦天的
//// */
//// List<AdvanceDetailEntity> carNumList = advanceDetailClient.getByCarNum(unloadCarDTO.getUnloadCarNum());
////
////
//// /**
//// * 安装品类进行分组
//// */
//// Map<String, List<AdvanceDetailEntity>> carNumMapList = carNumList.stream().collect(Collectors.groupingBy(AdvanceDetailEntity::getType));
////
//// List<AdvanceDetailEntity> mtListdata = carNumMapList.get("梦天");
////
//// if (mtListdata == null || mtListdata.size() == 0) {
//// return;
//// }
////
//// // 得到车次下面梦天的包条码集合
//// List<String> mtStrs = mtListdata.stream().map(AdvanceDetailEntity::getUnitNo).collect(Collectors.toList());
//// if (mtStrs == null || mtStrs.size() == 0) {
//// return;
//// }
////
//// List<MTOrderPackageRelationVO> allMtData = mtFactoryOrderMainService.mtOrderPackageRelation();
//// // 对这个集合内进行分组
//// Map<String, List<MTOrderPackageRelationVO>> stringListMap = allMtData.stream().collect(Collectors.groupingBy(MTOrderPackageRelationVO::getInvoiceOrderCode));
//// Set<String> set = stringListMap.keySet();
//// boolean isPush = false;
//// for (String s : set) {
//// // 得到某个工厂运输批次的集合
//// List<MTOrderPackageRelationVO> t = stringListMap.get(s);
//// //得到这个批次下面所有的包间
//// List<String> strs = t.stream().map(MTOrderPackageRelationVO::getPackageCode).collect(Collectors.toList());
//// // 当前批次的包间 在 这个配载计划中存在一个 则进行通知
//// for (String mtStr : mtStrs) {
//// if (strs.contains(mtStr)) {
//// isPush = true;
//// break;
//// }
//// }
//// if (isPush) {
//// break;
//// }
//// }
//// if (isPush) {
//// try {
////
//// Date data = new SimpleDateFormat().parse(unloadCarDTO.getCompleteDate());
//// R r = mtFactoryDataService.sendUnloadCarNum(unloadCarDTO.getUnloadCarNum(), data);
//// // 更新订单状态
//// UpdateChainWrapper<MtFactoryOrderMain> updateChainWrapper =new UpdateChainWrapper<MtFactoryOrderMain>(MtFactoryOrderMain.class);
//// updateChainWrapper.set("push_status","1");
//// updateChainWrapper.set("push_time",data);
//// updateChainWrapper.eq("invoice_order_code",unloadCarDTO.getUnloadCarNum());
//// mtFactoryOrderMainService.update(updateChainWrapper);
////
//// } catch (ParseException e) {
//// e.printStackTrace();
//// } catch (JsonProcessingException e) {
//// e.printStackTrace();
//// } catch (NoSuchAlgorithmException e) {
//// e.printStackTrace();
//// }
////
////
//// }
//
//
// }

Loading…
Cancel
Save