Commit 948cdc1e authored by chenzhao's avatar chenzhao

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

parents da8857fb f0fb7968
......@@ -108,6 +108,12 @@ public class JpStationDto extends BaseDto {
@ExcelIgnore
private String type;
/**
* 电站类型
*/
@ExcelIgnore
private String stationType;
/**
* 组织编码
*/
@ExcelIgnore
......
......@@ -31,11 +31,11 @@ public interface DayGenerateMapper extends BaseMapper<DayGenerate> {
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PowerCurveDto> getDayGeneratqx(@Param("date") String month, @Param("thirdStationId") String thirdStationId,@Param("dto")List<String> statioId);
List<PowerCurveDto> getDayGeneratqx(@Param("date") String month,@Param("regionalCompaniesCode") String regionalCompaniesCode, @Param("amosCompanyCode") String amosCompanyCode, @Param("stationType") String stationType, @Param("thirdStationId") String thirdStationId,@Param("dto")List<String> statioId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PowerCurveDto> getMonthGenerateqx(@Param("date") String month, @Param("thirdStationId") String thirdStationId, @Param("dto")List<String> statioId);
List<PowerCurveDto> getMonthGenerateqx(@Param("date") String month,@Param("regionalCompaniesCode") String regionalCompaniesCode, @Param("amosCompanyCode") String amosCompanyCode, @Param("stationType") String stationType, @Param("thirdStationId") String thirdStationId, @Param("dto")List<String> statioId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PowerCurveDto> getYearGenerateqx(@Param("date") String month, @Param("thirdStationId") String thirdStationId, @Param("dto")List<String> statioId);
List<PowerCurveDto> getYearGenerateqx(@Param("date") String month,@Param("regionalCompaniesCode") String regionalCompaniesCode, @Param("amosCompanyCode") String amosCompanyCode, @Param("stationType") String stationType, @Param("thirdStationId") String thirdStationId, @Param("dto")List<String> statioId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
......
......@@ -47,6 +47,15 @@
#{item}
</foreach>
</if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="amosCompanyCode!=null and amosCompanyCode != ''">
and amos_company_code = #{amosCompanyCode}
</if>
<if test="stationType!=null and stationType != ''">
and stationType = #{stationType}
</if>
<if test="thirdStationId!=null and thirdStationId != ''">
and third_station_id = #{thirdStationId}
......@@ -72,6 +81,16 @@
</foreach>
</if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="amosCompanyCode!=null and amosCompanyCode != ''">
and amos_company_code = #{amosCompanyCode}
</if>
<if test="stationType!=null and stationType != ''">
and stationType = #{stationType}
</if>
<if test="thirdStationId!=null and thirdStationId != ''">
and third_station_id = #{thirdStationId}
</if>
......@@ -96,6 +115,16 @@
</foreach>
</if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="amosCompanyCode!=null and amosCompanyCode != ''">
and amos_company_code = #{amosCompanyCode}
</if>
<if test="stationType!=null and stationType != ''">
and stationType = #{stationType}
</if>
<if test="thirdStationId!=null and thirdStationId != ''">
and third_station_id = #{thirdStationId}
</if>
......
......@@ -241,17 +241,17 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
map= getDayListOfMonth(reviewDto.getTimeDateMonth());
// if(statioId!=null&&!statioId.isEmpty()) {
data = dayGenerateMapper.getDayGeneratqx(reviewDto.getTimeDateMonth(),reviewDto.getThirdStationId(), null);
data = dayGenerateMapper.getDayGeneratqx(reviewDto.getTimeDateMonth(),reviewDto.getRegionalCompaniesCode(), reviewDto.getAmosCompanyCode(), reviewDto.getStationType(),reviewDto.getThirdStationId(), null);
// }
}else if(type.equals("year")){
map= getyearListOfMonth(reviewDto.getTimeDateYear());
// if(statioId!=null&&!statioId.isEmpty()) {
data = dayGenerateMapper.getMonthGenerateqx(reviewDto.getTimeDateYear(),reviewDto.getThirdStationId(), null);
data = dayGenerateMapper.getMonthGenerateqx(reviewDto.getTimeDateYear(),reviewDto.getRegionalCompaniesCode(), reviewDto.getAmosCompanyCode(), reviewDto.getStationType(),reviewDto.getThirdStationId(), null);
// }
}else{
map= getyearList();
// if(statioId!=null&&!statioId.isEmpty()) {
data = dayGenerateMapper.getYearGenerateqx(null,reviewDto.getThirdStationId(), null);
data = dayGenerateMapper.getYearGenerateqx(null,reviewDto.getRegionalCompaniesCode(), reviewDto.getAmosCompanyCode(), reviewDto.getStationType(),reviewDto.getThirdStationId(), null);
// }
}
listx = map.get("x");
......
......@@ -40,6 +40,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -759,16 +761,17 @@ public class IdxBizFanHealthIndexController extends BaseController {
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
String orgCode = "NULL";
if(gatewayIds.size()>0){
orgCode =gatewayIds.get(0)+"%";
orgCode =gatewayIds.get(0)+'%';
}
if (WarningPeriodEnum.DAY.getName().equals(requiredType)){
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
Date endDate = DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate);
}
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate);
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(FanHealthIndexDay::getAnalysisTime)).collect(Collectors.toList());
......@@ -787,10 +790,10 @@ public class IdxBizFanHealthIndexController extends BaseController {
}else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8);
endTimeTop = formatter.format(endDate);
}
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8);
startTimeTop = formatter.format(startDate);
List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getAnalysisTime)).collect(Collectors.toList());
......@@ -810,10 +813,10 @@ public class IdxBizFanHealthIndexController extends BaseController {
}else {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8);
endTimeTop = formatter.format(endDate);
}
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8);
startTimeTop = formatter.format(startDate);
List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
......
......@@ -424,11 +424,11 @@ public class IdxBizPvHealthIndexController extends BaseController {
if (WarningPeriodEnum.DAY.getName().equals(requiredType)){
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
Date endDate =DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate);
}
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate);
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, (current - 1) * size, size, orgCode);
......@@ -448,10 +448,10 @@ public class IdxBizPvHealthIndexController extends BaseController {
}else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8);
endTimeTop = formatter.format(endDate);
}
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8);
startTimeTop = formatter.format(startDate);
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(PvHealthIndexHour::getAnalysisTime)).collect(Collectors.toList());
......@@ -474,10 +474,10 @@ public class IdxBizPvHealthIndexController extends BaseController {
SimpleDateFormat formatterNYRSF = new SimpleDateFormat("yyyy-MM-dd HH:mm");
if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8);
endTimeTop = formatter.format(endDate);
}
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8);
startTimeTop = formatter.format(startDate);
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
......
......@@ -112,8 +112,8 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
startTime = sdf.format(currentDayStartTime);
endTime= sdf.format(currentDayEndTime);
}else{
Date currentDayStartTime =dateFormat.parse(startTime);
Date currentDayEndTime = dateFormat.parse(endTime);
Date currentDayStartTime =DateUtils.dateParse(startTime);
Date currentDayEndTime = DateUtils.dateParse(endTime);
startTime = sdf.format(currentDayStartTime);
endTime= sdf.format(currentDayEndTime);
}
......
......@@ -22,7 +22,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
// "<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
"<if test='orgCode!= null'>AND org_code like '%${orgCode}%' </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
......@@ -44,7 +44,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>" +
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND org_code like '%${orgCode}%' </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"</script>")
int selectDataTotal(@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("equipmentName")String equipmentName,@Param("subSystem")String subSystem,@Param("analysisType")String analysisType,@Param("analysisObjType")String analysisObjType,@Param("station")String station,@Param("pointName")String pointName, @Param("indexAddress")String indexAddress,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("orgCode")String orgCode);
......
......@@ -318,7 +318,6 @@
<modules>
<module>amos-boot-biz-common</module>
<module>amos-boot-core</module>
<module>amos-boot-utils</module>
<module>amos-boot-data</module>
<module>amos-boot-system-jxiop</module>
</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