Browse Source

feat(all): 添加索菲亚工厂数据接收

dist.1.3.0
zhaoqiaobo 11 months ago
parent
commit
3892e5c439
  1. 8
      blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java
  2. 20
      blade-service/logpm-factory-data/logpm-factory-data-piano/src/main/java/com/logpm/factorydata/PianoFactoryDataApplication.java
  3. 97
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/pom.xml
  4. 14
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/Dockerfile
  5. 20
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/FactoryDataSuoFeiYaApplication.java
  6. 40
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/FactoryDataSuoFeiYaConfiguration.java
  7. 55
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/controller/OrderController.java
  8. 62
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/DeliveryNoteEntity.java
  9. 58
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/FactoryOrderLogEntity.java
  10. 50
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/OrderInfoEntity.java
  11. 49
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/PackageInfoEntity.java
  12. 60
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/launcher/FactoryDataBaseLauncherServiceImpl.java
  13. 16
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/DeliveryNoteMapper.java
  14. 5
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/FactoryNodeOrderMapper.xml
  15. 16
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/FactoryOrderLogMapper.java
  16. 5
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/FactoryOrderLogMapper.xml
  17. 16
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java
  18. 5
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml
  19. 16
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/PackageInfoMapper.java
  20. 5
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/PackageInfoMapper.xml
  21. 337
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mq/FactoryOrderListener.java
  22. 20
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/pros/FactoryDataSuoFeiYaProperties.java
  23. 17
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/DeliveryNoteService.java
  24. 14
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/FactoryOrderLogService.java
  25. 14
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java
  26. 14
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/PackageInfoService.java
  27. 108
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/DeliveryNoteServiceImpl.java
  28. 22
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/FactoryOrderLogServiceImpl.java
  29. 22
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java
  30. 22
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/PackageInfoServiceImpl.java
  31. 43
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/util/ThreadPoolUtil.java
  32. 32
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/DeliveryNoteVO.java
  33. 21
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/OrderInfoVO.java
  34. 18
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/PackageInfoVO.java
  35. 28
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/ParamVO.java
  36. 26
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/Resp.java
  37. 71
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application-dev.yml
  38. 45
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application-prod.yml
  39. 71
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application-test.yml
  40. 31
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application.yml
  41. 40
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/logback.xml
  42. 14
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/resources/application-prod.yml

8
blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java

@ -49,6 +49,10 @@ public abstract class FactoryDataConstants {
*/
String ZBOM_NODE_DATA_PUSH = "factory.data.queue.zbom.nodeDataPush";
String ZBOM_FACTORY_ORDER = "factory.data.queue.zbom.factoryOrder";
/**
* 索菲亚工厂订单
*/
String SFY_FACTORY_ORDER = "factory.data.queue.sfy.factoryOrder";
/**
* 皮阿诺作业节点数据推送
*/
@ -76,6 +80,10 @@ public abstract class FactoryDataConstants {
*/
String ZBOM_NODE_DATA_PUSH = "zbom.nodeDataPush";
String ZBOM_FACTORY_ORDER = "zbom.factoryOrder";
/**
* 索菲亚工厂订单
*/
String SFY_FACTORY_ORDER = "sfy.factoryOrder";
/**
* 皮阿诺作业节点数据推送
*/

20
blade-service/logpm-factory-data/logpm-factory-data-piano/src/main/java/com/logpm/factorydata/PianoFactoryDataApplication.java

@ -0,0 +1,20 @@
package com.logpm.factorydata;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.cloud.client.BladeCloudApplication;
import org.springblade.core.launch.BladeApplication;
/**
* 工厂数据基础服务启动类
*
* @Author zqb
* @Date 2024/3/14
**/
@BladeCloudApplication
public class PianoFactoryDataApplication {
public static void main(String[] args) {
BladeApplication.run(ModuleNameConstant.LOGPM_FACTORY_DATA_BASE_NAME, PianoFactoryDataApplication.class, args);
}
}

97
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/pom.xml

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>logpm-factory-data</artifactId>
<groupId>org.springblade</groupId>
<version>3.2.0.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>${bladex.project.version}</version>
<packaging>jar</packaging>
<artifactId>logpm-factory-data-suofeiya</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-boot</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-auto</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-factory-data-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-swagger</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-trunkline-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-factory-data-base-api</artifactId>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-oss</artifactId>
</dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-resource-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

14
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/Dockerfile

@ -0,0 +1,14 @@
FROM bladex/alpine-java:openjdk8-openj9_cn_slim
MAINTAINER h5u@163.com
RUN mkdir -p /logpm/logpm-factory-data-suofeiya
WORKDIR /logpm/logpm-factory-data-suofeiya
EXPOSE 18920
ADD ./target/logpm-factory-data-suofeiya.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar","-Xms128m","-Xmx512m", "app.jar"]
CMD ["--spring.profiles.active=test"]

20
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/FactoryDataSuoFeiYaApplication.java

@ -0,0 +1,20 @@
package com.logpm.factorydata;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.cloud.client.BladeCloudApplication;
import org.springblade.core.launch.BladeApplication;
/**
* 索菲亚工厂数据启动类
*
* @author zhaoqiaobo
* @create 2024-4-26
*/
@BladeCloudApplication
public class FactoryDataSuoFeiYaApplication {
public static void main(String[] args) {
BladeApplication.run(ModuleNameConstant.LOGPM_FACTORY_DATA_SUOFEIYA_NAME, FactoryDataSuoFeiYaApplication.class, args);
}
}

40
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/FactoryDataSuoFeiYaConfiguration.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.factorydata.suofeiya.config;
import com.logpm.factorydata.suofeiya.pros.FactoryDataSuoFeiYaProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* 配置feignmybatis包名properties
*
* @author chaos
*/
@Configuration(proxyBeanMethods = false)
@ComponentScan({"org.springblade", "com.logpm"})
@EnableFeignClients({"org.springblade", "com.logpm"})
@MapperScan({"org.springblade.**.mapper.**", "com.logpm.**.mapper.**"})
@EnableConfigurationProperties(FactoryDataSuoFeiYaProperties.class)
public class FactoryDataSuoFeiYaConfiguration {
}

55
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/controller/OrderController.java

@ -0,0 +1,55 @@
package com.logpm.factorydata.suofeiya.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factorydata.suofeiya.service.DeliveryNoteService;
import com.logpm.factorydata.suofeiya.vo.DeliveryNoteVO;
import com.logpm.factorydata.suofeiya.vo.ParamVO;
import com.logpm.factorydata.suofeiya.vo.Resp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* 工厂订单 前端控制器
*
* @author zhaoqiaobo
* @create 2024-03-21 19:27
*/
@Slf4j
@RestController
@RequestMapping("/order")
@AllArgsConstructor
@Api(value = "工厂订单", tags = "工厂订单")
public class OrderController {
private final DeliveryNoteService service;
@ResponseBody
@PostMapping
@ApiOperationSupport(order = 1)
@ApiOperation(value = "工厂订单", notes = "工厂订单")
public Resp order(@RequestBody ParamVO vo) {
String jsonStr = JSONUtil.toJsonStr(vo);
log.info("接收工厂订单:{} ", jsonStr);
String res = "";
try {
DeliveryNoteVO params = vo.getParams();
if (ObjectUtil.isNotEmpty(params)) {
res = service.order(params);
}
} catch (Exception e) {
log.error("工厂订单异常:{} ", e);
return Resp.success("服务器异常");
}
return Resp.success(res);
}
}

62
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/DeliveryNoteEntity.java

@ -0,0 +1,62 @@
package com.logpm.factorydata.suofeiya.entity;
import com.baomidou.mybatisplus.annotation.TableField;
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 zhaoqiaobo
* @create 2024-04-26
*/
@Data
@TableName("sfy_delivery_note")
@ApiModel(value = "索菲亚发货单", description = "索菲亚发货单")
@EqualsAndHashCode(callSuper = true)
public class DeliveryNoteEntity extends BaseEntity {
@ApiModelProperty(name = "渠道单号")
@TableField("logistic_id")
private String logisticID;
@ApiModelProperty(name = "车牌号")
private String truckNo;
@ApiModelProperty(name = "车型")
private String truckTypeName;
@ApiModelProperty(name = "物流商编码")
private String carrierNo;
@ApiModelProperty(name = "司机姓名")
private String driverName;
@ApiModelProperty(name = "联系方式")
private String dirverTel;
@ApiModelProperty(name = "出厂时间")
private String gpsLeaveWhTime;
@ApiModelProperty(name = "发货方地址")
private String sendAddr;
@ApiModelProperty(name = "下单模式")
private String orderType;
@ApiModelProperty(name = "运输方式/产品类型")
private String transportType;
@ApiModelProperty(name = "客户编码/月结账号")
private String customerCode;
@ApiModelProperty(name = "备注")
private String remark;
@ApiModelProperty(name = "扩展字段")
private String orderExtendField;
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
}

58
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/FactoryOrderLogEntity.java

@ -0,0 +1,58 @@
package com.logpm.factorydata.suofeiya.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;
@Data
@TableName("sfy_factory_log")
@ApiModel(value = "接收工厂订单日志", description = "接收工厂订单日志")
@EqualsAndHashCode(callSuper = true)
public class FactoryOrderLogEntity extends BaseEntity {
/**
* 预留1
*/
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
/**
* 日志文件存放地址
*/
@ApiModelProperty(name = "日志文件存放地址", notes = "")
private String logUrl;
/**
* 数据类型 1.入库数据
*/
@ApiModelProperty(name = "数据类型 1.入库数据", notes = "")
private Integer type;
/**
* 解析状态 0 未解析 1 已解析 2 解析失败
*/
@ApiModelProperty(name = "解析状态 0 未解析 1 已解析 2 解析失败", notes = "")
private Integer saxStatus;
}

50
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/OrderInfoEntity.java

@ -0,0 +1,50 @@
package com.logpm.factorydata.suofeiya.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 zhaoqiaobo
* @create 2024-04-26
*/
@Data
@TableName("sfy_order_info")
@ApiModel(value = "订单信息", description = "订单信息")
@EqualsAndHashCode(callSuper = true)
public class OrderInfoEntity extends BaseEntity {
@ApiModelProperty(name = "主单号")
private String mainOrderNo;
@ApiModelProperty(name = "订单号")
private String orderNo;
@ApiModelProperty(name = "安装投影面积")
private String area;
@ApiModelProperty(name = "收货地址")
private String receiveAddr;
@ApiModelProperty(name = "收货人")
private String receiver;
@ApiModelProperty(name = "联系电话")
private String receiveTel;
@ApiModelProperty(name = "配送联系人")
private String connectName;
@ApiModelProperty(name = "配送联系电话")
private String connectPhone;
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
}

49
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/entity/PackageInfoEntity.java

@ -0,0 +1,49 @@
package com.logpm.factorydata.suofeiya.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 zhaoqiaobo
* @create 2024-04-26
*/
@Data
@TableName("sfy_package_info")
@ApiModel(value = "装箱包信息", description = "装箱包信息")
@EqualsAndHashCode(callSuper = true)
public class PackageInfoEntity extends BaseEntity {
@ApiModelProperty(name = "标签号")
private String paNo;
@ApiModelProperty(name = "物料名称")
private String plDepart;
@ApiModelProperty(name = "捆包号")
private String tcNumber;
@ApiModelProperty(name = "经销商编码")
private String dealerNo;
@ApiModelProperty(name = "经销商名称")
private String dealerName;
@ApiModelProperty(name = "订单号")
private String orderNo;
@ApiModelProperty(name = "重量")
private String weight;
@ApiModelProperty(name = "体积")
private String volume;
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
}

60
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/launcher/FactoryDataBaseLauncherServiceImpl.java

@ -0,0 +1,60 @@
/*
* 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.factorydata.suofeiya.launcher;
import org.springblade.core.auto.service.AutoService;
import org.springblade.core.launch.constant.NacosConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springblade.core.launch.utils.PropsUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
import java.util.Properties;
/**
* 启动参数拓展
*
* @author Chill
*/
@AutoService(LauncherService.class)
public class FactoryDataBaseLauncherServiceImpl implements LauncherService {
@Override
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
Properties props = System.getProperties();
// 开启多数据源
PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true");
// 指定注册配置信息
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].data-id", NacosConstant.dataId(appName, profile));
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].group", NacosConstant.NACOS_CONFIG_GROUP);
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH);
// 指定注册IP
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.ip", "127.0.0.1");
// 指定注册端口
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.port", "8200");
// 自定义命名空间
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", LauncherConstant.NACOS_NAMESPACE);
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", LauncherConstant.NACOS_NAMESPACE);
// 自定义分组
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.group", NacosConstant.NACOS_CONFIG_GROUP);
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.group", NacosConstant.NACOS_CONFIG_GROUP);
}
@Override
public int getOrder() {
return 20;
}
}

16
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/DeliveryNoteMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.suofeiya.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.suofeiya.entity.DeliveryNoteEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 发货单 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface DeliveryNoteMapper extends BaseMapper<DeliveryNoteEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/FactoryNodeOrderMapper.xml

@ -0,0 +1,5 @@
<?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.factorydata.suofeiya.mapper.DeliveryNoteMapper">
</mapper>

16
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/FactoryOrderLogMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.suofeiya.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.suofeiya.entity.FactoryOrderLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 工厂订单日志 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface FactoryOrderLogMapper extends BaseMapper<FactoryOrderLogEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/FactoryOrderLogMapper.xml

@ -0,0 +1,5 @@
<?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.factorydata.suofeiya.mapper.FactoryOrderLogMapper">
</mapper>

16
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.suofeiya.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.suofeiya.entity.OrderInfoEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 订单信息 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml

@ -0,0 +1,5 @@
<?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.factorydata.suofeiya.mapper.OrderInfoMapper">
</mapper>

16
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/PackageInfoMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.suofeiya.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.suofeiya.entity.PackageInfoEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 装箱包信息 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface PackageInfoMapper extends BaseMapper<PackageInfoEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/PackageInfoMapper.xml

@ -0,0 +1,5 @@
<?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.factorydata.suofeiya.mapper.PackageInfoMapper">
</mapper>

337
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mq/FactoryOrderListener.java

@ -0,0 +1,337 @@
package com.logpm.factorydata.suofeiya.mq;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.factorydata.base.feign.IFactoryDataBaseClient;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.suofeiya.vo.DeliveryNoteVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.PatternConstant;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.core.redis.cache.BladeRedis;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 监听索菲亚订单数据
*
* @author zhaoqiaobo
* @create 2024-03-18
*/
@Slf4j
@Component
@AllArgsConstructor
public class FactoryOrderListener {
private final BladeRedis bladeRedis;
private final IFactoryDataBaseClient baseClient;
private final IFactoryDataClient factoryDataClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FactoryDataConstants.Mq.Queues.SFY_FACTORY_ORDER),
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.SFY_FACTORY_ORDER
))
@Transactional(rollbackFor = Exception.class)
public void factoryOrder(String msg) {
log.info("处理索菲亚订单:{}", msg);
if (StrUtil.isEmpty(msg)) {
log.error("消息内容为空");
return;
}
DeliveryNoteVO vo = JSONUtil.toBean(msg, DeliveryNoteVO.class);
if (ObjectUtil.isEmpty(vo)) {
log.error("消息内容为空");
return;
}
// 幂等控制,同一个入库单号只能入一次
String code = vo.getLogisticID();
if (StrUtil.isEmpty(code)) {
log.error("渠道单号为空");
return;
}
// if (CollUtil.isNotEmpty(receiptService.list(Wrappers.<ZbReceiptEntity>lambdaQuery().eq(ZbReceiptEntity::getTaskCode, code)))) {
// log.error("渠道单号已推送过了");
// return;
// }
// 查询当前这次推送的数据中的所有包件,校验其是否在数据库中已存在,存在则不保存
Set<String> packageCode = new HashSet<>();
// List<OrderPackageDTO> details = vo.getDetails();
// if (CollUtil.isNotEmpty(details)) {
// // 收集包件编码
// List<String> collect = details.stream().map(OrderPackageDTO::getPackageCode).collect(Collectors.toList());
// if (CollUtil.isNotEmpty(collect)) {
// List<OrderPackageDTO> packageCodes = orderPackageService.findByPackageCodes(collect);
// if (CollUtil.isNotEmpty(packageCodes)) {
// // 将packageCodes中的数据存到packageCode中
// packageCodes.forEach(item -> {
// packageCode.add(item.getPackageCode());
// });
// }
// }
// }
// ZbReceiptEntity zbReceiptEntity = new ZbReceiptEntity();
// BeanUtil.copyProperties(vo, zbReceiptEntity);
// // 保存订单数据
// receiptService.save(zbReceiptEntity);
// if (CollUtil.isNotEmpty(details)) {
// List<ZbOrderPackageEntity> packageEntities = new ArrayList<>();
// List<ZbPackageInfoEntity> packageInfoEntities = new ArrayList<>();
// for (OrderPackageDTO detail : details) {
// if (packageCode.contains(detail.getPackageCode())) {
// log.info(" 接收志邦数据:包条码 {} 已存在数据库中,不保存。", detail.getPackageCode());
// continue;
// }
// ZbOrderPackageEntity packageEntity = new ZbOrderPackageEntity();
// BeanUtil.copyProperties(detail, packageEntity);
// packageEntity.setReceiptId(zbReceiptEntity.getId());
// packageEntities.add(packageEntity);
// }
// // 保存包件数据
// orderPackageService.saveBatch(packageEntities);
// for (OrderPackageDTO detail : details) {
// if (packageCode.contains(detail.getPackageCode())) {
// continue;
// }
// Long detailId = null;
// for (ZbOrderPackageEntity packageEntity : packageEntities) {
// if (ObjectUtil.equal(packageEntity.getPackageCode(), detail.getPackageCode())) {
// detailId = packageEntity.getId();
// }
// }
// List<PackageInfoDTO> items = detail.getItems();
// if (CollUtil.isNotEmpty(items)) {
// for (PackageInfoDTO item : items) {
// ZbPackageInfoEntity packageInfoEntity = new ZbPackageInfoEntity();
// BeanUtil.copyProperties(item, packageInfoEntity);
// packageInfoEntity.setPackageId(detailId);
// packageInfoEntities.add(packageInfoEntity);
// }
// }
// }
// // 保存物料数据
// packageInfoService.saveBatch(packageInfoEntities);
// }
// 处理暂存单
// buildAdvance(vo, packageCode);
}
// private void buildAdvance(DeliveryNoteVO vo, Set packageCode) {
// // 新起线程构建暂存单发送mq
// ThreadPoolUtil.getThreadPool().submit(() -> {
// Long startWarehouseId = null;
// String startWarehouseName = null;
// String tenantId = null;
// // 获取工厂基地绑定的始发仓信息
// R<FactoryWarehouseBindVO> warehouseByBrandAndSiteName = baseClient.getWarehouseByBrandAndSiteName(vo.getSenderName(), vo.getSenderName());
// if (ObjectUtil.equal(HttpConstants.HTTP.HTTP_RESOURCE_CODE.SUCCESS_CODE, warehouseByBrandAndSiteName.getCode())) {
// FactoryWarehouseBindVO data = warehouseByBrandAndSiteName.getData();
// if (ObjectUtil.isNotNull(data)) {
// startWarehouseId = data.getWarehouseId();
// startWarehouseName = data.getWarehouseName();
// tenantId = data.getTenantId();
// }
// }
// Map<String, List<OrderPackageDTO>> advanceMap = new HashMap<>();
// List<OrderPackageDTO> details = vo.getDetails();
// // 入库单号 + 订单自编号 + 发车单号 一个暂存单
// for (OrderPackageDTO detail : details) {
// if (packageCode.contains(detail.getPackageCode())) {
// log.info(" 接收志邦数据:包条码 {} 已存在数据库中,不生成暂存单。", detail.getPackageCode());
// continue;
// }
// String taskCode = vo.getTaskCode();
// String departCode = vo.getDepartCode();
// String platformOrderCode = detail.getPlatformOrderCode();
// String advanceKey = taskCode + departCode + platformOrderCode;
// if (advanceMap.containsKey(advanceKey)) {
// advanceMap.get(advanceKey).add(detail);
// } else {
// ArrayList<OrderPackageDTO> orderPackageDTOS = new ArrayList<>();
// orderPackageDTOS.add(detail);
// advanceMap.put(advanceKey, orderPackageDTOS);
// }
// }
// // 组装暂存单数据
// List<JSONObject> advances = new ArrayList<>();
// for (Map.Entry<String, List<OrderPackageDTO>> stringListEntry : advanceMap.entrySet()) {
// List<OrderPackageDTO> value = stringListEntry.getValue();
// TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceEntity();
// advanceEntity.setTenantId(tenantId);
// advanceEntity.setStatus(0);
// advanceEntity.setIsDeleted(0);
// advanceEntity.setHasPackage(CollUtil.isNotEmpty(vo.getDetails()) ? 1 : 0);
// advanceEntity.setOrderType(vo.getOrderType());
// advanceEntity.setBrand(vo.getSenderName());
// advanceEntity.setSiteName("");
// advanceEntity.setArea("");
// advanceEntity.setTotalNum(CollUtil.isNotEmpty(value) ? value.size() : 0);
// advanceEntity.setPackName("");
// advanceEntity.setPackCode("");
// advanceEntity.setWarehouseId(startWarehouseId);
// advanceEntity.setWarehouseName(startWarehouseName);
//
// advanceEntity.setIsGcp(0);
// advanceEntity.setCarrierName(vo.getVendorName());
// advanceEntity.setSystemType("线上");
// advanceEntity.setMatingType("");
// advanceEntity.setSenderName(vo.getSenderName());
// advanceEntity.setSenderPhone(vo.getSenderTel());
// advanceEntity.setSenderAddress(vo.getSenderAddress());
// advanceEntity.setWaybillStatus("0");
// advanceEntity.setWaybillNo("");
// advanceEntity.setTrainNumber(vo.getDepartCode());
// advanceEntity.setFreezeStatus("0");
//
// advanceEntity.setSenderFactory(vo.getSenderName());
// List<JSONObject> packageList = new ArrayList<>();
// for (OrderPackageDTO orderPackageDTO : value) {
// advanceEntity.setOrderCode(orderPackageDTO.getPlatformOrderCode());
// advanceEntity.setDealerCode(orderPackageDTO.getCustomerCode());
// advanceEntity.setDealerName(orderPackageDTO.getCustomerName());
// advanceEntity.setStoreCode(orderPackageDTO.getCustomerCode());
// advanceEntity.setStoreName(orderPackageDTO.getCustomerName());
// advanceEntity.setServiceNum(orderPackageDTO.getRelationOrderCode());
// advanceEntity.setCustomerName(orderPackageDTO.getReceiverName());
// advanceEntity.setCustomerPhone(orderPackageDTO.getReceiverMobile());
// advanceEntity.setCustomerAddress(orderPackageDTO.getReceiverAddress());
//
// // 封装包件
// TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity();
// advanceDetailEntity.setWarehouseId(startWarehouseId);
// advanceDetailEntity.setWarehouseName(startWarehouseName);
//// advanceDetailEntity.setIncomingWarehouseId(0L);
//// advanceDetailEntity.setIncomingWarehouseName("");
// // 根据志邦的一流单标识赋值
// advanceEntity.setLegacyStatus("0");
// if (ObjectUtil.equal(orderPackageDTO.getLegacyFlag(), "Y")) {
// advanceEntity.setLegacyStatus("1");
// }
//
// advanceDetailEntity.setOrderCode(orderPackageDTO.getPlatformOrderCode());
// advanceDetailEntity.setBrand(vo.getSenderName());
// advanceDetailEntity.setSystemType("线上");
// advanceDetailEntity.setFirstPackName(orderPackageDTO.getPackageTypeName());
// advanceDetailEntity.setFirstPackCode(orderPackageDTO.getPackageType());
// // 获取映射志邦映射品类信息
// ZbCategoryContrastEntity zbCategoryContrastEntity = buildZbCategoryContrastEntityCache(orderPackageDTO.getPackageClass());
// if (zbCategoryContrastEntity != null) {
// advanceDetailEntity.setSecondPackName(zbCategoryContrastEntity.getSecondName());//二级品类名称
// advanceDetailEntity.setSecondPackCode(zbCategoryContrastEntity.getSecondCode());//二级品类
// advanceDetailEntity.setThirdPackName(zbCategoryContrastEntity.getThirdName());//三级品类名称
// advanceDetailEntity.setThirdPackCode(zbCategoryContrastEntity.getThirdCode());//三级品类
// } else {
// advanceDetailEntity.setSecondPackName(StringUtil.isBlank(orderPackageDTO.getPackageClass()) ? "" : orderPackageDTO.getPackageClass());//二级品类名称
// advanceDetailEntity.setSecondPackCode("");//二级品类
// advanceDetailEntity.setThirdPackName(StringUtil.isBlank(orderPackageDTO.getPackageClass()) ? "" : orderPackageDTO.getPackageClass());//三级品类名称
// advanceDetailEntity.setThirdPackCode("");//三级品类
// }
// advanceDetailEntity.setSiteName("");
// advanceDetailEntity.setSiteCode("");
// String planQty = orderPackageDTO.getPlanQty();
// advanceDetailEntity.setQuantity((StrUtil.isNotBlank(planQty) && NumberUtil.isNumber(planQty)) ? Convert.toInt(planQty) : 0);
// advanceDetailEntity.setOrderPackageCode(orderPackageDTO.getPackageCode());
// advanceDetailEntity.setTrainNumber(vo.getDepartCode());
// advanceDetailEntity.setServiceNum(orderPackageDTO.getRelationOrderCode());
// advanceDetailEntity.setWaybillNo("");
// advanceDetailEntity.setPackageStatus("0");
// advanceDetailEntity.setWeight(StrUtil.isNotBlank(orderPackageDTO.getTotalGrossWeight()) ? new BigDecimal(orderPackageDTO.getTotalGrossWeight()) : BigDecimal.ZERO);
// advanceDetailEntity.setVolume(StrUtil.isNotBlank(orderPackageDTO.getTotalVolume()) ? new BigDecimal(orderPackageDTO.getTotalVolume()) : BigDecimal.ZERO);
//// advanceDetailEntity.setChargeType(0);
// advanceDetailEntity.setSupple("");
// advanceDetailEntity.setManifest("");
// advanceDetailEntity.setReturnNum("");
// advanceDetailEntity.setSendDateStr(DateUtil.formatLocalDateTime(LocalDateTime.now()));
// advanceDetailEntity.setCarNumber("");
// advanceDetailEntity.setGoodsMan("");
// advanceDetailEntity.setTenantId(tenantId);
// advanceDetailEntity.setStatus(0);
// advanceDetailEntity.setIsDeleted(0);
// List<JSONObject> itemJsons = new ArrayList<>();
// List<PackageInfoDTO> items = orderPackageDTO.getItems();
// for (PackageInfoDTO item : items) {
// TrunklineDetailProductEntity detailProductEntity = new TrunklineDetailProductEntity();
// detailProductEntity.setTenantId(tenantId);
// detailProductEntity.setWarehouseId(startWarehouseId);
// detailProductEntity.setWarehouseName(startWarehouseName);
// detailProductEntity.setUnitNo(orderPackageDTO.getPackageCode());
// detailProductEntity.setProductCode(item.getItemCode());
// detailProductEntity.setProductName(item.getItemName());
// detailProductEntity.setQuantity(item.getPlanQty());
// detailProductEntity.setTenantId(TenantNum.HUITONGCODE);
// detailProductEntity.setStatus(0);
// detailProductEntity.setIsDeleted(0);
// itemJsons.add(JSONUtil.parseObj(detailProductEntity));
// }
// JSONObject entries = JSONUtil.parseObj(advanceDetailEntity);
// entries.set("items", itemJsons);
// packageList.add(entries);
// }
// // 转成json对象,然后将包件明细放到detail中
// JSONObject entries = JSONUtil.parseObj(advanceEntity);
// entries.set("details", JSONUtil.toJsonStr(packageList));
// advances.add(entries);
// }
// // 将组装好的暂存单发送到 MQ ,由暂存单服务统一消费SendMsg.
// if (CollUtil.isNotEmpty(advances)) {
// for (JSONObject advance : advances) {
// SendMsg sendMsg = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER)
// .routingKey(FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER).message(JSONUtil.toJsonStr(advance)).build();
// factoryDataClient.sendMessage(sendMsg);
// }
// }
// });
// }
//
// private ZbCategoryContrastEntity buildZbCategoryContrastEntityCache(String packageClass) {
//
//
// if (StringUtil.isBlank(packageClass)) {
// return null;
// }
// if (containsChinese(packageClass)) {
// return null;
// }
//
// String key = TenantNum.HUITONGCODE + ":" + ZbCategoryContrastEntity.class.getName() + ":" + packageClass;
// ZbCategoryContrastEntity zbCategoryContrastEntity = bladeRedis.get(key);
// if (zbCategoryContrastEntity == null) {
// QueryWrapper<ZbCategoryContrastEntity> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("source_code", packageClass);
// queryWrapper.eq("status", "1");
// zbCategoryContrastEntity = zbCategoryContrastMapper.selectOne(queryWrapper);
// if (!Objects.isNull(zbCategoryContrastEntity)) {
// // 缓存起来
// bladeRedis.setEx(key, zbCategoryContrastEntity, 3600 * 24L);
// }
// }
// return zbCategoryContrastEntity;
//
//
// }
/**
* 验证参数中是否包含中文
*
* @param str 匹配参数
* @return true 包含中文 false 不包含中文
*/
private boolean containsChinese(String str) {
Pattern pattern = Pattern.compile(PatternConstant.REGEX_CHINESE);
Matcher matcher = pattern.matcher(str);
return matcher.find();
}
}

20
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/pros/FactoryDataSuoFeiYaProperties.java

@ -0,0 +1,20 @@
package com.logpm.factorydata.suofeiya.pros;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* FactoryProperties
*
* @author pref
*/
@Data
@ConfigurationProperties(prefix = "logpm")
public class FactoryDataSuoFeiYaProperties {
/**
* 名称
*/
private String name;
}

17
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/DeliveryNoteService.java

@ -0,0 +1,17 @@
package com.logpm.factorydata.suofeiya.service;
import com.logpm.factorydata.suofeiya.entity.DeliveryNoteEntity;
import com.logpm.factorydata.suofeiya.vo.DeliveryNoteVO;
import com.logpm.factorydata.suofeiya.vo.ParamVO;
import org.springblade.core.mp.base.BaseService;
/**
* 索菲亚发货单 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface DeliveryNoteService extends BaseService<DeliveryNoteEntity> {
String order(DeliveryNoteVO vo);
}

14
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/FactoryOrderLogService.java

@ -0,0 +1,14 @@
package com.logpm.factorydata.suofeiya.service;
import com.logpm.factorydata.suofeiya.entity.FactoryOrderLogEntity;
import org.springblade.core.mp.base.BaseService;
/**
* 工厂订单日志 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface FactoryOrderLogService extends BaseService<FactoryOrderLogEntity> {
}

14
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java

@ -0,0 +1,14 @@
package com.logpm.factorydata.suofeiya.service;
import com.logpm.factorydata.suofeiya.entity.OrderInfoEntity;
import org.springblade.core.mp.base.BaseService;
/**
* 订单信息 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface OrderInfoService extends BaseService<OrderInfoEntity> {
}

14
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/PackageInfoService.java

@ -0,0 +1,14 @@
package com.logpm.factorydata.suofeiya.service;
import com.logpm.factorydata.suofeiya.entity.PackageInfoEntity;
import org.springblade.core.mp.base.BaseService;
/**
* 装箱包信息 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface PackageInfoService extends BaseService<PackageInfoEntity> {
}

108
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/DeliveryNoteServiceImpl.java

@ -0,0 +1,108 @@
package com.logpm.factorydata.suofeiya.service.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.suofeiya.entity.DeliveryNoteEntity;
import com.logpm.factorydata.suofeiya.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.suofeiya.mapper.DeliveryNoteMapper;
import com.logpm.factorydata.suofeiya.service.DeliveryNoteService;
import com.logpm.factorydata.suofeiya.service.FactoryOrderLogService;
import com.logpm.factorydata.suofeiya.vo.DeliveryNoteVO;
import com.logpm.factorydata.suofeiya.vo.ParamVO;
import com.logpm.factorydata.vo.SendMsg;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.common.utils.FileLogsUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.tool.api.R;
import org.springblade.resource.feign.IOssClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
/**
* 发货单 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper, DeliveryNoteEntity> implements DeliveryNoteService {
private final IFactoryDataClient factoryDataClient;
private final FactoryOrderLogService factoryOrderLogService;
private final IOssClient ossClient;
@Override
public String order(DeliveryNoteVO vo) {
// 1 上传数据到 minio 获取到地址
String url = uploadFile(JSONObject.toJSONString(vo));
// 2 保存地址到数据库
FactoryOrderLogEntity logEntity = new FactoryOrderLogEntity();
logEntity.setType(1);
logEntity.setSaxStatus(0);
logEntity.setLogUrl(url);
factoryOrderLogService.save(logEntity);
// 3 将消息发送给 mq,解析保存
SendMsg build = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER)
.routingKey(FactoryDataConstants.Mq.RoutingKeys.SFY_FACTORY_ORDER).message(JSONUtil.toJsonStr(logEntity)).build();
factoryDataClient.sendMessage(build);
return "成功";
}
private String uploadFile(String body) {
//文本内容和保存为本地文件 并上传
String logPath = FileLogsUtil.saveFileLogs(body);
log.info(">>> 文件路径 {}", logPath);
MultipartFile multi = getMultipartFile(logPath);
//上传到服务器
R r = ossClient.fileUpload(multi, "sfy-order-logs");
if (r.isSuccess()) {
BladeFile data = (BladeFile) r.getData();
// 删除本地文件
FileUtil.del(logPath);
return data.getLink();
}
return null;
}
@NotNull
private MultipartFile getMultipartFile(String logPath) {
File file = new File(logPath);
// File 转 MultipartFile
FileItem item = new DiskFileItemFactory().createItem("file"
, MediaType.MULTIPART_FORM_DATA_VALUE
, true
, file.getName());
try (
InputStream input = Files.newInputStream(file.toPath());
OutputStream os = item.getOutputStream()) {
// 流转移
IOUtils.copy(input, os);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid file: " + e, e);
}
return new CommonsMultipartFile(item);
}
}

22
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/FactoryOrderLogServiceImpl.java

@ -0,0 +1,22 @@
package com.logpm.factorydata.suofeiya.service.impl;
import com.logpm.factorydata.suofeiya.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.suofeiya.mapper.FactoryOrderLogMapper;
import com.logpm.factorydata.suofeiya.service.FactoryOrderLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 工厂订单日志 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class FactoryOrderLogServiceImpl extends BaseServiceImpl<FactoryOrderLogMapper, FactoryOrderLogEntity> implements FactoryOrderLogService {
}

22
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java

@ -0,0 +1,22 @@
package com.logpm.factorydata.suofeiya.service.impl;
import com.logpm.factorydata.suofeiya.entity.OrderInfoEntity;
import com.logpm.factorydata.suofeiya.mapper.OrderInfoMapper;
import com.logpm.factorydata.suofeiya.service.OrderInfoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 订单信息 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class OrderInfoServiceImpl extends BaseServiceImpl<OrderInfoMapper, OrderInfoEntity> implements OrderInfoService {
}

22
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/PackageInfoServiceImpl.java

@ -0,0 +1,22 @@
package com.logpm.factorydata.suofeiya.service.impl;
import com.logpm.factorydata.suofeiya.entity.PackageInfoEntity;
import com.logpm.factorydata.suofeiya.mapper.PackageInfoMapper;
import com.logpm.factorydata.suofeiya.service.PackageInfoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 装箱包信息 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class PackageInfoServiceImpl extends BaseServiceImpl<PackageInfoMapper, PackageInfoEntity> implements PackageInfoService {
}

43
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/util/ThreadPoolUtil.java

@ -0,0 +1,43 @@
package com.logpm.factorydata.suofeiya.util;
import cn.hutool.core.thread.ExecutorBuilder;
import cn.hutool.core.thread.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.ExecutorService;
/**
* @author zhaoqiaobo
* @create 2024-03-14 10:26
*/
@Slf4j
public class ThreadPoolUtil {
private ThreadPoolUtil() {
}
/**
* 线程池
*/
public static ExecutorService executor = null;
static {
init();
}
synchronized public static void init() {
if (null != executor) {
executor.shutdownNow();
}
executor = ExecutorBuilder.create()
.setCorePoolSize(8)
.setMaxPoolSize(20)
.setThreadFactory(ThreadFactoryBuilder.create().setNamePrefix("logpm-factory-data-sfy-").build())
.useSynchronousQueue().build();
}
public static ExecutorService getThreadPool() {
return executor;
}
}

32
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/DeliveryNoteVO.java

@ -0,0 +1,32 @@
package com.logpm.factorydata.suofeiya.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.logpm.factorydata.suofeiya.entity.DeliveryNoteEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.util.List;
/**
* 送货单 实体类
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "索菲亚发货单", description = "索菲亚发货单")
@EqualsAndHashCode(callSuper = true)
public class DeliveryNoteVO extends DeliveryNoteEntity {
@ApiModelProperty("扩展字段")
private List<String> orderExtendFields;
@ApiModelProperty("装箱包信息")
private PackageInfoVO packageInfo;
@ApiModelProperty("订单信息")
private OrderInfoVO orderInfo;
}

21
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/OrderInfoVO.java

@ -0,0 +1,21 @@
package com.logpm.factorydata.suofeiya.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.logpm.factorydata.suofeiya.entity.OrderInfoEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
* 订单信息
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "订单信息", description = "订单信息")
@EqualsAndHashCode(callSuper = true)
public class OrderInfoVO extends OrderInfoEntity {
}

18
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/PackageInfoVO.java

@ -0,0 +1,18 @@
package com.logpm.factorydata.suofeiya.vo;
import com.logpm.factorydata.suofeiya.entity.PackageInfoEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 装箱包信息
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "装箱包信息", description = "装箱包信息")
@EqualsAndHashCode(callSuper = true)
public class PackageInfoVO extends PackageInfoEntity {
}

28
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/ParamVO.java

@ -0,0 +1,28 @@
package com.logpm.factorydata.suofeiya.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 请求参数 接收订单数据
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "索菲亚发货单", description = "索菲亚发货单")
public class ParamVO implements Serializable {
@ApiModelProperty("核算请求参数")
private DeliveryNoteVO params;
@ApiModelProperty("区域密文摘要")
private String digest;
@ApiModelProperty("核算当前时间戳")
private String timestamp;
@ApiModelProperty("核算第三方接入商的公司编码")
private String companyCode;
}

26
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/vo/Resp.java

@ -0,0 +1,26 @@
package com.logpm.factorydata.suofeiya.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class Resp implements Serializable {
private String resultCode;
private String resultMessage;
public Resp(String code, String message) {
this.resultCode = code;
this.resultMessage = message;
}
public static Resp success(String msg) {
return new Resp("0000", msg);
}
public static Resp fail(String msg) {
return new Resp("9999", msg);
}
}

71
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application-dev.yml

@ -0,0 +1,71 @@
#服务器端口
server:
port: 18920
#数据源配置
#spring:
# datasource:
# url: ${blade.datasource.dev.url}
# username: ${blade.datasource.dev.username}
# password: ${blade.datasource.dev.password}
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.2.46
port: 5672
username: admin
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
dynamic:
druid:
#通用校验配置
validation-query: select 1
#启用sql日志拦截器
proxy-filters:
- sqlLogInterceptor
#设置默认的数据源或者数据源组,默认值即为master
primary: master
datasource:
master:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.factorydata-sfy.master.url}
username: ${blade.datasource.factorydata-sfy.master.username}
password: ${blade.datasource.factorydata-sfy.master.password}
slave:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.factorydata-sfy.slave.url}
username: ${blade.datasource.factorydata-sfy.slave.username}
password: ${blade.datasource.factorydata-sfy.slave.password}

45
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application-prod.yml

@ -0,0 +1,45 @@
#服务器端口
server:
port: 18920
#数据源配置
#spring:
# datasource:
# url: ${blade.datasource.dev.url}
# username: ${blade.datasource.dev.username}
# password: ${blade.datasource.dev.password}
spring:
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
dynamic:
druid:
#通用校验配置
validation-query: select 1
#启用sql日志拦截器
proxy-filters:
- sqlLogInterceptor
#设置默认的数据源或者数据源组,默认值即为master
primary: master
datasource:
master:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.factorydata-sfy.master.url}
username: ${blade.datasource.factorydata-sfy.master.username}
password: ${blade.datasource.factorydata-sfy.master.password}
slave:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.factorydata-sfy.slave.url}
username: ${blade.datasource.factorydata-sfy.slave.username}
password: ${blade.datasource.factorydata-sfy.slave.password}

71
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application-test.yml

@ -0,0 +1,71 @@
#服务器端口
server:
port: 18920
#数据源配置
#spring:
# datasource:
# url: ${blade.datasource.dev.url}
# username: ${blade.datasource.dev.username}
# password: ${blade.datasource.dev.password}
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.2.110
port: 5672
username: admin
password: Slwk@123654
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
dynamic:
druid:
#通用校验配置
validation-query: select 1
#启用sql日志拦截器
proxy-filters:
- sqlLogInterceptor
#设置默认的数据源或者数据源组,默认值即为master
primary: master
datasource:
master:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.factorydata-sfy.master.url}
username: ${blade.datasource.factorydata-sfy.master.username}
password: ${blade.datasource.factorydata-sfy.master.password}
slave:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.factorydata-sfy.slave.url}
username: ${blade.datasource.factorydata-sfy.slave.username}
password: ${blade.datasource.factorydata-sfy.slave.password}

31
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/application.yml

@ -0,0 +1,31 @@
#mybatis-plus配置
mybatis-plus:
mapper-locations: classpath:com/logpm/**/mapper/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.logpm.**.entity
#swagger扫描路径配置
swagger:
base-packages:
- org.springblade
- com.logpm
#oss配置
oss:
enabled: true
name: minio
tenant-mode: false
endpoint: http://8.137.14.82:9000
access-key: minio
secret-key: 123123123
bucket-name: bladex
logging:
config: classpath:logback.xml
spring:
main:
allow-circular-references: true

40
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/logback.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</root>
</configuration>

14
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/resources/application-prod.yml

@ -1,6 +1,6 @@
#服务器端口
server:
port: 8900
port: 18910
#数据源配置
#spring:
@ -30,16 +30,16 @@ spring:
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.report.master.url}
username: ${blade.datasource.report.master.username}
password: ${blade.datasource.report.master.password}
url: ${blade.datasource.factorydata-zbom.master.url}
username: ${blade.datasource.factorydata-zbom.master.username}
password: ${blade.datasource.factorydata-zbom.master.password}
slave:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.report.slave.url}
username: ${blade.datasource.report.slave.username}
password: ${blade.datasource.report.slave.password}
url: ${blade.datasource.factorydata-zbom.slave.url}
username: ${blade.datasource.factorydata-zbom.slave.username}
password: ${blade.datasource.factorydata-zbom.slave.password}

Loading…
Cancel
Save