Commit 4ee4e972 authored by tangwei's avatar tangwei

解决冲突

parents b9876e03 79976dad
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -14,30 +16,40 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
/**
* 创建时间
*/
@ExcelIgnore
private Long createdTime;
/**
* 第三方场站id
*/
@ExcelIgnore
private String thirdStationId;
/**
* sncode
*日 yyyy-MM-dd
*/
private String snCode;
@ExcelProperty("时间")
private String dayTime;
/**
*日 yyyy-MM
* sncode
*/
private String monthTime;
@ExcelProperty("SN")
private String snCode;
/**
*月 yyyy
*/
private String year;
@ExcelIgnore
private String yearMonth;
/**
* 发电量
*/
@ExcelProperty("日发电量(kWh)")
private Double generate;
/**
* 满发小时数
*/
@ExcelProperty("日满发小时数(h)")
private Double fullhour;
@ExcelIgnore
private Double income;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "td_hygf_inverter_total_generate" ,autoResultMap = true)
public class TdHYGFInverterTotalGenerate implements Serializable {
/**
* 创建时间
*/
private Long createdTime;
/**
* 第三方场站id
*/
private String thirdStationId;
/**
* sncode
*/
private String snCode;
/**
*日 yyyy-MM
*/
private String yearTime;
/**
*月 yyyy
*/
private String year;
/**
* 发电量
*/
private Double generate;
/**
* 满发小时数
*/
private Double fullhour;
private Double income;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -14,30 +16,40 @@ public class TdHYGFInverterYearGenerate implements Serializable {
/**
* 创建时间
*/
@ExcelIgnore
private Long createdTime;
/**
* 第三方场站id
*/
@ExcelIgnore
private String thirdStationId;
/**
* sncode
*日 yyyy-MM
*/
private String snCode;
@ExcelProperty("时间")
private String monthTime;
/**
*日 yyyy-MM
* sncode
*/
private String yearTime;
@ExcelProperty("SN")
private String snCode;
/**
*月 yyyy
*/
@ExcelIgnore
private String year;
/**
* 发电量
*/
@ExcelProperty("月发电量(kWh)")
private Double generate;
/**
* 满发小时数
*/
@ExcelProperty("月满发小时数(h)")
private Double fullhour;
@ExcelIgnore
private Double income;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "td_hygf_station_day_generate" ,autoResultMap = true)
public class TdHYGFStationDayGenerate implements Serializable {
/**
* 创建时间
*/
private Long createdTime;
/**
* 第三方场站id
*/
private String thirdStationId;
/**
*日 yyyy-MM-dd
*/
private String dayTime;
/**
*月 yyyy-MM
*/
private String yearMonth;
/**
* 发电量
*/
private Double generate;
private Double fullhour;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "td_hygf_station_month_generate" ,autoResultMap = true)
public class TdHYGFStationMonthGenerate implements Serializable {
/**
* 创建时间
*/
private Long createdTime;
/**
* 第三方场站id
*/
private String thirdStationId;
/**
*日 yyyy-MM
*/
private String monthTime;
/**
*月 yyyy
*/
private String year;
/**
* 发电量
*/
private Double generate;
private Double fullhour;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author DELL
*/
@Data
@TableName(value = "td_hygf_station_year_generate" ,autoResultMap = true)
public class TdHYGFStationYearGenerate implements Serializable {
/**
* 创建时间
*/
private Long createdTime;
/**
* 第三方场站id
*/
private String thirdStationId;
/**
*日 yyyy-MM
*/
private String yearTime;
/**
*月 yyyy
*/
private String year;
/**
* 发电量
*/
private Double generate;
private Double fullhour;
}
......@@ -3,5 +3,12 @@ package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate;
import java.util.List;
import java.util.Map;
public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInverterDayGenerate> {
List<Map<String,Object>> selectDayTrend(List<String> treeParams, String time, String snCode, String thirdStationId);
}
......@@ -3,5 +3,11 @@ package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterMonthGenerate;
import java.util.List;
import java.util.Map;
public interface TdHYGFInverterMonthGenerateMapper extends BaseMapper<TdHYGFInverterMonthGenerate> {
List<Map<String,Object>> selectMonthTrend(String time, String snCode, String thirdStationId);
Map<String,Object> selectMonthTotal(String time, String snCode, String thirdStationId);
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterTotalGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterYearGenerate;
import java.util.List;
import java.util.Map;
public interface TdHYGFInverterYearGenerateMapper extends BaseMapper<TdHYGFInverterYearGenerate> {
List<Map<String, Object>> selectYearTrend(String time, String snCode, String thirdStationId);
List<Map<String, Object>> selectTotalTrend(String time, String snCode, String thirdStationId);
Map<String, Object> selectYearTotal(String time, String snCode, String thirdStationId);
List<TdHYGFInverterTotalGenerate> selectTotalSum(String time, String snCode, String thirdStationId);
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFStationDayGenerate;
public interface TdHYGFStationDayGenerateMapper extends BaseMapper<TdHYGFStationDayGenerate> {
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFStationMonthGenerate;
public interface TdHYGFStationMonthGenerateMapper extends BaseMapper<TdHYGFStationMonthGenerate> {
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFStationYearGenerate;
public interface TdHYGFStationYearGenerateMapper extends BaseMapper<TdHYGFStationYearGenerate> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHYGFInverterDayGenerateMapper">
<select id="selectDayTrend" resultType="map">
SELECT
<foreach collection="treeParams" item="item" separator=",">
#{item}
</foreach>,
created_time as `time`,
work_status as workstatus
from
house_pv_data.td_hygf_inverter_day_generate
<where>
created_time >= (#{time} - 8h )
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
<if test="thirdStationId != null and thirdStationId !=''">
and third_station_id = #{thirdStationId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHYGFInverterMonthGenerateMapper">
<select id="selectMonthTrend" resultType="map">
SELECT
day_time as dayTime,
generate,
fullhour
from
house_pv_data.td_hygf_inverter_month_generate
<where>
year_month = #{time}
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
<if test="thirdStationId != null and thirdStationId !=''">
and third_station_id = #{thirdStationId}
</if>
</where>
</select>
<select id="selectMonthTotal" resultType="map">
SELECT
generate,
fullhour,
income
from
house_pv_data.td_hygf_inverter_month_generate
<where>
day_time = #{time}
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
<if test="thirdStationId != null and thirdStationId !=''">
and third_station_id = #{thirdStationId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHYGFInverterYearGenerateMapper">
<select id="selectYearTrend" resultType="map">
SELECT
month_time as daytime,
generate,
fullhour
from
house_pv_data.td_hygf_inverter_year_generate
<where>
`year` = #{time}
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
<if test="thirdStationId != null and thirdStationId !=''">
and third_station_id = #{thirdStationId}
</if>
</where>
</select>
<select id="selectTotalTrend" resultType="map">
SELECT
year_time as dayTime,
generate,
fullhour
from
house_pv_data.td_hygf_inverter_total_generate
<where>
<if test="time != null and time !=''">
and year_time = #{time}
</if>
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
<if test="thirdStationId != null and thirdStationId !=''">
and third_station_id = #{thirdStationId}
</if>
</where>
</select>
<select id="selectYearTotal" resultType="map">
SELECT
income ,
generate,
fullhour
from
house_pv_data.td_hygf_inverter_year_generate
<where>
month_time = #{time}
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
<if test="thirdStationId != null and thirdStationId !=''">
and third_station_id = #{thirdStationId}
</if>
</where>
</select>
<select id="selectTotalSum" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterTotalGenerate">
SELECT
income ,
generate,
fullhour
from
house_pv_data.td_hygf_inverter_total_generate
<where>
<if test="time != null and time !=''">
year_time = #{time}
</if>
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
<if test="thirdStationId != null and thirdStationId !=''">
and third_station_id = #{thirdStationId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHYGFStationDayGenerateMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHYGFStationMonthGenerateMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHYGFStationYearGenerateMapper">
</mapper>
......@@ -182,7 +182,7 @@ public class HouseholdContractController extends BaseController {
//去签署
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "post", value = "根据sequenceNbr发起", notes = "根据sequenceNbr发起")
@ApiOperation(httpMethod = "POST", value = "根据sequenceNbr发起", notes = "根据sequenceNbr发起")
public ResponseModel<HouseholdContractDto> qsBySequenceNbrHouseholdContract(@RequestBody HouseholdContractDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(householdContractServiceImpl.updateWithModel(model));
......@@ -191,7 +191,7 @@ public class HouseholdContractController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping (value = "/signing/{sequenceNbr}")
@ApiOperation(httpMethod = "Post", value = "签字", notes = "签字")
@ApiOperation(httpMethod = "POST", value = "签字", notes = "签字")
public ResponseModel<Boolean> signing(@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
HouseholdContract householdContrac= householdContractServiceImpl.getById(sequenceNbr);
......@@ -207,7 +207,7 @@ public class HouseholdContractController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping (value = "/stamp/{sequenceNbr}")
@ApiOperation(httpMethod = "Post", value = "盖章", notes = "盖章")
@ApiOperation(httpMethod = "POST", value = "盖章", notes = "盖章")
public ResponseModel<Boolean> stamp(@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
......@@ -250,7 +250,7 @@ public class HouseholdContractController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping (value = "/cancel/{sequenceNbr}")
@ApiOperation(httpMethod = "Post", value = "作废", notes = "作废")
@ApiOperation(httpMethod = "POST", value = "作废", notes = "作废")
public ResponseModel<Boolean> cancel(@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(this.canceldata(sequenceNbr));
}
......@@ -298,7 +298,7 @@ public class HouseholdContractController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping (value = "/reissue")
@ApiOperation(httpMethod = "post", value = "重新发起", notes = "重新发起")
@ApiOperation(httpMethod = "POST", value = "重新发起", notes = "重新发起")
public ResponseModel<HouseholdContract> reissue(@RequestBody HouseholdContract model ) {
HouseholdContract householdContract= householdContractServiceImpl.reissueinitiateHouseholdContract(model);
return ResponseHelper.buildResponse(householdContract);
......
......@@ -364,11 +364,18 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "查询当前登录人权限区域公司", notes = "查询当前登录人权限区域公司")
@GetMapping(value = "/getRegion")
@UserLimits
public ResponseModel< List<DropDown>> getRegion() {
public ResponseModel<List<Map<String,String>>> getRegion() {
List<DropDown> list= jpStationMapper.getRegion();
List<Map<String,String>> result = new ArrayList<>();
list.forEach(dropDown -> {
Map<String,String> item = new HashMap<>();
item.put("name",dropDown.getName());
item.put("value",dropDown.getOrgCode());
result.add(item);
});
return ResponseHelper.buildResponse(list);
return ResponseHelper.buildResponse(result);
}
......@@ -377,9 +384,16 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "查询当前登录人权限经销商", notes = "查询当前登录人权限经销商")
@GetMapping(value = "/getDealer")
@UserLimits
public ResponseModel<List<DropDown>> getDealer(String regionalCompaniesCode ) {
public ResponseModel<List<Map<String,String>>> getDealer(String regionalCompaniesCode ) {
List<DropDown> list= jpStationMapper.getDealer(regionalCompaniesCode);
return ResponseHelper.buildResponse(list);
List<Map<String,String>> result = new ArrayList<>();
list.forEach(dropDown -> {
Map<String,String> item = new HashMap<>();
item.put("name",dropDown.getName());
item.put("value",dropDown.getOrgCode());
result.add(item);
});
return ResponseHelper.buildResponse(result);
}
//电站发电量统计
......
......@@ -89,7 +89,7 @@ public class QiyuesuoController extends BaseController {
private String engineering;
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "post",value = "个人token", notes = "个人token")
@ApiOperation(httpMethod = "POST",value = "个人token", notes = "个人token")
@PostMapping (value = "/getUserToken")
public ResponseModel<Object> getSdkResponse(@RequestBody UserAuthMiniappTicketRequest request) {
......@@ -99,7 +99,7 @@ public class QiyuesuoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "post",value = "合同token", notes = "合同token")
@ApiOperation(httpMethod = "POST",value = "合同token", notes = "合同token")
@PostMapping (value = "/getContractToken")
public ResponseModel<Object> getContractSdkResponse(@RequestBody ContractMiniappTicketRequest request) {
......@@ -108,7 +108,7 @@ public class QiyuesuoController extends BaseController {
return ResponseHelper.buildResponse(result.getResult());
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "post",value = "合同token", notes = "合同token")
@ApiOperation(httpMethod = "POST",value = "合同token", notes = "合同token")
@PostMapping (value = "/getContractTokengz/{sequenceNbr}")
public ResponseModel<Object> getContractSdkResponseSequenceNbr(@RequestBody ContractMiniappTicketRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
......@@ -122,7 +122,7 @@ public class QiyuesuoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "post",value = "创建合同", notes = "创建合同")
@ApiOperation(httpMethod = "POST",value = "创建合同", notes = "创建合同")
@PostMapping (value = "/addContract")
public ResponseModel<HouseholdContract> initiateHouseholdContract(@RequestBody HouseholdContractDto model) {
HouseholdContract householdContract=householdContractServiceImpl.initiateHouseholdContract(model);
......@@ -132,7 +132,7 @@ public class QiyuesuoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "post",value = "契约锁回调接口", notes = "契约锁回调接口")
@ApiOperation(httpMethod = "POST",value = "契约锁回调接口", notes = "契约锁回调接口")
@PostMapping (value = "/callback")
public String callback( String content) {
try {
......@@ -231,7 +231,7 @@ public class QiyuesuoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "post",value = "获取经销商单位", notes = "liebiao ")
@ApiOperation(httpMethod = "POST",value = "获取经销商单位", notes = "liebiao ")
@PostMapping (value = "/getUnit1000")
public ResponseModel<ContractListResult> getUnit1000(@RequestBody ContractListRequest request) {
......@@ -268,7 +268,7 @@ public class QiyuesuoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "post",value = "创建合同", notes = "创建合同")
@ApiOperation(httpMethod = "POST",value = "创建合同", notes = "创建合同")
@PostMapping (value = "/getUnit2000")
public ResponseModel<SdkResponse<Object>> getUnit2000(@RequestBody Map<String,String> map) {
......
## DB properties:
spring.datasource.dynamic.primary= mysql-service
spring.datasource.mysql-service.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.mysql-service.jdbc-url=jdbc:mysql://172.16.10.220:3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.jdbc-url=jdbc:mysql://172.16.10.220:3306/amos_project_2023?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.username=root
spring.datasource.mysql-service.password=Yeejoin@2020
spring.datasource.mysql-service.type=com.zaxxer.hikari.HikariDataSource
......
[
{
"name": "直流电压",
"key": "voltage",
"key": "acv",
"children": [
{"name":"直流电压PV1",
"key": "acv1"
"key": "acv_1",
"unit": "V"
},
{"name":"直流电压PV2",
"key": "acv2"
"key": "acv_2",
"unit": "V"
},
{"name":"直流电压PV3",
"key": "acv3"
"key": "acv_3",
"unit": "V"
},
{"name":"直流电压PV4",
"key": "acv4"
"key": "acv_4",
"unit": "V"
}
]
},
{
"name": "直流电流",
"key": "current",
"key": "acc",
"children": [
{"name":"直流电流PV1",
"key": "acc1"
"key": "acc_1",
"unit": "A"
},
{"name":"直流电流PV2",
"key": "acc2"
"key": "acc_2",
"unit": "A"
},
{"name":"直流电流PV3",
"key": "acc3"
"key": "acc_3",
"unit": "A"
},
{"name":"直流电流PV4",
"key": "acc4"
"key": "acc_4",
"unit": "A"
}
]
},
......@@ -54,66 +62,73 @@
]},
{
"name": "U_交流电压",
"key": "1",
"key": "acv1",
"unit": "V",
"children": [
]
},
{
"name": "V_交流电压",
"key": "2",
"key": "acv2",
"unit": "V",
"children": [
]
}, {
"name": "W_交流电压",
"key": "3",
"key": "acv3",
"unit": "V",
"children": [
]
},
{
"name": "U_交流电流",
"key": "4",
"key": "acc1",
"unit": "A",
"children": [
]
},
{
"name": "W_交流电流",
"key": "5",
"key": "acc3",
"unit": "A",
"children": [
]
},
{
"name": "V_交流电流",
"key": "6",
"key": "acc2",
"unit": "A",
"children": [
]
},
{
"name": "交流输出频率",
"key": "7",
"key": "frequency",
"unit": "Hz",
"children": [
]
},
{
"name": "总功率",
"key": "totalPower",
"key": "total_power",
"children": [
]
},
{
"name": "当日电量",
"key": "dayGen",
"key": "day_gen",
"children": [
]
},
{
"name": "累计电量",
"key": "totalGen",
"key": "total_gen",
"children": [
]
},
{
"name": "IGBT温度",
"key": "igbtTmep",
"key": "igbt_temp",
"children": [
]
}
......
......@@ -129,4 +129,10 @@ public class CommonConstans {
put("按天", DatePattern.NORM_DATE_PATTERN);
}
};
public static final String ANALYSE_TYPE_MOMENT = "按时刻";
public static final String ANALYSE_TYPE_HOUR = "按小时";
public static final String ANALYSE_TYPE_DAY = "按天";
}
......@@ -202,7 +202,7 @@ public class BigScreenAnalyseController extends BaseController {
public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception {
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea();
Map<String, Integer> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> Integer.valueOf(t.get("healthIndex").toString().replace(".0", ""))));
Map<String, Object> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> t.get("healthIndex")));
// List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
List<String> list = new ArrayList<>();
......@@ -220,7 +220,7 @@ public class BigScreenAnalyseController extends BaseController {
}
list = companyModels.stream().map(CompanyModel::getCompanyName).collect(Collectors.toList());
List<Object> seriesData = new ArrayList<>();
list.forEach(item -> seriesData.add(collect.getOrDefault(item, 100)));
list.forEach(item -> seriesData.add(collect.getOrDefault(item, 100.0)));
resultMap.put("axisData", list);
resultMap.put("seriesData", seriesData);
return ResponseHelper.buildResponse(resultMap);
......
......@@ -392,7 +392,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
page.setRecords(fanHealthIndexDays);
page.setTotal(total);
page.setTotal(Long.valueOf(fanHealthIndexDays.size()));
// page.setTotal(Long.valueOf(fanHealthIndexDays.size()));
return ResponseHelper.buildResponse(page);
}
......@@ -549,6 +549,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
Page page = new Page<>();
page.setCurrent(current);
page.setSize(size);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
page.setTotal(total);
page.setRecords(fanHealthIndexDays);
return ResponseHelper.buildResponse(page);
}else if (requiredType.equals("按小时")){
......@@ -578,6 +580,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
Page page = new Page<>();
page.setCurrent(current);
page.setSize(size);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
page.setTotal(total);
page.setRecords(fanHealthIndexHours);
return ResponseHelper.buildResponse(page);
}else {
......@@ -600,6 +604,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
Page page = new Page<>();
page.setCurrent(current);
page.setSize(size);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
page.setTotal(total);
page.setRecords(fanHealthIndexMoments);
return ResponseHelper.buildResponse(page);
}
......
......@@ -95,5 +95,9 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
List<Map<String, Object>> getWarningInfoBySubSystemTd(@Param("subSystem") String subSystem, @Param("gatewayId") String gatewayId);
String getInfoByDate(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode, @Param("date") String date);
List<Map<String,Object>> getInfoByDate(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode, @Param("list") List<String> list);
List<Map<String,Object>> getInfoByHour(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode, @Param("list") List<String> list);
List<Map<String,Object>> getInfoByMoment(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode, @Param("list") List<String> list);
}
......@@ -334,14 +334,18 @@
group by point_name
</select>
<select id="getInfoByDate" resultType="java.lang.String">
select ceil(avg(b.health_index)) as healthIndex from
<select id="getInfoByDate" resultType="java.util.Map">
select avg(b.health_index) as healthIndex,b.rec_date AS recDate from
(SELECT
health_index
health_index,
rec_date
FROM
pv_health_index_day
<where>
rec_date = concat(#{date}, ' 00:00:00')
rec_date IN
<foreach collection="list" separator="," item="item" index="index" open="(" close=")">
#{item}
</foreach>
<if test="areaCode != null and areaCode != ''">
AND area like #{areaCode}
AND analysis_obj_type = '片区'
......@@ -357,12 +361,15 @@
UNION ALL
(
SELECT
health_index
health_index,
rec_date
FROM
fan_health_index_day
<where>
rec_date = concat(#{date}, ' 00:00:00')
rec_date IN
<foreach collection="list" separator="," item="item" index="index" open="(" close=")">
#{item}
</foreach>
<if test="areaCode != null and areaCode != ''">
AND area like #{areaCode}
AND analysis_obj_type = '片区'
......@@ -375,10 +382,110 @@
AND analysis_obj_type = '片区'
</if>
</where>
)) b
)) b GROUP BY b.rec_date
</select>
<select id="getInfoByHour" resultType="java.util.Map">
select avg(b.health_index) as healthIndex,b.rec_date AS recDate from
(SELECT
health_index,
rec_date
FROM
pv_health_index_hour
<where>
rec_date IN
<foreach collection="list" separator="," item="item" index="index" open="(" close=")">
#{item}
</foreach>
<if test="areaCode != null and areaCode != ''">
AND area like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND gateway_id = #{stationCode}
AND analysis_obj_type = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
AND analysis_obj_type = '片区'
</if>
</where>
UNION ALL
(
SELECT
health_index,
rec_date
FROM
fan_health_index_hour
<where>
rec_date IN
<foreach collection="list" separator="," item="item" index="index" open="(" close=")">
#{item}
</foreach>
<if test="areaCode != null and areaCode != ''">
AND area like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND gateway_id = #{stationCode}
AND analysis_obj_type = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
AND analysis_obj_type = '片区'
</if>
</where>
)) b GROUP BY b.rec_date
</select>
<select id="getInfoByMoment" resultType="java.util.Map">
select avg(b.health_index) as healthIndex,b.rec_date AS recDate from
(SELECT
health_index,
rec_date
FROM
pv_health_index_moment
<where>
rec_date IN
<foreach collection="list" separator="," item="item" index="index" open="(" close=")">
#{item}
</foreach>
<if test="areaCode != null and areaCode != ''">
AND area like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND gateway_id = #{stationCode}
AND analysis_obj_type = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
AND analysis_obj_type = '片区'
</if>
</where>
UNION ALL
(
SELECT
health_index,
rec_date
FROM
fan_health_index_moment
<where>
rec_date IN
<foreach collection="list" separator="," item="item" index="index" open="(" close=")">
#{item}
</foreach>
<if test="areaCode != null and areaCode != ''">
AND area like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND gateway_id = #{stationCode}
AND analysis_obj_type = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
AND analysis_obj_type = '片区'
</if>
</where>
)) b GROUP BY b.rec_date
</select>
<select id="getInfoListByGroupByQgFan" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex">
......
......@@ -4,7 +4,7 @@
<select id="getHealthInfoByArea" resultType="java.util.Map">
select area as area,
ceil(avg(a.avghealthindex)) as healthIndex
avg(a.avghealthindex) as healthIndex
from (
select avg(health_index) as avghealthindex,
area
......
......@@ -111,6 +111,7 @@
</select>
<select id="selectWarningPoint" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord">
select * from (
SELECT
a.station,
a.warning_name,
......@@ -134,7 +135,7 @@
point_name,
rec_date ,
content,
warning_name
warning_name) b
limit #{current},#{size}
</select>
......
......@@ -2,7 +2,7 @@
{
"title": "逆变器台数",
"title1": "逆变器台数(台)",
"url": "upload/jxiop/amos_studio/EA3572E1BD31DC1E7D8DA162F09ECB.png"
"url": "upload/jxiop/amos_studio/4C82F011332D3EE6E378B7DF2E2F483.png"
},
{
"title": "装机容量",
......
......@@ -68,19 +68,26 @@ public class PersonYardMessage extends EmqxListener {
};
public void jxIopUpdate(JSONObject analysisResult) {
try {
Thread.sleep(10000); // 等待3秒
log.info("人员赋码数据:{}", analysisResult);
String warningObjectCode = String.valueOf(analysisResult.get("warningObjectCode"));
String codeColor = String.valueOf(analysisResult.get("codeColor"));
PersonBasic personBasic = personBasicMapper.selectById(warningObjectCode);
if (ObjectUtils.isEmpty(personBasic)) {
try {
emqKeeper.getMqttClient().publish("ryfm/warning/coding", analysisResult.toJSONString().getBytes(), 2, Boolean.FALSE);
} catch (MqttException e) {
e.printStackTrace();
}
} else {
log.info("人员基础信息:{}", JSON.toJSONString(personBasic));
// if (ObjectUtils.isEmpty(personBasic)) {
// try {
// emqKeeper.getMqttClient().publish("ryfm/warning/coding", analysisResult.toJSONString().getBytes(), 2, Boolean.FALSE);
// } catch (MqttException e) {
// e.printStackTrace();
// }
// } else {
personBasic.setQrcodeColor(codeColor);
personBasicMapper.updateById(personBasic);
} catch (InterruptedException e) {
e.printStackTrace();
}
// }
}
}
......@@ -228,10 +228,17 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
// personBasic.setQrcodeColor(QrcodeColorEnum.YELLOW.getCode());
personBasic.setQrcodeDesc("证书临期");
}
this.baseMapper.insert(personBasic);
CompanyModel companyModel = new CompanyModel();
//单位
companyModel = this.getCompanyModel(personAccount.getProjectId());
personBasic.setProjectOrgCode(companyModel.getOrgCode());
if (personUser.getNativePlace()!=null) {
personBasic.setNativePlace(JSON.toJSONString(personUser.getNativePlace()));
}
this.baseMapper.insert(personBasic);
if ("证书不全".equals(personBasic.getQrcodeDesc()) || "证书临期".equals(personBasic.getQrcodeDesc())) {
personBasic.setProjectOrgCode(companyModel.getOrgCode());
personAccount.setProjectName(companyModel.getCompanyName());
......@@ -308,15 +315,15 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
//personBasic.setProjectOrgCode(departmentModel.getOrgCode());
personAccount.setProjectDepartmentName(departmentModel.getDepartmentName());
}
personBasic.setProjectOrgCode(companyModel.getOrgCode());
if (personUser.getNativePlace()!=null) {
personBasic.setNativePlace(JSON.toJSONString(personUser.getNativePlace()));
}
// personBasic.setProjectOrgCode(companyModel.getOrgCode());
//
//
// if (personUser.getNativePlace()!=null) {
// personBasic.setNativePlace(JSON.toJSONString(personUser.getNativePlace()));
// }
personAccount.setPuserId(agencyUserModel.getUserId());
personAccount.setProjectName(companyModel.getCompanyName());
this.personBasicMapper.updateById(personBasic);
// this.personBasicMapper.updateById(personBasic);
this.personAccountService.updateById(personAccount);
PersonAccountFed personAccountFed = new PersonAccountFed();
......@@ -413,47 +420,17 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode());
personBasic.setQrcodeDesc("证书齐全");
} else if (CollectionUtils.isEmpty(list) && isOver == 1) {
// personBasic.setQrcodeColor(QrcodeColorEnum.RED.getCode());
personBasic.setQrcodeColor(QrcodeColorEnum.RED.getCode());
personBasic.setQrcodeDesc("证书不全");
} else if (CollectionUtils.isEmpty(list) && isOver == 0 && isInMonth == 1) {
// personBasic.setQrcodeColor(QrcodeColorEnum.YELLOW.getCode());
personBasic.setQrcodeColor(QrcodeColorEnum.YELLOW.getCode());
personBasic.setQrcodeDesc("证书临期");
}
personBasic.setProjectOrgCode(companyModel.getOrgCode());
personAccount.setProjectName(companyModel.getCompanyName());
if (!qrcodeDescOld.equals(personBasic.getQrcodeDesc())) {
personBasic.setRecDate(new Date());
this.personBasicMapper.updateById(personBasic);
if (("证书不全".equals(personBasic.getQrcodeDesc()) ||
"证书临期".equals(personBasic.getQrcodeDesc()))) {
BizMessage bizMessage = new BizMessage();
bizMessage.setIndexKey("RYFM");
bizMessage.setIndexValue(personBasic.getPostName() + personBasic.getQrcodeDesc());
RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount);
bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setDataSource("人员赋码");
try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) {
e.printStackTrace();
}
} else if ("证书齐全".equals(personBasic.getQrcodeDesc())) {
HashMap<String, String> personMap = new HashMap<>();
personMap.put("objectId", String.valueOf(personBasic.getSequenceNbr()));
personMap.put("qrCodeColor", qrcodeColorOld);
personMap.put("warningObjectType", "RYFM");
personMap.put("sourceAttribution", personBasic.getProjectOrgCode());
personMap.put("sourceAttributionDesc", personAccount.getProjectName());
personMap.put("warningSourceType", "人员赋码");
try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_GREEN, JSON.toJSONString(personMap).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) {
e.printStackTrace();
}
}
}
//人员账号信息
personAccount.setPersonId(sequenceNbr);
......@@ -501,7 +478,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
if (personAccount.getDepartmentId() != null) {
departmentModel = this.getdepartmentModel(personAccount.getDepartmentId());
}
BeanUtils.copyProperties(personUser, personBasic);
BeanUtils.copyProperties(personUser, personBasic, "qrcodeDesc", "qrcodeColor");
if (departmentModel != null) {
//personBasic.setProjectOrgCode(departmentModel.getOrgCode());
personAccount.setProjectDepartmentName(departmentModel.getDepartmentName());
......@@ -512,7 +489,40 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
personBasic.setNativePlace(JSON.toJSONString(personUser.getNativePlace()));
}
personAccount.setProjectName(companyModel.getCompanyName());
if (!qrcodeDescOld.equals(personBasic.getQrcodeDesc())) {
personBasic.setRecDate(new Date());
this.personBasicMapper.updateById(personBasic);
if (("证书不全".equals(personBasic.getQrcodeDesc()) ||
"证书临期".equals(personBasic.getQrcodeDesc()))) {
BizMessage bizMessage = new BizMessage();
bizMessage.setIndexKey("RYFM");
bizMessage.setIndexValue(personBasic.getPostName() + personBasic.getQrcodeDesc());
RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount);
bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setDataSource("人员赋码");
try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) {
e.printStackTrace();
}
} else if ("证书齐全".equals(personBasic.getQrcodeDesc())) {
HashMap<String, String> personMap = new HashMap<>();
personMap.put("objectId", String.valueOf(personBasic.getSequenceNbr()));
personMap.put("qrCodeColor", qrcodeColorOld);
personMap.put("warningObjectType", "RYFM");
personMap.put("sourceAttribution", personBasic.getProjectOrgCode());
personMap.put("sourceAttributionDesc", personAccount.getProjectName());
personMap.put("warningSourceType", "人员赋码");
try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_GREEN, JSON.toJSONString(personMap).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) {
e.printStackTrace();
}
}
} else {
this.personBasicMapper.updateById(personBasic);
}
personAccountService.updateById(personAccount);
PersonAccountFed personAccountFed = new PersonAccountFed();
......
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