|
@@ -1,8 +1,14 @@
|
|
|
package com.bofeng.controller;
|
|
|
|
|
|
+import com.bofeng.dao.MsReportMapper;
|
|
|
+import com.bofeng.dao.UserOpenMapper;
|
|
|
+import com.bofeng.entity.*;
|
|
|
+import com.bofeng.service.MsReportService;
|
|
|
+import com.bofeng.service.MsTripService;
|
|
|
import com.bofeng.word.WordUtils;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -10,42 +16,95 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@RestController
|
|
|
public class EpiLYExportController {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserOpenMapper userOpenMapper;
|
|
|
+ @Autowired
|
|
|
+ private MsReportMapper msReportMapper;
|
|
|
+ @Autowired
|
|
|
+ private MsTripService msTripService;
|
|
|
+ @Autowired
|
|
|
+ private MsReportService msReportService;
|
|
|
+
|
|
|
@ApiOperation("导出单个健康及旅居申报表")
|
|
|
@GetMapping("/whepi/export/lyReport")
|
|
|
public @ResponseBody
|
|
|
void exportSellPlan(HttpServletRequest request, HttpServletResponse response) {
|
|
|
- Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
|
|
|
+ //Long userId = Long.parseLong(request.getParameter("1234"));
|
|
|
+ Long userId = 1234L;
|
|
|
+ String userName = "", workPlace = "", telPhone = "", isLeave = "", trip = "", blackTime = "", veicle = "", otherSymptom = "", isTrue = "";
|
|
|
+ //用户姓名,电话
|
|
|
+ UserOpen userOpen = userOpenMapper.selectUserBaseByUserId(userId);
|
|
|
+ if (userOpen != null) {
|
|
|
+ userName = userOpen.getLinkman();
|
|
|
+ telPhone = userOpen.getPhone();
|
|
|
+ }
|
|
|
+ //工作驻地
|
|
|
+ MsTrip msTrip = msReportMapper.selectWorkByUserId(userId);
|
|
|
+ if (msTrip != null)
|
|
|
+ workPlace = msReportService.getLocalOther(msTrip.getWorkLocal(), msTrip.getWorkLocalOther());
|
|
|
+ //是否离开过驻地
|
|
|
+ MsTrip msTrip1 = msReportMapper.selectIsTripByUserId(userId);
|
|
|
+ if (msTrip1 == null)
|
|
|
+ isLeave = "否";
|
|
|
+ else
|
|
|
+ isLeave = "是";
|
|
|
+ //15日居住地
|
|
|
+ List<MsTrip> listMsTrip = msReportMapper.select15TripByUserId(userId);
|
|
|
+ if (listMsTrip != null && listMsTrip.size() > 0) {
|
|
|
+ for (MsTrip msTrip2 : listMsTrip) {
|
|
|
+ trip += msReportService.getLocalOther(msTrip2.getTodayLocal(), msTrip2.getTodayLocalOther()) + ",";
|
|
|
+ }
|
|
|
+ trip = trip.substring(0, trip.length() - 1);
|
|
|
+ }
|
|
|
+ //返回时间
|
|
|
+ MsReport msReport = msReportMapper.selectBackTripByUserId(userId);
|
|
|
+ if (msReport != null) {
|
|
|
+ blackTime = msReport.getReportDate().toString();
|
|
|
+ //返回交通工具
|
|
|
+ List<MsTripDet> listMsTripDet = msReportMapper.selectBackTripByReportrId(msReport.getReportId());
|
|
|
+ if (listMsTripDet != null && listMsTripDet.size() > 0) {
|
|
|
+ for (MsTripDet msTripDet : listMsTripDet) {
|
|
|
+ veicle += msReportService.getTripType(msTripDet.getTripType()) + ",";
|
|
|
+ }
|
|
|
+ veicle = veicle.substring(0, veicle.length() - 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
- map.put("userName", "张山");
|
|
|
- map.put("workPlace", "武汉");
|
|
|
- map.put("telPhone", "13245452345");
|
|
|
- map.put("isLeave", "是");
|
|
|
- map.put("trip", "北京、上海、武汉");
|
|
|
- map.put("backTime", "2020-03-10");
|
|
|
- map.put("vehicle", "火箭");
|
|
|
+ map.put("userName", userName);
|
|
|
+ map.put("workPlace", workPlace);
|
|
|
+ map.put("telPhone", telPhone);
|
|
|
+ map.put("isLeave", isLeave);
|
|
|
+ map.put("trip", trip);
|
|
|
+ map.put("backTime", blackTime);
|
|
|
+ map.put("vehicle", veicle);
|
|
|
|
|
|
Map<String, Object> rt = new HashMap<String, Object>();
|
|
|
map.put("rt", rt);
|
|
|
- rt.put("d1", "02-20");
|
|
|
- rt.put("d2", "02-21");
|
|
|
- rt.put("d3", "02-22");
|
|
|
- rt.put("d4", "02-23");
|
|
|
- rt.put("d5", "02-24");
|
|
|
- rt.put("t1", "-");
|
|
|
- rt.put("t2", "37.0");
|
|
|
- rt.put("t3", "36.6");
|
|
|
- rt.put("t4", "36.6");
|
|
|
- rt.put("t5", "36.8");
|
|
|
-
|
|
|
- map.put("otherSymptom", "ee");
|
|
|
- map.put("isTrue", "否");
|
|
|
+ for (int i = 1; i <= 5; i++) {
|
|
|
+ rt.put("d"+i, msReportService.getTimeByDate(i-5));
|
|
|
+ rt.put("t"+i, msReportService.getTemperature(userId, i-5));
|
|
|
+ }
|
|
|
+
|
|
|
+ //是否有其他症状
|
|
|
+ List<MsSuspected> listSuspected1 = msReportMapper.selectOtherSymptomByReportrId(userId);
|
|
|
+ if (listSuspected1 != null && listSuspected1.size() > 0)
|
|
|
+ otherSymptom = "是";
|
|
|
+ else
|
|
|
+ otherSymptom = "否";
|
|
|
+ map.put("otherSymptom", otherSymptom);
|
|
|
+ Integer sureNum = msReportMapper.selectisSuspectedNum(userId);
|
|
|
+ if (sureNum == 0)
|
|
|
+ isTrue = "否";
|
|
|
+ else
|
|
|
+ isTrue = "是";
|
|
|
+ //是否确诊
|
|
|
+ map.put("isTrue", isTrue);
|
|
|
|
|
|
WordUtils.exportWord("word/健康及旅居申报表_20200221.docx", "temp", "健康及旅居申报表.docx", map, request, response);
|
|
|
}
|
|
@@ -83,8 +142,6 @@ public class EpiLYExportController {
|
|
|
map.put("isTrue", "否");
|
|
|
list.add(map);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
WordUtils.exportWord("word/健康及旅居申报表_20200221.docx", "temp", "健康及旅居申报表.docx", list, request, response);
|
|
|
}
|
|
|
|
|
@@ -92,47 +149,52 @@ public class EpiLYExportController {
|
|
|
@GetMapping("/whepi/export/lyApprove")
|
|
|
public @ResponseBody
|
|
|
void lyApprove(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+
|
|
|
+ //Long userId = Long.parseLong(request.getParameter("1234"));
|
|
|
+ Long userId = 1234L;
|
|
|
+ String userName = "", org = "", gander = "", bAddr = "", backDate = "",otherSymptom="";
|
|
|
+ //用户姓名,部门
|
|
|
+ UserOpen userOpen = userOpenMapper.selectUserBaseByUserId(userId);
|
|
|
+ if (userOpen != null) {
|
|
|
+ userName = userOpen.getLinkman();
|
|
|
+ org = userOpen.getRidgepole() + userOpen.getUnit();
|
|
|
+ }
|
|
|
+ //性别
|
|
|
+ MsSuspected msSuspected = msReportMapper.selectGrenderUserId(userId);
|
|
|
+ if (msSuspected != null) {
|
|
|
+ if (msSuspected.getGrender() == 1)
|
|
|
+ gander = "男";
|
|
|
+ if (msSuspected.getGrender() == 2)
|
|
|
+ gander = "女";
|
|
|
+ }
|
|
|
+
|
|
|
+ //返回时间
|
|
|
+ MsReport msReport = msReportMapper.selectBackTripByUserId(userId);
|
|
|
+ if (msReport != null) {
|
|
|
+ backDate = msReport.getReportDate().toString();
|
|
|
+ bAddr = msReportService.getLocalOther(msReport.getTodayLocal(), msReport.getTodayLocalOther());
|
|
|
+ }
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
- map.put("userName", "张山");
|
|
|
- map.put("gander", "男");
|
|
|
- map.put("org", "研发部");
|
|
|
- map.put("bAddr", "北京");
|
|
|
- map.put("backDate", "2020-03-10");
|
|
|
+ map.put("userName", userName);
|
|
|
+ map.put("gander", gander);
|
|
|
+ map.put("org", org);
|
|
|
+ map.put("bAddr", bAddr);
|
|
|
+ map.put("backDate", backDate);
|
|
|
|
|
|
+ //最近15天体温
|
|
|
Map<String, Object> rt = new HashMap<String, Object>();
|
|
|
map.put("rt", rt);
|
|
|
- rt.put("d1", "02-20");
|
|
|
- rt.put("d2", "02-21");
|
|
|
- rt.put("d3", "02-22");
|
|
|
- rt.put("d4", "02-23");
|
|
|
- rt.put("d5", "02-24");
|
|
|
- rt.put("d6", "02-25");
|
|
|
- rt.put("d7", "02-26");
|
|
|
- rt.put("d8", "02-27");
|
|
|
- rt.put("d9", "02-28");
|
|
|
- rt.put("d10", "02-29");
|
|
|
- rt.put("d11", "03-01");
|
|
|
- rt.put("d12", "03-02");
|
|
|
- rt.put("d13", "03-03");
|
|
|
- rt.put("d14", "03-04");
|
|
|
- rt.put("d15", "03-05");
|
|
|
- rt.put("t1", "-");
|
|
|
- rt.put("t2", "37.0");
|
|
|
- rt.put("t3", "36.6");
|
|
|
- rt.put("t4", "36.6");
|
|
|
- rt.put("t5", "36.8");
|
|
|
- rt.put("t6", "-");
|
|
|
- rt.put("t7", "37.0");
|
|
|
- rt.put("t8", "36.6");
|
|
|
- rt.put("t9", "36.6");
|
|
|
- rt.put("t10", "36.8");
|
|
|
- rt.put("t11", "-");
|
|
|
- rt.put("t12", "37.0");
|
|
|
- rt.put("t13", "36.6");
|
|
|
- rt.put("t14", "36.6");
|
|
|
- rt.put("t15", "36.8");
|
|
|
-
|
|
|
- map.put("otherSymptom", "无");
|
|
|
+ for (int i = 1; i <= 15; i++) {
|
|
|
+ rt.put("d"+i, msReportService.getTimeByDate(i-15));
|
|
|
+ rt.put("t"+i, msReportService.getTemperature(userId, i-15));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<MsSuspected> listSuspected1 = msReportMapper.selectOtherSymptomByReportrId(userId);
|
|
|
+ if (listSuspected1 != null && listSuspected1.size() > 0)
|
|
|
+ otherSymptom = "是";
|
|
|
+ else
|
|
|
+ otherSymptom = "否";
|
|
|
+ map.put("otherSymptom", otherSymptom);
|
|
|
|
|
|
WordUtils.exportWord("word/隔离人员解除隔离审批表_20200221.docx", "temp", "隔离人员解除隔离审批表.docx", map, request, response);
|
|
|
}
|