添加 计费规则

pull/4/head
zhaokangyu 2024-03-02 17:21:51 +08:00
parent f55d493250
commit 1eb1938a59
33 changed files with 761 additions and 91 deletions

View File

@ -6,28 +6,31 @@
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="boot-auth" />
<module name="boot-common-seata" />
<module name="boot-visual-monitor" />
<module name="boot-job" />
<module name="boot-common-redis" />
<module name="boot-valuation-server" />
<module name="boot-valuation-rule-common" />
<module name="boot-common-datasource" />
<module name="boot-gen" />
<module name="boot-common-core" />
<module name="boot-common-swagger" />
<module name="boot-system-server" />
<module name="boot-auth" />
<module name="boot-valuation-rule-remote" />
<module name="boot-valuation-rule-server" />
<module name="boot-file-common" />
<module name="boot-file-remote" />
<module name="boot-system-remote" />
<module name="boot-valuation-remote" />
<module name="boot-valuation-common" />
<module name="boot-job" />
<module name="boot-common-log" />
<module name="boot-common-datascope" />
<module name="boot-common-redis" />
<module name="boot-valuation-server" />
<module name="boot-common-security" />
<module name="boot-common-datasource" />
<module name="boot-file-server" />
<module name="boot-system-common" />
<module name="boot-gen" />
<module name="boot-common-core" />
<module name="boot-gateway" />
<module name="boot-common-swagger" />
<module name="boot-system-server" />
</profile>
</annotationProcessing>
</component>

View File

@ -45,6 +45,14 @@
<file url="file://$PROJECT_DIR$/boot-modules/boot-system/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-modules/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-modules/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/boot-valuation-rule-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/boot-valuation-rule-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/boot-valuation-rule-remote/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/boot-valuation-rule-remote/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/boot-valuation-rule-server/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/boot-valuation-rule-server/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation-rule/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/boot-valuation/boot-valuation-remote/src/main/java" charset="UTF-8" />

View File

@ -0,0 +1,14 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

View File

@ -4,85 +4,8 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="4ff1d9f5-2c42-4e1d-b888-deb3ee69a0d5" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/domain/DataInit.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/domain/DefineParameter.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/domain/Estimated.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/domain/NightSection.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/domain/Section.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/domain/vo/DataVo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/domain/vo/DrivingRecordVo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/utils/BigDecimalUtils.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/src/main/java/com/boot/valuation/common/utils/ComputeSectionUtil.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/domain/DataInit.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/domain/DefineParameter.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/domain/Estimated.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/domain/NightSection.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/domain/Section.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/domain/vo/DataVo.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/domain/vo/DrivingRecordVo.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/utils/BigDecimalUtils.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-common/target/classes/com/boot/valuation/common/utils/ComputeSectionUtil.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-remote/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/src/main/java/com/boot/valuation/BootValuationApplication.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/src/main/java/com/boot/valuation/controller/ValuationController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/src/main/java/com/boot/valuation/mapper/ValuationMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/src/main/java/com/boot/valuation/service/ValuationService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/src/main/java/com/boot/valuation/service/impl/ValuationServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/src/main/resources/bootstrap.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/src/main/resources/mapper/ValuationMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/target/classes/bootstrap.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/target/classes/com/boot/valuation/BootValuationApplication.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/target/classes/com/boot/valuation/controller/ValuationController.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/target/classes/com/boot/valuation/mapper/ValuationMapper.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/target/classes/com/boot/valuation/service/ValuationService.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/target/classes/com/boot/valuation/service/impl/ValuationServiceImpl.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/boot-valuation-server/target/classes/mapper/ValuationMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/target/boot-valuation-3.6.3.jar" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/target/maven-archiver/pom.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
<change afterPath="$PROJECT_DIR$/boot-valuation/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-auth/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-auth/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-auth/target/classes/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-auth/target/classes/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-common/boot-common-core/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-common/boot-common-core/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-gateway/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-gateway/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-gateway/target/classes/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-gateway/target/classes/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-file/boot-file-server/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-file/boot-file-server/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-file/boot-file-server/target/classes/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-file/boot-file-server/target/classes/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-gen/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-gen/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-gen/target/classes/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-gen/target/classes/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-job/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-job/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-job/target/classes/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-job/target/classes/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-system/boot-system-server/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-system/boot-system-server/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-modules/boot-system/boot-system-server/target/classes/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-modules/boot-system/boot-system-server/target/classes/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-visual/boot-monitor/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-visual/boot-monitor/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/boot-visual/boot-monitor/target/classes/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/boot-visual/boot-monitor/target/classes/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-auth/info.2023-11-20.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-auth/info.2023-11-20.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-auth/info.2024-02-21.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-auth/info.2024-02-21.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-auth/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-auth/info.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-file/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-file/info.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-gateway/info.2023-11-20.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-gateway/info.2023-11-20.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-gateway/info.2024-02-21.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-gateway/info.2024-02-21.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-gateway/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-gateway/info.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-gen/info.2023-11-20.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-gen/info.2023-11-20.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-gen/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-gen/info.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-job/info.2023-11-20.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-job/info.2023-11-20.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-job/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-job/info.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-system/error.2023-11-20.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-system/error.2023-11-20.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-system/info.2023-11-20.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-system/info.2023-11-20.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-system/info.2024-02-21.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-system/info.2024-02-21.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-system/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-system/info.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/boot-visual-monitor/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/boot-visual-monitor/info.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<list default="true" id="4ff1d9f5-2c42-4e1d-b888-deb3ee69a0d5" name="Changes" comment="计价">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -117,7 +40,7 @@
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;git-widget-placeholder&quot;: &quot;zhaokangyu&quot;,
&quot;jdk.selected.JAVA_MODULE&quot;: &quot;17&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/car/boot-Cloud1/pom.xml&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
@ -146,7 +69,7 @@
</set>
</option>
</component>
<component name="RunManager" selected="Spring Boot.BootAuthApplication">
<component name="RunManager" selected="Spring Boot.BootValuationRuleApplication">
<configuration name="BootAuthApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<module name="boot-auth" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.boot.auth.BootAuthApplication" />
@ -203,6 +126,13 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="BootValuationRuleApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<module name="boot-valuation-rule-server" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.boot.rule.BootValuationRuleApplication" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
@ -214,11 +144,25 @@
<updated>1709274342728</updated>
<workItem from="1709274347013" duration="1613000" />
<workItem from="1709275989973" duration="29000" />
<workItem from="1709276029497" duration="303000" />
<workItem from="1709276029497" duration="1553000" />
<workItem from="1709349938279" duration="86000" />
</task>
<task id="LOCAL-00001" summary="计价">
<option name="closed" value="true" />
<created>1709276471469</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1709276471470</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="计价" />
<option name="LAST_COMMIT_MESSAGE" value="计价" />
</component>
</project>

View File

@ -0,0 +1,27 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.boot</groupId>
<artifactId>boot-valuation-rule</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>boot-valuation-rule-common</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-common-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,35 @@
package com.boot.rule.common.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @ClassName ChargingMiddleTable
* @Description
* @Author
* @Date 2024/3/1 16:20
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ChargingMiddleTable {
private Integer id;
private Integer cityId;
private Integer channelId;
private Integer serverTypeId;
private Integer rankId;
private Integer estimatedId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
private String userName;
private Integer availableState;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}

View File

@ -0,0 +1,36 @@
package com.boot.rule.common.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @ClassName EstimatedOrder
* @Description
* @Author
* @Date 2024/3/1 16:15
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EstimatedOrder {
private Integer id;
private Integer cityId;
private Integer serverTypeId;
private Integer channelId;
private Integer rankId;
private Double kilometres;
private Integer serverTime;
private BigDecimal mealPrice;
private BigDecimal basicsPrice;
private Integer nightId;
private String sectionId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}

View File

@ -0,0 +1,26 @@
package com.boot.rule.common.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @ClassName NightServer
* @Description
* @Author
* @Date 2024/3/1 16:22
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NightServer {
private Integer id;
private BigDecimal nightServerMileagePrice;
private BigDecimal nightServerTimePrice;
private BigDecimal mileagePrice;
private BigDecimal timePrice;
private Double longWayMileage;
private BigDecimal longWayPrice;
}

View File

@ -0,0 +1,24 @@
package com.boot.rule.common.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @ClassName Section
* @Description
* @Author
* @Date 2024/3/1 16:24
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Section {
private Integer id;
private Integer startTime;
private Integer endTime;
private BigDecimal kilometrePrice;
private BigDecimal timePrice;
}

View File

@ -0,0 +1,78 @@
package com.boot.rule.common.domain.vo;
import com.boot.rule.common.domain.Section;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @ClassName ValuationVo
* @Description
* @Author
* @Date 2024/3/1 15:52
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ValuationVo {
// 城市id
private Integer cityId;
// 渠道id
private Integer channelId;
// 服务类型id
private Integer serverTypeId;
// 车辆级别id
private Integer rankId;
// 最低消费(套餐价格)
private BigDecimal mealPrice;
// 基本消费
private BigDecimal basicsPrice;
// 包含公里数
private Double kilometres;
// 包含服务时间
private Integer serverTime;
// 超服务公里单价
private BigDecimal mileagePrice;
// 超服务时长单价
private BigDecimal timePrice;
// 远途服务起算公里
private Double longWayMileage;
// 远途服务公里单价
private BigDecimal longWayPrice;
// 夜间服务加收公里数单价
private BigDecimal nightServerMileagePrice;
// 夜间服务加收书剑单价
private BigDecimal nightServerTimePrice;
// 芬顿计费规则List集合
private List<Section> sectionList;
// 操作人
private String userName;
// 创建时间
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}

View File

@ -0,0 +1,28 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.boot</groupId>
<artifactId>boot-valuation-rule</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>boot-valuation-rule-remote</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-valuation-rule-common</artifactId>
<version>3.6.3</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,114 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.boot</groupId>
<artifactId>boot-valuation-rule</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>boot-valuation-rule-server</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Swagger UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- RuoYi Common DataSource -->
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-common-datasource</artifactId>
</dependency>
<!-- RuoYi Common DataScope -->
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-common-datascope</artifactId>
</dependency>
<!-- RuoYi Common Log -->
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-common-log</artifactId>
</dependency>
<!-- RuoYi Common Swagger -->
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-common-swagger</artifactId>
</dependency>
<!-- 计价服务的公共依赖-->
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-valuation-rule-common</artifactId>
<version>3.6.3</version>
</dependency>
<dependency>
<groupId>com.boot</groupId>
<artifactId>boot-file-remote</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,33 @@
package com.boot.rule;
import com.boot.common.security.annotation.EnableCustomConfig;
import com.boot.common.security.annotation.EnableRyFeignClients;
import com.boot.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @ClassName BootValuationRuleApplication
* @Description
* @Author
* @Date 2024/3/1 15:23
*/
@SpringBootApplication
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
public class BootValuationRuleApplication {
public static void main(String[] args) {
SpringApplication.run(BootValuationRuleApplication.class,args);
System.out.println("(♥◠‿◠)ノ゙ 计价规则模块启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -0,0 +1,29 @@
package com.boot.rule.controller;
import com.boot.common.core.domain.Result;
import com.boot.rule.common.domain.vo.ValuationVo;
import com.boot.rule.service.RuleService;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
/**
* @ClassName RuleController
* @Description
* @Author
* @Date 2024/3/1 16:27
*/
@RestController
@RequestMapping("/rule")
public class RuleController {
@Autowired
private RuleService ruleService;
@PostMapping("/addRule")
public Result addRule(@RequestBody ValuationVo valuationVo){
return ruleService.addRule(valuationVo);
}
}

View File

@ -0,0 +1,22 @@
package com.boot.rule.mapper;
import com.boot.rule.common.domain.ChargingMiddleTable;
import com.boot.rule.common.domain.EstimatedOrder;
import com.boot.rule.common.domain.NightServer;
import com.boot.rule.common.domain.Section;
/**
* @ClassName RuleMapper
* @Description
* @Author
* @Date 2024/3/1 16:28
*/
public interface RuleMapper {
void addSection(Section section);
void addNightServer(NightServer nightServer);
void addEstimatedOrder(EstimatedOrder estimatedOrder);
Integer addChargingMiddleTable(ChargingMiddleTable chargingMiddleTable);
}

View File

@ -0,0 +1,14 @@
package com.boot.rule.service;
import com.boot.common.core.domain.Result;
import com.boot.rule.common.domain.vo.ValuationVo;
/**
* @ClassName RuleService
* @Description
* @Author
* @Date 2024/3/1 16:27
*/
public interface RuleService {
Result addRule(ValuationVo valuationVo);
}

View File

@ -0,0 +1,86 @@
package com.boot.rule.service.impl;
import com.boot.common.core.domain.Result;
import com.boot.rule.common.domain.ChargingMiddleTable;
import com.boot.rule.common.domain.EstimatedOrder;
import com.boot.rule.common.domain.NightServer;
import com.boot.rule.common.domain.Section;
import com.boot.rule.common.domain.vo.ValuationVo;
import com.boot.rule.mapper.RuleMapper;
import com.boot.rule.service.RuleService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* @ClassName RuleServiceImpl
* @Description
* @Author
* @Date 2024/3/1 16:28
*/
@Service
public class RuleServiceImpl implements RuleService {
@Autowired
private RuleMapper ruleMapper;
@Override
@Transactional
public Result addRule(ValuationVo valuationVo) {
String str = "";
NightServer nightServer = new NightServer();
EstimatedOrder estimatedOrder = new EstimatedOrder();
Section section1 = new Section();
ChargingMiddleTable chargingMiddleTable = new ChargingMiddleTable();
// 将前台的值分别赋值给不同的表,然后添加表中的数据
// 1.分段计费表中进行赋值
// 含有芬顿计费
if (valuationVo.getSectionList() != null){
str = "";
for (Section section : valuationVo.getSectionList()) {
ruleMapper.addSection(section);
Integer section1Id = section1.getId();
str += ","+section1Id;
}
estimatedOrder.setSectionId(str.substring(1));
}else { // 不含分段计费
estimatedOrder.setSectionId(String.valueOf(0));
}
// 2.夜间服务统计表中进行赋值
nightServer.setNightServerMileagePrice(valuationVo.getNightServerMileagePrice());
nightServer.setNightServerTimePrice(valuationVo.getNightServerTimePrice());
nightServer.setMileagePrice(valuationVo.getMileagePrice());
nightServer.setTimePrice(valuationVo.getTimePrice());
nightServer.setLongWayMileage(valuationVo.getLongWayMileage());
nightServer.setLongWayPrice(valuationVo.getLongWayPrice());
ruleMapper.addNightServer(nightServer);
Integer nightServerId = nightServer.getId();
// 3.套餐表中进行赋值
estimatedOrder.setCityId(valuationVo.getCityId());
estimatedOrder.setChannelId(valuationVo.getChannelId());
estimatedOrder.setRankId(valuationVo.getRankId());
estimatedOrder.setServerTypeId(valuationVo.getServerTypeId());
estimatedOrder.setKilometres(valuationVo.getKilometres());
estimatedOrder.setServerTime(valuationVo.getServerTime());
estimatedOrder.setMealPrice(valuationVo.getMealPrice());
estimatedOrder.setBasicsPrice(valuationVo.getBasicsPrice());
estimatedOrder.setNightId(nightServerId);
ruleMapper.addEstimatedOrder(estimatedOrder);
Integer estimatedOrderId = estimatedOrder.getId();
// 4.计费规则中间表中进行赋值
chargingMiddleTable.setCityId(valuationVo.getCityId());
chargingMiddleTable.setRankId(valuationVo.getRankId());
chargingMiddleTable.setServerTypeId(valuationVo.getServerTypeId());
chargingMiddleTable.setChannelId(valuationVo.getChannelId());
chargingMiddleTable.setEstimatedId(estimatedOrderId);
chargingMiddleTable.setUpdateTime(new Date());
chargingMiddleTable.setUserName(valuationVo.getUserName());
chargingMiddleTable.setCreateTime(valuationVo.getCreateTime());
Integer i = ruleMapper.addChargingMiddleTable(chargingMiddleTable);
return i>0?Result.ok("添加成功"):Result.fail("添加失败");
}
}

View File

@ -0,0 +1,27 @@
# Tomcat
server:
port: 9502
# Spring
spring:
application:
# 应用名称
name: boot-valuation-rule
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 122.152.215.207:8848
namespace: 305eac8a-d1bd-4c64-8945-ad0c19c359c5
config:
# 配置中心地址
server-addr: 122.152.215.207:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
namespace: 305eac8a-d1bd-4c64-8945-ad0c19c359c5

View File

@ -0,0 +1,34 @@
<?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.boot.rule.mapper.RuleMapper">
<insert id="addSection" useGeneratedKeys="true" keyProperty="id">
INSERT INTO `car`.`tb_section`
(`start_time`, `end_time`, `kilometre_price`, `time_price`)
VALUES
(#{startTime}, #{endTime}, #{kilometrePrice}, #{timePrice})
</insert>
<insert id="addNightServer" keyProperty="id" useGeneratedKeys="true">
INSERT INTO `car`.`night_server`
(`night_server_mileage_price`, `night_server_time_price`, `mileage_price`, `time_price`, `long_way_mileage`, `long_way_price`)
VALUES
(#{nightServerMileagePrice}, #{nightServerTimePrice}, #{mileagePrice}, #{timePrice}, #{longWayMileage}, #{longWayPrice})
</insert>
<insert id="addEstimatedOrder" keyProperty="id" useGeneratedKeys="true">
INSERT INTO `car`.`estimated_order`
(`city_id`, `server_type_id`, `channel_id`, `rank_id`, `kilometres`, `server_time`, `meal_price`, `basics_price`, `night_id`, `section_id`)
VALUES
(#{cityId}, #{serverTypeId}, #{channelId}, #{rankId}, #{kilometres}, #{serverTime}, #{mealPrice}, #{basicsPrice}, #{nightId}, #{sectionId})
</insert>
<insert id="addChargingMiddleTable">
INSERT INTO `car`.`charging_middle_table`
(`city_id`, `channel_id`, `server_type_id`, `rank_id`, `estimated_id`, `update_time`, `user_name`, `available_state`, `create_time`)
VALUES
(#{cityId}, #{channelId}, #{serverTypeId}, #{rankId}, #{estimatedId}, #{updateTime}, #{userName}, 0, #{createTime})
</insert>
</mapper>

View File

@ -0,0 +1,27 @@
# Tomcat
server:
port: 9502
# Spring
spring:
application:
# 应用名称
name: boot-valuation-rule
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 122.152.215.207:8848
namespace: 305eac8a-d1bd-4c64-8945-ad0c19c359c5
config:
# 配置中心地址
server-addr: 122.152.215.207:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
namespace: 305eac8a-d1bd-4c64-8945-ad0c19c359c5

View File

@ -0,0 +1,34 @@
<?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.boot.rule.mapper.RuleMapper">
<insert id="addSection" useGeneratedKeys="true" keyProperty="id">
INSERT INTO `car`.`tb_section`
(`start_time`, `end_time`, `kilometre_price`, `time_price`)
VALUES
(#{startTime}, #{endTime}, #{kilometrePrice}, #{timePrice})
</insert>
<insert id="addNightServer" keyProperty="id" useGeneratedKeys="true">
INSERT INTO `car`.`night_server`
(`night_server_mileage_price`, `night_server_time_price`, `mileage_price`, `time_price`, `long_way_mileage`, `long_way_price`)
VALUES
(#{nightServerMileagePrice}, #{nightServerTimePrice}, #{mileagePrice}, #{timePrice}, #{longWayMileage}, #{longWayPrice})
</insert>
<insert id="addEstimatedOrder" keyProperty="id" useGeneratedKeys="true">
INSERT INTO `car`.`estimated_order`
(`city_id`, `server_type_id`, `channel_id`, `rank_id`, `kilometres`, `server_time`, `meal_price`, `basics_price`, `night_id`, `section_id`)
VALUES
(#{cityId}, #{serverTypeId}, #{channelId}, #{rankId}, #{kilometres}, #{serverTime}, #{mealPrice}, #{basicsPrice}, #{nightId}, #{sectionId})
</insert>
<insert id="addChargingMiddleTable">
INSERT INTO `car`.`charging_middle_table`
(`city_id`, `channel_id`, `server_type_id`, `rank_id`, `estimated_id`, `update_time`, `user_name`, `available_state`, `create_time`)
VALUES
(#{cityId}, #{channelId}, #{serverTypeId}, #{rankId}, #{estimatedId}, #{updateTime}, #{userName}, 0, #{createTime})
</insert>
</mapper>

View File

@ -0,0 +1,26 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.boot</groupId>
<artifactId>boot</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>boot-valuation-rule</artifactId>
<packaging>pom</packaging>
<modules>
<module>boot-valuation-rule-common</module>
<module>boot-valuation-rule-server</module>
<module>boot-valuation-rule-remote</module>
</modules>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -246,6 +246,7 @@
<module>boot-visual</module>
<module>boot-modules</module>
<module>boot-valuation</module>
<module>boot-valuation-rule</module>
<module>boot-common</module>
</modules>
<packaging>pom</packaging>