commit 5b3a61e7068d1e84223d4ecfe27c564dd781bae3
Author: 少年梦与砖 <2847127106@qq.com>
Date: Sun Aug 11 14:17:22 2024 +0800
初始化
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..09bdfea
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,46 @@
+######################################################################
+# Build Tools
+
+.gradle
+/build/
+!gradle/wrapper/gradle-wrapper.jar
+
+target/
+!.mvn/wrapper/maven-wrapper.jar
+
+######################################################################
+# IDE
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### JRebel ###
+rebel.xml
+### NetBeans ###
+nbproject/private/
+build/*
+nbbuild/
+dist/
+nbdist/
+.nb-gradle/
+
+######################################################################
+# Others
+*.log
+*.xml.versionsBackup
+*.swp
+
+!*/build/*.java
+!*/build/*.html
+!*/build/*.xml
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..aa74358
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,12 @@
+# |- home
+# |- app.jar
+# |- logs
+FROM openjdk:17-jdk
+
+WORKDIR /home
+
+VOLUME ["/home/logs/cloud-pay-server"]
+
+COPY ./cloud-resource-server/target/cloud-resource-server.jar /home/cloud-resource-server.jar
+
+ENTRYPOINT ["java","-jar","/home/cloud-resource-server.jar"]
diff --git a/cloud-resource-common/pom.xml b/cloud-resource-common/pom.xml
new file mode 100644
index 0000000..2882038
--- /dev/null
+++ b/cloud-resource-common/pom.xml
@@ -0,0 +1,30 @@
+
+
+ 4.0.0
+
+ com.muyu
+ cloud-resource
+ 3.6.5
+
+
+ cloud-resource-common
+
+
+ 17
+ 17
+ UTF-8
+
+
+
+
+ com.muyu
+ cloud-common-core
+
+
+
+
+
+
+
diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/domain/ResourceInfo.java b/cloud-resource-common/src/main/java/com/muyu/resource/domain/ResourceInfo.java
new file mode 100644
index 0000000..3d7f236
--- /dev/null
+++ b/cloud-resource-common/src/main/java/com/muyu/resource/domain/ResourceInfo.java
@@ -0,0 +1,78 @@
+package com.muyu.resource.domain;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.muyu.resource.domain.req.ResourceReq;
+import lombok.*;
+
+/**
+ * @Author: 胡杨
+ * @Name: ResourceInfo
+ * @Description: 资源类
+ * @CreatedDate: 2024/8/10 上午9:51
+ * @FilePath: com.muyu.resource.domain
+ */
+
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResourceInfo {
+ private String id;
+ private String recommendId;
+ private String title;
+ private String titleFormat;
+ private String otherTitle;
+ private String seriesNumber;
+ private String seriesTitle;
+ private String pissn;
+ private String eissn;
+ private String pisbn;
+ private String eisbn;
+ private String orderNumber;
+ private String subject;
+ private String publisher;
+ private String country;
+ private String pubYear;
+ private String foundedYear;
+ private String language;
+ private String pubFeq;
+ private String intro;
+ private String classiNumber;
+ private String url;
+ private String carrier;
+ private String type;
+ private String pubPattern;
+ private String pubStatus;
+ private String price;
+ private String currency;
+ private String oA;
+ private String sysTime;
+ private String sysUserId;
+ private String organId;
+ private String orderStatus;
+ private String distributionStatus;
+ private String reviewStatus;
+ private String updReviewStatus;
+ private String totalScore;
+ private String factor;
+ private String note;
+ private String inlet;
+ private String oldId;
+ private String systemId;
+ private String resVol;
+
+ // 是否是精确查询
+ private Boolean flag;
+
+ /**
+ * 为精确查询情况赋值
+ */
+ public void setFlag(ResourceReq req) {
+ this.flag = this.getTitle().equals(req.getTitle())
+ && this.getPissn().equals(req.getPissn())
+ && this.getEissn().equals(req.getEissn())
+ && this.getPisbn().equals(req.getPisbn())
+ && this.getEisbn().equals(req.getEisbn());
+ }
+}
diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/domain/SysParam.java b/cloud-resource-common/src/main/java/com/muyu/resource/domain/SysParam.java
new file mode 100644
index 0000000..737cd7d
--- /dev/null
+++ b/cloud-resource-common/src/main/java/com/muyu/resource/domain/SysParam.java
@@ -0,0 +1,94 @@
+package com.muyu.resource.domain;
+
+import lombok.*;
+
+/**
+ * @Author: 胡杨
+ * @Name: SysParam
+ * @Description: 文献参数表
+ * @CreatedDate: 2024/8/10 上午9:45
+ * @FilePath: com.muyu.resource.domain
+ */
+
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class SysParam {
+
+ /**
+ * 主键id
+ */
+ private String id;
+
+ /**
+ * 编码
+ */
+ private String code;
+
+ /**
+ * 0可用1已删除
+ */
+ private String isDel;
+
+ /**
+ * 节点级别
+ */
+ private String level;
+
+ /**
+ * 名称
+ */
+ private String name;
+
+ /**
+ * 中图分类号对应起始号(学科专用)
+ */
+ private String startNum;
+
+ /**
+ *
+ */
+ private String endNum;
+
+ /**
+ * 父级id
+ */
+ private String pid;
+
+ /**
+ * 分数,用于计算指标
+ */
+ private String score;
+
+ /**
+ * 权重,用于计算指标
+ */
+ private String weight;
+
+ /**
+ * 0不默认选中,1默认选中
+ */
+ private String defaultStatus;
+
+ /**
+ * 1是系统属性,不可删除,0是自定义属性可以删除
+ */
+ private String system;
+
+ /**
+ * 排序
+ */
+ private String orderBy;
+
+ /**
+ * 所属类型:文献类型中0代表期刊1代表非刊2代表开放资源
+ */
+ private String type;
+
+ /**
+ * 解释、备注
+ */
+ private String text;
+}
diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/domain/req/ResourceReq.java b/cloud-resource-common/src/main/java/com/muyu/resource/domain/req/ResourceReq.java
new file mode 100644
index 0000000..ef7945b
--- /dev/null
+++ b/cloud-resource-common/src/main/java/com/muyu/resource/domain/req/ResourceReq.java
@@ -0,0 +1,24 @@
+package com.muyu.resource.domain.req;
+
+import lombok.*;
+
+/**
+ * @Author: 胡杨
+ * @Name: ResourceInfo
+ * @Description: 资源类
+ * @CreatedDate: 2024/8/10 上午9:51
+ * @FilePath: com.muyu.resource.domain
+ */
+
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResourceReq {
+ private String title;
+ private String pissn;
+ private String eissn;
+ private String pisbn;
+ private String eisbn;
+}
diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/domain/resp/ResourceInfoResp.java b/cloud-resource-common/src/main/java/com/muyu/resource/domain/resp/ResourceInfoResp.java
new file mode 100644
index 0000000..eea3b87
--- /dev/null
+++ b/cloud-resource-common/src/main/java/com/muyu/resource/domain/resp/ResourceInfoResp.java
@@ -0,0 +1,90 @@
+package com.muyu.resource.domain.resp;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.muyu.common.core.annotation.Excel;
+import lombok.*;
+
+/**
+ * @Author: 胡杨
+ * @Name: ResourceInfo
+ * @Description: 资源类
+ * @CreatedDate: 2024/8/10 上午9:51
+ * @FilePath: com.muyu.resource.domain
+ */
+
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResourceInfoResp {
+ /*
+ * 题名
+ */
+ @Excel(name = "题名")
+ private String title;
+
+ /**
+ * 其他题名
+ */
+ @Excel(name = "题名译名")
+ private String otherTitle;
+
+ /**
+ * 印本ISSN
+ */
+ @Excel(name = "PISSN")
+ private String pissn;
+
+ /**
+ * 电子ISSN
+ */
+ @Excel(name = "EISSN")
+ private String eissn;
+
+ /**
+ * 印本isbn
+ */
+ @Excel(name = "PISBN")
+ private String pisbn;
+
+ /**
+ * 电子isbn
+ */
+ @Excel(name = "EISBN")
+ private String eisbn;
+
+ /**
+ * 文献类型
+ */
+ @Excel(name = "文献类型")
+ private String type;
+
+ /**
+ * 载体
+ */
+ @Excel(name = "载体")
+ private String carrier;
+
+ /**
+ * 学科
+ */
+ @Excel(name = "学科")
+ private String subject;
+
+ /**
+ * 国别
+ */
+ @Excel(name = "国家/地区")
+ private String country;
+
+ /**
+ * 语种
+ */
+ @Excel(name = "语种")
+ private String language;
+
+
+
+
+}
diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/domain/result/PageResult.java b/cloud-resource-common/src/main/java/com/muyu/resource/domain/result/PageResult.java
new file mode 100644
index 0000000..70c6255
--- /dev/null
+++ b/cloud-resource-common/src/main/java/com/muyu/resource/domain/result/PageResult.java
@@ -0,0 +1,34 @@
+package com.muyu.resource.domain.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author DongZl
+ * @description: 列表返回结果集
+ */
+@Data
+public class PageResult implements Serializable {
+ /**
+ * 总条数
+ */
+ private long total;
+ /**
+ * 结果集合
+ */
+ private List list;
+ public PageResult() {
+ }
+ public PageResult(long total, List list) {
+ this.total = total;
+ this.list = list;
+ }
+ public static PageResult toPageResult(long total, List list){
+ return new PageResult(total , list);
+ }
+ public static Result> toResult(long total, List list){
+ return Result.success(PageResult.toPageResult(total,list));
+ }
+}
diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/domain/result/Result.java b/cloud-resource-common/src/main/java/com/muyu/resource/domain/result/Result.java
new file mode 100644
index 0000000..8031618
--- /dev/null
+++ b/cloud-resource-common/src/main/java/com/muyu/resource/domain/result/Result.java
@@ -0,0 +1,76 @@
+package com.muyu.resource.domain.result;
+
+import com.muyu.common.core.constant.Constants;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author DongZl
+ * @description: 响应信息主体
+ */
+@Data
+public class Result implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ /**
+ * 成功
+ */
+ public static final int SUCCESS = Constants.SUCCESS;
+ /**
+ * 失败
+ */
+ public static final int FAIL = Constants.FAIL;
+ /**
+ * 返回状态码
+ */
+ private int code;
+ /**
+ * 响应信息
+ */
+ private String msg;
+ /**
+ * 响应数据
+ */
+ private T data;
+
+ public static Result success() {
+ return restResult(null, SUCCESS, Constants.LOGIN_SUCCESS);
+ }
+
+ public static Result success(T data) {
+ return restResult(data, SUCCESS, Constants.LOGIN_SUCCESS);
+ }
+
+ public static Result success(T data, String msg) {
+ return restResult(data, SUCCESS, msg);
+ }
+
+ public static Result error() {
+ return restResult(null, FAIL, Constants.LOGIN_FAIL);
+ }
+
+ public static Result error(String msg) {
+ return restResult(null, FAIL, msg);
+ }
+
+ public static Result error(T data) {
+ return restResult(data, FAIL, Constants.LOGIN_FAIL);
+ }
+
+ public static Result error(T data, String msg) {
+ return restResult(data, FAIL, msg);
+ }
+
+ public static Result error(int code, String msg) {
+ return restResult(null, code, msg);
+ }
+
+ private static Result restResult(T data, int code, String msg) {
+ Result apiResult = new Result<>();
+ apiResult.setCode(code);
+ apiResult.setData(data);
+ apiResult.setMsg(msg);
+ return apiResult;
+ }
+}
diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/utils/ExcelUtils.java b/cloud-resource-common/src/main/java/com/muyu/resource/utils/ExcelUtils.java
new file mode 100644
index 0000000..81cab8e
--- /dev/null
+++ b/cloud-resource-common/src/main/java/com/muyu/resource/utils/ExcelUtils.java
@@ -0,0 +1,798 @@
+package com.muyu.resource.utils;
+
+
+import com.muyu.common.core.annotation.Excel;
+import com.muyu.common.core.annotation.Excel.ColumnType;
+import com.muyu.common.core.annotation.Excel.Type;
+import com.muyu.common.core.annotation.Excels;
+import com.muyu.common.core.text.Convert;
+import com.muyu.common.core.utils.DateUtils;
+import com.muyu.common.core.utils.SpringUtils;
+import com.muyu.common.core.utils.StringUtils;
+import com.muyu.common.core.utils.reflect.ReflectUtils;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.log4j.Log4j2;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddressList;
+import org.apache.poi.util.IOUtils;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFDataValidation;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.*;
+
+/**
+ * Excel相关处理
+ */
+
+@Log4j2
+public class ExcelUtils{
+
+ /**
+ * Excel sheet最大行数,默认65536
+ */
+ public static final int SHEET_SIZE = 65536;
+
+ /**
+ * 工作表名称
+ */
+ private String sheetName;
+
+ /**
+ * 导出类型(EXPORT:导出数据;IMPORT:导入模板)
+ */
+ private Type type;
+
+ /**
+ * 工作薄对象
+ */
+ private Workbook wb;
+
+ /**
+ * 工作表对象
+ */
+ private Sheet sheet;
+
+ /**
+ * 样式列表
+ */
+ private Map styles;
+
+ /**
+ * 导入导出数据列表
+ */
+ private List list;
+
+ /**
+ * 注解列表
+ */
+ private List