Merge branch 'develop_3' into 'develop_master'
Develop 3 See merge request LiuChao/foton-slrs-system-rest!282
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);
|
||||
}
|
||||
}
|
||||
+1
@@ -78,6 +78,7 @@ public class QualityEvaluationController extends BaseController<QualityEvaluatio
|
||||
qualityEvaluation.setLawId(form.getLawId()) ;
|
||||
qualityEvaluation.setUserId(form.getUserId()) ;
|
||||
qualityEvaluation.setEvaluationType(form.getEvaluationType());
|
||||
qualityEvaluation.setProcessNode(form.getProcessNode());
|
||||
|
||||
List<QualityEvaluation> evaluationForm = iQualityEvaluationService.getEvaluationForm(qualityEvaluation);
|
||||
|
||||
|
||||
+3
@@ -25,4 +25,7 @@ public class FormVO {
|
||||
|
||||
@ApiModelProperty("评分类型")
|
||||
private String evaluationType;
|
||||
|
||||
@ApiModelProperty("流程节点名称")
|
||||
private String processNode;
|
||||
}
|
||||
|
||||
+36
-2
@@ -72,7 +72,8 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
// Page<QualityEvaluation> page = new Page<>(query.getPage(), query.getPageSize());
|
||||
Page<QualityEvaluation> page = new Page<>(1, 20);
|
||||
//没有page和pageSize无法分页
|
||||
Page<QualityEvaluation> page = new Page<>(1, 100000);
|
||||
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
@@ -84,6 +85,9 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
if (query.getLawId()!=null){ //指定评价指标
|
||||
queryWrapper.eq("law_id",query.getLawId());
|
||||
}
|
||||
queryWrapper.eq("`index`.value_type","number");
|
||||
//sql计算每个用户的评分
|
||||
return qualityEvaluationDao.getHistory(page,queryWrapper);
|
||||
@@ -112,6 +116,10 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
if (query.getProcessNode()!=null && !"".equals(query.getProcessNode()) ){
|
||||
queryWrapper.eq("process_node",query.getProcessNode());
|
||||
}
|
||||
|
||||
return qualityEvaluationDao.getEvaluationForm(queryWrapper);
|
||||
}
|
||||
|
||||
@@ -140,9 +148,35 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
result.put("dynamic",0.0);
|
||||
result.put("quality",0.0);
|
||||
|
||||
|
||||
/**
|
||||
* 同一节点为多人评价时,需要取多人评价的平均分用以计算最终得分。
|
||||
* 各环节评分权重分别设置为30%、40%、30%,
|
||||
* 即:标准编写质量最终得分=征求意见会签人评价平均分*30%+技术委员会专家评价平均分*40%+标准法规工程师和标准法规部主管领导评价平均分*30%。
|
||||
*/
|
||||
result.putAll(list.stream()
|
||||
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||
Collectors.averagingDouble(item ->Double.valueOf(item.getScore()) ))));
|
||||
Collectors.averagingDouble(item ->{
|
||||
|
||||
Double score;
|
||||
switch (item.getProcessNode()){
|
||||
case "会签征求意见":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
case "技术委员会负责人/起草中心主任审核":
|
||||
score=Double.valueOf(item.getScore()) * 0.4;
|
||||
break;
|
||||
case "标准法规工程师复审":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
case "标准法规部部长审核":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
default: score=Double.valueOf(item.getScore());
|
||||
}
|
||||
|
||||
return score;
|
||||
} ))));
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -28,12 +28,12 @@ public class IssueTrackController {
|
||||
@PutMapping()
|
||||
@ApiOperation("新增重点标准跟踪清单项目")
|
||||
public ResponseMessage addIssueTrack(@RequestBody IssueTrack issueTrack){
|
||||
boolean b = issueTrackService.addIssueTrack(issueTrack);
|
||||
int b = issueTrackService.addIssueTrack(issueTrack);
|
||||
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
if (b>0){
|
||||
return Result.success("200","信息已存在,更新!", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
return Result.error("100","新增成功!", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class IssueTrackController {
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
return Result.error("100","标准或政策已存在", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ public class IssueTrack {
|
||||
@TableField("product_type")
|
||||
private String productType;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-mm-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@TableField("impl_time")
|
||||
private Date implTime;
|
||||
private String implTime;
|
||||
|
||||
@TableField("impl_require")
|
||||
private String implRequire;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import java.util.Map;
|
||||
|
||||
public interface IIssueTrackService {
|
||||
|
||||
public boolean addIssueTrack(IssueTrack obj);
|
||||
public int addIssueTrack(IssueTrack obj);
|
||||
|
||||
public boolean removeIssueTrack(List<String> idList);
|
||||
|
||||
|
||||
+14
-5
@@ -25,14 +25,22 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addIssueTrack(IssueTrack obj) {
|
||||
public int addIssueTrack(IssueTrack obj) {
|
||||
|
||||
QueryWrapper<IssueTrack> countWrapper = new QueryWrapper<>();
|
||||
countWrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag",0);
|
||||
int count = this.count(countWrapper);
|
||||
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId());
|
||||
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
this.saveOrUpdate(obj,wrapper);
|
||||
|
||||
return this.saveOrUpdate(obj,wrapper);
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
@@ -56,12 +64,13 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
@Override
|
||||
public boolean updateIssueTrack(IssueTrack obj) {
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId());
|
||||
wrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag","0")
|
||||
.ne("id",obj.getId());
|
||||
IssueTrack one = this.getOne(wrapper);
|
||||
if (one==null){
|
||||
if (one!=null){
|
||||
return false;
|
||||
}else {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.updateById(obj);
|
||||
}
|
||||
|
||||
+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();
|
||||
|
||||
+9
-2
@@ -184,7 +184,12 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
|
||||
for(TsResource resource:TsResources){
|
||||
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
// TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
/**
|
||||
* 没有把改节点查出
|
||||
*/
|
||||
TsResourceQueryWrapper.isNotNull("PARENT_ID");
|
||||
|
||||
if(StringUtils.isNotBlank(tsResource.getSorDivide())){
|
||||
TsResourceQueryWrapper.in("ID",getMenuIdList);
|
||||
}
|
||||
@@ -323,7 +328,9 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
* @return List<TsResource>
|
||||
*/
|
||||
private List<TsResource> recursionGetListChildrenStand(TsResource resource,List<TsResource> children){
|
||||
List<TsResource> tsResources = children.stream().filter(resource1 -> resource1.getParentId().equals(resource.getId())).collect(Collectors.toList());
|
||||
List<TsResource> tsResources = children.stream()
|
||||
.filter(resource1 -> resource1.getParentId().equals(resource.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(!tsResources.isEmpty()){
|
||||
tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList());
|
||||
tsResources.forEach(resource1 -> {
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
}
|
||||
}else {
|
||||
page.setOrderBy("ITEMS_NUM");
|
||||
page.setOrder("DESC");
|
||||
page.setOrder("ASC");
|
||||
}
|
||||
|
||||
//分页查询的总数
|
||||
|
||||
+3
-2
@@ -9,6 +9,7 @@ import com.adc.da.slrs.sarStandIssueControlProduct.entity.StandIssueControlProdu
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
@@ -148,11 +149,11 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
|
||||
// List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
List<WarningExportVO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
|
||||
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), StandWarningEO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
EasyExcel.write(response.getOutputStream(), WarningExportVO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(exportExcel);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandWarning.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -14,6 +15,6 @@ public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
|
||||
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
|
||||
|
||||
|
||||
List<StandWarningEO> exportWarning(@Param("idList") List<String> ids);
|
||||
List<WarningExportVO> exportWarning(@Param("idList") List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
+12
-7
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandWarning.entity;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -47,17 +48,19 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String standType;
|
||||
|
||||
@ExcelProperty("标准号")
|
||||
@ExcelProperty(value = "标准编号",index = 1)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("标准号")
|
||||
@TableField(exist = false)
|
||||
private String standCode;
|
||||
|
||||
@ExcelProperty("标准名称")
|
||||
@ExcelProperty(value = "标准名称",index = 2)
|
||||
@ColumnWidth(40)
|
||||
@ApiModelProperty("标准名称")
|
||||
@TableField(exist = false)
|
||||
private String standName;
|
||||
|
||||
@ExcelProperty("发布日期")
|
||||
@ExcelProperty(value = "发布日期",index = 5)
|
||||
@ApiModelProperty("发布日期")
|
||||
@TableField(exist = false)
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@@ -67,12 +70,12 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private Date lastTime;
|
||||
|
||||
@ExcelProperty("适用车型")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("适用车型")
|
||||
@TableField(exist = false)
|
||||
private String applyType;
|
||||
|
||||
@ExcelProperty("责任工程师")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("责任工程师")
|
||||
@TableField(exist = false)
|
||||
private String dutyEngineer;
|
||||
@@ -82,12 +85,14 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String itemsId;
|
||||
|
||||
@ExcelProperty("条款(分解单)编号")
|
||||
@ExcelProperty(value = "条款编号",index = 3)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("条款(分解单)编号")
|
||||
@TableField(exist = false)
|
||||
private String itemsNum;
|
||||
|
||||
@ExcelProperty("条款(分解单)名称")
|
||||
@ExcelProperty(value = "条款名称",index = 4)
|
||||
@ColumnWidth(40)
|
||||
@ApiModelProperty("条款(分解单)名称")
|
||||
@TableField(exist = false)
|
||||
private String itemsName;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WarningExportVO extends EarlyWarningEO {
|
||||
|
||||
|
||||
|
||||
@ExcelProperty(value = "实施日期",index = 6)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("实施日期")
|
||||
private String SSRQ;
|
||||
|
||||
|
||||
@ExcelProperty(value = "新车型实施日期",index = 7)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("新车型实施日期")
|
||||
private String XCXSSRQ;
|
||||
|
||||
@ExcelProperty(value = "在产车实施日期",index = 8)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("在产车实施日期")
|
||||
private String ZCCSSRQ;
|
||||
|
||||
@ExcelProperty(value = "类型",index = 0)
|
||||
@ApiModelProperty("标准类别显示")
|
||||
private String standTypeShow;
|
||||
|
||||
@ExcelProperty(value = "适用车型",index = 9)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("适用车型展示")
|
||||
private String applyTypeShow;
|
||||
|
||||
|
||||
}
|
||||
+2
-1
@@ -4,6 +4,7 @@ package com.adc.da.slrs.sarStandWarning.service;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -22,5 +23,5 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
|
||||
|
||||
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
|
||||
|
||||
List<StandWarningEO> getExportExcel(WarningExcelVO excelVO);
|
||||
List<WarningExportVO> getExportExcel(WarningExcelVO excelVO);
|
||||
}
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@ import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -120,8 +121,8 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<StandWarningEO> getExportExcel(WarningExcelVO excelVO){
|
||||
List<StandWarningEO> standWarningEOList = earlyWarningEODao.exportWarning( excelVO.getIds());
|
||||
public List<WarningExportVO> getExportExcel(WarningExcelVO excelVO){
|
||||
List<WarningExportVO> standWarningEOList = earlyWarningEODao.exportWarning( excelVO.getIds());
|
||||
// IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, null);
|
||||
|
||||
return standWarningEOList;
|
||||
|
||||
Reference in New Issue
Block a user