no message

This commit is contained in:
2025-08-17 14:11:08 +08:00
commit fcffced718
43 changed files with 2378 additions and 0 deletions

View File

@ -0,0 +1,69 @@
server:
port: 8016
spring:
application:
name: sczx-sync # 微服务名称
http:
encoding:
charset: UTF-8
enabled: true
force: true
mvc:
async:
request-timeout: -1
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
cloud:
nacos:
discovery:
server-addr: 115.190.8.52:8848 # Nacos 地址
group: DEFAULT_GROUP
metadata:
version: 1.0.0
env: dev
lifecycle:
timeout-per-shutdown-phase: 30s # 设置优雅停机时间
datasource:
url: jdbc:mysql://115.190.8.52:3306/sczx?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: sczx_user
password: Sczx123@
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
maximum-pool-size: 10
auto-commit: true
management:
endpoints:
web:
exposure:
include: "*" # 暴露所有监控端点
endpoint:
health:
show-details: always
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
type-aliases-package: com.sczx.sync.po # 实体类包路径
configuration:
mapUnderscoreToCamelCase: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 控制台打印 SQL调试用
# 第三方平台配置
third-party:
platform:
app-id: 111
access-token: 111
api-url: 127.0.0.1:8081/api/ddd
timeout: 30000
retry-times: 3
battery-platform:
appid: 12312321
access_token: 23213213

View File

@ -0,0 +1,40 @@
CREATE TABLE `zc_order_main` (
`order_id` bigint NOT NULL AUTO_INCREMENT COMMENT '订单ID主键',
`order_no` varchar(50) NOT NULL COMMENT '订单编号',
`order_status` varchar(20) NOT NULL COMMENT '订单状态:下单未提车、租赁中、已结束-自动、已结束-手动',
`operator_id` bigint NOT NULL COMMENT '所属运营商ID',
`store_id` bigint NOT NULL COMMENT '所属门店ID',
`vehicle_id` bigint DEFAULT NULL COMMENT '车辆ID',
`car_model_id` bigint NOT NULL COMMENT '车型ID',
`customer_id` bigint NOT NULL COMMENT '客户id',
`customer_name` varchar(50) NOT NULL COMMENT '客户姓名',
`customer_phone` varchar(20) NOT NULL COMMENT '客户联系电话',
`battery_type` varchar(50) DEFAULT '' COMMENT '选择的电池类型(48V标准版/100km,48V超长版/200km等)',
`rental_type` varchar(20) NOT NULL COMMENT '租赁类型(时租/日租/按天数/以租代售)',
`rental_days` int DEFAULT NULL COMMENT '租赁天数(当类型为"按天数"时使用)',
`rental_price` decimal(10,2) NOT NULL COMMENT '租车价格(元)',
`deposit_price` decimal(10,2) NOT NULL COMMENT '押金价格(元)',
`overdue_fee` decimal(10,2) NOT NULL COMMENT '逾期金额(元)',
`overdue_type` varchar(10) DEFAULT '按日计费' COMMENT '逾期计费类型(按日计费/按月计费)',
`is_deposit_free` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开通免押',
`is_auto_deduct` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开通代扣',
`first_order_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '首次下单时间',
`start_rent_time` datetime DEFAULT NULL COMMENT '开始计费时间',
`end_rent_time` datetime DEFAULT NULL COMMENT '预计还车时间',
`req_end_rent_time` datetime DEFAULT NULL COMMENT '申请还车时间',
`act_end_rent_time` datetime DEFAULT NULL COMMENT '实际还车时间',
`overdue_days` int NOT NULL DEFAULT '0' COMMENT '逾期天数',
`renewal_times` int NOT NULL DEFAULT '0' COMMENT '续租次数',
`charge_times` int NOT NULL DEFAULT '0' COMMENT '充电次数',
`rent_car_rule_id` bigint DEFAULT NULL COMMENT '租车套餐id',
`rent_battey_rule_id` bigint DEFAULT NULL COMMENT '租电套餐id',
`end_order_time` datetime DEFAULT NULL COMMENT '订单结束时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`order_id`),
KEY `idx_order_no` (`order_no`),
KEY `idx_customer_id` (`customer_id`),
KEY `idx_operator_id` (`operator_id`),
KEY `idx_store_id` (`store_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='租车订单信息';

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--%d表示日期%X表示输出所有,:null表示为空时输出null%level表示日志级别 %thread表示线程名字 %c表示类名 %L表示行号 %n表示换行符-->
<property name="PATTERN"
value="%-12(%d{yyyy-MM-dd HH:mm:ss.SSS}) [%X{EagleEye-TraceID}%X{EagleEye-TraceID-Copy}] %level [%thread] %c[%L] %X{requestId} %msg%n"/>
<property name="LOG_FILE_PATH" value="./logs"/>
<appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${PATTERN}</pattern>
</encoder>
</appender>
<appender name="INFO_FILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_PATH}/${hostname}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<MaxHistory>31</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>${PATTERN}</pattern>
</layout>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>WARN</level>
<onMatch>DENY</onMatch>
<onMismatch>NEUTRAL</onMismatch>
</filter>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>DENY</onMatch>
<onMismatch>NEUTRAL</onMismatch>
</filter>
</appender>
<appender name="WARN_FILE_APPENDER" class="ch.qos.logback.core.FileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<file>${LOG_FILE_PATH}/${hostname}/warn.log</file>
<append>true</append>
<encoder>
<pattern>${PATTERN}</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="INFO_FILE_APPENDER"/>
<appender-ref ref="WARN_FILE_APPENDER"/>
<appender-ref ref="STDOUT"/>
</root>
</configuration>

View File

@ -0,0 +1,59 @@
<?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.sczx.sync.mapper.BatteryMealMapper">
<insert id="insertZcRentBatteyRule" parameterType="SyncDataInfo" useGeneratedKeys="true" keyProperty="id">
insert into zc_rent_battey_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">title,</if>
<if test="detail != null and detail != ''">detail,</if>
<if test="voltage != null and voltage != ''">voltage,</if>
<if test="ah != null and ah != ''">ah,</if>
<if test="rentPrice != null">rent_price,</if>
<if test="durationType != null">duration_type,</if>
<if test="duration != null">duration,</if>
<if test="cityId != null">city_id,</if>
<if test="operatorId != null">operator_id,</if>
<if test="provinceId != null">province_id,</if>
<if test="categoryId != null">category_id,</if>
<if test="mealId != null">meal_id,</if>
<if test="syncTime != null">sync_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">#{title},</if>
<if test="detail != null and detail != ''">#{detail},</if>
<if test="voltage != null and voltage != ''">#{voltage},</if>
<if test="ah != null and ah != ''">#{ah},</if>
<if test="rentPrice != null">#{rentPrice},</if>
<if test="durationType != null">#{durationType},</if>
<if test="duration != null">#{duration},</if>
<if test="cityId != null">#{cityId},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="provinceId != null">#{provinceId},</if>
<if test="categoryId != null">#{categoryId},</if>
<if test="mealId != null">#{mealId},</if>
<if test="syncTime != null">#{syncTime},</if>
</trim>
</insert>
<update id="updateBatteryRule" parameterType="SyncDataInfo">
update zc_rent_battey_rule
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>
<if test="detail != null and detail != ''">detail = #{detail},</if>
<if test="voltage != null and voltage != ''">voltage = #{voltage},</if>
<if test="ah != null and ah != ''">ah = #{ah},</if>
<if test="rentPrice != null">rent_price = #{rentPrice},</if>
<if test="durationType != null">duration_type = #{durationType},</if>
<if test="duration != null">duration = #{duration},</if>
<if test="cityId != null">city_id = #{cityId},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="provinceId != null">province_id = #{provinceId},</if>
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="syncTime != null">sync_time = #{syncTime},</if>
</trim>
where meal_id = #{mealId}
</update>
</mapper>

View File

@ -0,0 +1,18 @@
<?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.sczx.sync.mapper.CompanyStoreMapper">
<update id="updateStoreId">
update zc_company_store set bp_store_id = #{bpStoreId} where id =#{cId}
</update>
<update id="updateOpeId">
update zc_company set b_op_id = #{bOpId} where id =#{cId}
</update>
<update id="updateOdId">
update zc_order_sub set b_order_id = #{bOdId} where order_id =#{cId} and suborder_type = "RENTBATTEY"
</update>
</mapper>