Commit 092818f7 authored by hezhuozhi's avatar hezhuozhi

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

parents bdc55da1 ceda0a63
...@@ -39,7 +39,7 @@ public class HandleESMessage2TDService { ...@@ -39,7 +39,7 @@ public class HandleESMessage2TDService {
/** /**
* 十分钟拉取ES数据存入TdEngine * 十分钟拉取ES数据存入TdEngine
*/ */
@Scheduled(cron = "0 */10 * * * ?") @Scheduled(cron = "0 */2 * * * ?")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void syncEsData2TDEngine() throws Exception { public void syncEsData2TDEngine() throws Exception {
SimpleDateFormat format = new SimpleDateFormat(datePattern); SimpleDateFormat format = new SimpleDateFormat(datePattern);
...@@ -56,7 +56,7 @@ public class HandleESMessage2TDService { ...@@ -56,7 +56,7 @@ public class HandleESMessage2TDService {
try { try {
HashMap<String, String> syncFlag = new HashMap<>(); HashMap<String, String> syncFlag = new HashMap<>();
syncFlag.put("sync_flag", "success"); syncFlag.put("sync_flag", "success");
emqKeeper.getMqttClient().publish("sync_esdata_to_tdengine_notice", JSON.toJSONString(syncFlag).getBytes(), 0, false); emqKeeper.getMqttClient().publish("sync_esdata_to_tdengine_notice1", JSON.toJSONString(syncFlag).getBytes(), 0, false);
log.info("同步ES数据至发发送消息给业务发送通知成功!"); log.info("同步ES数据至发发送消息给业务发送通知成功!");
} catch (Exception exception) { } catch (Exception exception) {
log.info("同步ES数据至发发送消息给业务发送通知失败!"); log.info("同步ES数据至发发送消息给业务发送通知失败!");
......
#mysql ??? #mysql ???
spring.datasource.mysql-server.driver-class-name=com.kingbase8.Driver spring.datasource.mysql-server.driver-class-name=com.kingbase8.Driver
spring.datasource.mysql-server.jdbc-url = jdbc:kingbase8://10.20.1.176:54321/equipment?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&currentSchema=root spring.datasource.mysql-server.jdbc-url = jdbc:kingbase8://10.20.1.176:54321/equipment?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&currentSchema=root
...@@ -14,7 +15,7 @@ spring.datasource.mysql-server.hikari.connection-timeout= 60000 ...@@ -14,7 +15,7 @@ spring.datasource.mysql-server.hikari.connection-timeout= 60000
spring.datasource.mysql-server.hikari.connection-test-query= SELECT 1 spring.datasource.mysql-server.hikari.connection-test-query= SELECT 1
#TDengine ??? #TDengine ???
spring.datasource.tdengine-server.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver spring.datasource.tdengine-server.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
spring.datasource.tdengine-server.jdbc-url = jdbc:TAOS-RS://139.9.170.47:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true spring.datasource.tdengine-server.jdbc-url = jdbc:TAOS-RS://10.20.0.169:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.datasource.tdengine-server.username=root spring.datasource.tdengine-server.username=root
spring.datasource.tdengine-server.password=taosdata spring.datasource.tdengine-server.password=taosdata
spring.datasource.tdengine-server.type=com.zaxxer.hikari.HikariDataSource spring.datasource.tdengine-server.type=com.zaxxer.hikari.HikariDataSource
...@@ -27,8 +28,11 @@ spring.datasource.tdengine-server.hikari.max-lifetime= 1800000 ...@@ -27,8 +28,11 @@ spring.datasource.tdengine-server.hikari.max-lifetime= 1800000
spring.datasource.tdengine-server.hikari.connection-timeout= 60000 spring.datasource.tdengine-server.hikari.connection-timeout= 60000
spring.datasource.tdengine-server.hikari.connection-test-query= show tables spring.datasource.tdengine-server.hikari.connection-test-query= show tables
spring.redis.database=0 spring.redis.database=0
spring.redis.host=139.9.173.44 spring.redis.host=10.20.0.169
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
spring.redis.timeout=3000 spring.redis.timeout=3000
...@@ -46,33 +50,35 @@ eureka.instance.lease-renewal-interval-in-seconds=5 ...@@ -46,33 +50,35 @@ eureka.instance.lease-renewal-interval-in-seconds=5
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/doc.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.hostname= 139.9.173.44 eureka.instance.hostname= 172.17.3.6
eureka.instance.prefer-ip-address = true eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@139.9.173.44:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@10.20.1.160:10001/eureka/
spring.security.user.name=admin spring.security.user.name=admin
spring.security.user.password=a1234560 spring.security.user.password=a1234560
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.biz-client-id=consumer-${random.int[1,65536]} emqx.biz-client-id=consumer-${random.int[1024,65536]}
emqx.broker=tcp://139.9.173.44:1883 emqx.broker=tcp://10.20.1.210:2883
emqx.client-user-name=admin emqx.client-user-name=admin
emqx.client-password=public emqx.client-password=public
emqx.max-inflight=1000 emqx.max-inflight=1000
emqx.keep-alive-interval=10 emqx.keep-alive-interval=100
emqx.biz-topic[0]= iot/data/perspective emqx.biz-topic[0]= iot/data/perspective
#kafka #kafka
spring.kafka.bootstrap-servers=139.9.173.44:9092 spring.kafka.bootstrap-servers=10.20.0.169:9092
spring.kafka.producer.retries=1 spring.kafka.producer.retries=1
spring.kafka.producer.bootstrap-servers=139.9.173.44:9092 spring.kafka.producer.bootstrap-servers=10.20.0.169:9092
spring.kafka.producer.batch-size=16384 spring.kafka.producer.batch-size=16384
spring.kafka.producer.buffer-memory=33554432 spring.kafka.producer.buffer-memory=33554432
spring.kafka.producer.acks=1 spring.kafka.producer.acks=1
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.consumer.group-id=messageConsumerGroup spring.kafka.consumer.group-id=messageConsumerGroup
spring.kafka.consumer.bootstrap-servers=139.9.173.44:9092 spring.kafka.consumer.bootstrap-servers=10.20.0.169:9092
spring.kafka.consumer.enable-auto-commit=true spring.kafka.consumer.enable-auto-commit=true
spring.kafka.consumer.auto-offset-reset=earliest spring.kafka.consumer.auto-offset-reset=earliest
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
...@@ -85,12 +91,12 @@ kafka.alarm.topic=EQUIPMENT_ALARM ...@@ -85,12 +91,12 @@ kafka.alarm.topic=EQUIPMENT_ALARM
kafka.topic=PERSPECTIVE kafka.topic=PERSPECTIVE
emq.topic=iot/data/perspective emq.topic=iot/data/perspective
elasticsearch.address= 139.9.173.44:9200 elasticsearch.address=10.20.0.169:9200
elasticsearch.username= elastic elasticsearch.username=elastic
elasticsearch.password= Yeejoin@2020 elasticsearch.password=123456
elasticsearch.scheme= http elasticsearch.scheme=http
elasticsearch.connectTimeout= 50000 elasticsearch.connectTimeout=50000
elasticsearch.socketTimeout= 50000 elasticsearch.socketTimeout=50000
elasticsearch.connectionRequestTimeout= 50000 elasticsearch.connectionRequestTimeout=50000
elasticsearch.maxConnectNum= 1000 elasticsearch.maxConnectNum=1000
elasticsearch.maxConnectPerRoute= 1000 elasticsearch.maxConnectPerRoute=1000
\ No newline at end of file
spring.application.name=AMOS-DATA-EQUIP spring.application.name=AMOS-DATA-EQUIP-CZ
server.servlet.context-path=/data-equip server.servlet.context-path=/data-equip
server.port=8100 server.port=8100
spring.profiles.active=dev spring.profiles.active=kingbase8
server.compression.enabled=true server.compression.enabled=true
spring.jackson.dateFormat=yyyy-MM-dd HH:mm:ss spring.jackson.dateFormat=yyyy-MM-dd HH:mm:ss
......
...@@ -28,7 +28,7 @@ public class IcbcEnum { ...@@ -28,7 +28,7 @@ public class IcbcEnum {
@AllArgsConstructor @AllArgsConstructor
public static enum OpenAccountState { public static enum OpenAccountState {
INITIAL("初始", "00"), INITIAL("未开户", "00"),
OPENING("开户中", "01"), OPENING("开户中", "01"),
......
...@@ -36,4 +36,12 @@ public class HygfIcbcRecordQueryDTO { ...@@ -36,4 +36,12 @@ public class HygfIcbcRecordQueryDTO {
@ApiModelProperty (value = "所属地址") @ApiModelProperty (value = "所属地址")
private String address; private String address;
private Integer current;
private Integer size;
private Integer limit;
private Integer offset;
} }
...@@ -21,5 +21,8 @@ import java.util.List; ...@@ -21,5 +21,8 @@ import java.util.List;
public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> { public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and") @UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
Integer listObjectCount(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordDTO> listObject(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> listObject(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
} }
...@@ -9,6 +9,34 @@ ...@@ -9,6 +9,34 @@
sequence_nbr,cust_name,id_card,phone,medium_id,project_id,open_account_state,protocol_status,protocol_start_time,protocol_end_time,trx_limit_amount,day_limit_amount,protocol_limit_amount,app_id,out_user_id,out_vendor_id,sign_entrsut_prtl_status sequence_nbr,cust_name,id_card,phone,medium_id,project_id,open_account_state,protocol_status,protocol_start_time,protocol_end_time,trx_limit_amount,day_limit_amount,protocol_limit_amount,app_id,out_user_id,out_vendor_id,sign_entrsut_prtl_status
</sql> </sql>
<select id="listObjectCount" resultType="integer">
SELECT count(1)
FROM
hygf_peasant_household ph LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
<where>
ph.is_delete = 0
<if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''">
AND icbc.protocol_status = #{param.openAccountStatus}
</if>
<if test="param.custName != null and param.custName != ''">
AND ph.owners_name LIKE CONCAT('%', #{param.custName}, '%')
</if>
<if test="param.idCard != null and param.idCard != ''">
AND ph.id_card LIKE CONCAT('%', #{param.idCard}, '%')
</if>
<if test="param.phone != null and param.phone != ''">
AND ph.telephone LIKE CONCAT('%', #{param.phone}, '%')
</if>
<if test="param.regionalCompaniesSeq != null and param.regionalCompaniesSeq != ''">
AND ph.regional_companies_seq = #{param.regionalCompaniesSeq}
</if>
</if>
</where>
GROUP BY
ph.amos_user_id
</select>
<select id="listObject" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO"> <select id="listObject" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT DISTINCT SELECT DISTINCT
icbc.sequence_nbr, icbc.sequence_nbr,
...@@ -40,6 +68,9 @@ ...@@ -40,6 +68,9 @@
</if> </if>
</if> </if>
</where> </where>
<if test="param.offset != null and param.offset != '' and param.limit != null and param.limit != ''">
LIMIT ${param.offset}, ${param.limit}
</if>
GROUP BY GROUP BY
ph.amos_user_id ph.amos_user_id
ORDER BY ORDER BY
......
...@@ -104,11 +104,9 @@ public class HygfIcbcController extends BaseController { ...@@ -104,11 +104,9 @@ public class HygfIcbcController extends BaseController {
@GetMapping (value = "/page") @GetMapping (value = "/page")
@ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询") @ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询")
@UserLimits @UserLimits
public ResponseModel<Page<HygfIcbcRecordDTO>> queryForPage(@RequestParam (value = "current") int current, public ResponseModel<Page<HygfIcbcRecordDTO>> queryForPage(@ApiParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
@RequestParam(value = "size") int size,
@ApiParam @RequestParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(current, size, hygfIcbcRecordQueryDTO)); return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(hygfIcbcRecordQueryDTO.getCurrent(), hygfIcbcRecordQueryDTO.getSize(), hygfIcbcRecordQueryDTO));
} }
} }
...@@ -85,14 +85,29 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -85,14 +85,29 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
private static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB"; private static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB";
private static final String OUT_VENDOR_ID = "071301"; private static final String OUT_VENDOR_ID = "071301";
private static final String PROJECT_ID = "PJ14001401B000160171"; private static final String PROJECT_ID = "PJ14001401B000160171";
@Value ("${hygf.icbc.trxLmtAmt:200000}") /**
* 协议总限额
*/
@Value ("${hygf.icbc.protocolLimitAmount:2500000000}")
private String protocolLimitAmount;
/**
* 单笔限额
*/
@Value ("${hygf.icbc.trxLmtAmt:10000000}")
private String trxLmtAmt; private String trxLmtAmt;
@Value ("${hygf.icbc.dayLmtAmt:200000}") /**
* 日累计限额
*/
@Value ("${hygf.icbc.dayLmtAmt:20000000}")
private String dayLmtAmt; private String dayLmtAmt;
@Value ("${hygf.icbc.loanTotalAmt:200000}")
@Value ("${hygf.icbc.loanTotalAmt:0}")
private String loanTotalAmt; private String loanTotalAmt;
@Value ("${hygf.icbc.notifyUrl:}") /**
private String notifyUrl; * 合作方接收结果通知 URL
*/
@Value ("${hygf.icbc.callbackUrl:}")
private String callbackUrl;
@Resource (type = PeasantHouseholdServiceImpl.class) @Resource (type = PeasantHouseholdServiceImpl.class)
...@@ -133,14 +148,14 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -133,14 +148,14 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
String formattedDate = formatter.format(newDate); String formattedDate = formatter.format(newDate);
bizContent.setProtocolEndDate(formattedDate); // 协议到期日 bizContent.setProtocolEndDate(formattedDate); // 协议到期日
bizContent.setProtocolLimitAmount("99999999999999999"); // 协议累计额 bizContent.setProtocolLimitAmount(protocolLimitAmount); // 协议累计额
JSONObject templateParams = new JSONObject(); JSONObject templateParams = new JSONObject();
templateParams.put("prtl_enddate", formattedDate); templateParams.put("prtl_enddate", formattedDate);//协议到期日
templateParams.put("loan_total_amt", loanTotalAmt); templateParams.put("loan_total_amt", loanTotalAmt);// 贷款限额(单位:分)
templateParams.put("trx_lmt_amt", trxLmtAmt); templateParams.put("trx_lmt_amt", trxLmtAmt);// 单笔限额(单位:分)
templateParams.put("day_lmt_amt", dayLmtAmt); templateParams.put("day_lmt_amt", dayLmtAmt);// 日累计限额(单位:分)
bizContent.setTemplateParams(templateParams.toJSONString()); bizContent.setTemplateParams(templateParams.toJSONString());
bizContent.setCallbackUrl(notifyUrl); bizContent.setCallbackUrl(callbackUrl);
bizContent.setCamsPublicKey(CAMS_PUBLIC_KEY); bizContent.setCamsPublicKey(CAMS_PUBLIC_KEY);
request.setBizContent(bizContent); request.setBizContent(bizContent);
...@@ -207,9 +222,8 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -207,9 +222,8 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
*/ */
public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception { public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception {
log.info("户用光伏开户签约异步通知, => 验签"); log.info("户用光伏开户签约异步通知, => 验签");
boolean verifyFlag = verifySignData(request, notifyUrl); boolean verifyFlag = verifySignData(request, callbackUrl);
String returnJson; String returnJson;
// 获取其他参数略...
if (verifyFlag) { if (verifyFlag) {
// 验签成功 // 验签成功
String biz_content = request.getParameter("biz_content"); String biz_content = request.getParameter("biz_content");
...@@ -224,8 +238,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -224,8 +238,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
String projectId = data.get("projectId"); String projectId = data.get("projectId");
String openAccoutSucceedFlag = data.get("openAccoutSucceedFlag"); String openAccoutSucceedFlag = data.get("openAccoutSucceedFlag");
String signEntrsutPrtlSucceedFlag = data.get("signEntrsutPrtlSucceedFlag"); String signEntrsutPrtlSucceedFlag = data.get("signEntrsutPrtlSucceedFlag");
JftApiUserEntrustopenacctQueryResponseV1 jftApiUserEntrustopenacctQueryResponse = this.getHygfIcbcWalletInfo(outUserId); JftApiUserEntrustopenacctQueryResponseV1 hygfIcbcWalletInfo = this.getHygfIcbcWalletInfo(outUserId);
System.out.println(jftApiUserEntrustopenacctQueryResponse);
// region 保存数据 // region 保存数据
HygfIcbcRecord hygfIcbcRecord = this.lambdaQuery().eq(HygfIcbcRecord::getAmosUserId, outUserId).last(" limit 1").one(); HygfIcbcRecord hygfIcbcRecord = this.lambdaQuery().eq(HygfIcbcRecord::getAmosUserId, outUserId).last(" limit 1").one();
if (hygfIcbcRecord == null) { if (hygfIcbcRecord == null) {
...@@ -237,16 +250,18 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -237,16 +250,18 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
hygfIcbcRecord.setMediumId(newPayAcc); hygfIcbcRecord.setMediumId(newPayAcc);
hygfIcbcRecord.setProjectId(projectId); hygfIcbcRecord.setProjectId(projectId);
hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag); hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag);
hygfIcbcRecord.setProtocolStatus(jftApiUserEntrustopenacctQueryResponse.getProtocolStatus());
hygfIcbcRecord.setProtocolStartTime(jftApiUserEntrustopenacctQueryResponse.getProtocolStartDate());
hygfIcbcRecord.setProtocolEndTime(jftApiUserEntrustopenacctQueryResponse.getProtocolEndDate());
hygfIcbcRecord.setTrxLimitAmount(jftApiUserEntrustopenacctQueryResponse.getTrxLimitAmount());
hygfIcbcRecord.setDayLimitAmount(jftApiUserEntrustopenacctQueryResponse.getDayLimitAmount());
hygfIcbcRecord.setProtocolLimitAmount(jftApiUserEntrustopenacctQueryResponse.getProtocolLimitAmount());
hygfIcbcRecord.setAppId(jftApiUserEntrustopenacctQueryResponse.getAppId());
hygfIcbcRecord.setOutUserId(jftApiUserEntrustopenacctQueryResponse.getOutUserId());
hygfIcbcRecord.setOutVendorId(jftApiUserEntrustopenacctQueryResponse.getOutVendorId());
hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag); hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag);
if (hygfIcbcWalletInfo != null) {
hygfIcbcRecord.setProtocolStatus(hygfIcbcWalletInfo.getProtocolStatus());
hygfIcbcRecord.setProtocolStartTime(hygfIcbcWalletInfo.getProtocolStartDate());
hygfIcbcRecord.setProtocolEndTime(hygfIcbcWalletInfo.getProtocolEndDate());
hygfIcbcRecord.setTrxLimitAmount(hygfIcbcWalletInfo.getTrxLimitAmount());
hygfIcbcRecord.setDayLimitAmount(hygfIcbcWalletInfo.getDayLimitAmount());
hygfIcbcRecord.setProtocolLimitAmount(hygfIcbcWalletInfo.getProtocolLimitAmount());
hygfIcbcRecord.setAppId(hygfIcbcWalletInfo.getAppId());
hygfIcbcRecord.setOutUserId(hygfIcbcWalletInfo.getOutUserId());
hygfIcbcRecord.setOutVendorId(hygfIcbcWalletInfo.getOutVendorId());
}
// hygfIcbcRecord.setDiscardStatus(); // hygfIcbcRecord.setDiscardStatus();
hygfIcbcRecord.setAmosUserId(outUserId); hygfIcbcRecord.setAmosUserId(outUserId);
hygfIcbcRecord.setRecDate(new Date()); hygfIcbcRecord.setRecDate(new Date());
...@@ -255,7 +270,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -255,7 +270,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
String copReturnCode = "0";// 通知合作方接收成功的返回码,固定 String copReturnCode = "0";// 通知合作方接收成功的返回码,固定
String copReturnMsg = "success";// 合作方的返回信息,固定 String copReturnMsg = "success";// 合作方的返回信息,固定
returnJson = sign(request, copReturnCode, copReturnMsg); returnJson = sign(request, copReturnCode, copReturnMsg);
log.error("通知响应json结果:{}", returnJson); log.info("通知响应json结果:{}", returnJson);
return returnJson; return returnJson;
} else {// 验签失败 } else {// 验签失败
String copReturnCode = "‐12345"; String copReturnCode = "‐12345";
...@@ -277,16 +292,16 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -277,16 +292,16 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
} }
public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) { public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
PageHelper.startPage(current, size); // PageHelper.startPage(current, size);
// List<HygfIcbcRecord> hygfIcbcRecords = this.lambdaQuery().eq(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getOpenAccountState()), HygfIcbcRecord::getOpenAccountState, hygfIcbcRecordQueryDTO.getOpenAccountState()).like(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getCustName()), HygfIcbcRecord::getCustName, hygfIcbcRecordQueryDTO.getCustName()).like(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getIdCard()), HygfIcbcRecord::getIdCard, hygfIcbcRecordQueryDTO.getIdCard()).eq(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getPhone()), HygfIcbcRecord::getPhone, hygfIcbcRecordQueryDTO.getPhone()).list(); Integer total = hygfIcbcRecordMapper.listObjectCount(hygfIcbcRecordQueryDTO);
hygfIcbcRecordQueryDTO.setLimit(size);
hygfIcbcRecordQueryDTO.setOffset((current - 1) * size);
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO);
toModels(list);
PageInfo<HygfIcbcRecordDTO> pageInfo = new PageInfo<>(list);
Page<HygfIcbcRecordDTO> page = new Page<>(); Page<HygfIcbcRecordDTO> page = new Page<>();
page.setSize(pageInfo.getSize()); page.setSize(size);
page.setCurrent(pageInfo.getPageNum()); page.setCurrent(current);
page.setTotal(pageInfo.getTotal()); page.setTotal(total);
page.setRecords(list); page.setRecords(toModels(list));
return page; return page;
} }
......
...@@ -248,4 +248,4 @@ spring.elasticsearch.rest.password=123456 ...@@ -248,4 +248,4 @@ spring.elasticsearch.rest.password=123456
spring.elasticsearch.rest.read-timeout=30000 spring.elasticsearch.rest.read-timeout=30000
## 聚富通 配置 ## 聚富通 配置
hygf.icbc.notifyUrl=http://47.92.234.253:8088/hygf/icbc/notify hygf.icbc.callbackUrl=http://47.92.234.253:8088/hygf/icbc/notify
\ No newline at end of file \ No newline at end of file
...@@ -84,7 +84,7 @@ public class AmosJxiopAnalyseApplication { ...@@ -84,7 +84,7 @@ public class AmosJxiopAnalyseApplication {
public void initMqtt() throws Exception { public void initMqtt() throws Exception {
if (openHealth) { if (openHealth) {
//订阅固化周期性数据成功的消息 //订阅固化周期性数据成功的消息
emqKeeper.subscript("sync_esdata_to_tdengine_notice", 1, syncESDataToTdengineMqttListener); emqKeeper.subscript("sync_esdata_to_tdengine_notice1", 1, syncESDataToTdengineMqttListener);
//订阅业务固化同步数据成功消息 //订阅业务固化同步数据成功消息
emqKeeper.subscript("sync_iotdata_to_tdengine_notice", 1, syncDasSuccessMqttListener); emqKeeper.subscript("sync_iotdata_to_tdengine_notice", 1, syncDasSuccessMqttListener);
} }
......
...@@ -6,17 +6,23 @@ import java.sql.Timestamp; ...@@ -6,17 +6,23 @@ import java.sql.Timestamp;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.*;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -33,12 +39,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -33,12 +39,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ibm.icu.math.BigDecimal;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.feign.RiskWarningFeign; import com.yeejoin.amos.boot.module.jxiop.api.feign.RiskWarningFeign;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans; import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO; import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO; import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel;
...@@ -50,6 +57,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper ...@@ -50,6 +57,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl;
...@@ -59,6 +67,12 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper; ...@@ -59,6 +67,12 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil; import com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -132,37 +146,58 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -132,37 +146,58 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘-10分钟", notes = "场站设备健康状态指数与趋势 - 仪表盘-10分钟") @ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘-10分钟", notes = "场站设备健康状态指数与趋势 - 仪表盘-10分钟")
@GetMapping(value = "/getHealthScoreInfoByMinute") @GetMapping(value = "/getHealthScoreInfoByMinute")
public ResponseModel<Map<String, Object>> getHealthScoreInfoByMinute(@RequestParam(required = false) String areaCode, public ResponseModel<Map<String, Object>> getHealthScoreInfoByMinute(
@RequestParam(required = false) String stationCode, @RequestParam(required = false) String areaCode, @RequestParam(required = false) String stationCode,
@RequestParam (required = false) String tableName) { @RequestParam(required = false) String tableName) {
HashMap<String, Object> stringBigDecimalHashMap = new HashMap<>(); HashMap<String, Object> stringBigDecimalHashMap = new HashMap<>();
LambdaQueryWrapper<FanHealthIndex> wrapper = new LambdaQueryWrapper<FanHealthIndex>();
wrapper.orderByDesc(FanHealthIndex::getTs);
wrapper.last("limit 1");
if (CharSequenceUtil.isNotEmpty(stationCode)) { if (CharSequenceUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
if ("FDZ".equals(stationBasic.getStationType())) {
stationCode = stationBasic.getFanGatewayId(); stationCode = stationBasic.getFanGatewayId();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfoByStationByMinute(stationCode, tableName)); wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.eq(FanHealthIndex::getGatewayId, stationCode);
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
stringBigDecimalHashMap.put("value",
BigDecimal.valueOf(fanHealthIndex.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP));
} else {
LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
pvwrapper.eq(PvHealthIndex::getGatewayId, stationCode);
pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 1");
PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(pvwrapper);
stringBigDecimalHashMap.put("value",
BigDecimal.valueOf(pvHealthIndex.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP));
}
return ResponseHelper.buildResponse(stringBigDecimalHashMap); return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
stringBigDecimalHashMap.put("value", wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
idxBizFanHealthIndexMapper.getHealthScoreInfoByLatest(areaCode, stationCode)); wrapper.eq(FanHealthIndex::getAnalysisObjType, "全域");
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
stringBigDecimalHashMap.put("value",BigDecimal.valueOf( fanHealthIndex.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP));
return ResponseHelper.buildResponse(stringBigDecimalHashMap); return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 折线图", notes = "场站设备健康状态指数与趋势 - 折线图") @ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 折线图", notes = "场站设备健康状态指数与趋势 - 折线图")
@GetMapping(value = "/getHealthListInfo") @GetMapping(value = "/getHealthListInfo")
public ResponseModel<Map<String, Object>> getHealthListInfo(@RequestParam(required = false) String areaCode, public ResponseModel<Map<String, Object>> getHealthListInfo(@RequestParam(required = false) String areaCode,
@RequestParam(required = false) String stationCode, @RequestParam(required = false) String area, @RequestParam(required = false) String stationCode, @RequestParam(required = false) String area,
@RequestParam(required = false) String station, @RequestParam(required = false) String analysisType, @RequestParam(required = false) String station, @RequestParam(required = false) String analysisType,
@RequestParam(required = false) Date startTime, @RequestParam(required = false) Date startTime, @RequestParam(required = false) Date endTime) {
@RequestParam(required = false) Date endTime) {
if (StrUtil.isNotEmpty(stationCode)) { if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId(); stationCode = stationBasic.getFanGatewayId();
} else if (StrUtil.isNotEmpty(station)) { } else if (StrUtil.isNotEmpty(station)) {
//由于命名不统一 // 由于命名不统一
StationBasic stationBasic = stationBasicMapper.selectOne(new LambdaQueryWrapper<StationBasic>() StationBasic stationBasic = stationBasicMapper.selectOne(new LambdaQueryWrapper<StationBasic>()
.eq(StationBasic::getStationName, station.substring(0, station.length() - 1)+'场') .eq(StationBasic::getStationName, station.substring(0, station.length() - 1) + '场').or()
.or().eq(StationBasic::getStationName, station.substring(0, station.length() - 1)+'站')); .eq(StationBasic::getStationName, station.substring(0, station.length() - 1) + '站'));
stationCode = stationBasic.getFanGatewayId(); stationCode = stationBasic.getFanGatewayId();
} }
if (StrUtil.isNotEmpty(areaCode)) { if (StrUtil.isNotEmpty(areaCode)) {
...@@ -172,26 +207,26 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -172,26 +207,26 @@ public class TDBigScreenAnalyseController extends BaseController {
} }
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
//List<Map<String, String>> dateInfoBy15 = new ArrayList<>(); // List<Map<String, String>> dateInfoBy15 = new ArrayList<>();
List<String> dateList=new ArrayList<>(); List<String> dateList = new ArrayList<>();
if (startTime != null && endTime != null) { if (startTime != null && endTime != null) {
if (WarningPeriodEnum.DAY.getName().equals(analysisType)) { if (WarningPeriodEnum.DAY.getName().equals(analysisType)) {
//dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfo(startTime, endTime); // dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfo(startTime, endTime);
dateList=TimeRangeUtil.getDateInfo(startTime, endTime); dateList = TimeRangeUtil.getDateInfo(startTime, endTime);
} else if (WarningPeriodEnum.HOUR.getName().equals(analysisType)) { } else if (WarningPeriodEnum.HOUR.getName().equals(analysisType)) {
//dateInfoBy15 = idxBizFanHealthIndexMapper.getHourInfo(startTime, endTime); // dateInfoBy15 = idxBizFanHealthIndexMapper.getHourInfo(startTime, endTime);
dateList=TimeRangeUtil.getHourInfo(startTime, endTime); dateList = TimeRangeUtil.getHourInfo(startTime, endTime);
} else if (WarningPeriodEnum.MINUTES.getName().equals(analysisType)) { } else if (WarningPeriodEnum.MINUTES.getName().equals(analysisType)) {
//dateInfoBy15 = idxBizFanHealthIndexMapper.getMomentInfo(startTime, endTime); // dateInfoBy15 = idxBizFanHealthIndexMapper.getMomentInfo(startTime, endTime);
dateList=TimeRangeUtil.getMomentInfo(startTime, endTime); dateList = TimeRangeUtil.getMomentInfo(startTime, endTime);
} }
} else { } else {
//dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15(); dateList = TimeRangeUtil.getDateInfoBy15();
dateList=TimeRangeUtil.getDateInfoBy15();
} }
List<String> valueList = new ArrayList<>(); List<String> valueList = new ArrayList<>();
String finalStationCode = stationCode; String finalStationCode = stationCode;
// List<String> dateList = dateInfoBy15.stream().map(i -> i.get("date")).collect(Collectors.toList()); // List<String> dateList = dateInfoBy15.stream().map(i ->
// i.get("date")).collect(Collectors.toList());
String finalAreaCode = areaCode; String finalAreaCode = areaCode;
if ((WarningPeriodEnum.DAY.getName().equals(analysisType))) { if ((WarningPeriodEnum.DAY.getName().equals(analysisType))) {
List<String> fullDateList = dateList.stream().map(s -> { List<String> fullDateList = dateList.stream().map(s -> {
...@@ -202,8 +237,7 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -202,8 +237,7 @@ public class TDBigScreenAnalyseController extends BaseController {
Map<String, Object> map = healthListInfo.stream().collect(Collectors Map<String, Object> map = healthListInfo.stream().collect(Collectors
.toMap(i -> String.valueOf(i.get("recdate")), i -> i.get("healthindex"), (key1, key2) -> key2)); .toMap(i -> String.valueOf(i.get("recdate")), i -> i.get("healthindex"), (key1, key2) -> key2));
for (String date : dateList) { for (String date : dateList) {
String value = map.get(date) != null ? String.valueOf(map.get(date)) String value = map.get(date) != null ? String.valueOf(map.get(date)) : "100";
: "100";
valueList.add(String.valueOf(Math.round(Double.valueOf(value) * 10.0) / 10.0)); valueList.add(String.valueOf(Math.round(Double.valueOf(value) * 10.0) / 10.0));
} }
} else if (WarningPeriodEnum.HOUR.getName().equals(analysisType)) { } else if (WarningPeriodEnum.HOUR.getName().equals(analysisType)) {
...@@ -364,8 +398,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -364,8 +398,8 @@ public class TDBigScreenAnalyseController extends BaseController {
} }
Integer count = fanWaringRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName, Integer count = fanWaringRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName,
stationId, startDate, endDate); stationId, startDate, endDate);
//前端存在分页bug 此处限制分页后筛选导致页面超出问题 // 前端存在分页bug 此处限制分页后筛选导致页面超出问题
if (count > 0 && current > (count/10 + 1)){ if (count > 0 && current > (count / 10 + 1)) {
current = 1; current = 1;
} }
// List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = // List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage =
...@@ -850,12 +884,12 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -850,12 +884,12 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName, String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId());
int num = 0 ; int num = 0;
if (StringUtils.isNotEmpty(tableName2)){ if (StringUtils.isNotEmpty(tableName2)) {
num = idxBizFanHealthIndexMapper.getIsWarningByPointId(indexAddress, stationBasic.getFanGatewayId(), tableName2); num = idxBizFanHealthIndexMapper.getIsWarningByPointId(indexAddress, stationBasic.getFanGatewayId(),
tableName2);
} }
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("text", nameByIndexAddress); resultMap.put("text", nameByIndexAddress);
resultMap.put("warningNum", num); resultMap.put("warningNum", num);
...@@ -1576,16 +1610,15 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1576,16 +1610,15 @@ public class TDBigScreenAnalyseController extends BaseController {
ArrayList<FanWarningRecord> newList = new ArrayList<>(); ArrayList<FanWarningRecord> newList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
//分批次处理 // 分批次处理
newList.add(list.get(i));//循环将数据填入载体list newList.add(list.get(i));// 循环将数据填入载体list
if (500 == newList.size() || i == list.size() - 1) { //载体list达到要求,进行批量操作 if (500 == newList.size() || i == list.size() - 1) { // 载体list达到要求,进行批量操作
//调用批量插入 // 调用批量插入
fanWaringRecordMapper.saveBatchWarningRecords(newList); fanWaringRecordMapper.saveBatchWarningRecords(newList);
newList.clear();//每次批量操作后,清空载体list,等待下次的数据填入 newList.clear();// 每次批量操作后,清空载体list,等待下次的数据填入
} }
} }
List<PvWarningRecord> list2 = pvWaringRecordMapper.selectList(null); List<PvWarningRecord> list2 = pvWaringRecordMapper.selectList(null);
list2.forEach(item -> { list2.forEach(item -> {
if ("未处置".equals(item.getDisposotionState())) { if ("未处置".equals(item.getDisposotionState())) {
...@@ -1597,12 +1630,12 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1597,12 +1630,12 @@ public class TDBigScreenAnalyseController extends BaseController {
ArrayList<PvWarningRecord> newList2 = new ArrayList<>(); ArrayList<PvWarningRecord> newList2 = new ArrayList<>();
for (int i = 0; i < list2.size(); i++) { for (int i = 0; i < list2.size(); i++) {
//分批次处理 // 分批次处理
newList2.add(list2.get(i));//循环将数据填入载体list newList2.add(list2.get(i));// 循环将数据填入载体list
if (500 == newList2.size() || i == list2.size() - 1) { //载体list达到要求,进行批量操作 if (500 == newList2.size() || i == list2.size() - 1) { // 载体list达到要求,进行批量操作
//调用批量插入 // 调用批量插入
pvWaringRecordMapper.saveBatchWarningRecords(newList2); pvWaringRecordMapper.saveBatchWarningRecords(newList2);
newList2.clear();//每次批量操作后,清空载体list,等待下次的数据填入 newList2.clear();// 每次批量操作后,清空载体list,等待下次的数据填入
} }
} }
......
...@@ -2501,7 +2501,8 @@ public class CommonServiceImpl { ...@@ -2501,7 +2501,8 @@ public class CommonServiceImpl {
Map<String, Float> indicatorDataListAllMap = indicatorDataListAll.stream() Map<String, Float> indicatorDataListAllMap = indicatorDataListAll.stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
indicatorData -> indicatorData.getAddress() + "_" + indicatorData.getGatewayId(), indicatorData -> indicatorData.getAddress() + "_" + indicatorData.getGatewayId(),
IndicatorData::getValueF)); IndicatorData::getValueF,
(value1, value2) -> value1));
HashMap<String, Double> idxBizPvPointProcessVariableClassificationDtoIdValueMap = new HashMap<>(); HashMap<String, Double> idxBizPvPointProcessVariableClassificationDtoIdValueMap = new HashMap<>();
for (IdxBizPvPointProcessVariableClassificationDto datum : data) { for (IdxBizPvPointProcessVariableClassificationDto datum : data) {
// for (ESEquipments equipment : equipments) { // for (ESEquipments equipment : equipments) {
......
...@@ -26,15 +26,14 @@ spring.db6.datasource.password=Yeejoin@2020 ...@@ -26,15 +26,14 @@ spring.db6.datasource.password=Yeejoin@2020
spring.db6.datasource.driver-class-name=com.kingbase8.Driver spring.db6.datasource.driver-class-name=com.kingbase8.Driver
## eureka properties: ## eureka properties:
eureka.instance.hostname=47.92.234.253 eureka.instance.hostname=10.20.1.160
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties: ## redis properties:
spring.redis.database=1 spring.redis.database=1
spring.redis.host=47.92.234.253 spring.redis.host=10.20.0.169
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
openHealth=false
spring.cache.type=GENERIC spring.cache.type=GENERIC
j2cache.open-spring-cache=true j2cache.open-spring-cache=true
j2cache.cache-clean-mode=passive j2cache.cache-clean-mode=passive
...@@ -66,10 +65,10 @@ lettuce.timeout=10000 ...@@ -66,10 +65,10 @@ lettuce.timeout=10000
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://47.92.234.253:2883 emqx.broker=tcp://10.20.1.210:2883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=public
mqtt.scene.host=mqtt://47.92.234.253:8083/mqtt mqtt.scene.host=mqtt://10.20.1.210:8083/mqtt
mqtt.client.product.id=mqtt mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000 spring.mqtt.completionTimeout=3000
...@@ -79,13 +78,13 @@ emqx.client-password=public ...@@ -79,13 +78,13 @@ emqx.client-password=public
tdengine-server: tdengine-server:
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
jdbc-url: jdbc:TAOS-RS://10.20.0.203:6041/iot_data_1?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true jdbc-url: jdbc:TAOS-RS://10.20.0.169:6041/iot_data_1?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
username: root username: root
password: taosdata password: taosdata
#spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource #spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db3.datasource.url=jdbc:TAOS-RS://10.20.0.203:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true spring.db3.datasource.url=jdbc:TAOS-RS://10.20.0.169:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db3.datasource.username=root spring.db3.datasource.username=root
spring.db3.datasource.password=taosdata spring.db3.datasource.password=taosdata
spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
...@@ -93,7 +92,7 @@ spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver ...@@ -93,7 +92,7 @@ spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
# ����ר��td���ݿ� analyse_data # ����ר��td���ݿ� analyse_data
#spring.db4.datasource.type: com.alibaba.druid.pool.DruidDataSource #spring.db4.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db4.datasource.url=jdbc:TAOS-RS://10.20.0.203:6041/analysis_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true spring.db4.datasource.url=jdbc:TAOS-RS://10.20.0.169:6041/analysis_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db4.datasource.username=root spring.db4.datasource.username=root
spring.db4.datasource.password=taosdata spring.db4.datasource.password=taosdata
spring.db4.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver spring.db4.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
...@@ -150,7 +149,7 @@ amos.secret.key=qaz ...@@ -150,7 +149,7 @@ amos.secret.key=qaz
#eureka.instance.ip-address=172.16.3.122 #eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url=tcp://47.92.234.253:61616 spring.activemq.broker-url=tcp://10.20.0.169:61616
spring.activemq.user=admin spring.activemq.user=admin
spring.activemq.password=admin spring.activemq.password=admin
spring.jms.pub-sub-domain=false spring.jms.pub-sub-domain=false
...@@ -166,16 +165,16 @@ pictureUrl=upload/jxiop/syz/ ...@@ -166,16 +165,16 @@ pictureUrl=upload/jxiop/syz/
#kafka #kafka
spring.kafka.bootstrap-servers=10.20.0.223:9092,10.20.0.133:9200 spring.kafka.bootstrap-servers=10.20.0.169:9092
spring.kafka.producer.retries=1 spring.kafka.producer.retries=1
spring.kafka.producer.bootstrap-servers=10.20.0.223:9092,10.20.0.133:9200 spring.kafka.producer.bootstrap-servers=10.20.0.169:9092
spring.kafka.producer.batch-size=16384 spring.kafka.producer.batch-size=16384
spring.kafka.producer.buffer-memory=33554432 spring.kafka.producer.buffer-memory=33554432
spring.kafka.producer.acks=1 spring.kafka.producer.acks=1
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.consumer.group-id=consumerGroup spring.kafka.consumer.group-id=consumerGroup
spring.kafka.consumer.bootstrap-servers=10.20.0.223:9092,10.20.0.133:9200 spring.kafka.consumer.bootstrap-servers=10.20.0.169:9092
spring.kafka.consumer.enable-auto-commit=false spring.kafka.consumer.enable-auto-commit=false
spring.kafka.consumer.auto-offset-reset=earliest spring.kafka.consumer.auto-offset-reset=earliest
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
......
...@@ -75,7 +75,7 @@ station.section=10 ...@@ -75,7 +75,7 @@ station.section=10
gl.sum.column=日发电量,月发电量,年发电量 gl.sum.column=日发电量,月发电量,年发电量
gl.avg.column=有功功率,日利用小时,瞬时风速 gl.avg.column=有功功率,日利用小时,瞬时风速
spring.elasticsearch.rest.uris=http://139.9.173.44:9200 spring.elasticsearch.rest.uris=http://10.20.0.169:9200
spring.elasticsearch.rest.connection-timeout=30000 spring.elasticsearch.rest.connection-timeout=30000
spring.elasticsearch.rest.username=elastic spring.elasticsearch.rest.username=elastic
spring.elasticsearch.rest.password=Yeejoin@2020 spring.elasticsearch.rest.password=Yeejoin@2020
...@@ -90,4 +90,4 @@ healthValue_HourCount=6 ...@@ -90,4 +90,4 @@ healthValue_HourCount=6
healthValue_MinCount=5 healthValue_MinCount=5
##是否打开健康计算计算 true 打开 false 关闭 ##是否打开健康计算计算 true 打开 false 关闭
openHealth = false openHealth = true
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointProcessVariableClassificationMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointProcessVariableClassificationMapper">
<select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto"> <select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto">
SELECT SELECT
b.*, b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -21,9 +23,17 @@ ...@@ -21,9 +23,17 @@
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR UNION ALL b.SEQUENCE_NBR,
SELECT b.INDEX_ADDRESS,
b.*, b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID UNION ALL
SELECT
b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -41,9 +51,17 @@ ...@@ -41,9 +51,17 @@
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR UNION ALL b.SEQUENCE_NBR,
SELECT b.INDEX_ADDRESS,
b.*, b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID UNION ALL
SELECT
b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -61,9 +79,17 @@ ...@@ -61,9 +79,17 @@
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR UNION ALL b.SEQUENCE_NBR,
SELECT b.INDEX_ADDRESS,
b.*, b.GATEWAY_ID ,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID UNION ALL
SELECT
b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -81,7 +107,13 @@ ...@@ -81,7 +107,13 @@
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID
</select> </select>
<select id="getInfluxDBDataByGatewayId" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto"> <select id="getInfluxDBDataByGatewayId" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto">
SELECT SELECT
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto"> <select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto">
SELECT SELECT
b.*, b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -19,15 +21,23 @@ ...@@ -19,15 +21,23 @@
FROM FROM
idx_biz_pv_point_process_variable_classification uxfv idx_biz_pv_point_process_variable_classification uxfv
WHERE WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT1_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID ) uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT1_ID FROM idx_biz_pv_point_var_central_value WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b, ) AS b,
idx_biz_pv_point_var_central_value ibfpvcv idx_biz_pv_point_var_central_value ibfpvcv
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR UNION ALL b.SEQUENCE_NBR,
SELECT b.INDEX_ADDRESS,
b.*, b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID UNION ALL
SELECT
b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -39,15 +49,23 @@ ...@@ -39,15 +49,23 @@
FROM FROM
idx_biz_pv_point_process_variable_classification uxfv idx_biz_pv_point_process_variable_classification uxfv
WHERE WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT2_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID ) uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT2_ID FROM idx_biz_pv_point_var_central_value WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b, ) AS b,
idx_biz_pv_point_var_central_value ibfpvcv idx_biz_pv_point_var_central_value ibfpvcv
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR UNION ALL b.SEQUENCE_NBR,
SELECT b.INDEX_ADDRESS,
b.*, b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID UNION ALL
SELECT
b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -59,16 +77,23 @@ ...@@ -59,16 +77,23 @@
FROM FROM
idx_biz_pv_point_process_variable_classification uxfv idx_biz_pv_point_process_variable_classification uxfv
WHERE WHERE
uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT3_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID ) uxfv.SEQUENCE_NBR IN ( SELECT PROCESS_POINT3_ID FROM idx_biz_pv_point_var_central_value WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b, ) AS b,
idx_biz_pv_point_var_central_value ibfpvcv idx_biz_pv_point_var_central_value ibfpvcv
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR UNION ALL b.SEQUENCE_NBR,
SELECT b.INDEX_ADDRESS,
b.*, b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID UNION ALL
SELECT
b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID AS pointOneId, ibfpvcv.PROCESS_POINT1_ID AS pointOneId,
ibfpvcv.PROCESS_POINT2_ID AS pointTwoId, ibfpvcv.PROCESS_POINT2_ID AS pointTwoId,
ibfpvcv.PROCESS_POINT3_ID AS pointThreeId, ibfpvcv.PROCESS_POINT3_ID AS pointThreeId,
...@@ -80,13 +105,19 @@ ...@@ -80,13 +105,19 @@
FROM FROM
idx_biz_pv_point_process_variable_classification uxfv idx_biz_pv_point_process_variable_classification uxfv
WHERE WHERE
uxfv.SEQUENCE_NBR IN ( SELECT ANALYSIS_POINT_ID FROM `idx_biz_pv_point_var_central_value` WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID ) uxfv.SEQUENCE_NBR IN ( SELECT ANALYSIS_POINT_ID FROM idx_biz_pv_point_var_central_value WHERE ANALYSIS_POINT_ID IS NOT NULL GROUP BY ANALYSIS_POINT_ID, PROCESS_POINT1_ID, PROCESS_POINT3_ID, PROCESS_POINT2_ID )
) AS b, ) AS b,
idx_biz_pv_point_var_central_value ibfpvcv idx_biz_pv_point_var_central_value ibfpvcv
WHERE WHERE
b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY GROUP BY
b.SEQUENCE_NBR b.SEQUENCE_NBR,
b.INDEX_ADDRESS,
b.GATEWAY_ID,
ibfpvcv.PROCESS_POINT1_ID,
ibfpvcv.PROCESS_POINT2_ID,
ibfpvcv.PROCESS_POINT3_ID,
ibfpvcv.ANALYSIS_POINT_ID
</select> </select>
<select id="getInfluxDBDataByGatewayId" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto"> <select id="getInfluxDBDataByGatewayId" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto">
SELECT SELECT
......
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