初始化

master
sikadi 2023-10-27 18:49:42 +08:00
commit e925c04dbd
39 changed files with 1409 additions and 0 deletions

38
.gitignore vendored 100644
View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

8
.idea/.gitignore vendored 100644
View File

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

11
.idea/aws.xml 100644
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="accountSettings">
<option name="activeRegion" value="us-east-1" />
<option name="recentlyUsedRegions">
<list>
<option value="us-east-1" />
</list>
</option>
</component>
</project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/grail-patient-interrogation-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/grail-patient-interrogation-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/grail-patient-interrogation-remote/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/grail-patient-interrogation-remote/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/grail-patient-interrogation-server/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/grail-patient-interrogation-server/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

12
.idea/misc.xml 100644
View File

@ -0,0 +1,12 @@
<?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$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

View File

@ -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
.idea/vcs.xml 100644
View File

@ -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>

21
Dockerfile 100644
View File

@ -0,0 +1,21 @@
FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/openjdk:17-8.6
# 暴露端口号
EXPOSE 10002/tcp
# 挂载目录位置
VOLUME /home/logs/grail-interrogation
#构造 复制外部文件到docker 内部
COPY target/grail-patient-interrogation-server.jar /home/app.jar
# 工作目录 exec -it 进来就是默认这个目录
WORKDIR /home
# 指定东八区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > .etc.timezone
# 启动java程序
CMD ["java","-Dfile.encoding=UTF-8","-jar","/home/app.jar"]

View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.grail</groupId>
<artifactId>grail-patient</artifactId>
<version>3.6.3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>grail-patient-interrogation-common</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.grail</groupId>
<artifactId>grail-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.grail</groupId>
<artifactId>grail-common-redis</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,80 @@
package com.grail.interrogation.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
* @author: SIKADI
* @date: 2023/10/25 20:55
**/
@Data
public class DiseaseDetatil {
/**
* idid
**/
private Integer diseaseDetailId;
/**
* id
**/
private Integer diseaseId;
/**
*
**/
private String pathology;
/**
*
**/
private String symptom;
/**
* ()
**/
private String attention;
/**
* 西
**/
private String westernTreatment;
/**
* id
**/
private Integer createId;
/**
*
**/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date createDate;
/**
*
**/
private Integer updateId;
/**
*
**/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date updateDate;
/**
*
**/
private String image;
/**
*1234
**/
private Integer status;
}

View File

@ -0,0 +1,41 @@
package com.grail.interrogation.domain;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
/**
*
* @author: Zhuoxin
* @date: 2023/10/25 16:06
**/
@Data
public class Homepage {
/**
* id
**/
private Integer id;
/**
*
**/
private String homepage;
/**
* id
**/
private Integer pid;
/**
*
**/
private String picture;
/**
*
**/
List<ListHomepage> homepageList;
}

View File

@ -0,0 +1,47 @@
package com.grail.interrogation.domain;
import lombok.Data;
import java.util.List;
/**
*
* @author: SIKADI
* @date: 2023/10/25 20:45
**/
@Data
public class ListHomepage {
/**
* id
**/
private Integer id;
/**
*
**/
private String homepage;
/**
* id
**/
private Integer pid;
/**
*
**/
private String picture;
/**
*
**/
List<DiseaseDetatil> diseaseDetatils;
/**
*
**/
List<MedicineDetail> medicineDetailList;
}

View File

@ -0,0 +1,94 @@
package com.grail.interrogation.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
* @author: SIKADI
* @date: 2023/10/26 13:54
**/
@Data
public class MedicineDetail {
/**
* id
**/
private Integer medicineDetailId;
/**
* id
**/
private Integer medicineId;
/**
*
**/
private String ingredient;
/**
*
**/
private Integer medicineAvoid;
/**
*
**/
private String majorFunction;
/**
*
**/
private String usageAndDosage;
/**
*
**/
private String characterTwo;
/**
*
**/
private String packageSpecification;
/**
*
**/
private String adverseReaction;
/**
*
**/
private Integer createId;
/**
*
**/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date createTime;
/**
*
**/
private Integer updateId;
/**
*
**/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date updateTime;
/**
* 1234
**/
private Integer status;
/**
*
**/
private String image;
}

View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.grail</groupId>
<artifactId>grail-patient-interrogation</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>grail-patient-interrogation-remote</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.grail</groupId>
<artifactId>grail-patient-interrogation</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>grail-patient-interrogation-server</artifactId>
<version>3.6.3</version>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Swagger UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- grail Common DataSource -->
<dependency>
<groupId>com.grail</groupId>
<artifactId>grail-common-datasource</artifactId>
</dependency>
<!-- grail Common DataScope -->
<dependency>
<groupId>com.grail</groupId>
<artifactId>grail-common-datascope</artifactId>
</dependency>
<!-- grail Common Log -->
<dependency>
<groupId>com.grail</groupId>
<artifactId>grail-common-log</artifactId>
</dependency>
<!-- grail Common Swagger -->
<dependency>
<groupId>com.grail</groupId>
<artifactId>grail-common-swagger</artifactId>
</dependency>
<!-- 商品服务公共依赖 -->
<dependency>
<groupId>com.grail</groupId>
<artifactId>grail-patient-interrogation-common</artifactId>
<version>3.6.3</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,22 @@
package com.grail.interrogation;
import com.grail.common.security.annotation.EnableCustomConfig;
import com.grail.common.security.annotation.EnableRyFeignClients;
import com.grail.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
*
* @author: SIKADI
* @date: 2023/10/25 16:01
**/
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringBootApplication
public class GrailInterrogationApplication {
public static void main(String[] args) {
SpringApplication.run(GrailInterrogationApplication.class);
}
}

View File

@ -0,0 +1,56 @@
package com.grail.interrogation.controller;
import com.alibaba.fastjson.JSON;
import com.grail.common.core.domain.R;
import com.grail.interrogation.domain.DiseaseDetatil;
import com.grail.interrogation.service.DiseaseDetatilServer;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
*
* @author: SIKADI
* @date: 2023/10/27 11:03
**/
@RestController
@RequestMapping("/disease")
@Log4j2
public class DiseaseDetatilController {
@Autowired
private HttpServletRequest request;
@Autowired
private DiseaseDetatilServer diseaseDetatilServer;
/**
*
* @author: ZhuoXin
* @date: 2023/10/27 13:31
* @param: [diseaseDetatil]
* @return: com.grail.common.core.domain.R
**/
@PostMapping("/diseaseDetatailAdd")
public R diseaseDetatailAdd(@RequestBody DiseaseDetatil diseaseDetatil){
log.info("功能:添加病症数据,URI:{},方法:{},参数:{}",request.getRequestURI(),
request.getMethod(),
JSON.toJSONString(diseaseDetatil));
int i = diseaseDetatilServer.diseaseDetatailAdd(diseaseDetatil);
log.info("功能:添加病症数据,URI:{},方法:{},");
return i>0?R.ok("添加成功"):R.fail("添加失败");
}
}

View File

@ -0,0 +1,55 @@
package com.grail.interrogation.controller;
import com.alibaba.fastjson.JSON;
import com.grail.common.core.domain.R;
import com.grail.common.core.utils.QiNiuUpload;
import com.grail.interrogation.domain.Homepage;
import com.grail.interrogation.service.HomepageServer;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
*
* @author: SIKADI
* @date: 2023/10/25 16:11
**/
@RestController
@RequestMapping("/homepage")
@Log4j2
public class HomepageController {
@Autowired
private HttpServletRequest request;
@Autowired
private HomepageServer homepageServer;
/**
*
* @author: ZhuoXin
* @date: 2023/10/25 19:05
* @param: [homepageId]
* @return: com.grail.common.core.domain.R
**/
@GetMapping("/homepageList")
public R homepageList(){
log.info("功能:展示对应的三级页,URI:{},方法:{}",
request.getRequestURI(),
request.getMethod());
List<Homepage> list = homepageServer.homepageList();
log.info("功能:展示对应的三级页,URI:{},方法:{},响应:{}",
request.getRequestURI(),
request.getMethod(),
JSON.toJSONString(list));
return R.ok(list);
}
}

View File

@ -0,0 +1,17 @@
package com.grail.interrogation.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author: SIKADI
* @date: 2023/10/27 16:57
**/
@RestController
@RequestMapping("/medicineDetail")
public class MedicineDetailController {
}

View File

@ -0,0 +1,27 @@
package com.grail.interrogation.mapper;
import com.grail.interrogation.domain.DiseaseDetatil;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* @author: SIKADI
* @date: 2023/10/26 15:05
**/
@Mapper
public interface DiseaseDetatilMapper {
List<DiseaseDetatil> diseaseDetatilList(@Param("id") Integer id);
/**
*
* @author: ZhuoXin
* @date: 2023/10/27 16:42
* @param: [diseaseDetatil]
* @return: int
**/
int diseaseDetatilAdd(DiseaseDetatil diseaseDetatil);
}

View File

@ -0,0 +1,25 @@
package com.grail.interrogation.mapper;
import com.grail.interrogation.domain.DiseaseDetatil;
import com.grail.interrogation.domain.Homepage;
import com.grail.interrogation.domain.ListHomepage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* @author: SIKADI
* @date: 2023/10/25 16:16
**/
@Mapper
public interface HomepageMapper {
List<Homepage> homepageList();
List<ListHomepage> homepageSubquery(@Param("id") Integer id);
}

View File

@ -0,0 +1,18 @@
package com.grail.interrogation.mapper;
import com.grail.interrogation.domain.MedicineDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* @author: ZhuoXin
* @date: 2023/10/26 15:06
**/
@Mapper
public interface MedicineDetailMapper {
List<MedicineDetail> medicineDetailList(@Param("id") Integer id);
}

View File

@ -0,0 +1,19 @@
package com.grail.interrogation.service;
import com.grail.interrogation.domain.DiseaseDetatil;
/**
*
* @author: ZhuoXin
* @date: 2023/10/27 11:06
**/
public interface DiseaseDetatilServer {
/**
*
* @author: ZhuoXin
* @date: 2023/10/27 13:33
* @param: [diseaseDetatil]
* @return: int
**/
int diseaseDetatailAdd(DiseaseDetatil diseaseDetatil);
}

View File

@ -0,0 +1,22 @@
package com.grail.interrogation.service;
import com.grail.interrogation.domain.Homepage;
import java.util.List;
/**
*
* @author: SIKADI
* @date: 2023/10/25 16:11
**/
public interface HomepageServer {
/**
*
* @author: ZhuoXin
* @date: 2023/10/25 20:02
* @param: [homepageId]
* @return: com.grail.interrogation.domain.Homepage
**/
List<Homepage> homepageList();
}

View File

@ -0,0 +1,4 @@
package com.grail.interrogation.service;
public interface MedicineDetailServer {
}

View File

@ -0,0 +1,32 @@
package com.grail.interrogation.service.impl;
import com.grail.common.security.utils.SecurityUtils;
import com.grail.interrogation.domain.DiseaseDetatil;
import com.grail.interrogation.mapper.DiseaseDetatilMapper;
import com.grail.interrogation.service.DiseaseDetatilServer;
import com.grail.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* @author: SIKADI
* @date: 2023/10/27 11:16
**/
@Service
public class DiseaseDetatilServerImpl implements DiseaseDetatilServer {
@Autowired
private DiseaseDetatilMapper diseaseDetatilMapper;
@Override
public int diseaseDetatailAdd(DiseaseDetatil diseaseDetatil) {
// 获取id;
LoginUser loginUser = SecurityUtils.getLoginUser();
// 获取创建人的id
diseaseDetatil.setCreateId(Math.toIntExact(loginUser.getUserid()));
//设置状态为提交
diseaseDetatil.setStatus(1);
// 添加信息
int i = diseaseDetatilMapper.diseaseDetatilAdd(diseaseDetatil);
return i;
}
}

View File

@ -0,0 +1,82 @@
package com.grail.interrogation.service.impl;
import com.grail.interrogation.domain.DiseaseDetatil;
import com.grail.interrogation.domain.Homepage;
import com.grail.interrogation.domain.ListHomepage;
import com.grail.interrogation.domain.MedicineDetail;
import com.grail.interrogation.mapper.DiseaseDetatilMapper;
import com.grail.interrogation.mapper.HomepageMapper;
import com.grail.interrogation.mapper.MedicineDetailMapper;
import com.grail.interrogation.service.HomepageServer;
import org.springframework.beans.factory.annotation.Autowired;
import com.grail.common.redis.service.RedisService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
*
* @author: SIKADI
* @date: 2023/10/25 16:11
**/
@Service
public class HomepageServerImpl implements HomepageServer {
@Autowired
private HomepageMapper homepageMapper;
@Autowired
private DiseaseDetatilMapper diseaseDetatilMapper;
@Autowired
private MedicineDetailMapper medicineDetailMapper;
@Autowired
private RedisService redisService;
private static final String REDIS_HOMEPAGE="redis-homepage";
/**
*
* @author: ZhuoXin
* @date: 2023/10/25 20:24
* @param: [homepageId]
* @return: com.grail.interrogation.domain.Homepage
**/
@Override
public List<Homepage> homepageList() {
// 从redis里存储数据
if(redisService.hasKey(REDIS_HOMEPAGE)){
List<Homepage> cacheList = redisService.getCacheList(REDIS_HOMEPAGE);
return cacheList;
}
//查询到就对应科室或者病症
List<Homepage> list = homepageMapper.homepageList();
// 循环
for (Homepage item : list) {
// 再用id去查询他们的pid
List<ListHomepage> listHomepages = homepageMapper.homepageSubquery(item.getId());
// 再次循环
for (ListHomepage items : listHomepages) {
// 通过if判断
if(2 == items.getPid()){
// 病症的列表
List<DiseaseDetatil> diseaseDetatils = diseaseDetatilMapper.diseaseDetatilList(items.getId());
// 赋值到病症列表里
items.setDiseaseDetatils(diseaseDetatils);
}else {
// 药品的列表
List<MedicineDetail> medicineDetailList = medicineDetailMapper.medicineDetailList(items.getId());
// 赋值到药品列表里
items.setMedicineDetailList(medicineDetailList);
}
}
// 将他们赋值进去
item.setHomepageList(listHomepages);
}
redisService.setCacheList(REDIS_HOMEPAGE,list);
return list;
}
}

View File

@ -0,0 +1,13 @@
package com.grail.interrogation.service.impl;
import com.grail.interrogation.service.MedicineDetailServer;
import org.springframework.stereotype.Service;
/**
*
* @author: SIKADI
* @date: 2023/10/27 16:59
**/
@Service
public class MedicineDetailServerImpl implements MedicineDetailServer {
}

View File

@ -0,0 +1,2 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}

View File

@ -0,0 +1,32 @@
# Tomcat
server:
port: 10002
# Spring
spring:
application:
# 应用名称
name: grail-interrogation
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 10.100.1.3:8848
config:
# 配置中心地址
server-addr: 10.100.1.3:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
rabbitmq:
host: 10.100.1.5
mybatis:
configuration:
map-underscore-to-camel-case: true

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="./logs/grail/interrogation/wallet" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.bawei" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.grail.interrogation.mapper.DiseaseDetatilMapper">
<resultMap id="map" type="com.grail.interrogation.domain.DiseaseDetatil">
<id property="diseaseDetailId" column="disease_detail_id"></id>
<result property="diseaseId" column="disease_id"></result>
<result property="pathology" column="pathology"></result>
<result property="symptom" column="symptom"></result>
<result property="attention" column="attention"></result>
<result property="westernTreatment" column="western_treatment"></result>
<result property="createId" column="create_id"></result>
<result property="createDate" column="create_date"></result>
<result property="updateId" column="update_id"></result>
<result property="updateDate" column="update_date" ></result>
<result property="image" column="image"></result>
<result property="status" column="status"></result>
</resultMap>
<insert id="diseaseDetatilAdd">
insert into tb_disease_detatil (disease_detail_id,symptom,attention,western_treatment,create_id,create_date,image,status)
values (#{diseaseDetailId},#{symptom},#{attention},#{westernTreatment},#{createId},#{createDate},#{image},#{status});
</insert>
<select id="diseaseDetatilList" resultType="com.grail.interrogation.domain.DiseaseDetatil">
select
disease_detail_id,disease_id,pathology,symptom,attention,western_treatment,create_id,create_date,update_id,update_date,image,status
from tb_disease_detatil where status = 3 and disease_detail_id = #{id}
</select>
</mapper>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.grail.interrogation.mapper.HomepageMapper">
<resultMap id="homepage" type="com.grail.interrogation.domain.Homepage">
<id property="id" column="id"></id>
<result property="homepage" column="homepage"></result>
<result property="picture" column="picture"></result>
<result property="pid" column="pid"></result>
</resultMap>
<select id="homepageList" resultMap="homepage">
SELECT id , homepage , picture , pid from t_homepage where id = 1 or id =2
</select>
<select id="homepageSubquery" resultType="com.grail.interrogation.domain.ListHomepage">
SELECT id , homepage , picture , pid FROM t_homepage WHERE pid = #{id}
</select>
</mapper>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.grail.interrogation.mapper.MedicineDetailMapper">
<resultMap id="map" type="com.grail.interrogation.domain.MedicineDetail">
<id property="medicineId" column="medicine_id"></id>
<result property="medicineDetailId" column="medicine_detail_id"></result>
<result property="ingredient" column="ingredient"></result>
<result property="medicineAvoid" column="medicine_avoid"></result>
<result property="majorFunction" column="major_function"></result>
<result property="usageAndDosage" column="usage_and_dosage"></result>
<result property="characterTwo" column="character_two"></result>
<result property="packageSpecification" column="package_specification"></result>
<result property="adverseReaction" column="adverse_reaction"></result>
<result property="createId" column="create_id"></result>
<result property="createTime" column="create_time"></result>
<result property="updateId" column="update_id"></result>
<result property="updateTime" column="update_time"></result>
<result property="status" column="status"></result>
<result property="image" column="image"></result>
</resultMap>
<select id="medicineDetailList" resultType="com.grail.interrogation.domain.MedicineDetail">
select
medicine_detail_id,
medicine_id,
ingredient,
medicine_avoid,
major_function,
usage_and_dosage,
character_two,
package_specification,
adverse_reaction,
create_id,
create_time,
update_id,
update_time,
status,
image
from tb_medicine_detail where status=3 and medicine_detail_id = #{id}
</select>
</mapper>

30
pom.xml 100644
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.grail</groupId>
<artifactId>grail-patient</artifactId>
<version>3.6.3</version>
</parent>
<version>3.6.3</version>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>grail-patient-interrogation-common</module>
<module>grail-patient-interrogation-remote</module>
<module>grail-patient-interrogation-server</module>
</modules>
<artifactId>grail-patient-interrogation</artifactId>
<packaging>pom</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>