12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- package com.bofeng.wx.controller;
- import com.bofeng.entity.*;
- import com.bofeng.service.MsReportService;
- import com.bofeng.service.MsSuspectedService;
- import com.fasterxml.jackson.core.JsonProcessingException;
- import com.yvan.Model;
- import com.yvan.mvc.Pd;
- import com.yvan.platform.JsonWapper;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.ui.ModelMap;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.servlet.ModelAndView;
- import javax.servlet.http.HttpServletRequest;
- import java.util.List;
- import java.util.Map;
- /**
- * @Author: xielianghe
- * @Date: 2020/2/4 15:38
- */
- @RestController
- public class MsReportController {
- @Autowired
- private MsSuspectedService msSuspectedService;
- @Autowired
- private MsReportService msReportService;
- //添加家人
- @PostMapping("/home/addRibao.json")
- public ModelAndView saveUser(HttpServletRequest request) {
- String userName = request.getParameter("userName");
- String conditionStatus = request.getParameter("conditionStatus");
- Integer medical =Integer.parseInt( request.getParameter("medical"));
- String remarks = request.getParameter("remarks");
- msSuspectedService.addSuspected(userName, conditionStatus, medical, remarks);
- return new ModelAndView("/home/home.ftl");
- }
- //删除家人
- @PostMapping("/home/deleteSuspected.json")
- public ModelAndView deleteSuspected(HttpServletRequest request) {
- Long suspectedId =Long.parseLong( request.getParameter("suspectedId"));
- msSuspectedService.deleteSuspected(suspectedId);
- return new ModelAndView("/home/home.ftl");
- }
- //获取家人
- @GetMapping("/home/home/queryRibao")
- public Model<List<MsSuspected>> queryRibao(@Pd(name = "reportId") Long reportId) {
- return Model.newSuccess(msReportService.getByReportId(reportId));
- }
- //全家报平安
- @PostMapping("/home/addReport.json")
- public ModelAndView addReport(HttpServletRequest request) {
- String safetyNum = request.getParameter("safetyNum");
- msReportService.addReport(safetyNum);
- return new ModelAndView("/home/home.ftl");
- }
- }
|