EpiLYExportController.java 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. package com.bofeng.controller;
  2. import com.bofeng.word.WordUtils;
  3. import com.google.common.collect.Lists;
  4. import io.swagger.annotations.ApiOperation;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.ResponseBody;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import javax.servlet.http.HttpServletRequest;
  9. import javax.servlet.http.HttpServletResponse;
  10. import java.io.IOException;
  11. import java.util.HashMap;
  12. import java.util.List;
  13. import java.util.Map;
  14. @RestController
  15. public class EpiLYExportController {
  16. @ApiOperation("导出单个健康及旅居申报表")
  17. @GetMapping("/whepi/export/lyReport")
  18. public @ResponseBody
  19. void exportSellPlan(HttpServletRequest request, HttpServletResponse response) {
  20. Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
  21. Map<String, Object> map = new HashMap<String, Object>();
  22. map.put("userName", "张山");
  23. map.put("workPlace", "武汉");
  24. map.put("telPhone", "13245452345");
  25. map.put("isLeave", "是");
  26. map.put("trip", "北京、上海、武汉");
  27. map.put("backTime", "2020-03-10");
  28. map.put("vehicle", "火箭");
  29. Map<String, Object> rt = new HashMap<String, Object>();
  30. map.put("rt", rt);
  31. rt.put("d1", "02-20");
  32. rt.put("d2", "02-21");
  33. rt.put("d3", "02-22");
  34. rt.put("d4", "02-23");
  35. rt.put("d5", "02-24");
  36. rt.put("t1", "-");
  37. rt.put("t2", "37.0");
  38. rt.put("t3", "36.6");
  39. rt.put("t4", "36.6");
  40. rt.put("t5", "36.8");
  41. map.put("otherSymptom", "ee");
  42. map.put("isTrue", "否");
  43. WordUtils.exportWord("word/健康及旅居申报表_20200221.docx", "temp", "健康及旅居申报表.docx", map, request, response);
  44. }
  45. @ApiOperation("导出多个健康及旅居申报表")
  46. @GetMapping("/whepi/export/lyReports")
  47. public @ResponseBody
  48. void exportSellPlan2(HttpServletRequest request, HttpServletResponse response) {
  49. List<Map<String, Object>> list = Lists.newArrayList();
  50. for (int i = 0; i < 5; i++) {
  51. Map<String, Object> map = new HashMap<String, Object>();
  52. map.put("userName", "张山");
  53. map.put("workPlace", "武汉");
  54. map.put("telPhone", "13245452345");
  55. map.put("isLeave", "是");
  56. map.put("trip", "北京、上海、武汉");
  57. map.put("backTime", "2020-03-10");
  58. map.put("vehicle", "火箭");
  59. Map<String, Object> rt = new HashMap<String, Object>();
  60. map.put("rt", rt);
  61. rt.put("d1", "02-20");
  62. rt.put("d2", "02-21");
  63. rt.put("d3", "02-22");
  64. rt.put("d4", "02-23");
  65. rt.put("d5", "02-24");
  66. rt.put("t1", "-");
  67. rt.put("t2", "37.0");
  68. rt.put("t3", "36.6");
  69. rt.put("t4", "36.6");
  70. rt.put("t5", "36.8");
  71. map.put("otherSymptom", "ee");
  72. map.put("isTrue", "否");
  73. list.add(map);
  74. }
  75. WordUtils.exportWord("word/健康及旅居申报表_20200221.docx", "temp", "健康及旅居申报表.docx", list, request, response);
  76. }
  77. @ApiOperation("导出单个隔离人员解除隔离审批表")
  78. @GetMapping("/whepi/export/lyApprove")
  79. public @ResponseBody
  80. void lyApprove(HttpServletRequest request, HttpServletResponse response) {
  81. Map<String, Object> map = new HashMap<String, Object>();
  82. map.put("userName", "张山");
  83. map.put("gander", "男");
  84. map.put("org", "研发部");
  85. map.put("bAddr", "北京");
  86. map.put("backDate", "2020-03-10");
  87. Map<String, Object> rt = new HashMap<String, Object>();
  88. map.put("rt", rt);
  89. rt.put("d1", "02-20");
  90. rt.put("d2", "02-21");
  91. rt.put("d3", "02-22");
  92. rt.put("d4", "02-23");
  93. rt.put("d5", "02-24");
  94. rt.put("d6", "02-25");
  95. rt.put("d7", "02-26");
  96. rt.put("d8", "02-27");
  97. rt.put("d9", "02-28");
  98. rt.put("d10", "02-29");
  99. rt.put("d11", "03-01");
  100. rt.put("d12", "03-02");
  101. rt.put("d13", "03-03");
  102. rt.put("d14", "03-04");
  103. rt.put("d15", "03-05");
  104. rt.put("t1", "-");
  105. rt.put("t2", "37.0");
  106. rt.put("t3", "36.6");
  107. rt.put("t4", "36.6");
  108. rt.put("t5", "36.8");
  109. rt.put("t6", "-");
  110. rt.put("t7", "37.0");
  111. rt.put("t8", "36.6");
  112. rt.put("t9", "36.6");
  113. rt.put("t10", "36.8");
  114. rt.put("t11", "-");
  115. rt.put("t12", "37.0");
  116. rt.put("t13", "36.6");
  117. rt.put("t14", "36.6");
  118. rt.put("t15", "36.8");
  119. map.put("otherSymptom", "无");
  120. WordUtils.exportWord("word/隔离人员解除隔离审批表_20200221.docx", "temp", "隔离人员解除隔离审批表.docx", map, request, response);
  121. }
  122. @ApiOperation("导出多个隔离人员解除隔离审批表")
  123. @GetMapping("/whepi/export/lyApproves")
  124. public @ResponseBody
  125. void lyApproves(HttpServletRequest request, HttpServletResponse response) {
  126. List<Map<String, Object>> list = Lists.newArrayList();
  127. for (int i = 0; i < 5; i++) {
  128. Map<String, Object> map = new HashMap<String, Object>();
  129. map.put("userName", "张山");
  130. map.put("gander", "男");
  131. map.put("org", "研发部");
  132. map.put("bAddr", "北京");
  133. map.put("backDate", "2020-03-10");
  134. Map<String, Object> rt = new HashMap<String, Object>();
  135. map.put("rt", rt);
  136. rt.put("d1", "02-20");
  137. rt.put("d2", "02-21");
  138. rt.put("d3", "02-22");
  139. rt.put("d4", "02-23");
  140. rt.put("d5", "02-24");
  141. rt.put("d6", "02-25");
  142. rt.put("d7", "02-26");
  143. rt.put("d8", "02-27");
  144. rt.put("d9", "02-28");
  145. rt.put("d10", "02-29");
  146. rt.put("d11", "03-01");
  147. rt.put("d12", "03-02");
  148. rt.put("d13", "03-03");
  149. rt.put("d14", "03-04");
  150. rt.put("d15", "03-05");
  151. rt.put("t1", "-");
  152. rt.put("t2", "37.0");
  153. rt.put("t3", "36.6");
  154. rt.put("t4", "36.6");
  155. rt.put("t5", "36.8");
  156. rt.put("t6", "-");
  157. rt.put("t7", "37.0");
  158. rt.put("t8", "36.6");
  159. rt.put("t9", "36.6");
  160. rt.put("t10", "36.8");
  161. rt.put("t11", "-");
  162. rt.put("t12", "37.0");
  163. rt.put("t13", "36.6");
  164. rt.put("t14", "36.6");
  165. rt.put("t15", "36.8");
  166. map.put("otherSymptom", "无");
  167. list.add(map);
  168. }
  169. WordUtils.exportWord("word/隔离人员解除隔离审批表_20200221.docx", "temp", "隔离人员解除隔离审批表.docx", list, request, response);
  170. }
  171. }