Browse Source

#运行月报告

zhongwei
yang_shj 10 months ago
parent
commit
0b2abc5844
  1. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/AttributeVo.java
  2. 8
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveEchartVo.java
  3. 12
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/EchartValueVo.java
  4. 11
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/EchartVo.java
  5. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataShowVo.java
  6. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/DataService.java
  7. 38
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java
  8. 70
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java
  9. 65
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java
  10. 25
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java

22
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/AttributeVo.java

@ -1,22 +0,0 @@
package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
@ApiModel("曲线对象")
public class AttributeVo {
@ApiModelProperty("设备编码")
private String deviceCode;
@ApiModelProperty("属性")
private String signage;
@ApiModelProperty("属性名称")
private String signageName;
}

8
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveDataVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveEchartVo.java

@ -11,7 +11,7 @@ import java.util.List;
*/ */
@Data @Data
@ApiModel("运行数据对象") @ApiModel("运行数据对象")
public class CurveDataVo { public class CurveEchartVo {
@ApiModelProperty("设备编码") @ApiModelProperty("设备编码")
private String deviceCode; private String deviceCode;
@ -20,11 +20,11 @@ public class CurveDataVo {
private String deviceName; private String deviceName;
@ApiModelProperty("负荷曲线") @ApiModelProperty("负荷曲线")
private List<CurveAttributeVo> loadCurve; private List<EchartVo> loadCurve;
@ApiModelProperty("轴承温度曲线") @ApiModelProperty("轴承温度曲线")
private List<CurveAttributeVo> bearingTempCurve; private List<EchartVo> bearingTempCurve;
@ApiModelProperty("定子温度曲线") @ApiModelProperty("定子温度曲线")
private List<CurveAttributeVo> statorTempCurve; private List<EchartVo> statorTempCurve;
} }

12
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveAttributeVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/EchartValueVo.java

@ -4,15 +4,12 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
@Data @Data
@ApiModel("曲线对象") @ApiModel("运行数据对象")
public class CurveAttributeVo { public class EchartValueVo {
@ApiModelProperty("属性标识") @ApiModelProperty("属性标识")
private String attribute; private String attribute;
@ -20,6 +17,7 @@ public class CurveAttributeVo {
@ApiModelProperty("属性名称") @ApiModelProperty("属性名称")
private String attributeName; private String attributeName;
@ApiModelProperty("曲线") @ApiModelProperty("值")
private List<CurveVo> Curves; private Double value;
} }

11
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/EchartVo.java

@ -4,17 +4,18 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
@Data @Data
@ApiModel("曲线对象") @ApiModel("运行数据对象")
public class CurveVo { public class EchartVo {
@ApiModelProperty("时间:day") @ApiModelProperty("时间:day")
private String time; private String time;
@ApiModelProperty("值") @ApiModelProperty("数据对象")
private Double value; List<EchartValueVo> values;
} }

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataShowVo.java

@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
@ -29,4 +31,7 @@ public class RunDataShowVo extends RunMonthEntity {
@ApiModelProperty("年计划完成率") @ApiModelProperty("年计划完成率")
private Double yearRate; private Double yearRate;
@ApiModelProperty("曲线转换对象")
private List<CurveEchartVo> curveEcharts;
} }

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/DataService.java

@ -3,6 +3,7 @@ package com.hnac.hzims.scheduled.service.operation.plate;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -23,5 +24,7 @@ public interface DataService {
List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages); List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages);
List<AnalyzeDataConditionVO> periodTargetSignages(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, List<String> signages);
Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages); Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages);
} }

38
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java

@ -113,6 +113,44 @@ public class DataServiceImpl implements DataService {
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值 * @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6-> * @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号 * @param deviceCode 设备编号
* @param signages 指标集合
* @return
*/
@Override
public List<AnalyzeDataConditionVO> periodTargetSignages(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, List<String> signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
signages.forEach(signage->{
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setKeepFigures(2);
analyzeDataConditionPO.setAccessRules(accessRules);
analyzeDataConditionPO.setSaveTimeType(cycleType);
analyzeDataConditionPO.setSignages(signage);
// 间隔
analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
});
po.setSignboardConditions(signboardConditions);
log.error("period_targets_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
log.error("period_targets_data_resp {}",result);
return result.getData();
}
/***
* 指标数据列表查询
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号
* @param ride 配电比 * @param ride 配电比
* @param signages 指标 * @param signages 指标
* @return * @return

70
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java

@ -36,6 +36,7 @@ import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import com.hnac.hzinfo.datasearch.PointData; import com.hnac.hzinfo.datasearch.PointData;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient; import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient;
import com.hnac.hzinfo.datasearch.history.OriginalDataQuery; import com.hnac.hzinfo.datasearch.history.OriginalDataQuery;
import com.hnac.hzinfo.datasearch.soe.ISoeClient; import com.hnac.hzinfo.datasearch.soe.ISoeClient;
@ -640,6 +641,7 @@ public class ReportServiceImpl implements ReportService {
stations.forEach(station->{ stations.forEach(station->{
RunMonthEntity run = new RunMonthEntity(); RunMonthEntity run = new RunMonthEntity();
run.setStationCode(station.getCode()); run.setStationCode(station.getCode());
run.setStationName(station.getName());
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
//calendar.setTime(new Date()); //calendar.setTime(new Date());
calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME));
@ -885,6 +887,7 @@ public class ReportServiceImpl implements ReportService {
alarm.setDeviceName(entry.getValue().get(0).getDeviceName()); alarm.setDeviceName(entry.getValue().get(0).getDeviceName());
alarm.setContent(entry.getKey()); alarm.setContent(entry.getKey());
alarm.setType(String.valueOf(AlarmConstants.FAULT)); alarm.setType(String.valueOf(AlarmConstants.FAULT));
alarm.setTypeName("故障");
alarm.setCount(Math.max(entry.getValue().stream().filter(o->StringUtil.isNotBlank(o.getTraceCount())).mapToInt(soe->Integer.parseInt(soe.getTraceCount())).sum(), 1)); alarm.setCount(Math.max(entry.getValue().stream().filter(o->StringUtil.isNotBlank(o.getTraceCount())).mapToInt(soe->Integer.parseInt(soe.getTraceCount())).sum(), 1));
return alarm; return alarm;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -908,12 +911,15 @@ public class ReportServiceImpl implements ReportService {
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){ if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){
return new ArrayList<>(); return new ArrayList<>();
} }
return result.getData().getRecords().stream().collect(Collectors.groupingBy(StbAnalysisVO::getContent)).entrySet().stream().map(entry->{ return result.getData().getRecords().stream().collect(Collectors.groupingBy(StbAnalysisVO::getName)).entrySet().stream().map(entry->{
RunAlarmVo alarm = new RunAlarmVo(); RunAlarmVo alarm = new RunAlarmVo();
alarm.setAlarmTime(entry.getValue().stream().sorted(Comparator.comparing(StbAnalysisVO::getTs)).collect(Collectors.toList()).get(0).getTs()); alarm.setAlarmTime(entry.getValue().stream().sorted(Comparator.comparing(StbAnalysisVO::getTs)).collect(Collectors.toList()).get(0).getTs());
alarm.setDeviceName(entry.getValue().get(0).getDevicename()); alarm.setDeviceName(entry.getValue().get(0).getDevicename());
alarm.setContent(entry.getKey()); alarm.setContent(entry.getKey());
alarm.setType(String.valueOf(AlarmConstants.EARLY)); alarm.setType(String.valueOf(AlarmConstants.EARLY));
alarm.setTypeName("智能预警");
alarm.setReason(entry.getValue().get(0).getFinfo());
alarm.setMemo(entry.getValue().get(0).getInfo());
alarm.setCount(entry.getValue().size()); alarm.setCount(entry.getValue().size());
return alarm; return alarm;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -925,8 +931,8 @@ public class ReportServiceImpl implements ReportService {
* @return * @return
*/ */
private String curveData(List<RideDeviceVo> devices) { private String curveData(List<RideDeviceVo> devices) {
List<CurveDataVo> curveDatas = devices.stream().map(device->{ List<CurveEchartVo> curveDatas = devices.stream().map(device->{
CurveDataVo curveData = new CurveDataVo(); CurveEchartVo curveData = new CurveEchartVo();
curveData.setDeviceCode(device.getNumber()); curveData.setDeviceCode(device.getNumber());
curveData.setDeviceName(device.getName()); curveData.setDeviceName(device.getName());
// 负荷曲线 // 负荷曲线
@ -945,8 +951,10 @@ public class ReportServiceImpl implements ReportService {
* @param attributes * @param attributes
* @param deviceCode * @param deviceCode
* @return * @return
*
*
*/ */
private List<CurveAttributeVo> curve(List<AttributeVo> attributes, String deviceCode) { private List<EchartVo> curve(List<AttributeVo> attributes, String deviceCode) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
//calendar.setTime(new Date()); //calendar.setTime(new Date());
calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME));
@ -958,33 +966,47 @@ public class ReportServiceImpl implements ReportService {
calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE)); calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE));
calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND));
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
List<CurveAttributeVo> curveAttributes = new ArrayList<>(); List<AnalyzeDataConditionVO> datas = dataService.periodTargetSignages(start,end,3,3,deviceCode,attributes.stream().map(AttributeVo::getSignage).collect(Collectors.toList()));
attributes.forEach(attribute -> { if(CollectionUtil.isEmpty(datas)){
CurveAttributeVo signage = new CurveAttributeVo(); return new ArrayList<>();
signage.setAttribute(attribute.getSignage()); }
signage.setAttributeName(attribute.getSignageName()); List<AnalyseDataTaosVO> analyseDatas = new ArrayList<>();
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start,end,3,3,deviceCode,attribute.getSignage()); Calendar day = Calendar.getInstance();
if(CollectionUtil.isEmpty(records)){ datas.forEach(data->{
if(CollectionUtil.isEmpty(data.getList())){
return; return;
} }
signage.setCurves(records.stream().map(record -> { analyseDatas.addAll(data.getList().stream().peek(item->{
CurveVo curve = new CurveVo(); item.setSignage(data.getSignage());
Date date = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date date = DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s");
if(date.getDate() > 9){ day.setTime(date);
curve.setTime("0" + date.getDay()); if(day.get(Calendar.DAY_OF_MONTH) <= 9){
item.setTs("0" + day.get(Calendar.DAY_OF_MONTH));
}else{ }else{
curve.setTime(date.getDay() + ""); item.setTs(day.get(Calendar.DAY_OF_MONTH) + "");
} }
if(StringUtil.isEmpty(record.getVal())){ }).collect(Collectors.toList()));
curve.setValue(0.0); });
if(CollectionUtil.isEmpty(analyseDatas)){
return new ArrayList<>();
}
Map<String,List<AnalyseDataTaosVO>> map = analyseDatas.stream().collect(Collectors.groupingBy(AnalyseDataTaosVO::getTs));
return map.entrySet().stream().map(entry->{
EchartVo echart = new EchartVo();
echart.setTime(entry.getKey());
echart.setValues(entry.getValue().stream().map(value->{
EchartValueVo echartValue = new EchartValueVo();
echartValue.setAttribute(value.getSignage());
echartValue.setAttributeName(attributes.stream().filter(o->o.getSignage().equals(value.getSignage())).collect(Collectors.toList()).get(0).getSignageName());
if(StringUtil.isEmpty(value.getVal())){
echartValue.setValue(0.0);
}else{ }else{
curve.setValue(Double.valueOf(record.getVal())); echartValue.setValue(Double.parseDouble(value.getVal()));
} }
return curve; return echartValue;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
curveAttributes.add(signage); return echart;
}); }).sorted(Comparator.comparing(EchartVo::getTime)).collect(Collectors.toList());
return curveAttributes;
} }
/** /**

65
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java

@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.operational.report.entity.RunMonthEntity; import com.hnac.hzims.operational.report.entity.RunMonthEntity;
import com.hnac.hzims.operational.report.mapper.RunMonthMapper; import com.hnac.hzims.operational.report.mapper.RunMonthMapper;
import com.hnac.hzims.operational.report.service.RunMonthService; import com.hnac.hzims.operational.report.service.RunMonthService;
import com.hnac.hzims.operational.report.vo.RunAlarmVo; import com.hnac.hzims.operational.report.vo.*;
import com.hnac.hzims.operational.report.vo.RunDataShowVo;
import com.hnac.hzims.operational.report.vo.RunDataVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;
@ -33,7 +31,10 @@ import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author ysj * @author ysj
@ -81,6 +82,7 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
return data; return data;
} }
/** /**
* 导出站点月报文件 * 导出站点月报文件
* @param mon * @param mon
@ -130,7 +132,7 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
// 添加sheet页 // 添加sheet页
HSSFSheet sheet = hssWB.createSheet(headerName); HSSFSheet sheet = hssWB.createSheet(headerName);
// 绘制表格行标 // 绘制表格行标
int row = 2; int row = 1;
// 行高 // 行高
sheet.setDefaultRowHeight((short) (20 * 25)); sheet.setDefaultRowHeight((short) (20 * 25));
// 列宽 // 列宽
@ -139,36 +141,36 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
this.firstHeader(hssWB, sheet , headerName); this.firstHeader(hssWB, sheet , headerName);
// 一、表头格式设置 // 一、表头格式设置
this.titleHeader(hssWB, sheet,"1、运行数据总汇",row); this.titleHeader(hssWB, sheet,"1、运行数据总汇",row);
row =+ 1; row += 1;
// 运行数据表头 // 运行数据表头
this.runDataHeader(hssWB,sheet,row); this.runDataHeader(hssWB,sheet,row);
row =+ 1; row += 1;
// 运行数据填充 // 运行数据填充
List<RunDataVo> runData = JSONObject.parseObject(entity.getRunData(),new TypeReference<List<RunDataVo>>(){}); List<RunDataVo> runData = JSONObject.parseObject(entity.getRunData(),new TypeReference<List<RunDataVo>>(){});
row = this.runDataFill(hssWB,sheet,row,runData); row = this.runDataFill(hssWB,sheet,row,runData);
// 二、表头格式设置 // 二、表头格式设置
this.titleHeader(hssWB, sheet,"2、告警报表",row); this.titleHeader(hssWB, sheet,"2、告警报表",row);
row =+ 1; row += 1;
// 告警数据表头 // 告警数据表头
this.alarmHeader(hssWB,sheet,row); this.alarmHeader(hssWB,sheet,row);
row =+ 1; row += 1;
// 告警数据填充 // 告警数据填充
List<RunAlarmVo> runAlarm = JSONObject.parseObject(entity.getAlarmData(),new TypeReference<List<RunAlarmVo>>(){}); List<RunAlarmVo> runAlarm = JSONObject.parseObject(entity.getAlarmData(),new TypeReference<List<RunAlarmVo>>(){});
row = this.alarmDataFill(hssWB,sheet,row,runAlarm); row = this.alarmDataFill(hssWB,sheet,row,runAlarm);
// 三、表头格式设置 // 三、表头格式设置
this.titleHeader(hssWB, sheet,"3、机组负荷、温度曲线",row); this.titleHeader(hssWB, sheet,"3、机组负荷、温度曲线",row);
row =+ 1; row += 1;
// 四、表头格式设置 // 四、表头格式设置
this.titleHeader(hssWB, sheet,"4、运行数据分析",row); this.titleHeader(hssWB, sheet,"4、运行数据分析",row);
row =+ 1; row += 1;
// 五、表头格式设置 // 五、表头格式设置
this.titleHeader(hssWB, sheet,"5、运行建议及其他",row); this.titleHeader(hssWB, sheet,"5、运行建议及其他",row);
row =+ 1; row += 1;
return hssWB; return hssWB;
} }
@ -180,12 +182,12 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
private void firstHeader(HSSFWorkbook hssWB, HSSFSheet sheet,String headerName) { private void firstHeader(HSSFWorkbook hssWB, HSSFSheet sheet,String headerName) {
// 第一行 // 第一行
HSSFRow fisrtRow = sheet.createRow(0); HSSFRow fisrtRow = sheet.createRow(0);
this.setTitileStyle(hssWB, fisrtRow, 8, true,true,HorizontalAlignment.CENTER); this.setTitileStyle(hssWB, fisrtRow, 7, true,true,HorizontalAlignment.CENTER);
// 第一个单元格 // 第一个单元格
HSSFCell headCell = fisrtRow.getCell(0); HSSFCell headCell = fisrtRow.getCell(0);
headCell.setCellValue(headerName); headCell.setCellValue(headerName);
// 首行合并情况 // 首行合并情况
CellRangeAddress region1 = new CellRangeAddress(0, 0, (short) 0, (short) 8); CellRangeAddress region1 = new CellRangeAddress(0, 0, (short) 0, (short) 7);
sheet.addMergedRegion(region1); sheet.addMergedRegion(region1);
} }
@ -197,11 +199,11 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
private void titleHeader(HSSFWorkbook hssWB, HSSFSheet sheet,String title,int rowNumber) { private void titleHeader(HSSFWorkbook hssWB, HSSFSheet sheet,String title,int rowNumber) {
// 创建行 // 创建行
HSSFRow row_1 = sheet.createRow(rowNumber); HSSFRow row_1 = sheet.createRow(rowNumber);
this.setTitileStyle(hssWB, row_1, 8, false,true,HorizontalAlignment.LEFT); this.setTitileStyle(hssWB, row_1, 7, false,true,HorizontalAlignment.LEFT);
HSSFCell work_header_row_cell_1 = row_1.getCell(0); HSSFCell work_header_row_cell_1 = row_1.getCell(0);
work_header_row_cell_1.setCellValue(title); work_header_row_cell_1.setCellValue(title);
// 行合并情况 // 行合并情况
CellRangeAddress region1 = new CellRangeAddress(0, 0, (short) 0, (short) 8); CellRangeAddress region1 = new CellRangeAddress(rowNumber, rowNumber, (short) 0, (short) 7);
sheet.addMergedRegion(region1); sheet.addMergedRegion(region1);
} }
@ -213,7 +215,7 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
private void runDataHeader(HSSFWorkbook hssWB, HSSFSheet sheet,int rowNumber) { private void runDataHeader(HSSFWorkbook hssWB, HSSFSheet sheet,int rowNumber) {
// 创建行 // 创建行
HSSFRow row = sheet.createRow(rowNumber); HSSFRow row = sheet.createRow(rowNumber);
this.setTitileStyle(hssWB, row, 8, false,true,HorizontalAlignment.CENTER); this.setTitileStyle(hssWB, row, 7, false,true,HorizontalAlignment.CENTER);
// 第一行 // 第一行
HSSFCell row_cell_1 = row.getCell(0); HSSFCell row_cell_1 = row.getCell(0);
row_cell_1.setCellValue("组名"); row_cell_1.setCellValue("组名");
@ -247,10 +249,10 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
} }
int row = rowNumber; int row = rowNumber;
int endRow = rowNumber + runData.size(); int endRow = rowNumber + runData.size();
for (;row < endRow ; row ++){ for (;row < endRow; row ++){
// 创建行 // 创建行
HSSFRow frow = sheet.createRow(row); HSSFRow frow = sheet.createRow(row);
this.setTitileStyle(hssWB, frow, 8, false,false,HorizontalAlignment.CENTER); this.setTitileStyle(hssWB, frow, 7, false,false,HorizontalAlignment.CENTER);
// 组名 // 组名
HSSFCell frow_cell_1 = frow.getCell(0); HSSFCell frow_cell_1 = frow.getCell(0);
frow_cell_1.setCellValue(runData.get(row - rowNumber).getDeviceName()); frow_cell_1.setCellValue(runData.get(row - rowNumber).getDeviceName());
@ -289,18 +291,18 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
frow_cell_8.setCellValue("0%"); frow_cell_8.setCellValue("0%");
} }
} }
// 行合并情况
CellRangeAddress region3 = new CellRangeAddress(rowNumber, endRow , (short) 3, (short) 3);
CellRangeAddress region4 = new CellRangeAddress(rowNumber, endRow, (short) 4, (short) 4);
CellRangeAddress region5 = new CellRangeAddress(rowNumber, endRow, (short) 5, (short) 5);
CellRangeAddress region6 = new CellRangeAddress(rowNumber, endRow, (short) 6, (short) 6);
CellRangeAddress region7 = new CellRangeAddress(rowNumber, endRow, (short) 7, (short) 7);
sheet.addMergedRegion(region3);
sheet.addMergedRegion(region4);
sheet.addMergedRegion(region5);
sheet.addMergedRegion(region6);
sheet.addMergedRegion(region7);
} }
// 行合并情况
CellRangeAddress region3 = new CellRangeAddress(rowNumber, endRow - 1, (short) 3, (short) 3);
CellRangeAddress region4 = new CellRangeAddress(rowNumber, endRow - 1, (short) 4, (short) 4);
CellRangeAddress region5 = new CellRangeAddress(rowNumber, endRow - 1, (short) 5, (short) 5);
CellRangeAddress region6 = new CellRangeAddress(rowNumber, endRow - 1, (short) 6, (short) 6);
CellRangeAddress region7 = new CellRangeAddress(rowNumber, endRow - 1, (short) 7, (short) 7);
sheet.addMergedRegion(region3);
sheet.addMergedRegion(region4);
sheet.addMergedRegion(region5);
sheet.addMergedRegion(region6);
sheet.addMergedRegion(region7);
return endRow; return endRow;
} }
@ -342,7 +344,7 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
private void alarmHeader(HSSFWorkbook hssWB, HSSFSheet sheet,int rowNumber) { private void alarmHeader(HSSFWorkbook hssWB, HSSFSheet sheet,int rowNumber) {
// 创建行 // 创建行
HSSFRow row = sheet.createRow(rowNumber); HSSFRow row = sheet.createRow(rowNumber);
this.setTitileStyle(hssWB, row, 8, false,true,HorizontalAlignment.CENTER); this.setTitileStyle(hssWB, row, 7, false,true,HorizontalAlignment.CENTER);
// 第一行 // 第一行
HSSFCell row_cell_1 = row.getCell(0); HSSFCell row_cell_1 = row.getCell(0);
row_cell_1.setCellValue("组名"); row_cell_1.setCellValue("组名");
@ -381,7 +383,7 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
for (;row < endRow ; row ++){ for (;row < endRow ; row ++){
// 创建行 // 创建行
HSSFRow frow = sheet.createRow(row); HSSFRow frow = sheet.createRow(row);
this.setTitileStyle(hssWB, frow, 8, false,false,HorizontalAlignment.CENTER); this.setTitileStyle(hssWB, frow, 7, false,false,HorizontalAlignment.CENTER);
// 组名 // 组名
HSSFCell frow_cell_1 = frow.getCell(0); HSSFCell frow_cell_1 = frow.getCell(0);
frow_cell_1.setCellValue(runAlarm.get(row - rowNumber).getDeviceName()); frow_cell_1.setCellValue(runAlarm.get(row - rowNumber).getDeviceName());
@ -439,6 +441,7 @@ public class RunMonthServiceImpl extends BaseServiceImpl<RunMonthMapper, RunMont
headStyle.setBorderRight(BorderStyle.THIN); headStyle.setBorderRight(BorderStyle.THIN);
headStyle.setBorderTop(BorderStyle.THIN); headStyle.setBorderTop(BorderStyle.THIN);
headStyle.setBorderBottom(BorderStyle.THIN); headStyle.setBorderBottom(BorderStyle.THIN);
headStyle.setWrapText(true);
//格式: 居中、居右、居左..... //格式: 居中、居右、居左.....
headStyle.setAlignment(alignment); headStyle.setAlignment(alignment);
headStyle.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直居中 headStyle.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直居中

25
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java

@ -2,16 +2,8 @@ package com.hnac.hzims.ticket.repair.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.access.vo.ConstructionVo;
import com.hnac.hzims.ticket.repair.entity.RepairEntity;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import com.hnac.hzims.ticket.repair.service.IOperRepairService;
import com.hnac.hzims.ticket.repair.service.IWorkTaskService; import com.hnac.hzims.ticket.repair.service.IWorkTaskService;
import com.hnac.hzims.ticket.repair.service.impl.WorkTaskServiceImpl;
import com.hnac.hzims.ticket.repair.vo.RepairVO;
import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; import com.hnac.hzims.ticket.repair.vo.WorkTaskVO;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -22,17 +14,13 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import static com.alibaba.nacos.api.cmdb.pojo.PreservedEntityTypes.service;
/** /**
* @author ysj * @author ysj
*/ */
@ -52,22 +40,29 @@ public class WorkTaskController extends BladeController {
return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask)); return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask));
} }
@GetMapping("/preview") @GetMapping("/detail")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "详情")
public R<WorkTaskEntity> detail(@RequestParam Long id) {
return R.data(workTaskService.getById(id));
}
@GetMapping("/preview")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "工作任务单预览", notes = "工作任务单预览") @ApiOperation(value = "工作任务单预览", notes = "工作任务单预览")
public void preview(@RequestParam @ApiParam("工作任务单预览主键ID") @NotNull @Valid Long id) { public void preview(@RequestParam @ApiParam("工作任务单预览主键ID") @NotNull @Valid Long id) {
workTaskService.preview(id); workTaskService.preview(id);
} }
@GetMapping("/workTicketList") @GetMapping("/workTicketList")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 4)
@ApiOperation(value = "查询工作票") @ApiOperation(value = "查询工作票")
public R<List<WorkTicketInfoEntity>> workTicketList(@RequestParam(value = "ticketCode",required = false) String ticketCode) { public R<List<WorkTicketInfoEntity>> workTicketList(@RequestParam(value = "ticketCode",required = false) String ticketCode) {
return R.data(workTaskService.workTicketList(ticketCode)); return R.data(workTaskService.workTicketList(ticketCode));
} }
@PostMapping("/startProcess") @PostMapping("/startProcess")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 5)
@ApiOperation(value = "工作任务单") @ApiOperation(value = "工作任务单")
public R startV4(@RequestBody WorkTaskVO workTask) { public R startV4(@RequestBody WorkTaskVO workTask) {
return R.status(workTaskService.start(workTask)); return R.status(workTaskService.start(workTask));

Loading…
Cancel
Save