Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -6,6 +6,7 @@ import com.njcn.device.pq.pojo.vo.EventVO;
|
|||||||
import com.njcn.device.pq.pojo.vo.MiddleChildVO;
|
import com.njcn.device.pq.pojo.vo.MiddleChildVO;
|
||||||
import com.njcn.device.pq.pojo.vo.MiddleLimitRateVO;
|
import com.njcn.device.pq.pojo.vo.MiddleLimitRateVO;
|
||||||
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -16,6 +17,7 @@ import java.util.Map;
|
|||||||
* @author: zbj
|
* @author: zbj
|
||||||
* @date: 2023/03/31
|
* @date: 2023/03/31
|
||||||
*/
|
*/
|
||||||
|
@Mapper
|
||||||
public interface LargeScreenMapper {
|
public interface LargeScreenMapper {
|
||||||
|
|
||||||
Map<String, Object> selectDownCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
Map<String, Object> selectDownCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
@@ -24,7 +26,7 @@ public interface LargeScreenMapper {
|
|||||||
|
|
||||||
List<Map<String, Object>> getTimeCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
List<Map<String, Object>> getTimeCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
|
|
||||||
List<Map<String, Object>> eventLists(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
List<EventVO> eventLists(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
|
|
||||||
AllDataVO getFlagCount(@Param("lineIds") List<String> lineIds);
|
AllDataVO getFlagCount(@Param("lineIds") List<String> lineIds);
|
||||||
|
|
||||||
|
|||||||
@@ -54,25 +54,7 @@
|
|||||||
group by day
|
group by day
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="eventLists" resultType="java.util.Map">
|
|
||||||
SELECT
|
|
||||||
ed.create_time "time",pl.`Name` "name",sdd.`Name` reason,sdd.`Name` "type",ed.feature_amplitude amplitude,ed.duration
|
|
||||||
from r_mp_event_detail ed
|
|
||||||
left join pq_line pl on pl.id = ed.measurement_point_id
|
|
||||||
left join sys_dict_data sdd on sdd.id = ed.advance_reason
|
|
||||||
left join sys_dict_data sdd2 on sdd.id = ed.advance_type
|
|
||||||
<where>
|
|
||||||
<if test="startTime != null and startTime != ''">
|
|
||||||
and date_format(ed.create_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null and endTime != ''">
|
|
||||||
and date_format(ed.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
order by time desc
|
|
||||||
limit 50
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getFlagCount" resultType="com.njcn.device.pq.pojo.vo.AllDataVO">
|
<select id="getFlagCount" resultType="com.njcn.device.pq.pojo.vo.AllDataVO">
|
||||||
select
|
select
|
||||||
@@ -363,4 +345,21 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="eventLists" resultType="com.njcn.device.pq.pojo.vo.EventVO">
|
||||||
|
SELECT
|
||||||
|
ed.create_time "time",pl.`Name` "name",ed.advance_reason reason,ed.advance_type "type",ed.feature_amplitude amplitude,ed.duration
|
||||||
|
from r_mp_event_detail ed
|
||||||
|
left join pq_line pl on pl.id = ed.measurement_point_id
|
||||||
|
<where>
|
||||||
|
<if test="startTime != null and startTime != ''">
|
||||||
|
and date_format(ed.create_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
and date_format(ed.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by time desc
|
||||||
|
limit 50
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -246,20 +246,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EventVO> eventLists(LargeScreenParam largeScreenParam) {
|
public List<EventVO> eventLists(LargeScreenParam largeScreenParam) {
|
||||||
//创建返回VO
|
return largeScreenMapper.eventLists(largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
||||||
List<EventVO> result = new ArrayList<>();
|
|
||||||
List<Map<String, Object>> maps = largeScreenMapper.eventLists(largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
|
||||||
for (Map<String, Object> map : maps) {
|
|
||||||
EventVO eventVO = new EventVO();
|
|
||||||
eventVO.setTime(map.get("time").toString());
|
|
||||||
eventVO.setName(map.get("name").toString());
|
|
||||||
eventVO.setReason(map.get("reason").toString());
|
|
||||||
eventVO.setType(map.get("type").toString());
|
|
||||||
eventVO.setAmplitude(map.get("amplitude").toString());
|
|
||||||
eventVO.setDuration(map.get("duration").toString());
|
|
||||||
result.add(eventVO);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.njcn.system.pojo.po;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zbj
|
||||||
|
* @since 2023-04-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ResinformationParam {
|
||||||
|
|
||||||
|
@Excel(name = "资源名称", width = 20)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Excel(name = "资源类目", width = 20)
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Excel(name = "资源描述", width = 20)
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Excel(name = "数据更新时间", format = "yyyy-MM-dd HH:mm:ss", width = 20)
|
||||||
|
private LocalDateTime time;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,6 +16,9 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@@ -39,10 +42,10 @@ public class ResourceAdministrationController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/uploadFile")
|
@PostMapping("/uploadFile")
|
||||||
@ApiOperation("上传资源")
|
@ApiOperation("上传资源")
|
||||||
public HttpResult<Boolean> uploadFile(@ApiParam(value = "文件", required = true)@RequestPart("multipartFile") MultipartFile multipartFile,
|
public HttpResult<Boolean> uploadFile(@ApiParam(value = "文件", required = true) @RequestPart("multipartFile") MultipartFile multipartFile,
|
||||||
@ApiParam(value = "资源名称", required = true)String name,
|
@ApiParam(value = "资源名称", required = true) String name,
|
||||||
@ApiParam(value = "资源类型", required = true) String type,
|
@ApiParam(value = "资源类型", required = true) String type,
|
||||||
@ApiParam(value = "资源描述", required = false)String describe,
|
@ApiParam(value = "资源描述", required = false) String describe,
|
||||||
@ApiParam(value = "系统类型Guid", required = true) String systemType) {
|
@ApiParam(value = "系统类型Guid", required = true) String systemType) {
|
||||||
String methodDescribe = getMethodDescribe("uploadFile");
|
String methodDescribe = getMethodDescribe("uploadFile");
|
||||||
Boolean flag = iResourceAdministrationService.uploadFile(multipartFile, name, type, describe, systemType);
|
Boolean flag = iResourceAdministrationService.uploadFile(multipartFile, name, type, describe, systemType);
|
||||||
@@ -55,10 +58,65 @@ public class ResourceAdministrationController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryData")
|
@PostMapping("/queryData")
|
||||||
@ApiOperation("查询数据")
|
@ApiOperation("查询数据")
|
||||||
@ApiImplicitParam(name = "baseParam",value = "查询数据",required = true)
|
@ApiImplicitParam(name = "baseParam", value = "查询数据", required = true)
|
||||||
public HttpResult<List<Resinformation>> queryData(@RequestBody @Validated BaseParam baseParam) {
|
public HttpResult<List<Resinformation>> queryData(@RequestBody @Validated BaseParam baseParam) {
|
||||||
String methodDescribe = getMethodDescribe("queryData");
|
String methodDescribe = getMethodDescribe("queryData");
|
||||||
List<Resinformation> result = iResourceAdministrationService.queryData(baseParam);
|
List<Resinformation> result = iResourceAdministrationService.queryData(baseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改资源
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/updateFile")
|
||||||
|
@ApiOperation("修改资源")
|
||||||
|
public HttpResult<Boolean> updateFile(@ApiParam(value = "文件", required = true) @RequestPart("multipartFile") MultipartFile multipartFile,
|
||||||
|
@ApiParam(value = "id", required = true) String id,
|
||||||
|
@ApiParam(value = "资源名称", required = true) String name,
|
||||||
|
@ApiParam(value = "资源类型", required = true) String type,
|
||||||
|
@ApiParam(value = "资源描述", required = false) String describe,
|
||||||
|
@ApiParam(value = "系统类型Guid", required = true) String systemType) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateFile");
|
||||||
|
Boolean flag = iResourceAdministrationService.updateFile(multipartFile, id, name, type, describe, systemType);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资源
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/deleteFile")
|
||||||
|
@ApiOperation("删除资源")
|
||||||
|
@ApiImplicitParam(name = "id",value = "id",required = true)
|
||||||
|
public HttpResult<Boolean> deleteFile(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("deleteFile");
|
||||||
|
Boolean flag = iResourceAdministrationService.deleteFile(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载资源
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/downloadFile")
|
||||||
|
@ApiOperation("下载资源")
|
||||||
|
@ApiImplicitParam(name = "id",value = "id",required = true)
|
||||||
|
public HttpResult<Object> downloadFile(@RequestParam("id")String id,HttpServletResponse response) throws IOException {
|
||||||
|
String methodDescribe = getMethodDescribe("downloadFile");
|
||||||
|
iResourceAdministrationService.downloadFile(id,response);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "下载成功", methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*/
|
||||||
|
/*@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/exportData")
|
||||||
|
@ApiOperation("导出数据")
|
||||||
|
public HttpResult<Object> exportData() {
|
||||||
|
String methodDescribe = getMethodDescribe("exportData");
|
||||||
|
iResourceAdministrationService.exportData();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "成功", methodDescribe);
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package com.njcn.system.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.system.pojo.po.Resinformation;
|
import com.njcn.system.pojo.po.Resinformation;
|
||||||
|
import com.njcn.system.pojo.po.ResinformationParam;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @author: zbj
|
* @author: zbj
|
||||||
@@ -12,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ResourceAdministrationMapper extends BaseMapper<Resinformation> {
|
public interface ResourceAdministrationMapper extends BaseMapper<Resinformation> {
|
||||||
|
List<ResinformationParam> listAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,9 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njcn.system.mapper.ResourceAdministrationMapper">
|
<mapper namespace="com.njcn.system.mapper.ResourceAdministrationMapper">
|
||||||
|
|
||||||
|
<select id="listAll" resultType="com.njcn.system.pojo.po.ResinformationParam">
|
||||||
|
SELECT pr.`NAME` "name", sdd.`Name` "type", pr.DESCRIPTION "description", pr.UPDATETIME "time"
|
||||||
|
FROM pqs_resinformation pr
|
||||||
|
left join sys_dict_data sdd on sdd.Id = pr.TYPE
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import com.njcn.system.pojo.po.Resinformation;
|
|||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,7 +18,15 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface IResourceAdministrationService extends IService<Resinformation> {
|
public interface IResourceAdministrationService extends IService<Resinformation> {
|
||||||
|
|
||||||
Boolean uploadFile(MultipartFile multipartFile, String name, String type, String describe,String systemType);
|
Boolean uploadFile(MultipartFile multipartFile, String name, String type, String describe, String systemType);
|
||||||
|
|
||||||
List<Resinformation> queryData(BaseParam baseParam);
|
List<Resinformation> queryData(BaseParam baseParam);
|
||||||
|
|
||||||
|
Boolean updateFile(MultipartFile multipartFile, String id, String name, String type, String describe, String systemType);
|
||||||
|
|
||||||
|
Boolean deleteFile(String id);
|
||||||
|
|
||||||
|
void downloadFile(String id,HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
|
void exportData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,15 @@ package com.njcn.system.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
import com.njcn.system.mapper.ResourceAdministrationMapper;
|
import com.njcn.system.mapper.ResourceAdministrationMapper;
|
||||||
import com.njcn.system.pojo.po.Resinformation;
|
import com.njcn.system.pojo.po.Resinformation;
|
||||||
|
import com.njcn.system.pojo.po.ResinformationParam;
|
||||||
import com.njcn.system.service.IResourceAdministrationService;
|
import com.njcn.system.service.IResourceAdministrationService;
|
||||||
|
import com.njcn.user.pojo.dto.excel.UserExcel;
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -16,6 +20,10 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -34,6 +42,8 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
|||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
|
//private final GeneralInfo generalInfo;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean uploadFile(MultipartFile multipartFile, String name, String type, String describe, String systemType) {
|
public Boolean uploadFile(MultipartFile multipartFile, String name, String type, String describe, String systemType) {
|
||||||
//通过封装好的文件工具类来传入文件和文件夹名称来获取文件路径
|
//通过封装好的文件工具类来传入文件和文件夹名称来获取文件路径
|
||||||
@@ -41,7 +51,7 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
|||||||
//创建对象
|
//创建对象
|
||||||
Resinformation resinformation = new Resinformation();
|
Resinformation resinformation = new Resinformation();
|
||||||
resinformation.setName(name);
|
resinformation.setName(name);
|
||||||
if (Objects.nonNull(describe)) {
|
if (StringUtils.isNotBlank(describe)) {
|
||||||
resinformation.setDescription(describe);
|
resinformation.setDescription(describe);
|
||||||
}
|
}
|
||||||
resinformation.setUrl(url);
|
resinformation.setUrl(url);
|
||||||
@@ -66,4 +76,55 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
|||||||
return this.page(new Page<>(baseParam.getPageNum(), baseParam.getPageSize())).getRecords();
|
return this.page(new Page<>(baseParam.getPageNum(), baseParam.getPageSize())).getRecords();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateFile(MultipartFile multipartFile, String id, String name, String type, String describe, String systemType) {
|
||||||
|
Resinformation resinformation = resourceAdministrationMapper.selectById(id);
|
||||||
|
//删除文件
|
||||||
|
fileStorageUtil.deleteFile(resinformation.getUrl());
|
||||||
|
//获取路径
|
||||||
|
String url = fileStorageUtil.uploadMultipart(multipartFile, OssPath.RESOURCEADMINISTRATION);
|
||||||
|
resinformation.setUrl(url);
|
||||||
|
resinformation.setName(name);
|
||||||
|
if (StringUtils.isNotBlank(describe)) {
|
||||||
|
resinformation.setDescription(describe);
|
||||||
|
}
|
||||||
|
//获取用户id
|
||||||
|
//String userIndex = RequestUtil.getUserIndex();
|
||||||
|
String userIndex = "123456";
|
||||||
|
resinformation.setUpdateUser(userIndex);
|
||||||
|
resinformation.setUpdateTime(LocalDateTime.now());
|
||||||
|
resinformation.setState(1);
|
||||||
|
resinformation.setSystemType(systemType);
|
||||||
|
resinformation.setType(type);
|
||||||
|
int i = resourceAdministrationMapper.updateById(resinformation);
|
||||||
|
return i > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteFile(String id) {
|
||||||
|
Resinformation resinformation = resourceAdministrationMapper.selectById(id);
|
||||||
|
//删除文件
|
||||||
|
fileStorageUtil.deleteFile(resinformation.getUrl());
|
||||||
|
//删除数据
|
||||||
|
int i = resourceAdministrationMapper.deleteById(id);
|
||||||
|
return i > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadFile(String id,HttpServletResponse response) throws IOException {
|
||||||
|
Resinformation resinformation = resourceAdministrationMapper.selectById(id);
|
||||||
|
//下载文件
|
||||||
|
fileStorageUtil.downloadStream(response,resinformation.getUrl());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportData() {
|
||||||
|
String fileName = "资源列表.csv";
|
||||||
|
//String targetDir = generalInfo.getBusinessTempPath() + File.separator + RequestUtil.getUserIndex();
|
||||||
|
String targetDir = "C:\\Users\\User\\Desktop\\1";
|
||||||
|
File excel = new File(targetDir, fileName);
|
||||||
|
List<ResinformationParam> list = resourceAdministrationMapper.listAll();
|
||||||
|
ExcelUtil.exportExcelWithTargetFile(excel, ResinformationParam.class, list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user