| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.common.manager.CommonManager; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RespCodeEnum; |
| | | import com.fzzy.igds.constant.WarnType; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.domain.Company; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.domain.EventInfo; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.security.manager.EventInfoManager; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | */ |
| | | @GetMapping |
| | | public String getEventInfo(@RequestParam(value = "viewType", required = false) String viewType, Model model) { |
| | | //获取当前登录人 |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | //获取公司数据 |
| | | List<Company> companies = commonManager.listCompanyData(); |
| | | String defaultCompany = "" ; |
| | | if (companies != null && !companies.isEmpty()) { |
| | | defaultCompany = companies.get(0).getId(); |
| | | } |
| | | //获取库区数据 |
| | | List<Dept> depts = new ArrayList<>() ; |
| | | String defaultDeptId = "" ; |
| | | if (Constant.USER_TYPE_30.equals(user.getUserType())) { |
| | | depts=commonManager.listDeptData(null); |
| | | defaultDeptId=user.getDeptId() + ""; |
| | | }else{ |
| | | depts=commonManager.listDeptData(defaultCompany); |
| | | //在首位添加所有选项 |
| | | Dept all = new Dept(); |
| | | all.setId(""); |
| | | all.setKqmc("所有"); |
| | | depts.add(0, all); |
| | | } |
| | | IgdsBaseParam param = new IgdsBaseParam(); |
| | | param.setPage(1); |
| | | param.setLimit(6); |
| | | param.setKey(defaultCompany); |
| | | param.setDeptId(defaultDeptId); |
| | | Page<EventInfo> events = eventInfoManager.pageData(param); |
| | | model.addAttribute("eventInfoList", events.getRecords()); |
| | | model.addAttribute("currentPage", events.getCurrent()); |
| | |
| | | //设备数据 |
| | | model.addAttribute("cameraList", commonManager.listCameraData()); |
| | | //库区数据 |
| | | model.addAttribute("deptList", commonManager.listDeptData(defaultCompany)); |
| | | model.addAttribute("deptList", depts); |
| | | model.addAttribute("defaultDeptId", defaultDeptId); |
| | | |
| | | //业务类型数据 |
| | | List<Map<String, String>> bizTypeList = new ArrayList<>(); |
| | | for (WarnType type : WarnType.values()) { |
| | |
| | | model.addAttribute("bizTypeList", bizTypeList); |
| | | //公司数据 |
| | | model.addAttribute("companyList", companies); |
| | | model.addAttribute("defaultCompany", defaultCompany); |
| | | return prefix + "/eventInfo"; |
| | | } |
| | | |