资料中心
This commit is contained in:
+92
@@ -0,0 +1,92 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "资料中心")
|
||||
@RequestMapping("/fileMaterialCenter/file-material")
|
||||
public class FileMaterialController extends BaseController<FileMaterial> {
|
||||
|
||||
@Autowired
|
||||
IFileMaterialService iFileMaterialService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增文件资料组")
|
||||
public ResponseMessage addFileMaterial(FileMaterial material){
|
||||
boolean save = iFileMaterialService.save(material);
|
||||
|
||||
return Result.success(save);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除文件资料组")
|
||||
public ResponseMessage deleteMaterial(String id){
|
||||
List<String> idList = Arrays.asList(id.split(id));
|
||||
boolean b = iFileMaterialService.removeByIds(idList);
|
||||
|
||||
return Result.success(b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询文件资料组")
|
||||
public ResponseMessage<IPage<FileMaterial>> getFileMaterial(FileMaterialPage queryPage){
|
||||
IPage<FileMaterial> fileMaterial = iFileMaterialService.getFileMaterial(queryPage);
|
||||
|
||||
return Result.success(fileMaterial);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改文件资料组")
|
||||
public ResponseMessage updateFileMaterial(FileMaterial fileMaterial){
|
||||
boolean b = iFileMaterialService.updateById(fileMaterial);
|
||||
|
||||
return Result.success(b);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/type")
|
||||
@ApiOperation("获取类型")
|
||||
public ResponseMessage<List<String>> getFileMaterialType(){
|
||||
List<String> fileMaterialType = iFileMaterialService.getFileMaterialType();
|
||||
|
||||
return Result.success(fileMaterialType);
|
||||
}
|
||||
|
||||
@PutMapping("/topping")
|
||||
@ApiModelProperty("置顶")
|
||||
public ResponseMessage topping(String id){
|
||||
int topping = iFileMaterialService.topping(id);
|
||||
|
||||
return Result.success(topping);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.dao;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
public interface FileMaterialDao extends BaseMapper<FileMaterial> {
|
||||
|
||||
|
||||
int topping(@Param("id") String id);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.Tag;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="FileMaterial对象", description="")
|
||||
public class FileMaterial extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
@TableField("data_type")
|
||||
private String dataType;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
@TableField("data_title")
|
||||
private String dataTitle;
|
||||
|
||||
@ApiModelProperty(value = "上传时间")
|
||||
@TableField("data_upload_time")
|
||||
private Date dataUploadTime;
|
||||
|
||||
@ApiModelProperty(value = "文件id")
|
||||
@TableField("attach_file_id")
|
||||
private String attachFileId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "点击量")
|
||||
@TableField("click_count")
|
||||
private Integer clickCount;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "置顶")
|
||||
@TableField("is_top")
|
||||
private Integer isTop;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhaokaiyao
|
||||
*/
|
||||
@Data
|
||||
public class FileMaterialPage {
|
||||
|
||||
private String dataTitle;
|
||||
|
||||
private String dataType;
|
||||
|
||||
private String startDataUploadTime;
|
||||
|
||||
private String endDataUploadTime;
|
||||
|
||||
|
||||
private Integer page;
|
||||
|
||||
private Integer pageSize;
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.service;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javafx.scene.paint.Material;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
public interface IFileMaterialService extends IService<FileMaterial> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询文件资料组
|
||||
* @param queryPage
|
||||
* @return
|
||||
*/
|
||||
IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage);
|
||||
|
||||
|
||||
/**
|
||||
* 获取类型
|
||||
* @return
|
||||
*/
|
||||
List<String> getFileMaterialType();
|
||||
|
||||
/**
|
||||
* 置顶
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int topping(String id);
|
||||
|
||||
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.service.impl;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.dao.FileMaterialDao;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.management.Query;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@Service
|
||||
public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMaterial> implements IFileMaterialService {
|
||||
|
||||
@Autowired
|
||||
FileMaterialDao fileMaterialDao;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage) {
|
||||
|
||||
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (queryPage.getDataType()!=null){
|
||||
queryWrapper.eq("data_type",queryPage.getDataTitle());
|
||||
}
|
||||
|
||||
if (queryPage.getDataTitle()!=null){
|
||||
queryWrapper.like("data_title",queryPage.getDataTitle());
|
||||
}
|
||||
|
||||
if (queryPage.getStartDataUploadTime()!=null && queryPage.getEndDataUploadTime()!=null){
|
||||
|
||||
|
||||
String strDateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
|
||||
queryWrapper.between("data_upload_time",
|
||||
sdf.format(queryPage.getStartDataUploadTime()),
|
||||
sdf.format(queryPage.getEndDataUploadTime()));
|
||||
}
|
||||
|
||||
return this.page(new Page<>(queryPage.getPage(),queryPage.getPageSize()),queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getFileMaterialType() {
|
||||
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.select("data_type");
|
||||
return this.listObjs(queryWrapper, item -> item.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int topping(String id) {
|
||||
return fileMaterialDao.topping(id);
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -194,6 +194,8 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
@GetMapping(value = "/exportStandardsInfoExcel")
|
||||
public void exportStandardsInfoExcel(String exportContent, String exportType, String exportName,String userId, HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
@@ -204,7 +206,7 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
|
||||
response.setContentType("application/force-download");
|
||||
// 导出所有数据
|
||||
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
// List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
workbook = LawsStandExportUtil.exportDatas(data);
|
||||
|
||||
os = response.getOutputStream();
|
||||
|
||||
Reference in New Issue
Block a user