Commit 2a7def09 authored by wanghao's avatar wanghao

1 大屏端全局搜索调整

2 根据不同角色 动态导出不同字段功能研究实现。-在老旧管网改造上已调整。
parent 7cfa8945
......@@ -64,7 +64,9 @@ public class TPipeOldPlanProcessController extends BaseController
{
List<TPipeOldPlanProcess> list = tPipeOldPlanProcessService.exportTPipeOldPlanProcessList(tPipeOldPlanProcess);
ExcelUtil<TPipeOldPlanProcess> util = new ExcelUtil<TPipeOldPlanProcess>(TPipeOldPlanProcess.class);
return util.exportExcel(list, "老旧管网-改造计划和进度数据");
AjaxResult ajaxResult = util.exportExcel(list, "老旧管网-改造计划和进度数据");
ExcelUtil.hiddencolumns.clear();
return ajaxResult;
}
/**
......
......@@ -19,6 +19,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import org.apache.commons.collections4.bag.SynchronizedSortedBag;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
......@@ -110,6 +111,10 @@ public class ExcelUtil<T>
*/
public Class<T> clazz;
/**
* 隐藏的列号
*/
public static ArrayList<Integer> hiddencolumns = new ArrayList<>();
public ExcelUtil(Class<T> clazz)
{
this.clazz = clazz;
......@@ -368,6 +373,11 @@ public class ExcelUtil<T>
}
String filename = encodingFilename(sheetName);
out = new FileOutputStream(getAbsoluteFile(filename));
if(hiddencolumns != null && hiddencolumns.size() > 0) {
for (Integer hiddencolumn : hiddencolumns) {
this.sheet.setColumnHidden(hiddencolumn,true);
}
}
wb.write(out);
return AjaxResult.success(filename);
}
......
......@@ -124,10 +124,12 @@ public class TPipeOldPlanProcess extends BaseEntity
* 政府端上传数据
*/
/** 是否已上传,1-是,0-否 */
@Excel(name = " 上传状态",readConverterExp = "1=已上传,0=未上传")
private String govUploadState;
/** 政府端上传时间,yyyy-MM-dd hh:mm:ss */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = " 上传时间")
private Date govUploadTime;
public String getEnterpriseName() {
......
......@@ -7,6 +7,7 @@ import com.zehong.common.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.GovernmentDataUtil;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.ServletUtils;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.utils.uuid.IdUtils;
import com.zehong.system.domain.TPipeOldPlanProcess;
import com.zehong.system.domain.vo.TPipeOldPlanProcessVo;
......@@ -83,9 +84,13 @@ public class TPipeOldPlanProcessServiceImpl implements ITPipeOldPlanProcessServi
List<TPipeOldPlanProcess> tPipeOldPlanProcesses = tPipeOldPlanProcessMapper.exportPipeOldPlanProcessList(tPipeOldPlanProcess);
if(loginUser.getUser().getRoles().get(0).getRoleId()==3){
if(tPipeOldPlanProcesses.size() > 0) {
return tPipeOldPlanProcesses.stream().peek(TPipeOldPlanProcess::updateFields).collect(Collectors.toList());
}
ExcelUtil.hiddencolumns.add(13);
ExcelUtil.hiddencolumns.add(14);
}
if (loginUser.getUser().getRoles().get(0).getRoleId()==5) {
ExcelUtil.hiddencolumns.add(15);
ExcelUtil.hiddencolumns.add(16);
}
return tPipeOldPlanProcesses;
......
......@@ -135,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where b2.is_del = '0' and b3.is_del = '0' ) b
group by b.user_id,b.detector_type
) t2 on t2.userId = t1.userId where <if test="name != null and name != ''"> t1.nickName like concat('%', #{name}, '%')</if> UNION
) t2 on t2.userId = t1.userId <if test="name != null and name != ''"> where t1.nickName like concat('%', #{name}, '%')</if> UNION
SELECT
video_manager_id AS id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment