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 getWeekRiskList(WeekRiskEntity weekRiskEntity) { PageHelper.startPage(weekRiskEntity.getPage(), weekRiskEntity.getLimit()); List deviceList = service.getWeekRiskList(weekRiskEntity); PageInfo pageInfo = new PageInfo(deviceList); System.out.println("输出分页后的数据:" + pageInfo.getList()); Map map = new HashMap(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 list = service.getWeekRiskList(weekRiskEntity); ExcelUtil util = new ExcelUtil(WeekRiskEntity.class); util.exportExcel(response, list, "工程明细"); } }