|
|
@@ -7,6 +7,7 @@ import com.railway.common.utils.poi.WordUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -44,6 +45,9 @@ public class BusJcbFdfxjyqController extends BaseController {
|
|
|
@Autowired
|
|
|
private IBusJcbFdfxjyqService busJcbFdfxjyqService;
|
|
|
|
|
|
+ @Value("${file.path}")
|
|
|
+ public String filePath;
|
|
|
+
|
|
|
@ApiOperation(value = "新增")
|
|
|
@PostMapping("/add")
|
|
|
public AjaxResult add(@Validated @RequestBody BusJcbFdfxjyq busJcbFdfxjyq) {
|
|
|
@@ -118,11 +122,12 @@ public class BusJcbFdfxjyqController extends BaseController {
|
|
|
params.put("${qj}", "测试区间");
|
|
|
params.put("${wd}", "85");
|
|
|
try{
|
|
|
+
|
|
|
Map<String,Object> header = new HashMap<String, Object>();
|
|
|
- header.put("width", 400);
|
|
|
- header.put("height", 100);
|
|
|
+ header.put("width", 450);
|
|
|
+ header.put("height", 110);
|
|
|
header.put("type", "jpg");
|
|
|
- header.put("content", WordUtils.inputStream2ByteArray(new FileInputStream("D:/fdjyq-20211016.png"), true));
|
|
|
+ header.put("content", WordUtils.inputStream2ByteArray(new FileInputStream(filePath+"/fdjyq-20211016.png"), true));
|
|
|
params.put("${header}",header);
|
|
|
//InputStream inputStream = this.getClass().getResourceAsStream("/word/template/DXF分段绝缘器手册.docx");
|
|
|
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("word/template/DXF分段绝缘器手册.docx");
|