45 changed files with 1770 additions and 3 deletions
@ -0,0 +1,14 @@ |
|||||||
|
FROM bladex/alpine-java:openjdk8-openj9_cn_slim |
||||||
|
|
||||||
|
MAINTAINER h5u@163.com |
||||||
|
|
||||||
|
RUN mkdir -p /logpm/factory-data-jinpai |
||||||
|
|
||||||
|
WORKDIR /logpm/factory-data-jinpai |
||||||
|
|
||||||
|
EXPOSE 18940 |
||||||
|
|
||||||
|
ADD ./target/logpm-factory-data-jinpai.jar ./app.jar |
||||||
|
|
||||||
|
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar","-Xms128m","-Xmx512m", "app.jar"] |
||||||
|
CMD ["--spring.profiles.active=test"] |
@ -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-jinpai</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> |
@ -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 FactoryDataJinPaiApplication { |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
BladeApplication.run(ModuleNameConstant.LOGPM_FACTORY_DATA_JINPAI_NAME, FactoryDataJinPaiApplication.class, args); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -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.jinpai.config; |
||||||
|
|
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.pros.FactoryDataJinPaiProperties; |
||||||
|
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; |
||||||
|
|
||||||
|
/** |
||||||
|
* 配置feign、mybatis包名、properties |
||||||
|
* |
||||||
|
* @author chaos |
||||||
|
*/ |
||||||
|
@Configuration(proxyBeanMethods = false) |
||||||
|
@ComponentScan({"org.springblade", "com.logpm"}) |
||||||
|
@EnableFeignClients({"org.springblade", "com.logpm"}) |
||||||
|
@MapperScan({"org.springblade.**.mapper.**", "com.logpm.**.mapper.**"}) |
||||||
|
@EnableConfigurationProperties(FactoryDataJinPaiProperties.class) |
||||||
|
public class FactoryDataSuoFeiYaConfiguration { |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,89 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.controller; |
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil; |
||||||
|
import cn.hutool.json.JSONUtil; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import com.logpm.factorydata.jinpai.service.DeliveryNoteService; |
||||||
|
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO; |
||||||
|
import com.logpm.factorydata.jinpai.vo.OrderInfoVO; |
||||||
|
import com.logpm.factorydata.jinpai.vo.PackageInfoVO; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
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 R order(@RequestBody DeliveryNoteVO vo) { |
||||||
|
log.info("接收工厂订单:{} ", JSONUtil.toJsonStr(vo)); |
||||||
|
String res = ""; |
||||||
|
try { |
||||||
|
if (ObjectUtil.isNotEmpty(vo)) { |
||||||
|
res = service.order(vo); |
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
log.error("工厂订单异常:{} ", e); |
||||||
|
return R.success("服务器异常"); |
||||||
|
} |
||||||
|
return R.success(res); |
||||||
|
} |
||||||
|
|
||||||
|
@ResponseBody |
||||||
|
@PostMapping("orderInfo") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "工厂订单明细", notes = "工厂订单明细") |
||||||
|
public R detail(@RequestBody OrderInfoVO vo) { |
||||||
|
log.info("接收工厂订单明细:{} ", JSONUtil.toJsonStr(vo)); |
||||||
|
String res = ""; |
||||||
|
try { |
||||||
|
if (ObjectUtil.isNotEmpty(vo)) { |
||||||
|
res = service.detail(vo); |
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
log.error("工厂订单明细异常:{} ", e); |
||||||
|
return R.success("服务器异常"); |
||||||
|
} |
||||||
|
return R.success(res); |
||||||
|
} |
||||||
|
@ResponseBody |
||||||
|
@PostMapping("packageInfo") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "工厂包件信息", notes = "工厂包件信息") |
||||||
|
public R packageInfo(@RequestBody PackageInfoVO vo) { |
||||||
|
log.info("接收工厂包件信息:{} ", JSONUtil.toJsonStr(vo)); |
||||||
|
String res = ""; |
||||||
|
try { |
||||||
|
if (ObjectUtil.isNotEmpty(vo)) { |
||||||
|
res = service.packageInfo(vo); |
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
log.error("工厂包件信息异常:{} ", e); |
||||||
|
return R.success("服务器异常"); |
||||||
|
} |
||||||
|
return R.success(res); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,126 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.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("jp_delivery_note") |
||||||
|
@ApiModel(value = "金牌订单", description = "金牌订单") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class DeliveryNoteEntity extends BaseEntity { |
||||||
|
|
||||||
|
@ApiModelProperty(name = "日志id") |
||||||
|
private String logId; |
||||||
|
@ApiModelProperty(name = "确认时间") |
||||||
|
private String confirmTime; |
||||||
|
@ApiModelProperty(name = "订单号") |
||||||
|
private String orderId; |
||||||
|
@ApiModelProperty(name = "YS客户单号") |
||||||
|
private String omsExtYsId; |
||||||
|
@ApiModelProperty(name = "始发站") |
||||||
|
private String sendSite; |
||||||
|
@ApiModelProperty(name = "目的站") |
||||||
|
private String recvSite; |
||||||
|
@ApiModelProperty(name = "发货时间") |
||||||
|
private String sendTime; |
||||||
|
@ApiModelProperty(name = "要求到货时间") |
||||||
|
private String requireRecvTime; |
||||||
|
@ApiModelProperty(name = "发货客户编号") |
||||||
|
private String consignerCode; |
||||||
|
@ApiModelProperty(name = "发货方客户名称") |
||||||
|
private String consignerName; |
||||||
|
@ApiModelProperty(name = "发货方联系人") |
||||||
|
private String consignerContacts; |
||||||
|
@ApiModelProperty(name = "发货方联系手机") |
||||||
|
private String consignerMobile; |
||||||
|
@ApiModelProperty(name = "发货方联系电话(座机)") |
||||||
|
private String consignerPhone; |
||||||
|
@ApiModelProperty(name = "发货地址") |
||||||
|
private String consignerAddr; |
||||||
|
@ApiModelProperty(name = "收货客户名称") |
||||||
|
private String receiverName; |
||||||
|
@ApiModelProperty(name = "收货客户联系人") |
||||||
|
private String receiverContacts; |
||||||
|
@ApiModelProperty(name = "收货人联系手机") |
||||||
|
private String receiverMobile; |
||||||
|
@ApiModelProperty(name = "收货联系电话") |
||||||
|
private String receiverPhone; |
||||||
|
@ApiModelProperty(name = "收货地址") |
||||||
|
private String receiverAddr; |
||||||
|
@ApiModelProperty(name = "货物体积") |
||||||
|
private String goodsTotalVolume; |
||||||
|
@ApiModelProperty(name = "货物件数") |
||||||
|
private String goodsTotalNumber; |
||||||
|
@ApiModelProperty(name = "货物重量") |
||||||
|
private String goodsTotalWeight; |
||||||
|
@ApiModelProperty(name = "承运商编码") |
||||||
|
private String carrierId; |
||||||
|
@ApiModelProperty(name = "承运商名称") |
||||||
|
private String carrierName; |
||||||
|
@ApiModelProperty(name = "承运类型: sfwl 三方物流, sczp 干仓配") |
||||||
|
private String distributionMode; |
||||||
|
@ApiModelProperty(name = "送货模式:gc-wf 专线-基地直发,sc-ps 干仓配-2C,sc-wf 干仓配-2B") |
||||||
|
private String deliveryMode; |
||||||
|
@ApiModelProperty(name = "承运商联系人") |
||||||
|
private String carrierContacts; |
||||||
|
@ApiModelProperty(name = "承运商手机") |
||||||
|
private String carrierMobile; |
||||||
|
@ApiModelProperty(name = "承运商电话") |
||||||
|
private String carrierPhone; |
||||||
|
@ApiModelProperty(name = "车牌号") |
||||||
|
private String carNo; |
||||||
|
@ApiModelProperty(name = "司机姓名") |
||||||
|
private String driverName; |
||||||
|
@ApiModelProperty(name = "司机联系手机") |
||||||
|
private String driverMobile; |
||||||
|
@ApiModelProperty(name = "到站网点id") |
||||||
|
private String arriveOrg; |
||||||
|
@ApiModelProperty(name = "到站网点") |
||||||
|
private String arriveOrgName; |
||||||
|
@ApiModelProperty(name = "发车时间") |
||||||
|
private String departTime; |
||||||
|
@ApiModelProperty(name = "中转站") |
||||||
|
private String transferSite; |
||||||
|
@ApiModelProperty(name = "中转到达时间") |
||||||
|
private String transferArriveTime; |
||||||
|
@ApiModelProperty(name = "中转发出时间") |
||||||
|
private String transferStartTime; |
||||||
|
@ApiModelProperty(name = "到达时间") |
||||||
|
private String arriveTime; |
||||||
|
@ApiModelProperty(name = "签收时间") |
||||||
|
private String signTime; |
||||||
|
@ApiModelProperty(name = "门店名称") |
||||||
|
private String shopName; |
||||||
|
@ApiModelProperty(name = "门店手机") |
||||||
|
private String shopPhone; |
||||||
|
@ApiModelProperty(name = "门店地址") |
||||||
|
private String shopAddr; |
||||||
|
@ApiModelProperty(name = "中转地址编码") |
||||||
|
private String transferSiteId; |
||||||
|
@ApiModelProperty(name = "订单运输跟踪状态(0.0:待发车,1.0:已发车,2.3:已中转到达,2.8:已中转出发,3.0:已到达,4.0:已签收") |
||||||
|
private String trackingStatus; |
||||||
|
@ApiModelProperty(name = "运输车牌") |
||||||
|
private String vehicleNo; |
||||||
|
|
||||||
|
@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; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,63 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.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("jp_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; |
||||||
|
/** |
||||||
|
* 数据维度:1 订单 2 订单明细 3 包件 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(name = "维度:1 订单 2 订单明细 3 包件", notes = "") |
||||||
|
private Integer dimension; |
||||||
|
/** |
||||||
|
* 解析状态 0 未解析 1 已解析 2 解析失败 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(name = "解析状态 0 未解析 1 已解析 2 解析失败", notes = "") |
||||||
|
private Integer saxStatus; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,94 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.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("jp_order_info") |
||||||
|
@ApiModel(value = "订单明细信息", description = "订单明细信息") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class OrderInfoEntity extends BaseEntity { |
||||||
|
|
||||||
|
@ApiModelProperty(name = "日志id") |
||||||
|
private String logId; |
||||||
|
@ApiModelProperty(name = "发货单id") |
||||||
|
private String deliveryNoteId; |
||||||
|
@ApiModelProperty(name = "订单号") |
||||||
|
private String orderId; |
||||||
|
@ApiModelProperty(name = "DD单号") |
||||||
|
private String omsExtOrderNo; |
||||||
|
@ApiModelProperty(name = "YS订单号") |
||||||
|
private String omsExtYsId; |
||||||
|
@ApiModelProperty(name = "手工合同单号") |
||||||
|
private String manualContractNo; |
||||||
|
@ApiModelProperty(name = "货品名称") |
||||||
|
private String goodsName; |
||||||
|
@ApiModelProperty(name = "货品包装") |
||||||
|
private String goodsPack; |
||||||
|
@ApiModelProperty(name = "货品类型") |
||||||
|
private String goodsType; |
||||||
|
@ApiModelProperty(name = "货品数量") |
||||||
|
private String goodsNumber; |
||||||
|
@ApiModelProperty(name = "货品毛重") |
||||||
|
private String goodsGrossWeight; |
||||||
|
@ApiModelProperty(name = "货品净重") |
||||||
|
private String goodsNetWeight; |
||||||
|
@ApiModelProperty(name = "货品体积") |
||||||
|
private String goodsVolume; |
||||||
|
@ApiModelProperty(name = "客户批次") |
||||||
|
private String customerNum; |
||||||
|
@ApiModelProperty(name = "申明价值") |
||||||
|
private String goodsAmount; |
||||||
|
@ApiModelProperty(name = "长") |
||||||
|
private String goodsLength; |
||||||
|
@ApiModelProperty(name = "宽") |
||||||
|
private String goodsWidth; |
||||||
|
@ApiModelProperty(name = "高") |
||||||
|
private String goodsHeigth; |
||||||
|
@ApiModelProperty(name = "收货地址") |
||||||
|
private String receiverAddrDetail; |
||||||
|
@ApiModelProperty(name = "安装地址") |
||||||
|
private String yjInstallAddr; |
||||||
|
@ApiModelProperty(name = "安装联系人") |
||||||
|
private String yjInstallLinker; |
||||||
|
@ApiModelProperty(name = "安装联系电话") |
||||||
|
private String yjInstallPhone; |
||||||
|
@ApiModelProperty(name = "承运类型(sfwl- 三方物流;sczp- 省仓直配)") |
||||||
|
private String distributionMode; |
||||||
|
@ApiModelProperty(name = "门店编号") |
||||||
|
private String shopCode; |
||||||
|
@ApiModelProperty(name = "门店名称") |
||||||
|
private String shopName; |
||||||
|
@ApiModelProperty(name = "加急类型加急类型A、B、C") |
||||||
|
private String yjUrgentType; |
||||||
|
@ApiModelProperty(name = "加急日期") |
||||||
|
private String yjUrgentDate; |
||||||
|
@ApiModelProperty(name = "订单类型:零售正单、普通零售单、样块单、增补单、返修单、缺件单、售后单") |
||||||
|
private String yjOrderType; |
||||||
|
@ApiModelProperty(name = "返修时效返修时效48小时、24小时") |
||||||
|
private String yjRepairTimeliness; |
||||||
|
@ApiModelProperty(name = "易居订单号") |
||||||
|
private String yjOrderNo; |
||||||
|
|
||||||
|
@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; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,62 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.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("jp_package_info") |
||||||
|
@ApiModel(value = "包件信息", description = "包件信息") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class PackageInfoEntity extends BaseEntity { |
||||||
|
|
||||||
|
@ApiModelProperty(name = "日志id") |
||||||
|
private String logId; |
||||||
|
@ApiModelProperty(name = "订单明细id") |
||||||
|
private String orderInfoId; |
||||||
|
@ApiModelProperty(name = "DD单号") |
||||||
|
private String omsExtOrderNo; |
||||||
|
@ApiModelProperty(name = "订单号") |
||||||
|
private String orderId; |
||||||
|
@ApiModelProperty(name = "箱码") |
||||||
|
private String extBoxCode; |
||||||
|
@ApiModelProperty(name = "件数") |
||||||
|
private String goodsNum; |
||||||
|
@ApiModelProperty(name = "重量") |
||||||
|
private String goodsWeight; |
||||||
|
@ApiModelProperty(name = "体积") |
||||||
|
private String goodsVolume; |
||||||
|
@ApiModelProperty(name = "品名") |
||||||
|
private String goodsType; |
||||||
|
@ApiModelProperty(name = "箱码名称") |
||||||
|
private String goodsName; |
||||||
|
@ApiModelProperty(name = "箱码类型") |
||||||
|
private String extBoxType; |
||||||
|
@ApiModelProperty(name = "一级类别") |
||||||
|
private String boxType1; |
||||||
|
@ApiModelProperty(name = "二级类别") |
||||||
|
private String boxType2; |
||||||
|
@ApiModelProperty(name = "三级类别") |
||||||
|
private String boxType3; |
||||||
|
|
||||||
|
@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; |
||||||
|
|
||||||
|
} |
@ -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.jinpai.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; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发货单 mapper |
||||||
|
* |
||||||
|
* @author zqb |
||||||
|
* @since 2024-03-26 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DeliveryNoteMapper extends BaseMapper<DeliveryNoteEntity> { |
||||||
|
|
||||||
|
} |
@ -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.jinpai.mapper.DeliveryNoteMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,16 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* 工厂订单日志 mapper |
||||||
|
* |
||||||
|
* @author zqb |
||||||
|
* @since 2024-03-26 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface FactoryOrderLogMapper extends BaseMapper<FactoryOrderLogEntity> { |
||||||
|
|
||||||
|
} |
@ -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.jinpai.mapper.FactoryOrderLogMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,16 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.logpm.factorydata.jinpai.entity.OrderInfoEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* 订单信息 mapper |
||||||
|
* |
||||||
|
* @author zqb |
||||||
|
* @since 2024-03-26 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> { |
||||||
|
|
||||||
|
} |
@ -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.jinpai.mapper.OrderInfoMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,16 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.logpm.factorydata.jinpai.entity.PackageInfoEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* 装箱包信息 mapper |
||||||
|
* |
||||||
|
* @author zqb |
||||||
|
* @since 2024-03-26 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface PackageInfoMapper extends BaseMapper<PackageInfoEntity> { |
||||||
|
|
||||||
|
} |
@ -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.jinpai.mapper.PackageInfoMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,334 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.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.jinpai.entity.FactoryOrderLogEntity; |
||||||
|
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.JP_FACTORY_ORDER), |
||||||
|
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER, type = ExchangeTypes.TOPIC), |
||||||
|
key = FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_ORDER |
||||||
|
)) |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public void factoryOrder(String msg) { |
||||||
|
log.info("处理金牌订单:{}", msg); |
||||||
|
if (StrUtil.isEmpty(msg)) { |
||||||
|
log.error("消息内容为空"); |
||||||
|
return; |
||||||
|
} |
||||||
|
FactoryOrderLogEntity vo = JSONUtil.toBean(msg, FactoryOrderLogEntity.class); |
||||||
|
if (ObjectUtil.isEmpty(vo)) { |
||||||
|
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(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.pros; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
||||||
|
|
||||||
|
/** |
||||||
|
* FactoryProperties |
||||||
|
* |
||||||
|
* @author pref |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ConfigurationProperties(prefix = "logpm") |
||||||
|
public class FactoryDataJinPaiProperties { |
||||||
|
/** |
||||||
|
* 名称 |
||||||
|
*/ |
||||||
|
private String name; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.service; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity; |
||||||
|
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO; |
||||||
|
import com.logpm.factorydata.jinpai.vo.OrderInfoVO; |
||||||
|
import com.logpm.factorydata.jinpai.vo.PackageInfoVO; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 索菲亚发货单 服务类 |
||||||
|
* |
||||||
|
* @Author zqb |
||||||
|
* @Date 2024/4/26 |
||||||
|
**/ |
||||||
|
public interface DeliveryNoteService extends BaseService<DeliveryNoteEntity> { |
||||||
|
|
||||||
|
String order(DeliveryNoteVO vo); |
||||||
|
|
||||||
|
String detail(OrderInfoVO vo); |
||||||
|
|
||||||
|
String packageInfo(PackageInfoVO vo); |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.service; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 工厂订单日志 服务类 |
||||||
|
* |
||||||
|
* @Author zqb |
||||||
|
* @Date 2024/4/26 |
||||||
|
**/ |
||||||
|
public interface FactoryOrderLogService extends BaseService<FactoryOrderLogEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.service; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.entity.OrderInfoEntity; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 订单信息 服务类 |
||||||
|
* |
||||||
|
* @Author zqb |
||||||
|
* @Date 2024/4/26 |
||||||
|
**/ |
||||||
|
public interface OrderInfoService extends BaseService<OrderInfoEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.service; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.entity.PackageInfoEntity; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 装箱包信息 服务类 |
||||||
|
* |
||||||
|
* @Author zqb |
||||||
|
* @Date 2024/4/26 |
||||||
|
**/ |
||||||
|
public interface PackageInfoService extends BaseService<PackageInfoEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,146 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.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.jinpai.entity.DeliveryNoteEntity; |
||||||
|
import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity; |
||||||
|
import com.logpm.factorydata.jinpai.mapper.DeliveryNoteMapper; |
||||||
|
import com.logpm.factorydata.jinpai.service.DeliveryNoteService; |
||||||
|
import com.logpm.factorydata.jinpai.service.FactoryOrderLogService; |
||||||
|
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO; |
||||||
|
import com.logpm.factorydata.jinpai.vo.OrderInfoVO; |
||||||
|
import com.logpm.factorydata.jinpai.vo.PackageInfoVO; |
||||||
|
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); |
||||||
|
logEntity.setDimension(1); |
||||||
|
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 "成功"; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String detail(OrderInfoVO vo) { |
||||||
|
// 1 上传数据到 minio 获取到地址
|
||||||
|
String url = uploadFile(JSONObject.toJSONString(vo)); |
||||||
|
// 2 保存地址到数据库
|
||||||
|
FactoryOrderLogEntity logEntity = new FactoryOrderLogEntity(); |
||||||
|
logEntity.setType(1); |
||||||
|
logEntity.setSaxStatus(0); |
||||||
|
logEntity.setLogUrl(url); |
||||||
|
logEntity.setDimension(2); |
||||||
|
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 "成功"; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String packageInfo(PackageInfoVO vo) { |
||||||
|
// 1 上传数据到 minio 获取到地址
|
||||||
|
String url = uploadFile(JSONObject.toJSONString(vo)); |
||||||
|
// 2 保存地址到数据库
|
||||||
|
FactoryOrderLogEntity logEntity = new FactoryOrderLogEntity(); |
||||||
|
logEntity.setType(1); |
||||||
|
logEntity.setSaxStatus(0); |
||||||
|
logEntity.setLogUrl(url); |
||||||
|
logEntity.setDimension(3); |
||||||
|
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, "jp-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); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.service.impl; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity; |
||||||
|
import com.logpm.factorydata.jinpai.mapper.FactoryOrderLogMapper; |
||||||
|
import com.logpm.factorydata.jinpai.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 { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.service.impl; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.entity.OrderInfoEntity; |
||||||
|
import com.logpm.factorydata.jinpai.mapper.OrderInfoMapper; |
||||||
|
import com.logpm.factorydata.jinpai.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 { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.service.impl; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.entity.PackageInfoEntity; |
||||||
|
import com.logpm.factorydata.jinpai.mapper.PackageInfoMapper; |
||||||
|
import com.logpm.factorydata.jinpai.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 { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,43 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.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; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.vo; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.logpm.factorydata.jinpai.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 { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.vo; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.logpm.factorydata.jinpai.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 { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
package com.logpm.factorydata.jinpai.vo; |
||||||
|
|
||||||
|
import com.logpm.factorydata.jinpai.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 { |
||||||
|
} |
@ -0,0 +1,71 @@ |
|||||||
|
#服务器端口 |
||||||
|
server: |
||||||
|
port: 18940 |
||||||
|
|
||||||
|
#数据源配置 |
||||||
|
#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-jinpai.master.url} |
||||||
|
username: ${blade.datasource.factorydata-jinpai.master.username} |
||||||
|
password: ${blade.datasource.factorydata-jinpai.master.password} |
||||||
|
slave: |
||||||
|
druid: |
||||||
|
#独立校验配置 |
||||||
|
validation-query: select 1 |
||||||
|
#oracle校验 |
||||||
|
#validation-query: select 1 from dual |
||||||
|
url: ${blade.datasource.factorydata-jinpai.slave.url} |
||||||
|
username: ${blade.datasource.factorydata-jinpai.slave.username} |
||||||
|
password: ${blade.datasource.factorydata-jinpai.slave.password} |
||||||
|
|
@ -0,0 +1,45 @@ |
|||||||
|
#服务器端口 |
||||||
|
server: |
||||||
|
port: 18940 |
||||||
|
|
||||||
|
#数据源配置 |
||||||
|
#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-jinpai.master.url} |
||||||
|
username: ${blade.datasource.factorydata-jinpai.master.username} |
||||||
|
password: ${blade.datasource.factorydata-jinpai.master.password} |
||||||
|
slave: |
||||||
|
druid: |
||||||
|
#独立校验配置 |
||||||
|
validation-query: select 1 |
||||||
|
#oracle校验 |
||||||
|
#validation-query: select 1 from dual |
||||||
|
url: ${blade.datasource.factorydata-jinpai.slave.url} |
||||||
|
username: ${blade.datasource.factorydata-jinpai.slave.username} |
||||||
|
password: ${blade.datasource.factorydata-jinpai.slave.password} |
||||||
|
|
@ -0,0 +1,71 @@ |
|||||||
|
#服务器端口 |
||||||
|
server: |
||||||
|
port: 18940 |
||||||
|
|
||||||
|
#数据源配置 |
||||||
|
#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-jinpai.master.url} |
||||||
|
username: ${blade.datasource.factorydata-jinpai.master.username} |
||||||
|
password: ${blade.datasource.factorydata-jinpai.master.password} |
||||||
|
slave: |
||||||
|
druid: |
||||||
|
#独立校验配置 |
||||||
|
validation-query: select 1 |
||||||
|
#oracle校验 |
||||||
|
#validation-query: select 1 from dual |
||||||
|
url: ${blade.datasource.factorydata-jinpai.slave.url} |
||||||
|
username: ${blade.datasource.factorydata-jinpai.slave.username} |
||||||
|
password: ${blade.datasource.factorydata-jinpai.slave.password} |
||||||
|
|
@ -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 |
||||||
|
|
@ -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> |
Loading…
Reference in new issue