MobileHomeController.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package platform.modules.mobile;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.ui.ModelMap;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.ResponseBody;
  9. import platform.common.base.controller.BaseController;
  10. import platform.common.base.model.CompanyNotify;
  11. import platform.common.util.ShiroUtils;
  12. import platform.modules.build.DTO.*;
  13. import platform.modules.build.entity.CompanyShow;
  14. import platform.modules.build.entity.ElectricWater;
  15. import platform.modules.build.entity.Maintenance;
  16. import platform.modules.build.entity.Tenancy;
  17. import platform.modules.build.service.CompanyService;
  18. import platform.modules.build.service.CompanyShowService;
  19. import platform.modules.build.service.ElectricWaterService;
  20. import platform.modules.build.service.MaintenanceService;
  21. import platform.modules.build.service.TenancyService;
  22. import platform.modules.government.dto.NotifyDto;
  23. import platform.modules.government.entity.Notify;
  24. import platform.modules.government.service.NotifyService;
  25. import platform.modules.sys.web.ResponseMessage;
  26. import java.util.List;
  27. @Controller
  28. @RequestMapping(value = "/mobile/home")
  29. public class MobileHomeController extends BaseController {
  30. @Autowired
  31. private NotifyService notifyService;
  32. @GetMapping(value = "")
  33. public String page() {
  34. return BASE_MOBIl_PATH + "index";
  35. }
  36. /**
  37. * 获取手机端通知列表
  38. * @param modelMap
  39. * @return
  40. */
  41. @PostMapping(value="/getInfo")
  42. @ResponseBody
  43. public ResponseMessage getNoticeInfo(ModelMap modelMap){
  44. try {
  45. Integer build_id = ShiroUtils.getUserEntity().getBuild_id();
  46. Integer company_id = ShiroUtils.getUserEntity().getCompany_id();
  47. //通知公告
  48. int notifyCount = 10;
  49. NotifyDto notifyDto = new NotifyDto();
  50. notifyDto.setCompany_id(company_id);
  51. notifyDto.setCount(notifyCount);
  52. notifyDto.setIs_read(false);
  53. // todo
  54. List<Notify> notifyList = notifyService.findNotifyList(notifyDto);
  55. modelMap.put("notifyList", notifyList);
  56. } catch (Exception e) {
  57. // TODO Auto-generated catch block
  58. e.printStackTrace();
  59. }
  60. return new ResponseMessage(true, "查询成功", modelMap);
  61. }
  62. }