Commit 12c85dcf authored by 李腾威's avatar 李腾威

作战指挥处置记录预览

parent 34994fb4
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
......@@ -19,7 +18,6 @@ import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto;
import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
......@@ -49,16 +47,13 @@ import com.yeejoin.amos.boot.module.jcs.api.service.*;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -75,7 +70,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* *指挥资源Api
......@@ -690,17 +684,6 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledcount(id));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "下载附件", notes = "下载附件")
@PostMapping(value = "/downLoad")
public void downLoad(@RequestBody List<String> path, HttpServletResponse response){
try {
IOUtils.copy(new FileInputStream(readUrl + path.get(0)), response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* * @param null
*
......
......@@ -40,11 +40,11 @@
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.spire</groupId>-->
<!-- <artifactId>Spire.Doc</artifactId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.doc</artifactId>
<version>4.9.0</version>
</dependency>
</dependencies>
</project>
......@@ -728,15 +728,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if(i == 0) {
dto.setDisatchNum(String.valueOf(first.size()));
}
dto.setCarName(first.get(i).get("carName").toString());
dto.setStation(first.get(i).get("companyName").toString());
// 随车人员
List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(Long.valueOf(first.get(i).get("id").toString()));
if(!ValidationUtil.isEmpty(powerDataOne)) {
dto.setPersonNum(String.valueOf(powerDataOne.size()));
} else {
dto.setPersonNum("0");
}
handleFunc(dto,first.get(i));
LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate");
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8")));
......@@ -750,15 +743,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
for(int i = 0; i <other.size(); i++) {
AlertCalledPowerInfoDto dto = new AlertCalledPowerInfoDto();
dto.setCarName(other.get(i).get("carName").toString());
dto.setStation(other.get(i).get("companyName").toString());
// 随车人员
List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(Long.valueOf(first.get(i).get("id").toString()));
if(!ValidationUtil.isEmpty(powerDataOne)) {
dto.setPersonNum(String.valueOf(powerDataOne.size()));
} else {
dto.setPersonNum("0");
}
handleFunc(dto,first.get(i));
LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate");
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8")));
......@@ -793,6 +779,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String filePath = this.getClass().getClassLoader().getResource("templates").getPath();
String fileName = filePath + "/" + System.currentTimeMillis() + ".docx";
String newFileName= "";
AlertCalledPowerInfoTablePolicy calledPowerInfoTablePolicy = new AlertCalledPowerInfoTablePolicy();
AlertCallCommandTablePolicy alertCallCommandTablePolicy = new AlertCallCommandTablePolicy();
......@@ -812,13 +799,26 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// docx 转 doc
Document document = new Document();
document.loadFromFile(fileName);
String newFileName = System.currentTimeMillis()+".doc";
//保存结果文件
document.saveToFile(newFileName, FileFormat.Doc);
String os = System.getProperty("os.name");
//拼接完整连接
String pa1 = "";
if(os.toLowerCase().startsWith("win")){
String pa = fileName.substring(1);
document.loadFromFile(pa);
newFileName = filePath +"/" + System.currentTimeMillis()+".doc";
//保存结果文件
pa1 = newFileName.substring(1);
document.saveToFile(pa1, FileFormat.Doc);
} else {
document.loadFromFile(fileName);
newFileName = filePath + System.currentTimeMillis()+".doc";
document.saveToFile(newFileName, FileFormat.Doc);
pa1 = newFileName;
}
System.out.println(pa1);
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(WordConverterUtils.fileToMultipartFile(new File(newFileName)));
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(WordConverterUtils.fileToMultipartFile(new File(pa1)));
if (date != null) {
Map<String, String> map = date.getResult();
......@@ -841,18 +841,33 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
out.close();
template.close();
// File file = new File(fileName);
// if(file.exists()) {
// String htmlPath = System.getProperty("user.dir") + File.separator + "lookHtml" + File.separator + "file" + File.separator;
// String name = urlString.substring(urlString.lastIndexOf('/') + 1);
// new File(fileName).renameTo(new File(htmlPath+name.substring(0, name.indexOf(".")) + ".html"));
// }
File file = new File(fileName);
if(file.exists()) {
file.delete();
}
File file1 = new File(newFileName);
if(file1.exists()) {
file1.delete();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
void handleFunc(AlertCalledPowerInfoDto dto,Map<String, Object> map) {
dto.setCarName(map.get("carName").toString());
dto.setStation(map.get("companyName").toString());
// 随车人员
List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(Long.valueOf(map.get("id").toString()));
if(!ValidationUtil.isEmpty(powerDataOne)) {
dto.setPersonNum(String.valueOf(powerDataOne.size()));
} else {
dto.setPersonNum("0");
}
}
static int dangerListDataStartRow = 2; // 表头占两行
static int dangerListDataStartRowNew = 1; // 表头占一行
......
......@@ -57,7 +57,7 @@ public class ESAlertCalledService {
public void init() throws Exception
{
//初始化ES,重建索引
//initEs();
initEs();
}
/**
......
......@@ -283,6 +283,11 @@
<name>Snapshots</name>
<url>http://172.16.1.6:8081/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<modules>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment