|
@@ -2,7 +2,6 @@ package com.bofeng.wx.controller;
|
|
|
|
|
|
|
|
|
import com.bofeng.entity.*;
|
|
|
-import com.bofeng.service.HomeService;
|
|
|
import com.bofeng.service.MsReportService;
|
|
|
import com.bofeng.service.MsSuspectedService;
|
|
|
import com.yvan.Model;
|
|
@@ -11,9 +10,9 @@ 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.RestController;
|
|
|
-import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -26,66 +25,69 @@ import java.util.List;
|
|
|
public class MsReportController {
|
|
|
|
|
|
@Autowired
|
|
|
- private HomeService homeService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private MsSuspectedService msSuspectedService;
|
|
|
@Autowired
|
|
|
private MsReportService msReportService;
|
|
|
|
|
|
//添加家人
|
|
|
- @PostMapping("/home/addRibao.json")
|
|
|
- public ModelAndView saveUser(HttpServletRequest request) {
|
|
|
- //UserOpen userOpen = homeService.getUserOpen();
|
|
|
- long userId = 1224706869998772226L;
|
|
|
+ @PostMapping("/home/addRibao")
|
|
|
+ public Integer saveUser(HttpServletRequest request) {
|
|
|
+ //初始化今日日报
|
|
|
+ Long userCreate = Long.parseLong(request.getParameter("userCreate"));
|
|
|
String userName = request.getParameter("userName");
|
|
|
- String conditionStatus = request.getParameter("conditionStatus");
|
|
|
+ Integer grender = Integer.parseInt(request.getParameter("grender"));
|
|
|
+ Integer age = Integer.parseInt(request.getParameter("age"));
|
|
|
+ Integer familyStatus = Integer.parseInt(request.getParameter("familyStatus"));
|
|
|
+ String statusDesp = request.getParameter("statusDesp");
|
|
|
Integer medical = Integer.parseInt(request.getParameter("medical"));
|
|
|
- String remarks = request.getParameter("remarks");
|
|
|
- msSuspectedService.addSuspected(userName, conditionStatus, medical, remarks, userId);
|
|
|
- return new ModelAndView("/home/home.ftl");
|
|
|
+ BigDecimal temperature = new BigDecimal(request.getParameter("temperature"));
|
|
|
+ Integer cough = Integer.parseInt(request.getParameter("cough"));
|
|
|
+ Integer muscle = Integer.parseInt(request.getParameter("muscle"));
|
|
|
+ Integer dyspnea = Integer.parseInt(request.getParameter("dyspnea"));
|
|
|
+ Integer chest = Integer.parseInt(request.getParameter("chest"));
|
|
|
+ Integer fatigue = Integer.parseInt(request.getParameter("fatigue"));
|
|
|
+ Integer diarrhea = Integer.parseInt(request.getParameter("diarrhea"));
|
|
|
+ Integer diarrheaNum = Integer.parseInt(request.getParameter("diarrheaNum"));
|
|
|
+ String others = request.getParameter("others");
|
|
|
+ msSuspectedService.addSuspected(userName, grender, age, familyStatus,statusDesp,medical,temperature,cough,muscle,dyspnea,chest,fatigue,diarrhea,diarrheaNum, others, userCreate);
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
- //删除家人
|
|
|
- @PostMapping("/home/deleteSuspected.json")
|
|
|
- public ModelAndView deleteSuspected(HttpServletRequest request) {
|
|
|
+ //删除家人病例
|
|
|
+ @PostMapping("/home/deleteSuspected")
|
|
|
+ public Integer deleteSuspected(HttpServletRequest request) {
|
|
|
Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
|
|
|
msSuspectedService.deleteSuspected(suspectedId);
|
|
|
- return new ModelAndView("/home/home.ftl");
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
- //获取家人
|
|
|
+ //根据登录人获取家人
|
|
|
@GetMapping("/home/home/queryRibao")
|
|
|
- public Model<List<MsSuspected>> queryRibao() {
|
|
|
- //UserOpen userOpen = homeService.getUserOpen();
|
|
|
- long userId = 1224706869998772226L;
|
|
|
+ public Model<List<MsSuspected>> queryRibao(@Pd(name = "userCreate") Long userCreate) {
|
|
|
Date t = new Date();
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String reportDate = df.format(t);
|
|
|
- return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userId));
|
|
|
+ return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userCreate));
|
|
|
}
|
|
|
|
|
|
- //获取家人
|
|
|
+ //根据日报获取家人
|
|
|
@GetMapping("/home/home/queryRibaoRefresh")
|
|
|
- public Model<List<MsSuspected>> queryRibao(@Pd(name = "reportId") Long reportId) {
|
|
|
+ public Model<List<MsSuspected>> queryRibaoRefresh(@Pd(name = "reportId") Long reportId) {
|
|
|
return Model.newSuccess(msReportService.getByReportId(reportId));
|
|
|
}
|
|
|
|
|
|
//全家报平安
|
|
|
- @PostMapping("/home/addReport.json")
|
|
|
- public ModelAndView addReport(HttpServletRequest request) {
|
|
|
- //UserOpen userOpen = homeService.getUserOpen();
|
|
|
- long userId = 1224706869998772226L;
|
|
|
+ @PostMapping("/home/addReport")
|
|
|
+ public Integer addReport(HttpServletRequest request) {
|
|
|
+ Long userCreate = Long.parseLong(request.getParameter("userCreate"));
|
|
|
String safetyNum = request.getParameter("safetyNum");
|
|
|
- msReportService.addReport(safetyNum, userId);
|
|
|
- return new ModelAndView("/home/home.ftl");
|
|
|
+ msReportService.addReport(safetyNum, userCreate);
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
- //获取家人
|
|
|
+ //根据日期获取家人
|
|
|
@GetMapping("/home/home/queryRibaoReportDate")
|
|
|
- public Model<List<MsSuspected>> queryRibaoReportDate(@Pd(name = "reportDate") String reportDate) {
|
|
|
- //UserOpen userOpen = homeService.getUserOpen();
|
|
|
- long userId = 1224706869998772226L;
|
|
|
- return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userId));
|
|
|
+ public Model<List<MsSuspected>> queryRibaoReportDate(@Pd(name = "reportDate") String reportDate, @Pd(name = "userCreate") Long userCreate) {
|
|
|
+ return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userCreate));
|
|
|
}
|
|
|
}
|