add: ceshi
This commit is contained in:
@@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
package com.boge;
|
package com.boge;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
@Api(hidden = true)
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class BaseApplication {
|
public class BaseApplication {
|
||||||
|
|
||||||
@@ -19,4 +20,4 @@ public class BaseApplication {
|
|||||||
SpringApplication.run(BaseApplication.class, args);
|
SpringApplication.run(BaseApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,5 +60,9 @@ public class ContractEntity implements Serializable {
|
|||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
/**
|
||||||
|
* 文件id
|
||||||
|
*/
|
||||||
|
private String storageId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,16 +10,13 @@ import com.boge.modules.tickets.service.LocalStorageService;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -36,15 +33,15 @@ public class LocalStorageController {
|
|||||||
|
|
||||||
@ApiOperation("查询文件")
|
@ApiOperation("查询文件")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResponseEntity<Object> query() {
|
public ResponseEntity<Object> query(@RequestParam Integer contractId) {
|
||||||
return new ResponseEntity(this.localStorageService.queryAll(), HttpStatus.OK);
|
return new ResponseEntity(this.localStorageService.queryAll(contractId), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("导出数据")
|
@ApiOperation("导出数据")
|
||||||
@GetMapping({"/download"})
|
@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("上传文件")
|
@ApiOperation("上传文件")
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.boge.common.utils.R;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author ls
|
* @author ls
|
||||||
* @email dengpbs@163.com
|
* @email dengpbs@163.com
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import java.sql.Timestamp;
|
|||||||
@Entity
|
@Entity
|
||||||
@Data
|
@Data
|
||||||
@Table(
|
@Table(
|
||||||
name = "tool_local_storage"
|
name = "local_storage"
|
||||||
)
|
)
|
||||||
public class LocalStorage implements Serializable {
|
public class LocalStorage implements Serializable {
|
||||||
|
|
||||||
@@ -22,14 +22,10 @@ public class LocalStorage implements Serializable {
|
|||||||
@Column(
|
@Column(
|
||||||
name = "storage_id"
|
name = "storage_id"
|
||||||
)
|
)
|
||||||
@ApiModelProperty(
|
|
||||||
value = "ID",
|
|
||||||
hidden = true
|
|
||||||
)
|
|
||||||
@GeneratedValue(
|
@GeneratedValue(
|
||||||
strategy = GenerationType.IDENTITY
|
strategy = GenerationType.IDENTITY
|
||||||
)
|
)
|
||||||
private Long id;
|
private Long storageId;
|
||||||
@ApiModelProperty("真实文件名")
|
@ApiModelProperty("真实文件名")
|
||||||
private String realName;
|
private String realName;
|
||||||
@ApiModelProperty("文件名")
|
@ApiModelProperty("文件名")
|
||||||
@@ -60,7 +56,7 @@ public class LocalStorage implements Serializable {
|
|||||||
value = "更新人",
|
value = "更新人",
|
||||||
hidden = true
|
hidden = true
|
||||||
)
|
)
|
||||||
private String updatedBy;
|
private String updateBy;
|
||||||
@CreationTimestamp
|
@CreationTimestamp
|
||||||
@Column(
|
@Column(
|
||||||
name = "create_time",
|
name = "create_time",
|
||||||
@@ -81,6 +77,8 @@ public class LocalStorage implements Serializable {
|
|||||||
)
|
)
|
||||||
private Timestamp updateTime;
|
private Timestamp updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public LocalStorage(String realName, String name, String suffix, String path, String type, String size) {
|
public LocalStorage(String realName, String name, String suffix, String path, String type, String size) {
|
||||||
this.realName = realName;
|
this.realName = realName;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import java.util.Date;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author ls
|
* @author ls
|
||||||
* @email dengpbs@163.com
|
* @email dengpbs@163.com
|
||||||
* @date 2025-03-05 14:29:12
|
* @date 2025-03-05 14:29:12
|
||||||
@@ -23,7 +23,7 @@ public class TicketsEntity implements Serializable {
|
|||||||
* 工单id
|
* 工单id
|
||||||
*/
|
*/
|
||||||
@TableId
|
@TableId
|
||||||
private String ticketsId;
|
private Long ticketsId;
|
||||||
/**
|
/**
|
||||||
* 小车类型
|
* 小车类型
|
||||||
*/
|
*/
|
||||||
@@ -73,4 +73,6 @@ public class TicketsEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.boge.modules.tickets.service;
|
package com.boge.modules.tickets.service;
|
||||||
|
|
||||||
import com.boge.modules.tickets.dto.LocalStorageDto;
|
|
||||||
import com.boge.modules.tickets.entity.LocalStorage;
|
import com.boge.modules.tickets.entity.LocalStorage;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface LocalStorageService {
|
public interface LocalStorageService {
|
||||||
|
|
||||||
List<LocalStorage> queryAll();
|
List<LocalStorage> queryAll(Integer contractId);
|
||||||
|
|
||||||
|
|
||||||
LocalStorage create(String name, MultipartFile file);
|
LocalStorage create(String name, MultipartFile file);
|
||||||
|
|||||||
@@ -3,34 +3,43 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.exception.RRException;
|
||||||
import com.boge.common.utils.FileProperties;
|
import com.boge.common.utils.FileProperties;
|
||||||
import com.boge.common.utils.FileUtil;
|
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.dao.LocalStorageMapper;
|
||||||
import com.boge.modules.tickets.entity.LocalStorage;
|
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.repository.LocalStorageRepository;
|
||||||
import com.boge.modules.tickets.service.LocalStorageService;
|
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.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@Service
|
@Service
|
||||||
public class LocalStorageServiceImpl extends ServiceImpl<LocalStorageMapper, LocalStorage> implements LocalStorageService {
|
public class LocalStorageServiceImpl implements LocalStorageService {
|
||||||
private final LocalStorageRepository localStorageRepository;
|
private final LocalStorageRepository localStorageRepository;
|
||||||
private final LocalStorageMapper localStorageMapper;
|
private final LocalStorageMapper localStorageMapper;
|
||||||
private final FileProperties properties;
|
private final FileProperties properties;
|
||||||
|
|
||||||
public List<LocalStorage> queryAll() {
|
@Autowired
|
||||||
return localStorageMapper.selectList(new QueryWrapper<LocalStorage>());
|
private ContractService contractService;
|
||||||
|
|
||||||
|
public List<LocalStorage> 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<LocalStorage>().in("storage_id", Arrays.asList(split)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -69,4 +69,18 @@ renren:
|
|||||||
flowable:
|
flowable:
|
||||||
async-executor-activate: false
|
async-executor-activate: false
|
||||||
database-schema-update: true
|
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
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,7 @@
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: this.$http.adornParams()
|
params: this.$http.adornParams()
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 200) {
|
||||||
this.dynamiForm = data.data
|
this.dynamiForm = data.data
|
||||||
this.users = data.users
|
this.users = data.users
|
||||||
this.roles = data.roles
|
this.roles = data.roles
|
||||||
|
|||||||
Reference in New Issue
Block a user