Compare commits

...

No commits in common. 'dev' and 'recharge_rate-and-refund-zlp' have entirely different histories.

  1. 8
      gold-system/.idea/.gitignore
  2. 26
      gold-system/.idea/compiler.xml
  3. 14
      gold-system/.idea/encodings.xml
  4. 9
      gold-system/.idea/gold-system.iml
  5. 20
      gold-system/.idea/jarRepositories.xml
  6. 16
      gold-system/.idea/misc.xml
  7. 8
      gold-system/.idea/modules.xml
  8. 124
      gold-system/.idea/uiDesigner.xml
  9. 6
      gold-system/.idea/vcs.xml
  10. 0
      gold-system/demo/.gitattributes
  11. 0
      gold-system/demo/.gitignore
  12. 0
      gold-system/demo/.mvn/wrapper/maven-wrapper.properties
  13. 2
      gold-system/demo/commons/.gitattributes
  14. 33
      gold-system/demo/commons/.gitignore
  15. 19
      gold-system/demo/commons/.mvn/wrapper/maven-wrapper.properties
  16. 0
      gold-system/demo/commons/mvnw
  17. 0
      gold-system/demo/commons/mvnw.cmd
  18. 67
      gold-system/demo/commons/pom.xml
  19. 25
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Activity.java
  20. 25
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Admin.java
  21. 25
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Audit.java
  22. 35
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Detail.java
  23. 13
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Page.java
  24. 27
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Rate.java
  25. 10
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/RateSearchRequest.java
  26. 34
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Recharge.java
  27. 22
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Statistics.java
  28. 21
      gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/User.java
  29. 38
      gold-system/demo/commons/src/main/java/com/example/commons/domain/vo/RechargeVo.java
  30. 8
      gold-system/demo/commons/src/main/java/com/example/commons/domain/vo/Result.java
  31. 17
      gold-system/demo/commons/src/main/java/com/example/commons/sevice/ActivityService.java
  32. 14
      gold-system/demo/commons/src/main/java/com/example/commons/sevice/AuditService.java
  33. 16
      gold-system/demo/commons/src/main/java/com/example/commons/sevice/RateService.java
  34. 16
      gold-system/demo/commons/src/main/java/com/example/commons/sevice/RechargeService.java
  35. 12
      gold-system/demo/commons/src/main/java/com/example/commons/sevice/RefundService.java
  36. 11
      gold-system/demo/commons/src/main/java/com/example/commons/sevice/StatisticsService.java
  37. 13
      gold-system/demo/commons/src/main/java/com/example/commons/sevice/UserSevice.java
  38. 13
      gold-system/demo/commons/src/test/java/com/example/commons/CommonsApplicationTests.java
  39. 259
      gold-system/demo/mvnw
  40. 149
      gold-system/demo/mvnw.cmd
  41. 106
      gold-system/demo/pom.xml
  42. 2
      gold-system/demo/recharge/.gitattributes
  43. 33
      gold-system/demo/recharge/.gitignore
  44. 19
      gold-system/demo/recharge/.mvn/wrapper/maven-wrapper.properties
  45. 259
      gold-system/demo/recharge/mvnw
  46. 149
      gold-system/demo/recharge/mvnw.cmd
  47. 73
      gold-system/demo/recharge/pom.xml
  48. 13
      gold-system/demo/recharge/src/main/java/com/example/recharge/RechargeApplication.java
  49. 18
      gold-system/demo/recharge/src/main/java/com/example/recharge/controller/ActivityController.java
  50. 41
      gold-system/demo/recharge/src/main/java/com/example/recharge/controller/AuditController.java
  51. 102
      gold-system/demo/recharge/src/main/java/com/example/recharge/controller/RateController.java
  52. 53
      gold-system/demo/recharge/src/main/java/com/example/recharge/controller/RechargeController.java
  53. 66
      gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/ActivityMapper.java
  54. 36
      gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/AuditMapper.java
  55. 32
      gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/RateMapper.java
  56. 49
      gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/RechargeMapper.java
  57. 68
      gold-system/demo/recharge/src/main/java/com/example/recharge/service/ActivityServiceImpl.java
  58. 35
      gold-system/demo/recharge/src/main/java/com/example/recharge/service/AuditServiceImpl.java
  59. 55
      gold-system/demo/recharge/src/main/java/com/example/recharge/service/RateServiceImpl.java
  60. 46
      gold-system/demo/recharge/src/main/java/com/example/recharge/service/RechargeServiceImpl.java
  61. 15
      gold-system/demo/recharge/src/main/resources/application.yml
  62. 13
      gold-system/demo/recharge/src/test/java/com/example/recharge/RechargeApplicationTests.java
  63. 33
      gold-system/demo/refund/.gitignore
  64. 73
      gold-system/demo/refund/pom.xml
  65. 13
      gold-system/demo/refund/src/main/java/org/example/refund/RefundApplication.java
  66. 69
      gold-system/demo/refund/src/main/java/org/example/refund/controller/RefundController.java
  67. 62
      gold-system/demo/refund/src/main/java/org/example/refund/mapper/RefundMapper.java
  68. 80
      gold-system/demo/refund/src/main/java/org/example/refund/service/RefundServiceImpl.java
  69. 15
      gold-system/demo/refund/src/main/resources/application.yml
  70. 6
      gold-system/demo/refund/src/main/resources/static/index.html
  71. 13
      gold-system/demo/refund/src/test/java/org/example/refund/RefundApplicationTests.java
  72. 33
      gold-system/demo/statistics/.gitignore
  73. 73
      gold-system/demo/statistics/pom.xml
  74. 13
      gold-system/demo/statistics/src/main/java/org/example/statistics/StatisticsApplication.java
  75. 24
      gold-system/demo/statistics/src/main/java/org/example/statistics/controller/StatisticsController.java
  76. 38
      gold-system/demo/statistics/src/main/java/org/example/statistics/mapper/StatisticsMapper.java
  77. 29
      gold-system/demo/statistics/src/main/java/org/example/statistics/service/StatisticsServiceImpl.java
  78. 15
      gold-system/demo/statistics/src/main/resources/application.yml
  79. 6
      gold-system/demo/statistics/src/main/resources/static/index.html
  80. 13
      gold-system/demo/statistics/src/test/java/org/example/statistics/StatisticsApplicationTests.java
  81. 2
      gold-system/demo/user/.gitattributes
  82. 33
      gold-system/demo/user/.gitignore
  83. 19
      gold-system/demo/user/.mvn/wrapper/maven-wrapper.properties
  84. 259
      gold-system/demo/user/mvnw
  85. 149
      gold-system/demo/user/mvnw.cmd
  86. 73
      gold-system/demo/user/pom.xml
  87. 13
      gold-system/demo/user/src/main/java/com/example/user/UserApplication.java
  88. 21
      gold-system/demo/user/src/main/java/com/example/user/controller/UserController.java
  89. 16
      gold-system/demo/user/src/main/java/com/example/user/mapper/UserMapper.java
  90. 33
      gold-system/demo/user/src/main/java/com/example/user/service/UserServiceImpl.java
  91. 14
      gold-system/demo/user/src/main/resources/application.yml
  92. 13
      gold-system/demo/user/src/test/java/com/example/user/UserApplicationTests.java
  93. 24
      gold-system/vue/gold-system/.gitignore
  94. 3
      gold-system/vue/gold-system/.vscode/extensions.json
  95. 5
      gold-system/vue/gold-system/README.md
  96. 13
      gold-system/vue/gold-system/index.html
  97. 1658
      gold-system/vue/gold-system/package-lock.json
  98. 24
      gold-system/vue/gold-system/package.json
  99. 1
      gold-system/vue/gold-system/public/vite.svg
  100. 9
      gold-system/vue/gold-system/src/App.vue

8
gold-system/.idea/.gitignore

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

26
gold-system/.idea/compiler.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="recharge" />
<module name="user" />
<module name="commons" />
<module name="refund" />
<module name="statistics" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="commons" options="-parameters" />
<module name="recharge" options="-parameters" />
<module name="refund" options="-parameters" />
<module name="statistics" options="-parameters" />
<module name="user" options="-parameters" />
</option>
</component>
</project>

14
gold-system/.idea/encodings.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/demo/commons/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/recharge/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/refund/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/refund/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/statistics/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/statistics/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/demo/user/src/main/java" charset="UTF-8" />
</component>
</project>

9
gold-system/.idea/gold-system.iml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

20
gold-system/.idea/jarRepositories.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

16
gold-system/.idea/misc.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/demo/pom.xml" />
<option value="$PROJECT_DIR$/demo/refund/pom.xml" />
<option value="$PROJECT_DIR$/demo/statistics/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
gold-system/.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/gold-system.iml" filepath="$PROJECT_DIR$/.idea/gold-system.iml" />
</modules>
</component>
</project>

124
gold-system/.idea/uiDesigner.xml

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

6
gold-system/.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

0
.gitattributes → gold-system/demo/.gitattributes

0
.gitignore → gold-system/demo/.gitignore

0
.mvn/wrapper/maven-wrapper.properties → gold-system/demo/.mvn/wrapper/maven-wrapper.properties

2
gold-system/demo/commons/.gitattributes

@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf

33
gold-system/demo/commons/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

19
gold-system/demo/commons/.mvn/wrapper/maven-wrapper.properties

@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

0
mvnw → gold-system/demo/commons/mvnw

0
mvnw.cmd → gold-system/demo/commons/mvnw.cmd

67
gold-system/demo/commons/pom.xml

@ -0,0 +1,67 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>commons</artifactId>
<version>0.0.1</version>
<name>commons</name>
<description>commons</description>
<parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

25
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Activity.java

@ -0,0 +1,25 @@
package com.example.commons.domain.entity;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
public class Activity {
private int activityId ;
private int adminId;
private String dept;
private LocalDate startTime;
private LocalDate endTime;
private String activityName;
private BigDecimal rechargeRatio;
private LocalDateTime createTime;
private int activityFlag;
private String name;
private Integer status;
}

25
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Admin.java

@ -0,0 +1,25 @@
package com.example.commons.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@NoArgsConstructor
public class Admin {
private Integer adminId;
private String name;
private String username;
private String password;
private String permission;
private String area;
private String adminFlag;
private Integer status;
private String reson;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createTime;
}

25
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Audit.java

@ -0,0 +1,25 @@
package com.example.commons.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@NoArgsConstructor
public class Audit {
private Integer auditId;
private Integer homilyId;
private Integer rechargeId;
private Integer refundId;
private String name;
private String status;
private Integer AuditFlag;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createTime;
private Date startDate;
private Date endDate;
}

35
src/main/java/com/example/demo/domain/vo/ConsumeDetail.java → gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Detail.java

@ -1,27 +1,21 @@
package com.example.demo.domain.vo;
package com.example.commons.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.catalina.util.StringUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@NoArgsConstructor
public class ConsumeDetail implements Serializable {
private static final long serialVersionUID = 1L;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
@DateTimeFormat(pattern = "yyyy-MM-dd")
public class Detail {
private Integer detailId;
private String name;
private String jwcode;
private String area;
private String uarea;
private Integer activityId;
private String rechargeWay;
private String goods;
@ -34,26 +28,17 @@ public class ConsumeDetail implements Serializable {
private BigDecimal rechargeCoin;
private BigDecimal freeCoin;
private BigDecimal taskCoin;
private String conmmitName;
private Integer status;
private Integer adminId;
private String updateType;
private Integer detailFlag;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createTime;
private Integer adminId;
private String reson;
private String user;
private Date startDate;
private Date endDate;
private Integer auditId;
private String token;
private Integer refundId;
private String productName;
private String username;
private String sortField;
private String sortOrder;
private List<String> areas;
private String adminArea;
private String adminName;
private String userName;
private String auditStatus;
private String auditReson;
}

13
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Page.java

@ -0,0 +1,13 @@
package com.example.commons.domain.entity;
import lombok.Data;
@Data
public class Page {
private Integer pageNum;
private Integer pageSize;
private Rate rate;
private Detail detail;
private Activity activity;
}

27
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Rate.java

@ -0,0 +1,27 @@
package com.example.commons.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@NoArgsConstructor
public class Rate {
private Integer rateId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
private String currency;
private String exchangeRate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
private Integer adminId;
}

10
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/RateSearchRequest.java

@ -0,0 +1,10 @@
package com.example.commons.domain.entity;
import lombok.Data;
@Data
public class RateSearchRequest {
private Integer pageNum;
private Integer pageSize;
private Rate rate;
}

34
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Recharge.java

@ -0,0 +1,34 @@
package com.example.commons.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@NoArgsConstructor
public class Recharge {
private Integer rechargeId;
private String homilyId;
private Integer activityId;
private Double paidGold;
private Double freeGold;
private Double rechargeGold;
private String payWay;
private String rechargeWay;
private Date rechargeTime;
private String rechargeVoucher;
private Integer adminId;
private String area;
private String remark;
private Integer flag;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createTime;
private Date startDate;
private Date endDate;
}

22
gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/Statistics.java

@ -0,0 +1,22 @@
package com.example.commons.domain.entity;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@NoArgsConstructor
public class Statistics {
private BigDecimal rechargeSumCoin;
private BigDecimal freeSumCoin;
private BigDecimal taskSumCoin;
private BigDecimal totalSumCoin;
private BigDecimal rechargeYesterdaySumCoin;
private BigDecimal freeYesterdaySumCoin;
private BigDecimal taskYesterdaySumCoin;
private BigDecimal totalYesterdaySumCoin;
private Integer rechargeCount;
private Integer rechargeCountThisWeek ;
private Integer rechargeCountLastWeek ;
}

21
src/main/java/com/example/demo/domain/entity/User.java → gold-system/demo/commons/src/main/java/com/example/commons/domain/entity/User.java

@ -1,40 +1,27 @@
package com.example.demo.domain.entity;
package com.example.commons.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@NoArgsConstructor
public class User implements Serializable {
private static final long serialVersionUID = 1L;
public class User {
private Integer userId;
private String name;
private String jwcode;
private String homilyId;
private String password;
private String phone;
private String email;
private String gender;
private String area;
private Date birthday;
private String head;
private Integer UserFlag;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createTime;
private String signature;
private BigDecimal sumgold;
private BigDecimal buyJb;
private BigDecimal coreJb;
private BigDecimal free6;
private BigDecimal free12;
private Date lastTime;
private String token;
}

38
gold-system/demo/commons/src/main/java/com/example/commons/domain/vo/RechargeVo.java

@ -0,0 +1,38 @@
package com.example.commons.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@NoArgsConstructor
public class RechargeVo {
private Integer rechargeId;
private String homilyId;
private Integer activityId;
private Double paidGold;
private Double freeGold;
private Double rechargeGold;
private String payWay;
private String rechargeWay;
private Date rechargeTime;
private String rechargeVoucher;
private Integer adminId;
private String area;
private String remark;
private Integer flag;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createTime;
private Date startDate;
private Date endDate;
private String username;
private String activityName;
private String name;
private Integer status;
private String reson;
}

8
src/main/java/com/example/demo/domain/vo/Result.java → gold-system/demo/commons/src/main/java/com/example/commons/domain/vo/Result.java

@ -1,4 +1,4 @@
package com.example.demo.domain.vo;
package com.example.commons.domain.vo;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -6,13 +6,10 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result implements Serializable {
private static final long serialVersionUID = 1L;
public class Result {
private Integer code;
private String msg;
private Object data;
@ -23,7 +20,6 @@ public class Result implements Serializable {
public static Result success(Integer code, Object data) {
return success(code, "操作成功", data);
}
public static Result success(String msg, Object data) {return success(200, msg, data);}
public static Result success(Object data){
return success(200, data);
}

17
gold-system/demo/commons/src/main/java/com/example/commons/sevice/ActivityService.java

@ -0,0 +1,17 @@
package com.example.commons.sevice;
import com.example.commons.domain.entity.Activity;
import java.util.List;
public interface ActivityService {
int add(Activity activity);
int edit(Activity activity);
List<Activity> search(Activity activity);
}

14
gold-system/demo/commons/src/main/java/com/example/commons/sevice/AuditService.java

@ -0,0 +1,14 @@
package com.example.commons.sevice;
import com.example.commons.domain.entity.Audit;
import com.example.commons.domain.entity.Recharge;
import com.github.pagehelper.PageInfo;
import java.util.List;
public interface AuditService {
int add (Audit audit);
List<Audit> search(Audit audit) ;
PageInfo<Audit> searchForPage(Integer pageNum, Integer pageSize, Audit audit);
}

16
gold-system/demo/commons/src/main/java/com/example/commons/sevice/RateService.java

@ -0,0 +1,16 @@
package com.example.commons.sevice;
import com.example.commons.domain.entity.Rate;
import com.github.pagehelper.PageInfo;
import java.util.List;
public interface RateService {
int add(Rate rate) throws Exception;
int edit(Rate rate) ;
void delete(Integer rateId) throws Exception;
Rate getById(Integer rateId);
List<Rate> search(Rate rate);
PageInfo<Rate> searchForPage(Integer pageNum, Integer pageSize,Rate rate);
}

16
gold-system/demo/commons/src/main/java/com/example/commons/sevice/RechargeService.java

@ -0,0 +1,16 @@
package com.example.commons.sevice;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.domain.vo.RechargeVo;
import com.github.pagehelper.PageInfo;
import java.util.List;
public interface RechargeService {
int add(Recharge recharge) throws Exception;
int edit(Recharge recharge) throws Exception;
Recharge findById(int id) throws Exception;
List<RechargeVo> search(RechargeVo rechargeVo) ;
PageInfo<RechargeVo> searchForPage(Integer pageNum, Integer pageSize, RechargeVo rechargeVo);
}

12
src/main/java/com/example/demo/sevice/RefundService.java → gold-system/demo/commons/src/main/java/com/example/commons/sevice/RefundService.java

@ -1,8 +1,7 @@
package com.example.demo.sevice;
package com.example.commons.sevice;
import com.example.demo.domain.entity.Detail;
import com.example.demo.domain.vo.RefundA;
import com.example.commons.domain.entity.Detail;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
@ -13,14 +12,9 @@ public interface RefundService {
int add(Detail detail) ;
int addAudit(Detail detail);
void edit(Detail newDetail) ;
int update(Integer contactId) ;
boolean existsByContactId(Integer contactId);
int softDelete(Integer detailId) ;
Detail selectByOrderCode(String orderCode) ;
Detail selectByJWCODE(String jwcode) ;
Detail selectByDetailId(Integer detailId);
List<Detail> search(Detail detail);
PageInfo<Detail> searchForPage(Integer pageNum, Integer pageSize, Detail detail);
List<RefundA> getRefundA(RefundA refundA);
}

11
gold-system/demo/commons/src/main/java/com/example/commons/sevice/StatisticsService.java

@ -0,0 +1,11 @@
package com.example.commons.sevice;
import com.example.commons.domain.entity.Statistics;
import org.springframework.stereotype.Service;
@Service
public interface StatisticsService {
int totalYearCoin();
int yesterdayNewCoin();
int yearRechargeCount();
}

13
gold-system/demo/commons/src/main/java/com/example/commons/sevice/UserSevice.java

@ -0,0 +1,13 @@
package com.example.commons.sevice;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.domain.entity.User;
import com.github.pagehelper.PageInfo;
import java.util.List;
public interface UserSevice {
List<User> search(User user) ;
PageInfo<User> searchForPage(Integer pageNum, Integer pageSize, User User);
}

13
gold-system/demo/commons/src/test/java/com/example/commons/CommonsApplicationTests.java

@ -0,0 +1,13 @@
package com.example.commons;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class CommonsApplicationTests {
@Test
void contextLoads() {
}
}

259
gold-system/demo/mvnw

@ -0,0 +1,259 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

149
gold-system/demo/mvnw.cmd

@ -0,0 +1,149 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

106
gold-system/demo/pom.xml

@ -0,0 +1,106 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1</version>
<name>demo</name>
<description>demo</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.6</version>
</parent>
<packaging>pom</packaging>
<modules>
<module>recharge</module>
<module>commons</module>
<module>user</module>
<module>refund</module>
<module>statistics</module>
</modules>
<properties>
<java.version>21</java.version>
<spring-boot.version>3.3.6</spring-boot.version>
<dubbo.version>3.3.0-beta.2</dubbo.version>
<seata.version>2.0.0</seata.version>
</properties>
<dependencies>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<artifactId>spring-boot-starter-logging</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

2
gold-system/demo/recharge/.gitattributes

@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf

33
gold-system/demo/recharge/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

19
gold-system/demo/recharge/.mvn/wrapper/maven-wrapper.properties

@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

259
gold-system/demo/recharge/mvnw

@ -0,0 +1,259 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

149
gold-system/demo/recharge/mvnw.cmd

@ -0,0 +1,149 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

73
gold-system/demo/recharge/pom.xml

@ -0,0 +1,73 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>recharge</artifactId>
<version>0.0.1</version>
<name>recharge</name>
<description>recharge</description>
<parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>commons</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

13
gold-system/demo/recharge/src/main/java/com/example/recharge/RechargeApplication.java

@ -0,0 +1,13 @@
package com.example.recharge;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RechargeApplication {
public static void main(String[] args) {
SpringApplication.run(RechargeApplication.class, args);
}
}

18
src/main/java/com/example/demo/controller/ActivityController.java → gold-system/demo/recharge/src/main/java/com/example/recharge/controller/ActivityController.java

@ -1,15 +1,17 @@
package com.example.demo.controller;
package com.example.recharge.controller;
import com.example.demo.domain.entity.Activity;
import com.example.demo.domain.vo.Page;
import com.example.demo.domain.vo.Result;
import com.example.demo.serviceImpl.ActivityServiceImpl;
import com.example.commons.domain.entity.Activity;
import com.example.commons.domain.entity.Page;
import com.example.commons.domain.vo.Result;
import com.example.recharge.service.ActivityServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.util.ObjectUtils;
import java.util.Arrays;
@RestController
@RequestMapping("/recharge/activity")
@ -27,7 +29,9 @@ public class ActivityController {
@PostMapping("/add")
public Result add(@RequestBody Activity activity) {
// try {
System.out.println("------6---");
int result=activityService.add(activity);
System.out.println(result);
return Result.success();
// } catch (Exception e) {
// log.warn(Arrays.toString(e.getStackTrace()));
@ -55,7 +59,7 @@ public class ActivityController {
Integer pageSize=page.getPageSize();
Activity activity= page.getActivity();
if (ObjectUtils.isEmpty(pageNum)){
return Result.success(activityService.search(activity));
return Result.success(activityService.search(page.getActivity()));
}
return Result.success(activityService.searchForPage(pageNum,pageSize,activity));
}

41
gold-system/demo/recharge/src/main/java/com/example/recharge/controller/AuditController.java

@ -0,0 +1,41 @@
package com.example.recharge.controller;
import com.example.commons.domain.entity.Audit;
import com.example.commons.domain.vo.Result;
import com.example.commons.sevice.AuditService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@RestController
@RequestMapping("/recharge/audit")
@RequiredArgsConstructor
@Slf4j
@CrossOrigin
public class AuditController {
private final AuditService auditService;
@PostMapping("/add")
public Result add(@RequestBody Audit audit){
try {
auditService.add(audit);
return Result.success();
}catch (Exception e){
log.warn(Arrays.toString(e.getStackTrace()));
return Result.error(e.getMessage());
}
}
@PostMapping
public Result search(Integer pageNum,Integer pageSize,@RequestBody Audit audit){
if(ObjectUtils.isEmpty(pageNum)){
return Result.success(auditService.search(audit));
}
else {
return Result.success(auditService.searchForPage(pageNum,pageSize,audit));
}
}
}

102
gold-system/demo/recharge/src/main/java/com/example/recharge/controller/RateController.java

@ -0,0 +1,102 @@
package com.example.recharge.controller;
import com.example.commons.domain.entity.Page;
import com.example.commons.domain.entity.Rate;
import com.example.commons.domain.entity.RateSearchRequest;
import com.example.commons.domain.vo.Result;
import com.example.commons.sevice.RateService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@RestController
@RequestMapping("/rates")
@RequiredArgsConstructor
@Slf4j
@CrossOrigin
public class RateController {
private final RateService rateService;
@PostMapping("/add")
public Result add(@RequestBody Rate rate) {
try {
rateService.add(rate);
return Result.success();
} catch (Exception e) {
log.warn(Arrays.toString(e.getStackTrace()));
return Result.error(e.getMessage());
}
}
@PostMapping("/update") // PUT 改为 POST
public Result update(@RequestBody Rate rate) {
// try {
rateService.edit(rate);
return Result.success();
// } catch (Exception e) {
// log.warn(Arrays.toString(e.getStackTrace()));
// return Result.error(e.getMessage());
// }
}
// @PutMapping("/update")
// public Result update(@RequestBody Rate rate) {
// try {
// rateService.edit(rate);
// return Result.success();
// } catch (Exception e) {
// log.warn(Arrays.toString(e.getStackTrace()));
// return Result.error(e.getMessage());
// }
// }
@PostMapping("/delete/{rateId}") // DELETE 改为 POST
public Result delete(@PathVariable("rateId") Integer rateId) {
try {
rateService.delete(rateId);
return Result.success();
} catch (Exception e) {
log.warn(Arrays.toString(e.getStackTrace()));
return Result.error(e.getMessage());
}
}
// @DeleteMapping("/{rateId}")
// public Result delete(@PathVariable("rateId") Integer rateId) {
// try {
// rateService.delete(rateId);
// return Result.success();
// } catch (Exception e) {
// log.warn(Arrays.toString(e.getStackTrace()));
// return Result.error(e.getMessage());
// }
// }
// @GetMapping("/{rateId}")
// public Result get(@PathVariable Integer rateId) {
// return Result.success(rateService.getById(rateId));
// }
//
// @GetMapping
// public Result search(Integer pageNum, Integer pageSize,Rate rate) {
// if(ObjectUtils.isEmpty(pageNum)){
// return Result.success(rateService.search(rate));
// }else{
// return Result.success(rateService.searchForPage(pageNum,pageSize,rate));
// }
// }
@PostMapping("/search") // 改为 POST 请求
public Result search(@RequestBody Page page) {
Integer pageNum = page.getPageNum();
Integer pageSize = page.getPageSize();
Rate rate = page.getRate();
if (ObjectUtils.isEmpty(pageNum)) {
return Result.success(rateService.search(rate));
} else {
return Result.success(rateService.searchForPage(pageNum, pageSize, rate));
}
}
}

53
gold-system/demo/recharge/src/main/java/com/example/recharge/controller/RechargeController.java

@ -0,0 +1,53 @@
package com.example.recharge.controller;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.domain.vo.RechargeVo;
import com.example.commons.domain.vo.Result;
import com.example.commons.sevice.RechargeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@RestController
@RequestMapping("/recharge/recharge")
@RequiredArgsConstructor
@Slf4j
@CrossOrigin
public class RechargeController {
private final RechargeService rechargeService;
@PostMapping("/add")
public Result add(@RequestBody Recharge recharge) {
try {
rechargeService.add(recharge);
return Result.success();
} catch (Exception e) {
log.warn(Arrays.toString(e.getStackTrace()));
return Result.error(e.getMessage());
}
}
@PostMapping("/edit")
public Result edit(@RequestBody Recharge recharge) {
try {
rechargeService.edit(recharge);
} catch (Exception e) {
log.warn(Arrays.toString(e.getStackTrace()));
return Result.error(e.getMessage());
}
return Result.success();
}
@PostMapping
public Result search(Integer pageNum, Integer pageSize,@RequestBody RechargeVo rechargeVo) {
if(ObjectUtils.isEmpty(pageNum)){
return Result.success(rechargeService.search(rechargeVo));
}
else {
return Result.success(rechargeService.searchForPage(pageNum,pageSize,rechargeVo));
}
}
}

66
gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/ActivityMapper.java

@ -0,0 +1,66 @@
package com.example.recharge.mapper;
import com.example.commons.domain.entity.Activity;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface ActivityMapper {
//增加活动信息
@Insert({"insert into activity",
"(admin_id,dept,start_time,end_time,recharge_ratio,activity_name,activity_flag,create_time) " ,
"values",
"(#{adminId},#{dept},#{startTime},#{endTime},#{rechargeRatio},#{activityName},1,now())"
})
@Options(useGeneratedKeys = true,keyColumn = "activity_id",keyProperty = "activityId")
int add(Activity activity);
// 修改活动信息
@Update({
"<script>",
"update activity",
"<set>",
"<if test='adminId != null'> admin_id = #{adminId}, </if>",
"<if test='dept != null '> dept= #{dept}, </if>",
"<if test='startTime != null '> start_time = #{startTime}, </if>",
"<if test='endTime != null '> end_time = #{endTime}, </if>",
"<if test='rechargeRatio != null '> recharge_ratio = #{rechargeRatio}, </if>",
"<if test='activityName != null and activityName.length>0'> activity_name = #{activityName}, </if>",
"<if test='activityFlag != null'> `activity_flag` = #{activityFlag}, </if>",
"<if test='status != null'> `status` = #{status}, </if>",
"</set>",
"where activity_id=#{activityId}",
"</script>"
})
int edit(Activity activity);
//查询--根据活动id查询活动信息
@Select({
"select activity_id from activity where activity_id=#{activityId}"
})
Activity selectById(Integer activityId);
//模糊查询--根据活动id查询活动信息
@Select({
"<script>",
"select activity.*,admin.name from activity",
"inner join admin on activity.admin_id=admin.admin_id ",
"<where>",
"`activity_flag`=1",
"<if test='startTime!=null'>start_time=#{startTime}</if>",
"<if test='endTime!=null'>and end_time=#{endTime}</if>",
"<if test='activityName!=null'>and activity_name like concat('%','#{activityName}','%')</if>",
"</where>",
"</script>"
})
List<Activity> select(Activity activity);
//
}

36
gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/AuditMapper.java

@ -0,0 +1,36 @@
package com.example.recharge.mapper;
import com.example.commons.domain.entity.Audit;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.sevice.AuditService;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface AuditMapper {
@Insert({
"INSERT INTO audit",
"(homily_id,recharge_id,refund_id,name,status,auditFlag)",
"values",
"(#{homilyId},#{rechargeId},#{refundId},#{name},#{status},1)"
})
int insert(Audit audit);
@Select({
"<script>",
"select * from audit",
"<where>",
"<if test='homilyId!=null'>and homily_id=#{homilyId}</if>",
"<if test='startDate != null and endDate != null'>AND create_time BETWEEN #{startDate} AND #{endDate}</if>",
"<if test='rechargeId!=null'>and refund_id=#{fefundId}</if>",
"<if test='refundId!=null'>and refund_id=#{fefundId}</if>",
"<if test='status!=null'>and status=#{status}</if>",
"</where>",
"</script>"
})
List<Audit> select(Audit Audit);
}

32
src/main/java/com/example/demo/mapper/RateMapper.java → gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/RateMapper.java

@ -1,7 +1,6 @@
package com.example.demo.mapper;
package com.example.recharge.mapper;
import com.example.demo.domain.entity.Rate;
import com.example.commons.domain.entity.Rate;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Mapper;
@ -13,17 +12,16 @@ public interface RateMapper {
@Insert({
"insert into rate",
"(start_time,end_time,currency,exchange_rate,create_time,update_time,admin_id,flag)",
"(start_time,end_time,currency,exchange_rate,create_time,update_time,admin_id)",
"values",
"(#{startTime},#{endTime},#{currency},#{exchangeRate},now(),#{updateTime},#{adminId},1)"
"(#{startTime},#{endTime},#{currency},#{exchangeRate},now(),#{updateTime},#{adminId})"
})
// 获取自增主键
@Options(useGeneratedKeys = true,keyColumn = "rate_id",keyProperty = "rateId")
int insert(Rate rate);
//软删除
@Update({
"update rate set flag = 0 where rate_id=#{rateId}"
@Delete({
"delete from rate where rate_id=#{rateId}"
})
int deleteById(Integer rateId);
@ -37,7 +35,6 @@ public interface RateMapper {
"<if test='exchangeRate!=null'>exchange_rate=#{exchangeRate},</if>",
"<if test='updateTime!=null'>update_time=#{updateTime},</if>",
"<if test='adminId!=null'>admin_id=#{adminId},</if>",
"<if test='status != null'>`status`=#{status},</if>",
"</set>",
"where rate_id = #{rateId}",
"</script>"
@ -45,7 +42,7 @@ public interface RateMapper {
int update(Rate rate);
@Select({
"select * from rate where rate_id=#{rateId}"
"select rate_id from rate where rate_id=#{rateId}"
})
Rate selectById(Integer rateId);
@ -54,8 +51,7 @@ public interface RateMapper {
"SELECT r.*, a.name AS adminName",
"FROM rate r",
"LEFT JOIN admin a ON r.admin_id = a.admin_id",
"LEFT JOIN admin u ON r.admin_id = u.admin_id",
"WHERE r.flag =1 ",
"<where>",
"<if test='rateId != null'>AND r.rate_id = #{rateId}</if>",
"<if test='startTime != null'>AND r.start_time &gt;= #{startTime}</if>",
"<if test='endTime != null'>AND r.end_time &lt;= #{endTime}</if>",
@ -63,19 +59,9 @@ public interface RateMapper {
"<if test='exchangeRate != null'>AND r.exchange_rate LIKE CONCAT('%', #{exchangeRate}, '%')</if>",
"<if test='updateTime != null'>AND r.update_time LIKE CONCAT('%', #{updateTime}, '%')</if>",
"<if test='adminId != null'>AND r.admin_id = #{adminId}</if>",
"<if test='updateId != null'>AND r.update_id = #{updateId}</if>",
"<if test='status != null'>`status`=#{status},</if>",
"ORDER BY r.status ASC,r.create_time DESC",
"</where>",
"</script>"
})
List<Rate> select(Rate rate);
@Select({
"select * from rate where status=1 and flag=1"
})
List<Rate> selectByStatus(Rate rate);
@Select({
"select * from rate where currency=#{currency} and flag=1"
})
Integer selectByCurrency(String currency);
}

49
gold-system/demo/recharge/src/main/java/com/example/recharge/mapper/RechargeMapper.java

@ -0,0 +1,49 @@
package com.example.recharge.mapper;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.domain.vo.RechargeVo;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface RechargeMapper {
@Insert({
"INSERT INTO recharge",
"(homily_id,activity_id,paid_gold,free_gold,recharge_gold,pay_way,recharge_way,recharge_time,recharge_voucher,admin_id,area,remark,flag)",
"values ",
"(#{homilyId},#{activityId},#{paidGold},#{freeGold},#{rechargeGold},#{payWay},#{rechargeWay},#{rechargeTime},#{rechargeVoucher},#{adminId},#{area},#{remark},1)"
})
int insert(Recharge recharge);
@Update({
"<script>",
"UPDATE recharge",
"<set>",
"<if test= 'flag!=null '>flag=#{flag},</if>",
"</set>",
"where recharge_id=#{rechargeId}",
"</script>"
})
int update(Recharge recharge);
@Select({
"<script>",
"SELECT user.`name` as user_name , recharge.*,activity.activity_name,audit.`status`, admin.`name` FROM recharge",
"INNER JOIN audit ON recharge.recharge_id = audit.recharge_id",
"INNER JOIN `user` ON recharge.homily_id = `user`.homily_id",
"INNER JOIN activity on recharge.activity_id = activity.activity_id",
"INNER JOIN admin on recharge.admin_id = admin.admin_id",
"<where>",
"flag='1'",
"<if test='activityId!=null'>and activity_id=#{activityId}</if>",
"<if test='startDate != null and endDate != null'>AND create_time BETWEEN #{startDate} AND #{endDate}</if>",
"<if test='rechargeWay!=null and rechargeWay.length>0 '>and recharge_way like concat('%',#{rechargeWay},'%')</if>",
"<if test='area!=null and area.length>0'>and area like concat('%',#{area},'%')</if>",
"<if test='status!=null'>and audit.status=#{status}</if>",
"</where>",
"</script>"
})
List<RechargeVo> select(RechargeVo rechargeVo);
}

68
gold-system/demo/recharge/src/main/java/com/example/recharge/service/ActivityServiceImpl.java

@ -0,0 +1,68 @@
package com.example.recharge.service;
import com.example.commons.domain.entity.Activity;
import com.example.commons.domain.entity.Page;
import com.example.commons.domain.entity.Rate;
import com.example.commons.sevice.ActivityService;
import com.example.recharge.mapper.ActivityMapper;
import com.github.pagehelper.PageHelper;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@Service
@Transactional
@RequiredArgsConstructor
public class ActivityServiceImpl implements ActivityService {
@Autowired
ActivityMapper activityMapper;
@Override
public int add(Activity activity) {
return activityMapper.add(activity);
}
@Override
public int edit(Activity activity) {
return activityMapper.edit(activity);
}
@Override
public List<Activity> search(Activity activity) {
return activityMapper.select(activity);
}
public PageInfo<Activity> searchForPage(Integer pageNum, Integer pageSize, Activity activity) {
// PageHelper.startPage(pageNum, pageSize);
// List<Activity> list = activityMapper.select(activity);
// return new PageInfo<>(list);
PageHelper.startPage(pageNum, pageSize);
List<Activity> list = activityMapper.select(activity);
LocalDate nowDate = LocalDate.now(); // 获取当前的 LocalDate
list.stream()
.forEach(activity1 -> {
if (nowDate.isBefore(activity1.getStartTime())) {
// 假设 Activity 类有一个 setStatus 方法来设置状态
activity1.setStatus(0); // 设置新的状态
activityMapper.edit(activity1); // 保存修改后的对象
}
else if(nowDate.isAfter(activity1.getEndTime())) {
// 假设 Activity 类有一个 setStatus 方法来设置状态
activity1.setStatus(2); // 设置新的状态
activityMapper.edit(activity1); // 保存修改后的对象
}
});
return new PageInfo<>(list);
}
}

35
gold-system/demo/recharge/src/main/java/com/example/recharge/service/AuditServiceImpl.java

@ -0,0 +1,35 @@
package com.example.recharge.service;
import com.example.commons.domain.entity.Audit;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.sevice.AuditService;
import com.example.recharge.mapper.AuditMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class AuditServiceImpl implements AuditService {
private final AuditMapper auditMapper;
@Override
public int add(Audit audit) {
return auditMapper.insert(audit);
}
@Override
public List<Audit> search(Audit audit) {
return auditMapper.select(audit);
}
@Override
public PageInfo<Audit> searchForPage(Integer pageNum, Integer pageSize, Audit audit) {
PageHelper.startPage(pageNum,pageSize);
List<Audit> list= auditMapper.select(audit);
return new PageInfo<>(list);
}
}

55
gold-system/demo/recharge/src/main/java/com/example/recharge/service/RateServiceImpl.java

@ -0,0 +1,55 @@
package com.example.recharge.service;
import com.example.commons.domain.entity.Rate;
import com.example.commons.sevice.RateService;
import com.example.recharge.mapper.RateMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@RequiredArgsConstructor
public class RateServiceImpl implements RateService {
private final RateMapper rateMapper;
@Override
public int add(Rate rate) {
return rateMapper.insert(rate);
}
@Transactional
@Override
public int edit(Rate rate) {
return rateMapper.update(rate);
}
@Override
public void delete(Integer rateId) throws Exception {
int result = rateMapper.deleteById(rateId);
if(result == 0){
throw new Exception("未找到对应的记录,删除失败");
};
}
@Override
public Rate getById(Integer rateId) {
return rateMapper.selectById(rateId);
}
@Override
public List<Rate> search(Rate rate) {
return rateMapper.select(rate);
}
@Override
public PageInfo<Rate> searchForPage(Integer pageNum, Integer pageSize, Rate rate) {
PageHelper.startPage(pageNum, pageSize);
List<Rate> list = rateMapper.select(rate);
return new PageInfo<>(list);
}
}

46
gold-system/demo/recharge/src/main/java/com/example/recharge/service/RechargeServiceImpl.java

@ -0,0 +1,46 @@
package com.example.recharge.service;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.domain.vo.RechargeVo;
import com.example.commons.sevice.RechargeService;
import com.example.recharge.mapper.RechargeMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class RechargeServiceImpl implements RechargeService {
private final RechargeMapper rechargeMapper;
@Override
public int add(Recharge recharge) throws Exception {
return rechargeMapper.insert(recharge);
}
@Override
public int edit(Recharge recharge) throws Exception {
return rechargeMapper.update(recharge);
}
@Override
public Recharge findById(int id) throws Exception {
return null;
}
@Override
public List<RechargeVo> search(RechargeVo rechargeVo) {
return rechargeMapper.select(rechargeVo);
}
@Override
public PageInfo<RechargeVo> searchForPage(Integer pageNum, Integer pageSize, RechargeVo rechargeVo) {
PageHelper.startPage(pageNum, pageSize);
List<RechargeVo> list= rechargeMapper.select(rechargeVo);
return new PageInfo<>(list);
}
}

15
gold-system/demo/recharge/src/main/resources/application.yml

@ -0,0 +1,15 @@
server:
port: 10010
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://39.101.133.168/hwgold?&serverTimezone=Asia/Shanghai
username: hwgold
password: 'AGX4Z3YMxiCG3GR2'
application:
name: recharge
mybatis:
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

13
gold-system/demo/recharge/src/test/java/com/example/recharge/RechargeApplicationTests.java

@ -0,0 +1,13 @@
package com.example.recharge;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class RechargeApplicationTests {
@Test
void contextLoads() {
}
}

33
gold-system/demo/refund/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

73
gold-system/demo/refund/pom.xml

@ -0,0 +1,73 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>refund</artifactId>
<version>0.0.1</version>
<name>refund</name>
<description>refund</description>
<parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>commons</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

13
gold-system/demo/refund/src/main/java/org/example/refund/RefundApplication.java

@ -0,0 +1,13 @@
package org.example.refund;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RefundApplication {
public static void main(String[] args) {
SpringApplication.run(RefundApplication.class, args);
}
}

69
gold-system/demo/refund/src/main/java/org/example/refund/controller/RefundController.java

@ -0,0 +1,69 @@
package org.example.refund.controller;
import com.example.commons.domain.entity.Detail;
import com.example.commons.domain.entity.Page;
import com.example.commons.domain.vo.Result;
import com.example.commons.sevice.RefundService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@RestController
@RequestMapping("/refund")
@RequiredArgsConstructor
@Slf4j
@CrossOrigin
public class RefundController {
private final RefundService refundService;
@PostMapping("/add")
public Result add(@RequestBody Detail detail) {
// try {
refundService.add(detail);
refundService.addAudit(detail);
return Result.success();
// } catch (Exception e) {
// log.warn(Arrays.toString(e.getStackTrace()));
// return Result.error(e.getMessage());
//// }
}
@PostMapping("/softDelete")
public Result softDelete(@RequestParam Integer detailId) {
// try {
refundService.softDelete(detailId);
return Result.success();
// } catch (Exception e) {
// log.warn(Arrays.toString(e.getStackTrace()));
// return Result.error(e.getMessage());
// }
}
@PostMapping("/update")
public Result update(@RequestBody Detail newDetail) {
try {
refundService.edit(newDetail);
return Result.success();
} catch (Exception e) {
log.warn(Arrays.toString(e.getStackTrace()));
return Result.error(e.getMessage());
}
}
@PostMapping("/search")
public Result search(@RequestBody Page page) {
Integer pageNum = page.getPageNum();
Integer pageSize = page.getPageSize();
Detail detail = page.getDetail();
if (ObjectUtils.isEmpty(detail)) {
return Result.success(refundService.search(detail));
}else{
return Result.success(refundService.searchForPage(pageNum, pageSize,detail));
}
}
}

62
gold-system/demo/refund/src/main/java/org/example/refund/mapper/RefundMapper.java

@ -0,0 +1,62 @@
package org.example.refund.mapper;
import com.example.commons.domain.entity.Detail;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface RefundMapper {
@Insert({
"insert into detail",
"(jwcode,refund_type,refund_goods,recharge_coin,free_coin,task_coin,remark,admin_id,create_time,update_type)",
"values",
"(#{jwcode},#{refundType},#{refundGoods},#{rechargeCoin},#{freeCoin},#{taskCoin},#{remark},#{adminId},now(),#{updateType})"
})
@Options(useGeneratedKeys = true, keyColumn = "detail_id", keyProperty = "detailId")
int insert(Detail detail);
@Select({
"insert into audit",
"(jwcode,refund_id,admin_id,create_time,detail_id)",
"values",
"(,#{jwcode},#{refundId},#{adminId},now(),#{detailId})"
})
int insertAudit(Detail detail);
@Update("update detail set detail_flag = 0 where detail_id = #{detailId}")
int update(@Param("detailId") Integer detailId);
@Select("select * from detail where detail_id = #{detailId} and detail_flag = 1")
Detail selectByDetailId(Integer detailId);
@Select({
"<script>",
"SELECT d.*,",
" a.area AS adminArea, a.name AS adminName,",
" u.name AS userName,",
" au.status AS auditStatus, au.reson AS auditReson",
"FROM detail d",
"LEFT JOIN admin a ON d.admin_id = a.admin_id",
"LEFT JOIN user u ON d.jwcode = u.jwcode",
"LEFT JOIN audit au ON d.detail_id = au.refund_id",
"WHERE d.detail_flag = 1 and update_type ='退款'",
"<if test='jwcode != null'>AND d.jwcode = #{jwcode}</if>",
"<if test='refundType != null'>AND d.refund_type LIKE CONCAT('%', #{refundType}, '%')</if>",
"<if test='refundGoods != null'>AND d.refund_goods LIKE CONCAT('%', #{refundGoods}, '%')</if>",
"<if test='rechargeCoin != null'>AND d.recharge_coin = #{rechargeCoin}</if>",
"<if test='freeCoin != null'>AND d.free_coin = #{freeCoin}</if>",
"<if test='taskCoin != null'>AND d.task_coin = #{taskCoin}</if>",
"<if test='remark != null'>AND d.remark LIKE CONCAT('%', #{remark}, '%')</if>",
"<if test='adminId != null'>AND d.admin_id = #{adminId}</if>",
"<if test='adminArea != null'>AND a.area LIKE CONCAT('%', #{adminArea}, '%')</if>", // admin表字段过滤
"<if test='adminName != null'>AND a.name LIKE CONCAT('%', #{adminName}, '%')</if>", // admin表字段过滤
"<if test='userName != null'>AND u.name LIKE CONCAT('%', #{userName}, '%')</if>", // user表字段过滤
"<if test='auditStatus != null'>AND au.status = #{auditStatus}</if>", // audit 表字段过滤
"<if test='auditReson != null'>AND au.reson LIKE CONCAT('%', #{auditReson}, '%')</if>", // audit表字段过滤
"</script>"
})
List<Detail> select(Detail detail);
}

80
gold-system/demo/refund/src/main/java/org/example/refund/service/RefundServiceImpl.java

@ -0,0 +1,80 @@
package org.example.refund.service;
import com.example.commons.domain.entity.Detail;
import com.example.commons.sevice.RefundService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.example.refund.mapper.RefundMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@RequiredArgsConstructor
@Transactional
@Service
public class RefundServiceImpl implements RefundService {
private final RefundMapper refundMapper;
@Override
public int add(Detail detail) {
return refundMapper.insert(detail);
}
@Override
public int addAudit(Detail detail) {
return refundMapper.insertAudit(detail);
}
//自动软删除数据加更新数据
@Override
public void edit(Detail newDetail) {
// 获取旧的明细记录
Detail oldDetail = refundMapper.selectByDetailId(newDetail.getDetailId());
if (oldDetail == null || oldDetail.getDetailFlag() ==0) {
throw new IllegalArgumentException("该记录不存在或已被隐藏!");
}
// 软删除旧记录
refundMapper.update(oldDetail.getDetailId());
// 将新的字段值复制到旧记录中未修改的字段保持旧值
if (newDetail.getJwcode() == null) newDetail.setJwcode(oldDetail.getJwcode());
if (newDetail.getRefundType() == null) newDetail.setRefundType(oldDetail.getRefundType());
if (newDetail.getRefundGoods() == null) newDetail.setRefundGoods(oldDetail.getRefundGoods());
if (newDetail.getRechargeCoin() == null) newDetail.setRechargeCoin(oldDetail.getRechargeCoin());
if (newDetail.getFreeCoin() == null) newDetail.setFreeCoin(oldDetail.getFreeCoin());
if (newDetail.getTaskCoin() == null) newDetail.setTaskCoin(oldDetail.getTaskCoin());
if (newDetail.getRemark() == null) newDetail.setRemark(oldDetail.getRemark());
if (newDetail.getAdminId() == null) newDetail.setAdminId(oldDetail.getAdminId());
// 插入新记录
newDetail.setDetailId(null); // 清空 ID让其自动生成
newDetail.setDetailFlag(1); // 确保新记录未被删除
refundMapper.insert(newDetail);
}
@Override
public int softDelete(Integer detailId) {
return refundMapper.update(detailId);
}
@Override
public Detail selectByDetailId(Integer detailId) {
return refundMapper.selectByDetailId(detailId);
}
@Override
public List<Detail> search(Detail detail) {
return refundMapper.select(detail);
}
@Override
public PageInfo<Detail> searchForPage(Integer pageNum, Integer pageSize, Detail detail) {
PageHelper.startPage(pageNum, pageSize);
List<Detail> list = refundMapper.select(detail);
return new PageInfo<>(list);
}
}

15
gold-system/demo/refund/src/main/resources/application.yml

@ -0,0 +1,15 @@
server:
port: 10040
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://39.101.133.168/hwgold?&serverTimezone=Asia/Shanghai
username: hwgold
password: 'AGX4Z3YMxiCG3GR2'
application:
name: refund
mybatis:
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

6
gold-system/demo/refund/src/main/resources/static/index.html

@ -0,0 +1,6 @@
<html>
<body>
<h1>hello word!!!</h1>
<p>this is a html page</p>
</body>
</html>

13
gold-system/demo/refund/src/test/java/org/example/refund/RefundApplicationTests.java

@ -0,0 +1,13 @@
package org.example.refund;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class RefundApplicationTests {
@Test
void contextLoads() {
}
}

33
gold-system/demo/statistics/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

73
gold-system/demo/statistics/pom.xml

@ -0,0 +1,73 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>statistics</artifactId>
<version>0.0.1</version>
<name>statistics</name>
<description>statistics</description>
<parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>commons</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

13
gold-system/demo/statistics/src/main/java/org/example/statistics/StatisticsApplication.java

@ -0,0 +1,13 @@
package org.example.statistics;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class StatisticsApplication {
public static void main(String[] args) {
SpringApplication.run(StatisticsApplication.class, args);
}
}

24
gold-system/demo/statistics/src/main/java/org/example/statistics/controller/StatisticsController.java

@ -0,0 +1,24 @@
package org.example.statistics.controller;
import com.example.commons.domain.vo.Result;
import com.example.commons.sevice.StatisticsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/statistics")
@RequiredArgsConstructor
@Slf4j
@CrossOrigin
public class StatisticsController {
private final StatisticsService statisticsService;
@PostMapping
public Result count(){
return Result.success(statisticsService.totalYearCoin());
}
}

38
gold-system/demo/statistics/src/main/java/org/example/statistics/mapper/StatisticsMapper.java

@ -0,0 +1,38 @@
package org.example.statistics.mapper;
import com.example.commons.domain.entity.Statistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface StatisticsMapper {
//全年累计金币数
@Select("SELECT SUM(recharge_coin) AS rechargeSumCoin, " +
" SUM(free_coin) AS freeSumCoin, " +
" SUM(task_coin) AS taskSumCoin, " +
" (SUM(recharge_coin) + SUM(free_coin) + SUM(task_coin)) AS totalSumCoin " +
"FROM `detail` " +
"WHERE update_type = '充值' " +
" AND create_time >= '2024-01-01' " +
" AND create_time < NOW()")
int totalYearCoin();
//昨日新增
@Select("SELECT SUM(recharge_coin) AS rechargeYesterdaySumCoin, " +
" SUM(free_coin) AS freeYesterdaySumCoin, " +
" SUM(task_coin) AS taskYesterdaySumCoin, " +
" (SUM(recharge_coin) + SUM(free_coin) + SUM(task_coin)) AS totalYesterdaySumCoin " +
"FROM `detail` " +
"WHERE update_type = '充值' " +
" AND create_time >= CURDATE() - INTERVAL 1 DAY " +
" AND create_time < CURDATE()")
int yesterdayNewCoin();
//全年累计充值人数
@Select("SELECT COUNT(DISTINCT jwcode) AS rechargeCount " +
"FROM `detail` " +
"WHERE update_type = '充值' " +
" AND create_time >= '2024-01-01' " +
" AND create_time < NOW()")
int yearRechargeCount();
}

29
gold-system/demo/statistics/src/main/java/org/example/statistics/service/StatisticsServiceImpl.java

@ -0,0 +1,29 @@
package org.example.statistics.service;
import com.example.commons.domain.entity.Statistics;
import com.example.commons.sevice.StatisticsService;
import lombok.RequiredArgsConstructor;
import org.example.statistics.mapper.StatisticsMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@RequiredArgsConstructor
@Transactional
@Service
public class StatisticsServiceImpl implements StatisticsService {
private final StatisticsMapper statisticsMapper;
@Override
public int totalYearCoin() {
return statisticsMapper.totalYearCoin();
}
@Override
public int yesterdayNewCoin() {
return statisticsMapper.yesterdayNewCoin();
}
@Override
public int yearRechargeCount() {
return statisticsMapper.yearRechargeCount();
}
}

15
gold-system/demo/statistics/src/main/resources/application.yml

@ -0,0 +1,15 @@
server:
port: 10070
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://39.101.133.168/hwgold?&serverTimezone=Asia/Shanghai
username: hwgold
password: 'AGX4Z3YMxiCG3GR2'
application:
name: statistics
mybatis:
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

6
gold-system/demo/statistics/src/main/resources/static/index.html

@ -0,0 +1,6 @@
<html>
<body>
<h1>hello word!!!</h1>
<p>this is a html page</p>
</body>
</html>

13
gold-system/demo/statistics/src/test/java/org/example/statistics/StatisticsApplicationTests.java

@ -0,0 +1,13 @@
package org.example.statistics;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class StatisticsApplicationTests {
@Test
void contextLoads() {
}
}

2
gold-system/demo/user/.gitattributes

@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf

33
gold-system/demo/user/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

19
gold-system/demo/user/.mvn/wrapper/maven-wrapper.properties

@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

259
gold-system/demo/user/mvnw

@ -0,0 +1,259 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

149
gold-system/demo/user/mvnw.cmd

@ -0,0 +1,149 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

73
gold-system/demo/user/pom.xml

@ -0,0 +1,73 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>user</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>user</name>
<description>user</description>
<parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>commons</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

13
gold-system/demo/user/src/main/java/com/example/user/UserApplication.java

@ -0,0 +1,13 @@
package com.example.user;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UserApplication.class, args);
}
}

21
gold-system/demo/user/src/main/java/com/example/user/controller/UserController.java

@ -0,0 +1,21 @@
package com.example.user.controller;
import com.example.commons.domain.entity.User;
import com.example.commons.domain.vo.Result;
import com.example.commons.sevice.UserSevice;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/recharge/user")
@RequiredArgsConstructor
@Slf4j
@CrossOrigin
public class UserController {
private final UserSevice userSevice;
@PostMapping
public Result User(@RequestBody User user) {
return Result.success(userSevice.search(user));
}
}

16
gold-system/demo/user/src/main/java/com/example/user/mapper/UserMapper.java

@ -0,0 +1,16 @@
package com.example.user.mapper;
import com.example.commons.domain.entity.Audit;
import com.example.commons.domain.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface UserMapper {
@Select({
"select * from user where homily_id=#{homilyId}"
})
List<User> select(User user);
}

33
gold-system/demo/user/src/main/java/com/example/user/service/UserServiceImpl.java

@ -0,0 +1,33 @@
package com.example.user.service;
import com.example.commons.domain.entity.Recharge;
import com.example.commons.domain.entity.User;
import com.example.commons.sevice.UserSevice;
import com.example.user.mapper.UserMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Service
@RequiredArgsConstructor
public class UserServiceImpl implements UserSevice {
private final UserMapper userMapper;
@Override
public List<User> search(User user) {
return userMapper.select(user);
}
@Override
public PageInfo<User> searchForPage(Integer pageNum, Integer pageSize, User user) {
PageHelper.startPage(pageNum,pageSize);
List<User> list= userMapper.select(user);
return new PageInfo<>(list);
}
}

14
gold-system/demo/user/src/main/resources/application.yml

@ -0,0 +1,14 @@
server:
port: 10020
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://39.101.133.168/hwgold?serverTimezone=GMT%2b8
username: hwgold
password: 'AGX4Z3YMxiCG3GR2'
application:
name: recharge
mybatis:
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

13
gold-system/demo/user/src/test/java/com/example/user/UserApplicationTests.java

@ -0,0 +1,13 @@
package com.example.user;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class UserApplicationTests {
@Test
void contextLoads() {
}
}

24
gold-system/vue/gold-system/.gitignore

@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

3
gold-system/vue/gold-system/.vscode/extensions.json

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}

5
gold-system/vue/gold-system/README.md

@ -0,0 +1,5 @@
# Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).

13
gold-system/vue/gold-system/index.html

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>财务金币管理系统</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

1658
gold-system/vue/gold-system/package-lock.json
File diff suppressed because it is too large
View File

24
gold-system/vue/gold-system/package.json

@ -0,0 +1,24 @@
{
"name": "gold-system",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"axios": "^1.7.8",
"element-plus": "^2.8.8",
"vue": "^3.5.12",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
"typescript": "~5.6.2",
"vite": "^5.4.10",
"vue-tsc": "^2.1.8"
}
}

1
gold-system/vue/gold-system/public/vite.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

9
gold-system/vue/gold-system/src/App.vue

@ -0,0 +1,9 @@
<script setup>
</script>
<template>
<router-view></router-view>
</template>
<style scoped>
</style>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save