|
|
@@ -109,28 +109,46 @@ public class BusJcbFdfxjyqController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "提交")
|
|
|
@PutMapping("/submit")
|
|
|
- public AjaxResult submit(@RequestBody BusJcbFdfxjyq busJcbFdfxjyq) {
|
|
|
+ public AjaxResult submit(@RequestBody BusJcbFdfxjyq busJcbFdfxjyq) throws Exception {
|
|
|
busJcbFdfxjyq.setUpdateBy(getUsername());
|
|
|
+ //将文件转成base64
|
|
|
+ if(busJcbFdfxjyq.getPicUrl()!=null&&!"".equals(busJcbFdfxjyq.getPicUrl())){
|
|
|
+ MultipartFile multipartFile = BASE64DecodedMultipartFile.base64ToMultipart(busJcbFdfxjyq.getPicUrl());
|
|
|
+ String path = sysFileService.uploadFile(multipartFile);
|
|
|
+ busJcbFdfxjyq.setPicUrl(path);
|
|
|
+ }
|
|
|
return toAjax(busJcbFdfxjyqService.submit(busJcbFdfxjyq));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "退回")
|
|
|
@PutMapping("/reject")
|
|
|
- public AjaxResult reject(@RequestBody BusJcbFdfxjyq busJcbFdfxjyq) {
|
|
|
+ public AjaxResult reject(@RequestBody BusJcbFdfxjyq busJcbFdfxjyq) throws Exception {
|
|
|
busJcbFdfxjyq.setUpdateBy(getUsername());
|
|
|
+ //将文件转成base64
|
|
|
+ if(busJcbFdfxjyq.getPicUrl()!=null&&!"".equals(busJcbFdfxjyq.getPicUrl())){
|
|
|
+ MultipartFile multipartFile = BASE64DecodedMultipartFile.base64ToMultipart(busJcbFdfxjyq.getPicUrl());
|
|
|
+ String path = sysFileService.uploadFile(multipartFile);
|
|
|
+ busJcbFdfxjyq.setPicUrl(path);
|
|
|
+ }
|
|
|
return toAjax(busJcbFdfxjyqService.reject(busJcbFdfxjyq));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "确认")
|
|
|
@PutMapping("/confirm")
|
|
|
- public AjaxResult confirm(@RequestBody BusJcbFdfxjyq busJcbFdfxjyq) {
|
|
|
+ public AjaxResult confirm(@RequestBody BusJcbFdfxjyq busJcbFdfxjyq) throws Exception {
|
|
|
busJcbFdfxjyq.setUpdateBy(getUsername());
|
|
|
+ //将文件转成base64
|
|
|
+ if(busJcbFdfxjyq.getPicUrl()!=null&&!"".equals(busJcbFdfxjyq.getPicUrl())){
|
|
|
+ MultipartFile multipartFile = BASE64DecodedMultipartFile.base64ToMultipart(busJcbFdfxjyq.getPicUrl());
|
|
|
+ String path = sysFileService.uploadFile(multipartFile);
|
|
|
+ busJcbFdfxjyq.setPicUrl(path);
|
|
|
+ }
|
|
|
return toAjax(busJcbFdfxjyqService.confirm(busJcbFdfxjyq));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出")
|
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(@RequestParam String id) {
|
|
|
+ public AjaxResult export(@RequestParam String id) throws InterruptedException {
|
|
|
//获取基础数据
|
|
|
BusJcbFdfxjyq info = busJcbFdfxjyqService.getInfo(id);
|
|
|
WordUtils wordUtil=new WordUtils();
|
|
|
@@ -158,13 +176,16 @@ public class BusJcbFdfxjyqController extends BaseController {
|
|
|
params.put("${xlfdFdsxlqj}", info.getXlfdFdsxlqj().toString());
|
|
|
params.put("${xlfdFdczxlqj}", info.getXlfdFdczxlqj().toString());
|
|
|
params.put("${sdgjcztSddg}", StringUtils.yesOrNo(info.getSdgjcztSddg()));
|
|
|
- params.put("${qrr}", info.getConfirmUser());
|
|
|
+ params.put("${confirmUser}", info.getConfirmUser()==null?"":info.getConfirmUser());
|
|
|
+ params.put("${czwt}", info.getCzwt());
|
|
|
//填充图片信息
|
|
|
Map<String,Object> header = new HashMap<>();
|
|
|
header.put("width", 450);
|
|
|
header.put("height", 110);
|
|
|
header.put("type", "jpg");
|
|
|
InputStream inputStream = HttpUtils.sendGetStream(info.getPicUrl(), "");
|
|
|
+ //解决网络传输造成流读取不全问题
|
|
|
+ Thread.sleep(200);
|
|
|
header.put("content", WordUtils.inputStream2ByteArray(inputStream, true));
|
|
|
params.put("${header}",header);
|
|
|
|