Commit cd69551c authored by 李腾威's avatar 李腾威

修改bug

parent b529676a
......@@ -150,7 +150,7 @@
</select>
<select id="getOther" resultType="Map">
SELECT distinct
SELECT distinct
a.rec_date recDate ,
b.company_name companyName,
c.resources_name carName,
......@@ -161,9 +161,9 @@
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
where a.sequence_nbr = (select sequence_nbr from jc_power_transfer where alert_called_id
where a.sequence_nbr in (select sequence_nbr from (select sequence_nbr from jc_power_transfer where alert_called_id
= #{alertId}
order by rec_date asc limit 1,100)
order by rec_date asc limit 1,100) as t )
</select>
......
......@@ -121,7 +121,7 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
String aircraft = "";
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList());
if(list1.size() > 0) {
if(ValidationUtil.isEmpty(list1.get(0).getFieldValue())) {
if(!ValidationUtil.isEmpty(list1.get(0).getFieldValue())) {
aircraft = list1.get(0).getFieldValue();
} else {
aircraft = list1.get(0).getFieldValueCode();
......
......@@ -35,7 +35,10 @@ import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttPersistenceException;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -834,7 +837,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List<Map<String, Object>> first = alertSubmittedMapper.getFirst(alertCalled.getSequenceNbr());
// 查询后续调派
List<Map<String, Object>> other = alertSubmittedMapper.getFirst(alertCalled.getSequenceNbr());
List<Map<String, Object>> other = alertSubmittedMapper.getOther(alertCalled.getSequenceNbr());
LinkedList<AlertCalledPowerInfoDto> list = new LinkedList<>();
for(int i = 0; i <first.size(); i++) {
......@@ -858,8 +861,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
for(int i = 0; i <other.size(); i++) {
AlertCalledPowerInfoDto dto = new AlertCalledPowerInfoDto();
handleFunc(dto,first.get(i));
LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate");
handleFunc(dto,other.get(i));
LocalDateTime dateTime = (LocalDateTime)other.get(i).get("recDate");
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8")));
dto.setArriveTime((DateUtils.dateFormat(date,DateUtils.HOUR_PATTERN)));
......@@ -1101,18 +1104,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (!ValidationUtil.isEmpty(dangerList)) {
firstSize = dangerList.get(0).getCellDatas().get(5).getRenderData().getText();
int fSizs = Integer.parseInt(firstSize);
dangerList.get(0).getCellDatas().get(5).getRenderData().setText("");
// 表格渲染和列表数据下标相反,需要翻转一下列表
List<RowRenderData> reverseList = Lists.reverse(dangerList);
table.removeRow(dangerListDataStartRow);
table.removeRow(dangerListDataStartRow);
// 循环插入行
int listLength = dangerList.size();
for (int i = 0; i < fSizs; i++) {
if(i == 0) {
TableStyle tableStyle = new TableStyle();
tableStyle.setAlign(Enum.forInt(2));
reverseList.get(i).getCellDatas().get(0).setCellStyle(tableStyle);
reverseList.get(i).getCellDatas().get(0).getRenderData().setText("增\n援\n力\n量");
Style style = new Style();
style.setFontFamily("宋体");
style.setFontSize(12);
......@@ -1132,23 +1132,43 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
MiniTableRenderPolicy.Helper.renderRow(table, dangerListDataStartRow, reverseList.get(i));
}
for (int i = fSizs; i < listLength ; i++) {
reverseList.get(i).getCellDatas().forEach(cellRenderData -> {
Style style = new Style();
style.setFontFamily("仿宋");
style.setFontSize(12);
cellRenderData.getRenderData().setStyle(style);
});
TableStyle tableStyle = new TableStyle();
tableStyle.setAlign(Enum.forInt(2));
reverseList.get(i).getCellDatas().get(0).setCellStyle(tableStyle);
reverseList.get(i).getCellDatas().get(0).getRenderData().setText("增\n援\n力\n量");
Style style = new Style();
style.setFontFamily("宋体");
style.setFontSize(12);
style.setBold(true);
reverseList.get(i).getCellDatas().get(0).getRenderData().setStyle(style);
// reverseList.get(i).getCellDatas().forEach(cellRenderData -> {
// Style style = new Style();
// style.setFontFamily("仿宋");
// style.setFontSize(12);
// cellRenderData.getRenderData().setStyle(style);
// });
XWPFTableRow insertNewTableRow = table.insertNewTableRow(dangerListDataStartRow);
IntStream.range(5,14).forEach(j -> insertNewTableRow.createCell());
MiniTableRenderPolicy.Helper.renderRow(table, dangerListDataStartRow, reverseList.get(i));
}
TableTools.mergeCellsVertically(table, 0, 0, fSizs + 1);
TableTools.mergeCellsVertically(table, 0, 0, fSizs+1);
if(listLength - fSizs > 1 ) {
TableTools.mergeCellsVertically(table, 0, fSizs + 2 , listLength + 1);
if(fSizs == 1 && (listLength - fSizs > 1)) {
TableTools.mergeCellsVertically(table, 0, fSizs +2 , fSizs + 2 + (listLength - fSizs -1));
}
if(fSizs > 1 && (listLength - fSizs > 1)) {
TableTools.mergeCellsVertically(table, 0, fSizs +2, fSizs + 2 + (listLength - fSizs -1));
}
XWPFTableRow xwpfTableRow = table.getRows().get(fSizs +2);
CTTc ctTc = xwpfTableRow.getTableCells().get(0).getCTTc();
CTTcPr ctTcPr = ctTc.addNewTcPr();
ctTcPr.addNewVAlign().setVal(STVerticalJc.CENTER);
}
}
......
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