97 lines
3.2 KiB
Plaintext
97 lines
3.2 KiB
Plaintext
|
|
package com.sercurityControl.proteam.controller;
|
||
|
|
|
||
|
|
import com.github.pagehelper.PageHelper;
|
||
|
|
import com.github.pagehelper.PageInfo;
|
||
|
|
import com.securityControl.common.core.utils.aes.Aes;
|
||
|
|
import com.securityControl.common.core.utils.poi.ExcelUtil;
|
||
|
|
import com.securityControl.common.core.web.domain.AjaxResult;
|
||
|
|
import com.securityControl.common.log.annotation.Log;
|
||
|
|
import com.securityControl.common.log.enums.BusinessType;
|
||
|
|
import com.securityControl.common.log.enums.OperationType;
|
||
|
|
import com.sercurityControl.proteam.domain.ProData;
|
||
|
|
import com.sercurityControl.proteam.domain.WeekRiskEntity;
|
||
|
|
import com.sercurityControl.proteam.service.WeekRiskService;
|
||
|
|
import org.slf4j.Logger;
|
||
|
|
import org.slf4j.LoggerFactory;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
|
||
|
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
import java.util.HashMap;
|
||
|
|
import java.util.List;
|
||
|
|
import java.util.Map;
|
||
|
|
|
||
|
|
/**
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/pot/weekRisk/")
|
||
|
|
public class WeekRiskController {
|
||
|
|
|
||
|
|
private static final Logger log = LoggerFactory.getLogger(WeekRiskController.class);
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private WeekRiskService service;
|
||
|
|
|
||
|
|
@PostMapping("/getWeekRiskList")
|
||
|
|
@Log(title = "周风险管理", menu = "设备管理->周风险管理", businessType = BusinessType.QUERY, details = "周风险详情列表", grade = OperationType.QUERY_BUSINESS)
|
||
|
|
public Map<String,Object> getWeekRiskList(WeekRiskEntity weekRiskEntity) {
|
||
|
|
PageHelper.startPage(weekRiskEntity.getPage(), weekRiskEntity.getLimit());
|
||
|
|
List<WeekRiskEntity> deviceList = service.getWeekRiskList(weekRiskEntity);
|
||
|
|
PageInfo<WeekRiskEntity> pageInfo = new PageInfo<WeekRiskEntity>(deviceList);
|
||
|
|
System.out.println("输出分页后的数据:" + pageInfo.getList());
|
||
|
|
Map<String, Object> map = new HashMap<String, Object>(16);
|
||
|
|
map.put("code", 200);
|
||
|
|
map.put("msg", "");
|
||
|
|
map.put("count", pageInfo.getTotal());
|
||
|
|
map.put("curr", weekRiskEntity.getPage());
|
||
|
|
map.put("limit", weekRiskEntity.getLimit());
|
||
|
|
map.put("data", pageInfo.getList());
|
||
|
|
return map;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取工程下拉框
|
||
|
|
*
|
||
|
|
* @return 集合
|
||
|
|
*/
|
||
|
|
@PostMapping("/getProject")
|
||
|
|
public AjaxResult getProject(WeekRiskEntity entity) {
|
||
|
|
return service.getProject(entity);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 工程列表导出Pro
|
||
|
|
*
|
||
|
|
* @param weekRiskEntity 条件
|
||
|
|
* @return 集合
|
||
|
|
*/
|
||
|
|
@GetMapping("/exportProData")
|
||
|
|
@Log(title = "周风险详情", menu = "工程信息->周风险详情", businessType = BusinessType.EXPORT, details = "周风险详情导出", grade = OperationType.EXPORT_BUSINESS)
|
||
|
|
public void exportProData(HttpServletResponse response, WeekRiskEntity weekRiskEntity) {
|
||
|
|
List<WeekRiskEntity> list = service.getWeekRiskList(weekRiskEntity);
|
||
|
|
ExcelUtil<WeekRiskEntity> util = new ExcelUtil<WeekRiskEntity>(WeekRiskEntity.class);
|
||
|
|
util.exportExcel(response, list, "工程明细");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|