| src/main/java/org/springblade/common/node/TreeNode.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/desk/mapper/StrainService.xml | patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/farm/entity/FarmPaper.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/farm/mapper/FarmPaperMapper.xml | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/farm/mapper/StrainService.xml | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/stock/mapper/StrainService.xml | patch | view | raw | blame | history |
src/main/java/org/springblade/common/node/TreeNode.java
New file @@ -0,0 +1,39 @@ package org.springblade.common.node; import lombok.Data; import java.util.ArrayList; import java.util.List; /** * 自定义Node * @author zhongrj */ @Data public class TreeNode { /** * id */ private Long id; /** * 父id */ private Long parentId; /** * 树节点名称 */ private String name; /** * 子节点 */ private List<TreeNode> children = new ArrayList<>(); /** * 是否有子节点 */ private Boolean hasChildren; } src/main/java/org/springblade/modules/desk/mapper/StrainService.xml
src/main/java/org/springblade/modules/farm/entity/FarmPaper.java
@@ -28,47 +28,44 @@ private Integer id; /** * 农场名称 * 证书名称/检测项目 */ private Integer farmName; private String name; /** * 农场地址 * 检测/颁发机构名称 */ private String farmAddress; /** * 土地流转面积 */ private String farmArea; private String organName; /** * 口号 * 证书/报告编号 */ private String slogan; private String code; /** * 介绍 * 证书/报告颁发日期 */ private String introduce; @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") private Date time; /** * 农场环境照片(多张) * 证书/报告照片 */ private String picture; private String pictures; /** * 农场位置(面) */ private String position; private String type; /** * 租户id */ private String tenantId; private Integer farmId; /** * 创建时间 src/main/java/org/springblade/modules/farm/mapper/FarmPaperMapper.xml
File was deleted src/main/java/org/springblade/modules/farm/mapper/StrainService.xml
New 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="org.springblade.modules.farm.mapper.FarmPaperMapper"> <!--自定义查询农场检测报告/证书分页数据--> <select id="selectFarmPaperPage" resultType="org.springblade.modules.farm.vo.FarmPaperVO"> select * from sys_farm_paper where 1=1 <if test="farmPaper.type!=null"> and type = #{farmPaper.type} </if> <if test="farmPaper.farmId!=null"> and farm_id = #{farmPaper.farmId} </if> <if test="farmPaper.name!=null and farmPaper.name!=''"> and name like concat('%',#{farmPaper.name},'%') </if> </select> </mapper> src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -16,6 +16,8 @@ */ package org.springblade.modules.resource.endpoint; import io.minio.*; import io.minio.errors.*; import io.swagger.annotations.Api; import lombok.AllArgsConstructor; import lombok.SneakyThrows; @@ -33,6 +35,14 @@ import org.springblade.modules.resource.service.IAttachService; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.Map; import java.util.UUID; /** * 对象存储端点 @@ -150,6 +160,55 @@ } /** * 文件上传,自定义上传 * * @param file 图片对象 */ @PostMapping("put-files") public R putFiles(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { //填写你文件上传的地址以及相应信息 String url = "http://61.131.136.25:2081"; String access = "zhbaadmin"; String secret = "zhbapassword"; String bucket = "zhba"; MinioClient minioClient = MinioClient.builder() .endpoint(url) .credentials(access, secret) .build(); // 检查存储桶是否已经存在 boolean isExist = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucket).build()); if (!isExist) { // 创建一个名为zip的存储桶,用于zip文件。 minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucket).build()); minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build()); } String fileName = file.getOriginalFilename(); String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") + fileName.substring(fileName.lastIndexOf(".")); InputStream in = file.getInputStream(); String[] split = newName.split("/"); //创建头部信息 Map<String, String> headers = new HashMap<>(1 << 2); //添加自定义内容类型 headers.put("Content-Type", "application/octet-stream"); //上传 minioClient.putObject( PutObjectArgs.builder().bucket(bucket).object(newName).stream( in, in.available(), -1) .headers(headers) .build()); in.close(); String urls = "http://61.131.136.25:2081/zhba/" + newName; //数据封装 Map<String, Object> map = new HashMap<>(2); map.put("name", newName); map.put("url", urls); //返回 return R.data(map); } /** * 上传文件 * * @param fileName 存储桶对象名称 src/main/java/org/springblade/modules/stock/mapper/StrainService.xml