EpiLYExportController.java 6.7 KB

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