在线编辑日志记录 测试
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.OnlineFileLog.controller;
|
||||
|
||||
import com.adc.da.slrs.OnlineFileLog.service.OnlineFileLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/OnlineFileLog")
|
||||
@Api(description = "|OnlineFileLog|")
|
||||
public class OnlineFileLogController {
|
||||
|
||||
@Autowired
|
||||
private OnlineFileLogService onlineFileLogService;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.adc.da.slrs.OnlineFileLog.dao;
|
||||
|
||||
import com.adc.da.slrs.OnlineFileLog.entity.OnlineFileLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface OnlineFileLogDao extends BaseMapper<OnlineFileLog> {
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.adc.da.slrs.OnlineFileLog.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("online_file_log")
|
||||
@ApiModel(value="OnlineFileLog对象", description="")
|
||||
@Data
|
||||
public class OnlineFileLog extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@TableField("HIS_ID")
|
||||
@ApiModelProperty(value = "在线编辑工作流的id")
|
||||
private String hisId;
|
||||
|
||||
@TableField("ATT_FILE_ID")
|
||||
@ApiModelProperty(value = "新文件存储的id")
|
||||
private String attFileId;
|
||||
|
||||
@TableField("FILE_NAME")
|
||||
@ApiModelProperty(value = "新名称")
|
||||
private String fileName;
|
||||
|
||||
@TableField("OLD_FILE_NAME")
|
||||
@ApiModelProperty(value = "老名称")
|
||||
private String oLdFileName;
|
||||
|
||||
@TableField("FILE_SUFFIX")
|
||||
@ApiModelProperty(value = "后缀")
|
||||
private String fileSuffix;
|
||||
|
||||
@TableField("FILE_PATH")
|
||||
@ApiModelProperty(value = "路径")
|
||||
private String filePath;
|
||||
|
||||
@TableField("COUNT")
|
||||
@ApiModelProperty(value = "计数")
|
||||
private Integer count;
|
||||
|
||||
@TableField("CREATE_TIME")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@TableField("UPDATE_TIME")
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private String validFlag;
|
||||
|
||||
//跨服io流转换
|
||||
@TableField(exist = false)
|
||||
private byte[] bytes;
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.adc.da.slrs.OnlineFileLog.service;
|
||||
|
||||
import com.adc.da.slrs.OnlineFileLog.entity.OnlineFileLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface OnlineFileLogService extends IService<OnlineFileLog> {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.slrs.OnlineFileLog.service.impl;
|
||||
|
||||
import com.adc.da.slrs.OnlineFileLog.dao.OnlineFileLogDao;
|
||||
import com.adc.da.slrs.OnlineFileLog.entity.OnlineFileLog;
|
||||
import com.adc.da.slrs.OnlineFileLog.service.OnlineFileLogService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class OnlineFileLogServiceImpl extends ServiceImpl<OnlineFileLogDao, OnlineFileLog> implements OnlineFileLogService {
|
||||
|
||||
}
|
||||
+41
@@ -20,6 +20,8 @@ import com.adc.da.search.entity.StandLawsEO;
|
||||
import com.adc.da.search.service.StandLawsSearchService;
|
||||
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||
import com.adc.da.slrs.NewsFeed.service.INewsFeedService;
|
||||
import com.adc.da.slrs.OnlineFileLog.dao.OnlineFileLogDao;
|
||||
import com.adc.da.slrs.OnlineFileLog.entity.OnlineFileLog;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanDao;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanLogDao;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
@@ -282,6 +284,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
@Autowired
|
||||
private SarBussionessStandStateDao sarBussionessStandStateDao;
|
||||
|
||||
@Autowired
|
||||
private OnlineFileLogDao onlineFileLogDao;
|
||||
|
||||
@Override
|
||||
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
||||
SarBussionessStand bussionessStand = new SarBussionessStand();
|
||||
@@ -1443,6 +1448,42 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListBuss != null && InitStandAttrUtil.fileFieldListBuss.size() > 0 && InitStandAttrUtil.fileFieldListBuss.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
String onFileId = "";
|
||||
String fileId = "";
|
||||
String[] split = value.split(",");
|
||||
for (String id : split) {
|
||||
if (id.contains("ATT_FILE")) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(fileId)) {
|
||||
fileId = fileId + "," + id;
|
||||
} else {
|
||||
fileId = id;
|
||||
}
|
||||
} else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(onFileId)) {
|
||||
onFileId = onFileId + "," + id;
|
||||
} else {
|
||||
onFileId = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
String officeFileIds = "";
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(onFileId)){
|
||||
String[] splitOn = onFileId.split(",");
|
||||
for (String idOn: splitOn){
|
||||
QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapper = new QueryWrapper<>();
|
||||
onlineFileLogQueryWrapper.eq("HIS_ID",idOn);
|
||||
onlineFileLogQueryWrapper.orderByDesc("CREATE_TIME");
|
||||
List<OnlineFileLog> onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogQueryWrapper);
|
||||
if(!onlineFileLogs.isEmpty()){
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(officeFileIds)){
|
||||
officeFileIds = officeFileIds+","+onlineFileLogs.get(0).getAttFileId();
|
||||
}else {
|
||||
officeFileIds = onlineFileLogs.get(0).getAttFileId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
value = fileId+","+officeFileIds;
|
||||
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfosOrderByDateDesc(value);
|
||||
entry.setValue(fileObj);
|
||||
}
|
||||
|
||||
+133
-135
@@ -6,10 +6,8 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandIssueControlProduct.entity.SarStandIssueControlProduct;
|
||||
import com.adc.da.slrs.sarStandIssueControlProduct.entity.StandIssueControlProductExcelVO;
|
||||
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;
|
||||
@@ -31,144 +29,144 @@ import java.util.*;
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/sys/EarlyWarning")
|
||||
@Api(tags = "sarStandWarning")
|
||||
public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
public class EarlyWarningEOController {
|
||||
@Resource
|
||||
private EarlyWarningEOServiceImpl earlyWarningEOService;
|
||||
/**
|
||||
*
|
||||
* @param newStandPage
|
||||
* @param newStandPageSize
|
||||
* @param oldStandPage
|
||||
* @param oldStandPageSize
|
||||
* @param newItemsPage
|
||||
* @param newItemsPageSize
|
||||
* @param oldItemsPage
|
||||
* @param oldItemsPageSize
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-06-15
|
||||
**/
|
||||
@GetMapping("/${restPath}/StandWarning")
|
||||
@ApiOperation("标准预警查询")
|
||||
public ResponseMessage newPageInfo(@RequestParam(defaultValue = "1", value = "newStandPage")int newStandPage, @RequestParam(defaultValue = "10", value = "newStandPageSize") int newStandPageSize,
|
||||
@RequestParam(defaultValue = "1", value = "oldStandPage")int oldStandPage, @RequestParam(defaultValue = "10", value = "oldStandPageSize") int oldStandPageSize,
|
||||
@RequestParam(defaultValue = "1", value = "newItemsPage")int newItemsPage, @RequestParam(defaultValue = "10", value = "newItemsPageSize") int newItemsPageSize,
|
||||
@RequestParam(defaultValue = "1", value = "oldItemsPage")int oldItemsPage, @RequestParam(defaultValue = "10", value = "oldItemsPageSize") int oldItemsPageSize,EarlyWarningEO earlyWarningEO) {
|
||||
IPage<EarlyWarningEO> list1 = earlyWarningEOService.newStandQuery(newStandPage,newStandPageSize,earlyWarningEO);//新车标准预警
|
||||
IPage<EarlyWarningEO> list2 = earlyWarningEOService.oldStandQuery(oldStandPage,oldStandPageSize,earlyWarningEO);//在产车标准预警
|
||||
IPage<EarlyWarningEO> list3 = earlyWarningEOService.newItemsQuery(newItemsPage,newItemsPageSize,earlyWarningEO);//新车条款预警
|
||||
IPage<EarlyWarningEO> list4 = earlyWarningEOService.oldItemsQuery(oldItemsPage,oldItemsPageSize,earlyWarningEO);//在产车条款预警
|
||||
return getResponseMessage(list1, list2, list3, list4);
|
||||
}
|
||||
|
||||
@GetMapping("/getStandWarning")
|
||||
@ApiOperation("标准预警查询")
|
||||
public ResponseMessage<IPage<StandWarningEO>> getStandWaring(StandWarningEO queryPageEO){
|
||||
IPage<StandWarningEO> standWarning = earlyWarningEOService.getStandWarning(queryPageEO);
|
||||
standWarning.getRecords().forEach(item->{
|
||||
|
||||
Optional.ofNullable(item.getSSRQ())
|
||||
.ifPresent(SSRQ -> item.setSSRQ(item.getSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
Optional.ofNullable(item.getXCXSSRQ())
|
||||
.ifPresent(SSRQ ->item.setXCXSSRQ(item.getXCXSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
Optional.ofNullable(item.getZCCSSRQ())
|
||||
.ifPresent(SSRQ ->item.setZCCSSRQ(item.getZCCSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
|
||||
});
|
||||
return Result.success(standWarning);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ResponseMessage getResponseMessage(IPage<EarlyWarningEO> list1, IPage<EarlyWarningEO> list2, IPage<EarlyWarningEO> list3, IPage<EarlyWarningEO> list4) {
|
||||
List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("newStand", list1);
|
||||
map.put("oldStand", list2);
|
||||
map.put("newItems", list3);
|
||||
map.put("oldItems", list4);
|
||||
listMap .add(map);
|
||||
return Result.success("200",listMap);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-06-15
|
||||
**/
|
||||
@GetMapping("/ChangePermissions")
|
||||
@ApiOperation("取消预警")
|
||||
public ResponseMessage ChangePermissions(String id) {
|
||||
String power = earlyWarningEOService.ChangePermissions(id);
|
||||
return Result.success("200",power);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param newPolicyPage
|
||||
* @param newPolicyPageSize
|
||||
* @param oldPolicyPage
|
||||
* @param oldPolicyPageSize
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-06-15
|
||||
**/
|
||||
@GetMapping("/PolicyWarning")
|
||||
@ApiOperation("政策预警查询")
|
||||
public ResponseMessage newPolicyPageInfo(@RequestParam(defaultValue = "1", value = "newPolicyPage")int newPolicyPage, @RequestParam(defaultValue = "10", value = "newPolicyPageSize") int newPolicyPageSize,
|
||||
@RequestParam(defaultValue = "1", value = "oldPolicyPage")int oldPolicyPage, @RequestParam(defaultValue = "10", value = "oldPolicyPageSize") int oldPolicyPageSize) {
|
||||
IPage<EarlyWarningEO> list1 = earlyWarningEOService.newPolicyQuery(newPolicyPage,newPolicyPageSize);
|
||||
IPage<EarlyWarningEO> list2 = earlyWarningEOService.oldPolicyQuery(oldPolicyPage,oldPolicyPageSize);
|
||||
List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("newPolicy", list1);
|
||||
map.put("oldPolicy", list2);
|
||||
System.out.println(map);
|
||||
listMap .add(map);
|
||||
System.out.println(listMap);
|
||||
return Result.success("200",listMap);
|
||||
}
|
||||
// /**
|
||||
// *
|
||||
// * @param newStandPage
|
||||
// * @param newStandPageSize
|
||||
// * @param oldStandPage
|
||||
// * @param oldStandPageSize
|
||||
// * @param newItemsPage
|
||||
// * @param newItemsPageSize
|
||||
// * @param oldItemsPage
|
||||
// * @param oldItemsPageSize
|
||||
// * @return
|
||||
// * @author zj
|
||||
// * date 2021-06-15
|
||||
// **/
|
||||
// @GetMapping("/${restPath}/StandWarning")
|
||||
// @ApiOperation("标准预警查询")
|
||||
// public ResponseMessage newPageInfo(@RequestParam(defaultValue = "1", value = "newStandPage")int newStandPage, @RequestParam(defaultValue = "10", value = "newStandPageSize") int newStandPageSize,
|
||||
// @RequestParam(defaultValue = "1", value = "oldStandPage")int oldStandPage, @RequestParam(defaultValue = "10", value = "oldStandPageSize") int oldStandPageSize,
|
||||
// @RequestParam(defaultValue = "1", value = "newItemsPage")int newItemsPage, @RequestParam(defaultValue = "10", value = "newItemsPageSize") int newItemsPageSize,
|
||||
// @RequestParam(defaultValue = "1", value = "oldItemsPage")int oldItemsPage, @RequestParam(defaultValue = "10", value = "oldItemsPageSize") int oldItemsPageSize,EarlyWarningEO earlyWarningEO) {
|
||||
// IPage<EarlyWarningEO> list1 = earlyWarningEOService.newStandQuery(newStandPage,newStandPageSize,earlyWarningEO);//新车标准预警
|
||||
// IPage<EarlyWarningEO> list2 = earlyWarningEOService.oldStandQuery(oldStandPage,oldStandPageSize,earlyWarningEO);//在产车标准预警
|
||||
// IPage<EarlyWarningEO> list3 = earlyWarningEOService.newItemsQuery(newItemsPage,newItemsPageSize,earlyWarningEO);//新车条款预警
|
||||
// IPage<EarlyWarningEO> list4 = earlyWarningEOService.oldItemsQuery(oldItemsPage,oldItemsPageSize,earlyWarningEO);//在产车条款预警
|
||||
// return getResponseMessage(list1, list2, list3, list4);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/getStandWarning")
|
||||
// @ApiOperation("标准预警查询")
|
||||
// public ResponseMessage<IPage<StandWarningEO>> getStandWaring(StandWarningEO queryPageEO){
|
||||
// IPage<StandWarningEO> standWarning = earlyWarningEOService.getStandWarning(queryPageEO);
|
||||
// standWarning.getRecords().forEach(item->{
|
||||
//
|
||||
// Optional.ofNullable(item.getSSRQ())
|
||||
// .ifPresent(SSRQ -> item.setSSRQ(item.getSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
// Optional.ofNullable(item.getXCXSSRQ())
|
||||
// .ifPresent(SSRQ ->item.setXCXSSRQ(item.getXCXSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
// Optional.ofNullable(item.getZCCSSRQ())
|
||||
// .ifPresent(SSRQ ->item.setZCCSSRQ(item.getZCCSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
//
|
||||
// });
|
||||
// return Result.success(standWarning);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// private ResponseMessage getResponseMessage(IPage<EarlyWarningEO> list1, IPage<EarlyWarningEO> list2, IPage<EarlyWarningEO> list3, IPage<EarlyWarningEO> list4) {
|
||||
// List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
|
||||
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
// map.put("newStand", list1);
|
||||
// map.put("oldStand", list2);
|
||||
// map.put("newItems", list3);
|
||||
// map.put("oldItems", list4);
|
||||
// listMap .add(map);
|
||||
// return Result.success("200",listMap);
|
||||
// }
|
||||
// /**
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// * @author zj
|
||||
// * date 2021-06-15
|
||||
// **/
|
||||
// @GetMapping("/ChangePermissions")
|
||||
// @ApiOperation("取消预警")
|
||||
// public ResponseMessage ChangePermissions(String id) {
|
||||
// String power = earlyWarningEOService.ChangePermissions(id);
|
||||
// return Result.success("200",power);
|
||||
// }
|
||||
// /**
|
||||
// *
|
||||
// * @param newPolicyPage
|
||||
// * @param newPolicyPageSize
|
||||
// * @param oldPolicyPage
|
||||
// * @param oldPolicyPageSize
|
||||
// * @return
|
||||
// * @author zj
|
||||
// * date 2021-06-15
|
||||
// **/
|
||||
// @GetMapping("/PolicyWarning")
|
||||
// @ApiOperation("政策预警查询")
|
||||
// public ResponseMessage newPolicyPageInfo(@RequestParam(defaultValue = "1", value = "newPolicyPage")int newPolicyPage, @RequestParam(defaultValue = "10", value = "newPolicyPageSize") int newPolicyPageSize,
|
||||
// @RequestParam(defaultValue = "1", value = "oldPolicyPage")int oldPolicyPage, @RequestParam(defaultValue = "10", value = "oldPolicyPageSize") int oldPolicyPageSize) {
|
||||
// IPage<EarlyWarningEO> list1 = earlyWarningEOService.newPolicyQuery(newPolicyPage,newPolicyPageSize);
|
||||
// IPage<EarlyWarningEO> list2 = earlyWarningEOService.oldPolicyQuery(oldPolicyPage,oldPolicyPageSize);
|
||||
// List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
|
||||
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
// map.put("newPolicy", list1);
|
||||
// map.put("oldPolicy", list2);
|
||||
// System.out.println(map);
|
||||
// listMap .add(map);
|
||||
// System.out.println(listMap);
|
||||
// return Result.success("200",listMap);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/exportWarning")
|
||||
@ApiOperation("导出预警")
|
||||
public void exportStandardsInfoExcel(WarningExcelVO excelVO, HttpServletResponse response) throws Exception {
|
||||
|
||||
|
||||
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
||||
if(excelVO.getExportName()==null){
|
||||
excelVO.setExportName("标准预警");
|
||||
}
|
||||
String fileName = URLEncoder.encode(excelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
|
||||
// List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
List<WarningExportVO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
for (WarningExportVO warningExportVO : exportExcel){
|
||||
String condition = warningExportVO.getTermsConditions();
|
||||
if (condition != null && condition.length() > 32001){
|
||||
condition = condition.substring(0,32000);
|
||||
warningExportVO.setTermsConditions(condition);
|
||||
}
|
||||
}
|
||||
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), WarningExportVO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(exportExcel);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
// 重置response
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.getWriter().println(JSON.toJSONString(Result.error()));
|
||||
}
|
||||
}
|
||||
// @GetMapping("/exportWarning")
|
||||
// @ApiOperation("导出预警")
|
||||
// public void exportStandardsInfoExcel(WarningExcelVO excelVO, HttpServletResponse response) throws Exception {
|
||||
//
|
||||
//
|
||||
// // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||
// try {
|
||||
// response.setContentType("application/vnd.ms-excel");
|
||||
// response.setCharacterEncoding("utf-8");
|
||||
// // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
||||
// if(excelVO.getExportName()==null){
|
||||
// excelVO.setExportName("标准预警");
|
||||
// }
|
||||
// String fileName = URLEncoder.encode(excelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
||||
// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
//
|
||||
//// List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
// List<WarningExportVO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
// for (WarningExportVO warningExportVO : exportExcel){
|
||||
// String condition = warningExportVO.getTermsConditions();
|
||||
// if (condition != null && condition.length() > 32001){
|
||||
// condition = condition.substring(0,32000);
|
||||
// warningExportVO.setTermsConditions(condition);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 这里需要设置不关闭流
|
||||
// EasyExcel.write(response.getOutputStream(), WarningExportVO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
// .doWrite(exportExcel);
|
||||
// } catch (Exception e) {
|
||||
// System.out.println(e);
|
||||
// // 重置response
|
||||
// response.reset();
|
||||
// response.setContentType("application/json");
|
||||
// response.setCharacterEncoding("utf-8");
|
||||
// response.getWriter().println(JSON.toJSONString(Result.error()));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
-10
@@ -292,11 +292,6 @@ public class SarStandardComplianceAssessResultController {
|
||||
iPage.setTotal(datasCount);
|
||||
iPage.setRecords(standards);
|
||||
while (iPage.getRecords().remove(null)) ;
|
||||
if(StringUtils.isNotBlank(eo.getOrder())){
|
||||
if(eo.getOrder().equals("desc")){
|
||||
iPage.getRecords().sort((m1,m2)-> m2.getSpecificItem().compareTo(m1.getSpecificItem()));
|
||||
}
|
||||
}
|
||||
return Result.success(iPage);
|
||||
} else {
|
||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
@@ -312,11 +307,6 @@ public class SarStandardComplianceAssessResultController {
|
||||
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
|
||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||
while (page.getRecords().remove(null)) ;
|
||||
if(StringUtils.isNotBlank(eo.getOrder())){
|
||||
if(eo.getOrder().equals("desc")){
|
||||
iPage.getRecords().sort((m1,m2)-> m2.getSpecificItem().compareTo(m1.getSpecificItem()));
|
||||
}
|
||||
}
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
|
||||
+41
@@ -6,6 +6,8 @@ import com.adc.da.person.entity.StandInfo;
|
||||
import com.adc.da.person.entity.TsPersonCollect;
|
||||
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||
import com.adc.da.slrs.NewsFeed.service.INewsFeedService;
|
||||
import com.adc.da.slrs.OnlineFileLog.dao.OnlineFileLogDao;
|
||||
import com.adc.da.slrs.OnlineFileLog.entity.OnlineFileLog;
|
||||
import com.adc.da.slrs.regulations.dao.StandDataDao;
|
||||
import com.adc.da.slrs.regulations.entity.SearchStandContext;
|
||||
import com.adc.da.slrs.regulations.entity.StandData;
|
||||
@@ -263,6 +265,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Autowired
|
||||
private EncryptFileUtils encryptFileUtils;
|
||||
|
||||
@Autowired
|
||||
private OnlineFileLogDao onlineFileLogDao;
|
||||
|
||||
|
||||
// /**
|
||||
// * 反向操作标准
|
||||
@@ -937,6 +942,42 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
if (entry.getValue() != null && InitStandAttrUtil.fileFieldList != null && InitStandAttrUtil.fileFieldList.size() > 0 && InitStandAttrUtil.fileFieldList.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
String onFileId = "";
|
||||
String fileId = "";
|
||||
String[] split = value.split(",");
|
||||
for (String id : split) {
|
||||
if (id.contains("ATT_FILE")) {
|
||||
if (StringUtils.isNotBlank(fileId)) {
|
||||
fileId = fileId + "," + id;
|
||||
} else {
|
||||
fileId = id;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(onFileId)) {
|
||||
onFileId = onFileId + "," + id;
|
||||
} else {
|
||||
onFileId = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
String officeFileIds = "";
|
||||
if(StringUtils.isNotBlank(onFileId)){
|
||||
String[] splitOn = onFileId.split(",");
|
||||
for (String idOn: splitOn){
|
||||
QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapper = new QueryWrapper<>();
|
||||
onlineFileLogQueryWrapper.eq("HIS_ID",idOn);
|
||||
onlineFileLogQueryWrapper.orderByDesc("CREATE_TIME");
|
||||
List<OnlineFileLog> onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogQueryWrapper);
|
||||
if(!onlineFileLogs.isEmpty()){
|
||||
if(StringUtils.isNotBlank(officeFileIds)){
|
||||
officeFileIds = officeFileIds+","+onlineFileLogs.get(0).getAttFileId();
|
||||
}else {
|
||||
officeFileIds = onlineFileLogs.get(0).getAttFileId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
value = fileId+","+officeFileIds;
|
||||
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfosOrderByDateDesc(value);
|
||||
entry.setValue(fileObj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user