diff --git a/base-fast/src/main/java/com/boge/BaseApplication.java b/base-fast/src/main/java/com/boge/BaseApplication.java index ae33a8a..025ba67 100644 --- a/base-fast/src/main/java/com/boge/BaseApplication.java +++ b/base-fast/src/main/java/com/boge/BaseApplication.java @@ -8,9 +8,10 @@ package com.boge; +import io.swagger.annotations.Api; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; - +@Api(hidden = true) @SpringBootApplication public class BaseApplication { @@ -19,4 +20,4 @@ public class BaseApplication { SpringApplication.run(BaseApplication.class, args); } -} \ No newline at end of file +} diff --git a/base-fast/src/main/java/com/boge/modules/contract/entity/ContractEntity.java b/base-fast/src/main/java/com/boge/modules/contract/entity/ContractEntity.java index bb9f496..93ad562 100644 --- a/base-fast/src/main/java/com/boge/modules/contract/entity/ContractEntity.java +++ b/base-fast/src/main/java/com/boge/modules/contract/entity/ContractEntity.java @@ -60,5 +60,9 @@ public class ContractEntity implements Serializable { * 备注 */ private String remarks; + /** + * 文件id + */ + private String storageId; } diff --git a/base-fast/src/main/java/com/boge/modules/tickets/controller/LocalStorageController.java b/base-fast/src/main/java/com/boge/modules/tickets/controller/LocalStorageController.java index c5b9051..10129d6 100644 --- a/base-fast/src/main/java/com/boge/modules/tickets/controller/LocalStorageController.java +++ b/base-fast/src/main/java/com/boge/modules/tickets/controller/LocalStorageController.java @@ -10,16 +10,13 @@ import com.boge.modules.tickets.service.LocalStorageService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.io.IOException; -import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -36,15 +33,15 @@ public class LocalStorageController { @ApiOperation("查询文件") @GetMapping - public ResponseEntity query() { - return new ResponseEntity(this.localStorageService.queryAll(), HttpStatus.OK); + public ResponseEntity query(@RequestParam Integer contractId) { + return new ResponseEntity(this.localStorageService.queryAll(contractId), HttpStatus.OK); } @ApiOperation("导出数据") @GetMapping({"/download"}) - public void download(HttpServletResponse response) throws IOException { + public void download(@RequestParam Integer contractId ,HttpServletResponse response) throws IOException { - this.localStorageService.download(this.localStorageService.queryAll(), response); + this.localStorageService.download(this.localStorageService.queryAll(contractId), response); } @ApiOperation("上传文件") diff --git a/base-fast/src/main/java/com/boge/modules/tickets/controller/TicketsController.java b/base-fast/src/main/java/com/boge/modules/tickets/controller/TicketsController.java index 405dbc7..9fc6143 100644 --- a/base-fast/src/main/java/com/boge/modules/tickets/controller/TicketsController.java +++ b/base-fast/src/main/java/com/boge/modules/tickets/controller/TicketsController.java @@ -18,7 +18,7 @@ import com.boge.common.utils.R; /** - * + * * * @author ls * @email dengpbs@163.com diff --git a/base-fast/src/main/java/com/boge/modules/tickets/entity/LocalStorage.java b/base-fast/src/main/java/com/boge/modules/tickets/entity/LocalStorage.java index 3af2983..a71e5b5 100644 --- a/base-fast/src/main/java/com/boge/modules/tickets/entity/LocalStorage.java +++ b/base-fast/src/main/java/com/boge/modules/tickets/entity/LocalStorage.java @@ -14,7 +14,7 @@ import java.sql.Timestamp; @Entity @Data @Table( - name = "tool_local_storage" + name = "local_storage" ) public class LocalStorage implements Serializable { @@ -22,14 +22,10 @@ public class LocalStorage implements Serializable { @Column( name = "storage_id" ) - @ApiModelProperty( - value = "ID", - hidden = true - ) @GeneratedValue( strategy = GenerationType.IDENTITY ) - private Long id; + private Long storageId; @ApiModelProperty("真实文件名") private String realName; @ApiModelProperty("文件名") @@ -60,7 +56,7 @@ public class LocalStorage implements Serializable { value = "更新人", hidden = true ) - private String updatedBy; + private String updateBy; @CreationTimestamp @Column( name = "create_time", @@ -81,6 +77,8 @@ public class LocalStorage implements Serializable { ) private Timestamp updateTime; + + public LocalStorage(String realName, String name, String suffix, String path, String type, String size) { this.realName = realName; this.name = name; diff --git a/base-fast/src/main/java/com/boge/modules/tickets/entity/TicketsEntity.java b/base-fast/src/main/java/com/boge/modules/tickets/entity/TicketsEntity.java index 9397f7c..e967e84 100644 --- a/base-fast/src/main/java/com/boge/modules/tickets/entity/TicketsEntity.java +++ b/base-fast/src/main/java/com/boge/modules/tickets/entity/TicketsEntity.java @@ -8,8 +8,8 @@ import java.util.Date; import lombok.Data; /** - * - * + * + * * @author ls * @email dengpbs@163.com * @date 2025-03-05 14:29:12 @@ -23,7 +23,7 @@ public class TicketsEntity implements Serializable { * 工单id */ @TableId - private String ticketsId; + private Long ticketsId; /** * 小车类型 */ @@ -73,4 +73,6 @@ public class TicketsEntity implements Serializable { */ private Date updateTime; + + } diff --git a/base-fast/src/main/java/com/boge/modules/tickets/service/LocalStorageService.java b/base-fast/src/main/java/com/boge/modules/tickets/service/LocalStorageService.java index d7038fb..4e037b5 100644 --- a/base-fast/src/main/java/com/boge/modules/tickets/service/LocalStorageService.java +++ b/base-fast/src/main/java/com/boge/modules/tickets/service/LocalStorageService.java @@ -1,6 +1,5 @@ package com.boge.modules.tickets.service; -import com.boge.modules.tickets.dto.LocalStorageDto; import com.boge.modules.tickets.entity.LocalStorage; import org.springframework.web.multipart.MultipartFile; @@ -10,7 +9,7 @@ import java.util.List; public interface LocalStorageService { - List queryAll(); + List queryAll(Integer contractId); LocalStorage create(String name, MultipartFile file); diff --git a/base-fast/src/main/java/com/boge/modules/tickets/service/impl/LocalStorageServiceImpl.java b/base-fast/src/main/java/com/boge/modules/tickets/service/impl/LocalStorageServiceImpl.java index 92a5bc2..c2b9c4a 100644 --- a/base-fast/src/main/java/com/boge/modules/tickets/service/impl/LocalStorageServiceImpl.java +++ b/base-fast/src/main/java/com/boge/modules/tickets/service/impl/LocalStorageServiceImpl.java @@ -3,34 +3,43 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import javax.servlet.http.HttpServletResponse; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.boge.common.exception.RRException; import com.boge.common.utils.FileProperties; import com.boge.common.utils.FileUtil; +import com.boge.modules.contract.entity.ContractEntity; +import com.boge.modules.contract.service.ContractService; import com.boge.modules.tickets.dao.LocalStorageMapper; import com.boge.modules.tickets.entity.LocalStorage; -import com.boge.modules.tickets.entity.LocalStorageQueryCriteria; import com.boge.modules.tickets.repository.LocalStorageRepository; import com.boge.modules.tickets.service.LocalStorageService; +import net.bytebuddy.implementation.bytecode.Throw; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @Service -public class LocalStorageServiceImpl extends ServiceImpl implements LocalStorageService { +public class LocalStorageServiceImpl implements LocalStorageService { private final LocalStorageRepository localStorageRepository; private final LocalStorageMapper localStorageMapper; private final FileProperties properties; - public List queryAll() { - return localStorageMapper.selectList(new QueryWrapper()); + @Autowired + private ContractService contractService; + + public List queryAll(Integer contractId) { + ContractEntity contract = contractService.getById(contractId); + if (ObjectUtil.isNull(contract)) { + throw new RRException("合同为空"); + } + if (StrUtil.isEmpty(contract.getStorageId())){ + return null; + } + String[] split = contract.getStorageId().split(","); + return localStorageMapper.selectList(new QueryWrapper().in("storage_id", Arrays.asList(split))); } diff --git a/base-fast/src/main/resources/application.yml b/base-fast/src/main/resources/application.yml index 7b72eda..57f855e 100644 --- a/base-fast/src/main/resources/application.yml +++ b/base-fast/src/main/resources/application.yml @@ -69,4 +69,18 @@ renren: flowable: async-executor-activate: false database-schema-update: true +# 文件存储路径 +file: + mac: + path: ~/file/ + avatar: ~/avatar/ + linux: + path: /home/eladmin/file/ + avatar: /home/eladmin/avatar/ + windows: + path: C:\eladmin\file\ + avatar: C:\eladmin\avatar\ + # 文件大小 /M + maxSize: 100 + avatarMaxSize: 5 diff --git a/base-vue/src/views/modules/deploy/flwdeployprodef.vue b/base-vue/src/views/modules/deploy/flwdeployprodef.vue index 3b10185..4d02776 100644 --- a/base-vue/src/views/modules/deploy/flwdeployprodef.vue +++ b/base-vue/src/views/modules/deploy/flwdeployprodef.vue @@ -272,7 +272,7 @@ method: 'get', params: this.$http.adornParams() }).then(({data}) => { - if (data && data.code === 0) { + if (data && data.code === 200) { this.dynamiForm = data.data this.users = data.users this.roles = data.roles