|
|
@@ -14,6 +14,7 @@ import java.io.FileInputStream;
|
|
|
import java.io.InputStream;
|
|
|
import java.net.URL;
|
|
|
import java.net.URLEncoder;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -108,7 +109,7 @@ public class BusJcbFdfxjyqController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出")
|
|
|
- @PutMapping("/export")
|
|
|
+ @GetMapping("/export")
|
|
|
public void export(@RequestParam String id, HttpServletResponse response) {
|
|
|
try {
|
|
|
//获取基础数据
|
|
|
@@ -116,28 +117,30 @@ public class BusJcbFdfxjyqController extends BaseController {
|
|
|
WordUtils wordUtil=new WordUtils();
|
|
|
//填充变量
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
- params.put("${fdh}", info.getFcd().toString());
|
|
|
+ params.put("${fdh}", info.getFdh());
|
|
|
params.put("${qj}", info.getQj().toString());
|
|
|
- params.put("${jcrq}", info.getJcrq().toString());
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
+ String jcrq = simpleDateFormat.format(info.getJcrq());
|
|
|
+ params.put("${jcrq}", jcrq);
|
|
|
params.put("${wd}", info.getWd().toString());
|
|
|
params.put("${jcr}", info.getJcr().toString());
|
|
|
params.put("${pointB}", info.getPointB().toString());
|
|
|
params.put("${pointG}", info.getPointG().toString());
|
|
|
params.put("${fcd}", info.getFcd().toString());
|
|
|
params.put("${fddmpsd}", info.getFddmpsd().toString());
|
|
|
- params.put("${jybjFdjyqzjyzt}", info.getJybjFdjyqzjyzt().equals("0")?"√":"×");
|
|
|
- params.put("${jybjClsjyzzt}", info.getJybjClsjyzzt().equals("0")?"√":"×");
|
|
|
- params.put("${lbjztLs}", info.getLbjztLs().equals("0")?"√":"×");
|
|
|
- params.put("${lbjztXdx}", info.getLbjztXdx().equals("0")?"√":"×");
|
|
|
- params.put("${lbjztPhzj}", info.getLbjztPhzj().equals("0")?"√":"×");
|
|
|
- params.put("${lbjztJcxjt}", info.getLbjztJcxjt().equals("0")?"√":"×");
|
|
|
- params.put("${lbjztXhj}", info.getLbjztXhj().equals("0")?"√":"×");
|
|
|
- params.put("${sbzt}", info.getSbzt().equals("0")?"√":"×");
|
|
|
+ params.put("${jybjFdjyqzjyzt}", info.getJybjFdjyqzjyzt().equals("1")?"√":"×");
|
|
|
+ params.put("${jybjClsjyzzt}", info.getJybjClsjyzzt().equals("1")?"√":"×");
|
|
|
+ params.put("${lbjztLs}", info.getLbjztLs().equals("1")?"√":"×");
|
|
|
+ params.put("${lbjztXdx}", info.getLbjztXdx().equals("1")?"√":"×");
|
|
|
+ params.put("${lbjztPhzj}", info.getLbjztPhzj().equals("1")?"√":"×");
|
|
|
+ params.put("${lbjztJcxjt}", info.getLbjztJcxjt().equals("1")?"√":"×");
|
|
|
+ params.put("${lbjztXhj}", info.getLbjztXhj().equals("1")?"√":"×");
|
|
|
+ params.put("${sbzt}", info.getSbzt().equals("0") ? "合格" : "不合格");
|
|
|
params.put("${xlfdXlpd}", info.getXlfdXlpd().toString());
|
|
|
params.put("${xlfdWgdg}", info.getXlfdWgdg().toString());
|
|
|
params.put("${xlfdFdsxlqj}", info.getXlfdFdsxlqj().toString());
|
|
|
params.put("${xlfdFdczxlqj}", info.getXlfdFdczxlqj().toString());
|
|
|
- params.put("${sdgjcztSddg}", info.getSdgjcztSddg().equals("0")?"√":"×");
|
|
|
+ params.put("${sdgjcztSddg}", info.getSdgjcztSddg().equals("1")?"√":"×");
|
|
|
params.put("${qrr}", info.getJcr().toString());
|
|
|
try{
|
|
|
//填充图片信息
|
|
|
@@ -149,7 +152,7 @@ public class BusJcbFdfxjyqController extends BaseController {
|
|
|
params.put("${header}",header);
|
|
|
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("word/template/DXF分段绝缘器手册.docx");
|
|
|
//生成word文件的文件名
|
|
|
- String fileName= URLEncoder.encode("测试文档.docx", "UTF-8");
|
|
|
+ String fileName= URLEncoder.encode("DXF分段绝缘器手册.docx", "UTF-8");
|
|
|
//调用生成导出方法
|
|
|
wordUtil.getWord(inputStream,params,null,fileName,response);
|
|
|
|