Ver código fonte

自来水相关修改 , 更改定时任务的注释内容

1037015548@qq.com 6 meses atrás
pai
commit
68abad6d67

+ 11 - 5
sql.properties

@@ -9,13 +9,19 @@ spring.datasource.data.driver-class-name=org.postgis.DriverWrapper
 #spring.datasource.db2.username=postgres
 #spring.datasource.db2.password=kpr.23417.postgres
 #spring.datasource.db2.driver-class-name=org.postgis.DriverWrapper
-#spring.datasource.db2.jdbc-url=jdbc:postgresql_postGIS://10.101.5.50:5432/water_volume_prediction?useSSL=false&useAffectedRows=false&allowMultiQueries=true
-spring.datasource.db2.jdbc-url=jdbc:postgresql_postGIS://10.101.3.104:5432/water_volume_prediction_jiangjin?useSSL=false&useAffectedRows=false&allowMultiQueries=true
+spring.datasource.db2.jdbc-url=jdbc:postgresql_postGIS://10.101.5.50:5432/water_volume_prediction?useSSL=false&useAffectedRows=false&allowMultiQueries=true
+#spring.datasource.db2.jdbc-url=jdbc:postgresql_postGIS://10.101.3.104:5432/water_volume_prediction_jiangjin?useSSL=false&useAffectedRows=false&allowMultiQueries=true
 spring.datasource.db2.username=postgres
-#spring.datasource.db2.password=ygt.23417.postgres
-spring.datasource.db2.password=kpr.23417.postgres
+spring.datasource.db2.password=ygt.23417.postgres
+#spring.datasource.db2.password=kpr.23417.postgres
 spring.datasource.db2.driver-class-name=org.postgis.DriverWrapper
-spring,database.name=water_volume_prediction_jiangjin
+#spring,database.name=water_volume_prediction_jiangjin
+spring,database.name=water_volume_prediction
+
+spring.datasource.child2pg.jdbc-url=jdbc:postgresql_postGIS://10.101.5.50:5432/water_level_prediction?useSSL=false&useAffectedRows=false&allowMultiQueries=true
+spring.datasource.child2pg.username=postgres
+spring.datasource.child2pg.password=ygt.23417.postgres
+spring.datasource.child2pg.driver-class-name=org.postgis.DriverWrapper
 
 spring.datasource.data2.jdbc-url=jdbc:postgresql://119.96.165.176:5432/water_smart_central?useSSL=false&useAffectedRows=false&allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8
 spring.datasource.data2.username=postgres

+ 44 - 4
src/main/java/com/shkpr/service/aimodelpower/bizmgr/KprAimWaterCollecationBizFun.java

@@ -15,10 +15,7 @@ import com.shkpr.service.aimodelpower.dto.TraceRunnable;
 import com.shkpr.service.aimodelpower.dto.zilaishuiModel.InPumpModel;
 import com.shkpr.service.aimodelpower.globalmgr.ThreadTaskMgr;
 import com.shkpr.service.aimodelpower.globalmgr.TraceLogMgr;
-import com.shkpr.service.aimodelpower.jsonbean.zilaishui.JP3TPDay;
-import com.shkpr.service.aimodelpower.jsonbean.zilaishui.JP3TPHour;
-import com.shkpr.service.aimodelpower.jsonbean.zilaishui.JPTbMHourWater;
-import com.shkpr.service.aimodelpower.jsonbean.zilaishui.JPTbMWater;
+import com.shkpr.service.aimodelpower.jsonbean.zilaishui.*;
 import com.shkpr.service.aimodelpower.services.ServiceMgrProxy;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
@@ -1370,4 +1367,47 @@ public class KprAimWaterCollecationBizFun {
 
         return splits;
     }
+
+
+    /**
+     * TODO 水位预测相关
+     */
+    //TODO 小时取水量预测接口
+    /**
+     * 传入水厂id及日期,返回指定日期内的小时取水量预测数据和实际小时取水量数据
+     */
+    public static ResponseRes selectTbHourLevelList(JPTbLevelHourWater jpTbMHourWater){
+        ResponseRes responseRes = new ResponseRes();
+        List<Map<String, Object>> list = new ArrayList<>();
+        Map<String, Object> map = new HashMap<>();
+        map.put("id",null);
+        map.put("date",null);
+        map.put("hour",null);
+        map.put("hour_forecast_actual_level",null);
+        map.put("hour_actual_water_level",null);
+        map.put("last_modify_time",null);
+        map.put("device_code",null);
+        map.put("site_id",null);
+        map.put("zone_id",null);
+        list.add(map);
+        responseRes.setResdata(list);
+        responseRes.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
+        responseRes.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
+        try {
+            //
+            List<Map<String, Object>> resList = getWaterTapWaterApi().getTbLevelHourwater(jpTbMHourWater.getIsPage(),
+                    jpTbMHourWater.getLimit(), jpTbMHourWater.getOffset(), jpTbMHourWater.getForDateStr());
+            if(!CollectionUtils.isEmpty(resList)){
+                responseRes.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
+                responseRes.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
+                responseRes.setResdata(resList);
+            }
+            return responseRes;
+        }catch(Exception ex){
+            responseRes.setResdata(null);
+            responseRes.setResmsg(ResponseCode.RESULT_BAD.toStrMsg());
+            responseRes.setRescode(ResponseCode.RESULT_BAD.toStrCode());
+            return responseRes;
+        }
+    }
 }

+ 107 - 0
src/main/java/com/shkpr/service/aimodelpower/configuration/Child2SourceConfiguration.java

@@ -0,0 +1,107 @@
+package com.shkpr.service.aimodelpower.configuration;
+
+import com.shkpr.service.aimodelpower.globalcache.GlobalData;
+import com.zaxxer.hikari.HikariConfig;
+import com.zaxxer.hikari.HikariDataSource;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+
+import javax.annotation.PostConstruct;
+import javax.sql.DataSource;
+
+@Configuration
+@MapperScan(basePackages = "io.github.pnoker.gateway.dbdao.mapper", sqlSessionTemplateRef = "child2SqlSessionTemplate")
+public class Child2SourceConfiguration {
+    @Value("${spring.datasource.child2pg.driver-class-name:}")
+    private String driveClass = "org.postgresql.Driver";
+
+    @Value("${spring.datasource.child2pg.jdbc-url:}")
+    private String url = "";
+
+    @Value("${spring.datasource.child2pg.username:}")
+    private String username = "";
+
+    @Value("${spring.datasource.child2pg.password:}")
+    private String password = "";
+
+    @Value("${spring.datasource.data.maximum-pool-size:200}")
+    private Integer maxPoolSize;
+
+    @Value("${spring.datasource.data.minimum-idle:1}")
+    private Integer minIdle;
+
+    @Value("${spring.datasource.data.connection-test-query:}")
+    private String connectionTestQuery;
+
+    @Value("${spring.datasource.data.max-lifetime:120000}")
+    private Long maxLifetime;
+
+    @Value("${spring.datasource.data.idle-timeout:30000}")
+    private Long idleTimeout;
+
+    @Value("${spring.datasource.data.connection-timeout:30000}")
+    private Long connectionTimeout;
+
+    @Value("${spring.datasource.data.validation-timeout:30000}")
+    private Long validTimeout;
+
+    @Bean(name = "child2Datasource")
+    //@ConfigurationProperties(prefix = "spring.datasource.data")
+    public DataSource mainDataSource() {
+        return new HikariDataSource(getConfig());
+        //return DataSourceBuilder.create().build();
+        //Spring Boot 2.x默认使用HikariCP
+    }
+
+    private HikariConfig getConfig() {
+        HikariConfig hikariConfig = new HikariConfig();
+        hikariConfig.setDriverClassName(driveClass);
+        hikariConfig.setJdbcUrl(url);
+        hikariConfig.setUsername(username);
+        hikariConfig.setPassword(password);
+
+        hikariConfig.setMaximumPoolSize(maxPoolSize);
+        hikariConfig.setMinimumIdle(minIdle);
+        hikariConfig.setConnectionTestQuery(connectionTestQuery);
+        hikariConfig.setMaxLifetime(maxLifetime);
+        hikariConfig.setIdleTimeout(idleTimeout);
+        hikariConfig.setConnectionTimeout(connectionTimeout);
+        hikariConfig.setValidationTimeout(validTimeout);
+        return hikariConfig;
+    }
+
+    @Bean("child2SqlSessionFactory")
+    public SqlSessionFactory child2SqlSessionFactoryBean(@Qualifier("child2Datasource") DataSource dataSource) throws Exception {
+        SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+        sessionFactoryBean.setDataSource(dataSource);
+
+        org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
+        configuration.setCallSettersOnNulls(true);       //数据库中字段值为null时也要求返回
+        configuration.setMapUnderscoreToCamelCase(true); //开启驼峰映射
+        configuration.setCacheEnabled(false);
+        sessionFactoryBean.setConfiguration(configuration);
+        return sessionFactoryBean.getObject();
+    }
+
+    @Bean("child2SqlSessionTemplate")
+    public SqlSessionTemplate child2SqlSessionTemplate(@Qualifier("child2SqlSessionFactory") SqlSessionFactory sessionFactory) {
+        return new SqlSessionTemplate(sessionFactory);
+    }
+
+    @Bean(name = "child2DbTransactionManager")
+    public DataSourceTransactionManager child2DbTransactionManager(@Qualifier("child2Datasource") DataSource dataSource){
+        return new DataSourceTransactionManager(dataSource);
+    }
+
+    @PostConstruct
+    public void init(){
+        GlobalData.getInstance().setPostGisValid("org.postgis.DriverWrapper".equals(driveClass));
+    }
+}

+ 1 - 0
src/main/java/com/shkpr/service/aimodelpower/constants/ApiURI.java

@@ -122,6 +122,7 @@ public class ApiURI {
     public static final String URI_WATER_ZILAISHUI_HOUR = "hourdata";
     public static final String URI_WATER_ZILAISHUI_HOUR_PUMP_IN = "hourIndata";
     public static final String URI_WATER_ZILAISHUI_HOUR_PUMP_OUT= "hourOutdata";
+    public static final String URI_WATER_ZILAISHUI_HOUR_LEVEL = "hourleveldata";
 
     public static final String URI_DISPATCH_PLAN_H = URI_CURRENCY_H+"/dispatch/plan";
     public static final String URI_DISPATCH_TAG_DICT = "tag/dict";

+ 50 - 0
src/main/java/com/shkpr/service/aimodelpower/controllerapi/WaterCollecationController.java

@@ -14,6 +14,7 @@ import com.shkpr.service.aimodelpower.dto.MsgNotifyBean;
 import com.shkpr.service.aimodelpower.dto.ResponseCode;
 import com.shkpr.service.aimodelpower.dto.ResponseRes;
 import com.shkpr.service.aimodelpower.exception.SelfException;
+import com.shkpr.service.aimodelpower.jsonbean.zilaishui.JPTbLevelHourWater;
 import com.shkpr.service.aimodelpower.jsonbean.zilaishui.JPTbMHourWater;
 import com.shkpr.service.aimodelpower.jsonbean.zilaishui.JPTbMWater;
 import org.springframework.beans.factory.annotation.Value;
@@ -253,4 +254,53 @@ public class WaterCollecationController {
                         ,resResult.getTimestamp()-llReqBefore));
         return resResult;
     }
+
+    /**
+     * TODO 水位预测相关
+     */
+    @PostMapping(value = ApiURI.URI_WATER_ZILAISHUI_HOUR_LEVEL)
+    public ResponseRes hourlevelData(HttpServletRequest request
+            , @RequestHeader(value= ApiURI.HEADER_CLIENT_TYPE, required=false) String strClientType
+            , @RequestHeader(value= ApiURI.HEADER_USER_AGENT, required=false) String strUserAgent) throws Exception{
+        final String URI_PATH = request.getRequestURI();
+        final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
+        final String strUserId = (String)request.getAttribute(TokenAuthenticationService.HEADER_USERID);
+        JPTbLevelHourWater oJsonParam = FastJsonUtil.fromJSONByGson(HttpTool.getJsonBodyStr(request), JPTbLevelHourWater.class);
+        if (oJsonParam == null
+                || !oJsonParam.checkValid()){
+            throw new SelfException(ResponseCode.STATUS_ERROR_JSON_FORMAT.toStrCode()
+                    , String.format(ApiURI.EXCEPTION_FORMAT
+                    , strPlatform
+                    , URI_PATH
+                    , ResponseCode.STATUS_ERROR_JSON_FORMAT.toStrMsg()));
+        }
+        long llReqBefore = System.currentTimeMillis();
+        String strRunSeq = String.format("%d-%d", llReqBefore, mSeqNotify.incrementAndGet());
+
+        ResponseRes<String> resResult = new ResponseRes<String>();
+        resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
+        resResult.setResmsg(MSG_SUCCESS);
+        resResult.setResdata("");
+
+//        resResult.setResdata(waterZILAISHUIDao.getCount("WHERE TAG_CODE = 'SPB.SSWD.total_flow1' and QCQUISITION_TIME >= to_date('2023-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')").toString());
+        ResponseRes oRes = KprAimWaterCollecationBizFun.selectTbHourLevelList(oJsonParam);
+        if(oRes!=null&&ResponseCode.RESULT_NORMAL.toStrCode().equals(oRes.getRescode())) {
+            resResult.setResdata(FastJsonUtil.toJSON(oRes.getResdata()));
+        }else{
+            resResult.setRescode(ResponseCode.RESULT_BAD.toStrCode());
+            resResult.setResmsg(MSG_FAILED);
+            resResult.setResdata("");
+        }
+
+        resResult.setTimestamp(System.currentTimeMillis());
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, LogFlagBusiType.BUSI_INTERNAL.toStrValue(), mStrClassName, strUserId
+                ,String.format("%s:%s seq:{%s} rescode:{%s} resmsg:{%s} time:{%d ms} end<===="
+                        ,strPlatform
+                        ,URI_PATH
+                        ,strRunSeq
+                        ,resResult.getRescode()
+                        ,resResult.getResmsg()
+                        ,resResult.getTimestamp()-llReqBefore));
+        return resResult;
+    }
 }

+ 1 - 0
src/main/java/com/shkpr/service/aimodelpower/controllerfilter/third/ThirdJWTCurrencyFilter.java

@@ -24,6 +24,7 @@ public class ThirdJWTCurrencyFilter extends JWTAuthenticationFilter {
         msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_WATER_ZILAISHUI_H, ApiURI.URI_WATER_ZILAISHUI_HOUR), "POST");
         msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_WATER_ZILAISHUI_H, ApiURI.URI_WATER_ZILAISHUI_HOUR_PUMP_IN), "POST");
         msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_WATER_ZILAISHUI_H, ApiURI.URI_WATER_ZILAISHUI_HOUR_PUMP_OUT), "POST");
+        msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_WATER_ZILAISHUI_H, ApiURI.URI_WATER_ZILAISHUI_HOUR_LEVEL), "POST");
 
         msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_DISPATCH_PLAN_H, ApiURI.URI_XXX_LISTS), "POST");
         msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_DISPATCH_PLAN_H, ApiURI.URI_XXX_SK), "POST");

+ 27 - 0
src/main/java/com/shkpr/service/aimodelpower/dbdao/shizilaishuiDataSource/WaterCollecationDao.java

@@ -26,6 +26,10 @@ public class WaterCollecationDao {
     @Qualifier("childDatasource")
     private DataSource childDataSource;
 
+    @Autowired
+    @Qualifier("child2Datasource")
+    private DataSource child2DataSource;
+
     //TODO 查询样本及预测水量表;支持是否分页
     public List<Map<String,Object>> getTbMWater(boolean isPage,int limit,int offset,String extend){
             String sql = "";
@@ -171,4 +175,27 @@ public class WaterCollecationDao {
             return tableData;
         
     }
+
+    /**
+     * TODO 水位预测相关
+     */
+    //TODO 查询小时水位预测表;支持是否分页
+    public List<Map<String,Object>> getTbLevelHourwater(boolean isPage,int limit,int offset,String extend){
+        String sql = "";
+        sql = "select aTable.id,aTable.date,aTable.hour,aTable.hour_forecast_actual_level,aTable.hour_actual_water_level,aTable.last_modify_time,aTable.device_code,bTable.site_id,bTable.zone_id " +
+                "from tb_m_hourlevel as aTable " +
+                "left JOIN water_level_config as bTable  " +
+                "ON aTable.device_code = bTable.device_code " +
+                "WHERE 1=1 ";
+        if(!StringUtils.isEmpty(extend)){
+            sql+=extend;
+        }
+        if(isPage) {
+            sql += " LIMIT " + limit + " OFFSET " + offset;
+        }
+        JdbcTemplate pgJdbc = new JdbcTemplate(child2DataSource);
+        List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
+        return tableData;
+
+    }
 }

+ 20 - 0
src/main/java/com/shkpr/service/aimodelpower/dbdao/shizilaishuiDataSource/service/WaterCollecationServiceImpl.java

@@ -220,4 +220,24 @@ public class WaterCollecationServiceImpl implements WaterCollecationService{
         }
         return arrRes;
     }
+
+    @Override
+    public List<Map<String, Object>> getTbLevelHourwater(boolean isPage, int limit, int offset, String extend) throws Exception{
+        int nCode = 0;
+        String strMsg = "Success";
+        List<Map<String, Object>> arrRes = null;
+        try {
+            arrRes = waterCollecationDao.getTbLevelHourwater(isPage,limit,offset,extend);
+        }catch (Exception e){ throw new Exception(e.getLocalizedMessage());
+
+
+        }finally {
+            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.valueFromInt(nCode)
+                    , LogFlagBusiType.BUSI_CHILD_DB_TAP_WATER.toStrValue()
+                    , mStrClassName
+                    , String.format("Batch Query TbMWater from database, code:{%d} msg:{%s} ..."
+                            , nCode, strMsg));
+        }
+        return arrRes;
+    }
 }

+ 6 - 0
src/main/java/com/shkpr/service/aimodelpower/dbdao/shizilaishuiDataSource/service/intef/WaterCollecationService.java

@@ -37,4 +37,10 @@ public interface WaterCollecationService {
     //TODO 主数据源相关
     //TODO 获取指定水厂的供/取水泵房分区
     public List<Map<String,Object>> getZoonInfoList(String puid,String subType)throws Exception;
+
+    /*
+    * TODO 水位预测相关
+    */
+    public List<Map<String,Object>> getTbLevelHourwater(boolean isPage,int limit,int offset,String extend)throws Exception;
+
 }

+ 6 - 6
src/main/java/com/shkpr/service/aimodelpower/globalmgr/ScheduleTaskMgr.java

@@ -102,17 +102,17 @@ public class ScheduleTaskMgr {
     }
 
     //TODO 每天整点的五分执行检查小时用水量是否对齐,检查时间范围为当前时间到昨天
-    /*@Scheduled(cron = "0 5 * * * *")
+    @Scheduled(cron = "0 5 * * * *")
 //    @Scheduled(cron = "0 0/1 * * * ?")
     public void executeTaskEveryHourAtTenMinutesRecordAll() {
         KprAimTapWaterBizFun.checkRecordAllData();
-    }*/
+    }
 
     //TODO 每天整点的十分执行检查小时用水量是否对齐,检查时间范围为当前时间到昨天
-    /*@Scheduled(cron = "0 10 * * * *")
+    @Scheduled(cron = "0 10 * * * *")
     public void executeTaskEveryHourAtTenMinutesRecord() {
         KprAimTapWaterBizFun.checkRecordData();
-    }*/
+    }
 
     //TODO 每天每小时的20分执行当前月预测日数据
     @Scheduled(cron = "0 20 * * * *")
@@ -162,7 +162,7 @@ public class ScheduleTaskMgr {
 
 
     //TODO 启动时执行一次 江津的就给注释掉
-    /*@PostConstruct
+    @PostConstruct
     public void initOneTapWater(){
         Timer timer = new Timer();
         // 创建定时器任务
@@ -185,7 +185,7 @@ public class ScheduleTaskMgr {
             }
         };
         timer.schedule(timerTask1,11000);//11秒后执行一次
-    }*/
+    }
 
     @PostConstruct
     public void initWaterDay(){

+ 83 - 0
src/main/java/com/shkpr/service/aimodelpower/jsonbean/zilaishui/JPTbLevelHourWater.java

@@ -0,0 +1,83 @@
+package com.shkpr.service.aimodelpower.jsonbean.zilaishui;
+
+import com.global.base.log.LogLevelFlag;
+import com.global.base.log.LogPrintMgr;
+import com.shkpr.service.aimodelpower.bizmgr.KprAimWaterCollecationBizFun;
+import com.shkpr.service.aimodelpower.controllervalid.CommonParamValidList;
+import com.shkpr.service.aimodelpower.controllervalid.CommonParamValidSS;
+import lombok.Data;
+import org.hibernate.validator.constraints.Range;
+import org.springframework.util.StringUtils;
+
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.TemporalAdjusters;
+
+/**
+ * @ClassName JPTbMHourWater
+ * @Description: TODO 查询日预测小时液位数据
+ * @Author LX
+ * @Date 2024/5/27
+ * @Version V1.0
+ **/
+@Data
+public class JPTbLevelHourWater {
+    private Boolean isPage = false;//是否分页 默认false
+
+    private String zoneId;//水厂id
+    private String siteId;//站点id
+    private String deviceCode;//设备编号
+
+    @Range(min = 0, max = 65535, groups = {CommonParamValidList.class, CommonParamValidSS.class})
+    private Integer limit = 20;//若分页 默认数为20
+
+    @Range(min = 0, max = Integer.MAX_VALUE, groups = {CommonParamValidList.class, CommonParamValidSS.class})
+    private Integer offset = 0;//若分页 默认起始值为0
+
+    private Long queryDate;//开始日期 (实际时间为 年 月 日(就为当月的一号),时分秒为 00:00:00,如2023-03-01 00:00:00)
+
+    //业务字段
+    private String forDateStr;
+
+    public boolean checkValid(){
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            StringBuilder strSql = new StringBuilder("");
+            if (!StringUtils.isEmpty(zoneId)) {
+                strSql.append(" AND \"zone_id\" = '" + zoneId + "'");
+            }
+            if (!StringUtils.isEmpty(siteId)) {
+                strSql.append(" AND \"site_id\" = '" + siteId + "'");
+            }
+            if (!StringUtils.isEmpty(deviceCode)) {
+                strSql.append(" AND aTable.\"device_code\" = '" + deviceCode + "'");
+            }
+            if (queryDate == null) {
+                //TODO 说明前端没传,那么默认为今天
+                LocalDateTime nowDate = LocalDateTime.now();//结束时间
+                nowDate = nowDate.with(TemporalAdjusters.lastDayOfMonth());
+                nowDate = nowDate.withHour(0);
+                nowDate = nowDate.withMinute(0);
+                nowDate = nowDate.withSecond(0);
+
+                strSql.append(" AND \"date\" =  '" + nowDate.format(formatter) + "' ");
+                forDateStr = strSql.toString();
+            } else if (queryDate != null) {
+                try {
+                    //TODO 说明符合可组成查询日期的条件
+                    String sqlStr = LocalDateTime.ofInstant(Instant.ofEpochMilli(queryDate), ZoneId.systemDefault())
+                            .withHour(0).withMinute(0).withSecond(0).format(formatter);
+                    strSql.append(" AND \"date\" =  '" + sqlStr + "' ");
+                    forDateStr = strSql.toString();
+                } catch (Exception ex) {
+                    LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, "JPCustomerMeterSS", "JPCustomerMeterSS"
+                            , String.format("errorMsg:%s====>"
+                                    , ex.getLocalizedMessage()));
+                    return false;
+                }
+            }
+            return true;
+    }
+
+}