Commit f36e247b authored by helinlin's avatar helinlin

Merge remote-tracking branch 'origin/developer' into developer

parents 2ca6c409 12c85dcf
...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.command.biz.controller; ...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
...@@ -19,7 +18,6 @@ import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto; ...@@ -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.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService; 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.*;
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.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
...@@ -49,16 +47,13 @@ import com.yeejoin.amos.boot.module.jcs.api.service.*; ...@@ -49,16 +47,13 @@ import com.yeejoin.amos.boot.module.jcs.api.service.*;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; 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.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException; 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.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -75,7 +70,6 @@ import java.util.ArrayList; ...@@ -75,7 +70,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* *指挥资源Api * *指挥资源Api
...@@ -690,17 +684,6 @@ public class CommandController extends BaseController { ...@@ -690,17 +684,6 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledcount(id)); 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 * * @param null
* *
......
...@@ -40,11 +40,11 @@ ...@@ -40,11 +40,11 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- <dependency>--> <dependency>
<!-- <groupId>com.spire</groupId>--> <groupId>e-iceblue</groupId>
<!-- <artifactId>Spire.Doc</artifactId>--> <artifactId>spire.doc</artifactId>
<!-- <version>1.0.0</version>--> <version>4.9.0</version>
<!-- </dependency>--> </dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -728,15 +728,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -728,15 +728,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if(i == 0) { if(i == 0) {
dto.setDisatchNum(String.valueOf(first.size())); dto.setDisatchNum(String.valueOf(first.size()));
} }
dto.setCarName(first.get(i).get("carName").toString());
dto.setStation(first.get(i).get("companyName").toString()); handleFunc(dto,first.get(i));
// 随车人员
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");
}
LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate"); LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate");
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8"))); Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8")));
...@@ -750,15 +743,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -750,15 +743,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
for(int i = 0; i <other.size(); i++) { for(int i = 0; i <other.size(); i++) {
AlertCalledPowerInfoDto dto = new AlertCalledPowerInfoDto(); AlertCalledPowerInfoDto dto = new AlertCalledPowerInfoDto();
dto.setCarName(other.get(i).get("carName").toString());
dto.setStation(other.get(i).get("companyName").toString()); handleFunc(dto,first.get(i));
// 随车人员
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");
}
LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate"); LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate");
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8"))); Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8")));
...@@ -793,6 +779,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -793,6 +779,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String filePath = this.getClass().getClassLoader().getResource("templates").getPath(); String filePath = this.getClass().getClassLoader().getResource("templates").getPath();
String fileName = filePath + "/" + System.currentTimeMillis() + ".docx"; String fileName = filePath + "/" + System.currentTimeMillis() + ".docx";
String newFileName= "";
AlertCalledPowerInfoTablePolicy calledPowerInfoTablePolicy = new AlertCalledPowerInfoTablePolicy(); AlertCalledPowerInfoTablePolicy calledPowerInfoTablePolicy = new AlertCalledPowerInfoTablePolicy();
AlertCallCommandTablePolicy alertCallCommandTablePolicy = new AlertCallCommandTablePolicy(); AlertCallCommandTablePolicy alertCallCommandTablePolicy = new AlertCallCommandTablePolicy();
...@@ -812,13 +799,26 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -812,13 +799,26 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// docx 转 doc // docx 转 doc
Document document = new Document(); Document document = new Document();
document.loadFromFile(fileName);
String newFileName = System.currentTimeMillis()+".doc"; String os = System.getProperty("os.name");
//保存结果文件 //拼接完整连接
document.saveToFile(newFileName, FileFormat.Doc); 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) { if (date != null) {
Map<String, String> map = date.getResult(); Map<String, String> map = date.getResult();
...@@ -841,18 +841,33 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -841,18 +841,33 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
out.close(); out.close();
template.close(); template.close();
// File file = new File(fileName); File file = new File(fileName);
// if(file.exists()) { if(file.exists()) {
// String htmlPath = System.getProperty("user.dir") + File.separator + "lookHtml" + File.separator + "file" + File.separator; file.delete();
// String name = urlString.substring(urlString.lastIndexOf('/') + 1); }
// new File(fileName).renameTo(new File(htmlPath+name.substring(0, name.indexOf(".")) + ".html"));
// } File file1 = new File(newFileName);
if(file1.exists()) {
file1.delete();
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); 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 dangerListDataStartRow = 2; // 表头占两行
static int dangerListDataStartRowNew = 1; // 表头占一行 static int dangerListDataStartRowNew = 1; // 表头占一行
......
...@@ -57,7 +57,7 @@ public class ESAlertCalledService { ...@@ -57,7 +57,7 @@ public class ESAlertCalledService {
public void init() throws Exception public void init() throws Exception
{ {
//初始化ES,重建索引 //初始化ES,重建索引
//initEs(); initEs();
} }
/** /**
......
...@@ -283,6 +283,11 @@ ...@@ -283,6 +283,11 @@
<name>Snapshots</name> <name>Snapshots</name>
<url>http://172.16.1.6:8081/nexus/content/repositories/snapshots/</url> <url>http://172.16.1.6:8081/nexus/content/repositories/snapshots/</url>
</repository> </repository>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories> </repositories>
<modules> <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