feat(service): 增加直发商家签收数据推送工厂 #35

Merged
zhaoqiaobo merged 6 commits from dev into pre-production 12 months ago
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStockarticleEntity.java
  2. 11
      blade-service/logpm-basicdata/src/main/resources/application-dev.yml
  3. 11
      blade-service/logpm-basicdata/src/main/resources/application-prod.yml
  4. 11
      blade-service/logpm-basicdata/src/main/resources/application-test.yml
  5. 11
      blade-service/logpm-basicdata/src/main/resources/application.yml
  6. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  7. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java
  8. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  9. 109
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  10. 11
      blade-service/logpm-warehouse/src/main/resources/application-dev.yml
  11. 11
      blade-service/logpm-warehouse/src/main/resources/application-prod.yml
  12. 11
      blade-service/logpm-warehouse/src/main/resources/application-test.yml
  13. 29
      blade-service/logpm-warehouse/src/main/resources/application.yml

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStockarticleEntity.java

@ -66,7 +66,7 @@ public class DistributionReservationStockarticleEntity extends TenantEntity {
/** /**
* 订单状态1-正常2-取消 * 订单状态1-正常2-取消
*/ */
@ApiModelProperty(value = "订单") @ApiModelProperty(value = "订单状态")
private String stockArticleStatus; private String stockArticleStatus;

11
blade-service/logpm-basicdata/src/main/resources/application-dev.yml

@ -43,3 +43,14 @@ spring:
username: ${blade.datasource.basicdata.slave.username} username: ${blade.datasource.basicdata.slave.username}
password: ${blade.datasource.basicdata.slave.password} password: ${blade.datasource.basicdata.slave.password}
xxl:
job:
accessToken: ''
admin:
addresses: http://127.0.0.1:7009/xxl-job-admin
executor:
appname: logpm-basicdata-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-data-xxljob/jobhandler
logretentiondays: -1
port: 17018

11
blade-service/logpm-basicdata/src/main/resources/application-prod.yml

@ -43,3 +43,14 @@ spring:
username: ${blade.datasource.basicdata.slave.username} username: ${blade.datasource.basicdata.slave.username}
password: ${blade.datasource.basicdata.slave.password} password: ${blade.datasource.basicdata.slave.password}
xxl:
job:
accessToken: ''
admin:
addresses: http://172.16.128.147:7009/xxl-job-admin
executor:
appname: logpm-basicdata-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-data-xxljob/jobhandler
logretentiondays: -1
port: 17018

11
blade-service/logpm-basicdata/src/main/resources/application-test.yml

@ -43,3 +43,14 @@ spring:
username: ${blade.datasource.basicdata.slave.username} username: ${blade.datasource.basicdata.slave.username}
password: ${blade.datasource.basicdata.slave.password} password: ${blade.datasource.basicdata.slave.password}
xxl:
job:
accessToken: ''
admin:
addresses: http://127.0.0.1:7009/xxl-job-admin
executor:
appname: logpm-basicdata-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-data-xxljob/jobhandler
logretentiondays: -1
port: 17018

11
blade-service/logpm-basicdata/src/main/resources/application.yml

@ -20,15 +20,4 @@ spring:
main: main:
allow-circular-references: true allow-circular-references: true
xxl:
job:
accessToken: ''
admin:
addresses: http://127.0.0.1:7009/xxl-job-admin
executor:
appname: logpm-basicdata-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-data-xxljob/jobhandler
logretentiondays: -1
port: 17018

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -6535,6 +6535,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//先查询预约单对应有哪些订单 //先查询预约单对应有哪些订单
QueryWrapper<DistributionReservationStockarticleEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<DistributionReservationStockarticleEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("reservation_id", reservationId); queryWrapper.eq("reservation_id", reservationId);
queryWrapper.ne("stock_article_status", 2);
List<DistributionReservationStockarticleEntity> reservationStockarticleList = distributionReservationStockarticleService.list(queryWrapper); List<DistributionReservationStockarticleEntity> reservationStockarticleList = distributionReservationStockarticleService.list(queryWrapper);
List<Map<String, Object>> ls = new ArrayList<>(); List<Map<String, Object>> ls = new ArrayList<>();
BigDecimal totalPrice = BigDecimal.ZERO; BigDecimal totalPrice = BigDecimal.ZERO;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java

@ -29,7 +29,7 @@ public class OpFailRetryPushPackageServiceImpl implements OpFailRetryPushPackage
protected IOuPaiFactoryService ouPaiFactoryService; protected IOuPaiFactoryService ouPaiFactoryService;
protected final int MAX_RETRY_TIMES = 3; protected final int MAX_RETRY_TIMES = 7;
@Async @Async
@Override @Override

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -495,7 +495,7 @@
</where> </where>
</select> </select>
<select id="fingPackageCodeByLoadId" resultType="com.logpm.trunkline.dto.LoadScanBrandDTO"> <select id="fingPackageCodeByLoadId" resultType="com.logpm.trunkline.dto.LoadScanBrandDTO">
select dpl.brand_name brand,dpl.accept_warehouse_id startWarehouseId,group_concat(dpl.order_package_code) packageCode select dpl.brand_name brand,dpl.send_warehouse_id startWarehouseId,group_concat(dpl.order_package_code) packageCode
from logpm_trunkline_cars_load_scan t from logpm_trunkline_cars_load_scan t
left join logpm_distribution_parcel_list dpl on dpl.order_package_code = t.scan_code and dpl.warehouse_id = #{warehouseId} left join logpm_distribution_parcel_list dpl on dpl.order_package_code = t.scan_code and dpl.warehouse_id = #{warehouseId}
where t.load_id = #{loadId} where t.load_id = #{loadId}

109
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -29,11 +29,73 @@ import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender; import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg; import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.trunkline.bean.Resp; import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.*; import com.logpm.trunkline.dto.BatchUnloadDTO;
import com.logpm.trunkline.entity.*; import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.LoadScanBrandDTO;
import com.logpm.trunkline.dto.LoadingPackageDTO;
import com.logpm.trunkline.dto.LoadingZeroDTO;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO;
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO;
import com.logpm.trunkline.dto.UnloadPackageDTO;
import com.logpm.trunkline.dto.UnloadZeroDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLogEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.entity.TrunklineCostShareRecordEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignPhotoEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper; import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*; import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.vo.*; import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.IPackageTrackLogAsyncService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineCarsLoadContractService;
import com.logpm.trunkline.service.ITrunklineCarsLoadFinanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLineService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLogService;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineCarsLoadingLogService;
import com.logpm.trunkline.service.ITrunklineCarsOrderService;
import com.logpm.trunkline.service.ITrunklineCarsSignLogService;
import com.logpm.trunkline.service.ITrunklineCarsUnloadLogService;
import com.logpm.trunkline.service.ITrunklineCostShareRecordService;
import com.logpm.trunkline.service.ITrunklineLoadSignOrderService;
import com.logpm.trunkline.service.ITrunklineLoadSignPhotoService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.CarsLoadOrderInfoVO;
import com.logpm.trunkline.vo.CarsLoadWaybillInfoVO;
import com.logpm.trunkline.vo.HasNotFinalNodeIdDataVO;
import com.logpm.trunkline.vo.LoadScanFinalNodeIdVO;
import com.logpm.trunkline.vo.LoadScanOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.LoadingListGoodsVO;
import com.logpm.trunkline.vo.LoadingListMainVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.OrderScanDetailVO;
import com.logpm.trunkline.vo.SignOrderDetailVO;
import com.logpm.trunkline.vo.SignPackageVO;
import com.logpm.trunkline.vo.SignScanOrderVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadLoadingListVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadScanVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import com.logpm.trunkline.vo.TrunklineLoadSignOrderVO;
import com.logpm.trunkline.vo.UnloadPackageVO;
import com.logpm.trunkline.vo.UnloadScanOrderVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import com.logpm.trunkline.vo.WaybillCarsLoadVO;
import com.logpm.trunkline.vo.ZeroSuppleVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient; import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
@ -43,7 +105,11 @@ import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.springblade.common.constant.*; import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant; import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException; import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.CommonUtil;
@ -62,7 +128,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
@Slf4j @Slf4j
@Service @Service
@ -3682,16 +3755,34 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//重新计算签收单的数量 //重新计算签收单的数量
updateSignOrderNumBySignOrderId(signOrderId); updateSignOrderNumBySignOrderId(signOrderId);
try{
List<String> orderPackageCodes = new ArrayList<>(); List<String> orderPackageCodes = new ArrayList<>();
try {
orderPackageCodes.add(orderPackageCode); orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseEntity.getName() + "直发商家签收"; String content = "包件在 " + warehouseEntity.getName() + "直发商家签收";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_DIRECT_SHIPPER.getCode(), content); packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_DIRECT_SHIPPER.getCode(), content);
} catch (Exception e) { } catch (Exception e) {
log.warn("###########存入日志信息失败"); log.warn("###########存入日志信息失败");
} }
// 推送签收数据给工厂
try {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if (ObjectUtil.isNotEmpty(parcelListEntity)) {
List<Object> contents = new ArrayList<>();
JSONObject jsonObject = new JSONObject();
jsonObject.put("packageCode", orderPackageCode);
contents.add(jsonObject);
NodePushMsg msg = new NodePushMsg();
msg.setNode(WorkNodeEnums.CLERK_REVIEW);
msg.setBrand(BrandEnums.getByValue(parcelListEntity.getBrandName()));
msg.setOperator(AuthUtil.getNickName());
msg.setOperatorTime(new Date());
msg.setContent(contents);
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg));
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
} catch (Exception e) {
log.error("推送签收数据给工厂失败 {}", e);
}
return R.success("签收成功"); return R.success("签收成功");
} }

11
blade-service/logpm-warehouse/src/main/resources/application-dev.yml

@ -68,3 +68,14 @@ spring:
url: ${blade.datasource.warehouse.slave.url} url: ${blade.datasource.warehouse.slave.url}
username: ${blade.datasource.warehouse.slave.username} username: ${blade.datasource.warehouse.slave.username}
password: ${blade.datasource.warehouse.slave.password} password: ${blade.datasource.warehouse.slave.password}
xxl:
job:
accessToken: ''
admin:
addresses: http://127.0.0.1:7009/xxl-job-admin
executor:
appname: logpm-factory-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-xxljob/jobhandler
logretentiondays: -1
port: 7018

11
blade-service/logpm-warehouse/src/main/resources/application-prod.yml

@ -55,3 +55,14 @@ spring:
acknowledge-mode: manual acknowledge-mode: manual
template: template:
mandatory: true mandatory: true
xxl:
job:
accessToken: ''
admin:
addresses: http://172.16.128.147:7009/xxl-job-admin
executor:
appname: logpm-factory-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-xxljob/jobhandler
logretentiondays: -1
port: 7018

11
blade-service/logpm-warehouse/src/main/resources/application-test.yml

@ -55,3 +55,14 @@ spring:
acknowledge-mode: manual acknowledge-mode: manual
template: template:
mandatory: true mandatory: true
xxl:
job:
accessToken: ''
admin:
addresses: http://127.0.0.1:7009/xxl-job-admin
executor:
appname: logpm-factory-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-xxljob/jobhandler
logretentiondays: -1
port: 7018

29
blade-service/logpm-warehouse/src/main/resources/application.yml

@ -10,23 +10,6 @@ swagger:
- org.springblade - org.springblade
- com.logpm - com.logpm
#oss配置
oss:
enabled: true
name: minio
tenant-mode: false
endpoint: http://127.0.0.1:9000
access-key: D99KGE6ZTQXSATTJWU24
secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ
bucket-name: bladex
#blade配置
blade:
#本地文件上传
file:
remote-mode: true
upload-domain: http://localhost:8999
remote-path: /usr/share/nginx/html
logging: logging:
config: classpath:logback.xml config: classpath:logback.xml
@ -37,15 +20,5 @@ spring:
allow-circular-references: true allow-circular-references: true
xxl:
job:
accessToken: ''
admin:
addresses: http://127.0.0.1:7009/xxl-job-admin
executor:
appname: logpm-factory-xxljob
ip: 127.0.0.1
logpath: ../data/applogs/logpm-factory-xxljob/jobhandler
logretentiondays: -1
port: 7018

Loading…
Cancel
Save