Commit 49c43cd2 authored by KeYong's avatar KeYong

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

parents 88e7d2da cc9a951d
...@@ -62,182 +62,7 @@ public class HttpUtils { ...@@ -62,182 +62,7 @@ public class HttpUtils {
requestConfig = configBuilder.build(); requestConfig = configBuilder.build();
} }
/**
* 发送 GET 请求(HTTP),不带输入数据
*
* @param url
* @return
*/
public static String doGet(String url) {
return doGet(url, new HashMap<String, Object>());
}
/**
* 发送 GET 请求(HTTP),K-V形式
*
* @param url
* @param params
* @return
*/
public static String doGet(String url, Map<String, Object> params) {
String apiUrl = url;
StringBuffer param = new StringBuffer();
int i = 0;
for (String key : params.keySet()) {
if (i == 0)
param.append("?");
else
param.append("&");
param.append(key).append("=").append(params.get(key));
i++;
}
apiUrl += param;
String result = null;
HttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
try {
HttpGet httpGet = new HttpGet(apiUrl);
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
result = IOUtils.toString(instream, "UTF-8");
}
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
/**
* 发送 POST 请求(HTTP),不带输入数据
*
* @param apiUrl
* @return
*/
public static String doPost(String apiUrl) {
return doPost(apiUrl, new HashMap<String, Object>());
}
/**
* 发送 POST 请求,K-V形式
*
* @param apiUrl
* API接口URL
* @param params
* 参数map
* @return
*/
public static String doPost(String apiUrl, Map<String, Object> params) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
CloseableHttpResponse response = null;
try {
httpPost.setConfig(requestConfig);
List<NameValuePair> pairList = new ArrayList<>(params.size());
for (Map.Entry<String, Object> entry : params.entrySet()) {
NameValuePair pair = new BasicNameValuePair(entry.getKey(), entry.getValue()!=null?entry.getValue().toString():"");
pairList.add(pair);
}
httpPost.setEntity(new UrlEncodedFormEntity(pairList, Charset.forName("UTF-8")));
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return httpStr;
}
/**
* 发送 POST 请求,JSON形式,接收端需要支持json形式,否则取不到数据
*
* @param apiUrl
* @param json
* json对象
* @return
*/
public static String doPost(String apiUrl, String json) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()).setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
CloseableHttpResponse response = null;
try {
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(json, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return httpStr;
}
/**
* 创建SSL安全连接
*
* @return
*/
private static SSLConnectionSocketFactory createSSLConnSocketFactory() {
SSLConnectionSocketFactory sslsf = null;
try {
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return true;
}
}).build();
sslsf = new SSLConnectionSocketFactory(sslContext, new HostnameVerifier() {
@Override
public boolean verify(String arg0, SSLSession arg1) {
return true;
}
});
} catch (GeneralSecurityException e) {
e.printStackTrace();
}
return sslsf;
}
......
...@@ -1664,6 +1664,7 @@ ...@@ -1664,6 +1664,7 @@
GROUP BY GROUP BY
a.sequenceNbr a.sequenceNbr
ORDER BY a.personStatus DESC ORDER BY a.personStatus DESC
LIMIT #{map.pageNum}, #{map.pageSize} LIMIT #{map.pageNum}, #{map.pageSize}
</select> </select>
...@@ -1718,6 +1719,7 @@ ...@@ -1718,6 +1719,7 @@
a.biz_org_name IS NOT NULL a.biz_org_name IS NOT NULL
AND a.is_delete = 0 AND a.is_delete = 0
AND a.biz_org_type = 'PERSON' AND a.biz_org_type = 'PERSON'
and fp.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
<if test='peopleTypeCode != null and peopleTypeCode != ""'>and a.peopleType like concat ('%', #{peopleTypeCode},'%')</if> <if test='peopleTypeCode != null and peopleTypeCode != ""'>and a.peopleType like concat ('%', #{peopleTypeCode},'%')</if>
</select> </select>
...@@ -1841,7 +1843,7 @@ ...@@ -1841,7 +1843,7 @@
AND a.is_delete = 0 AND a.is_delete = 0
AND a.biz_org_type = 'PERSON' AND a.biz_org_type = 'PERSON'
AND fp.is_delete = 0 AND fp.is_delete = 0
AND LENGTH( a.biz_org_code ) = 18 AND LENGTH( a.biz_org_code ) > 18
<if test='bizOrgCode!=null and bizOrgCode!=""'> <if test='bizOrgCode!=null and bizOrgCode!=""'>
and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%') and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')
</if> </if>
......
...@@ -82,6 +82,18 @@ public class PluginInterceptor implements Interceptor { ...@@ -82,6 +82,18 @@ public class PluginInterceptor implements Interceptor {
ReflectionUtils.makeAccessible(field); ReflectionUtils.makeAccessible(field);
field.set(boundSql, sql); field.set(boundSql, sql);
return executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, boundSql); return executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, boundSql);
} else if ("com.yeejoin.equipmanage.mapper.FireFightingSystemMapper.getSystemInfoPage".equals(id)) {
//执行结果
String sortField = "";
if (parameter instanceof HashMap) {
sortField = ((HashMap<?, ?>) parameter).get("sortField").toString();
}
sql = sql.replace("_sortField", sortField);
//通过反射修改sql语句
Field field = boundSql.getClass().getDeclaredField("sql");
ReflectionUtils.makeAccessible(field);
field.set(boundSql, sql);
return executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, boundSql);
} else { } else {
return invocation.proceed(); return invocation.proceed();
} }
......
...@@ -119,7 +119,7 @@ public class PoolStatisticController { ...@@ -119,7 +119,7 @@ public class PoolStatisticController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/panel/station/statistic", method = RequestMethod.GET) @RequestMapping(value = "/panel/station/statistic", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取水池统计信息", notes = "获取水池统计信息") @ApiOperation(httpMethod = "GET", value = "获取水池统计信息", notes = "获取水池统计信息")
public ResponseModel getStationWaterPanelInfo( @RequestParam(required = false) String bizOrgCode) { public ResponseModel<List<Map<String, Object>>> getStationWaterPanelInfo( @RequestParam(required = false) String bizOrgCode) {
List<Map<String, Object>> infoList = fireFightingSystemMapper.getWaterInfoBySuper(bizOrgCode); List<Map<String, Object>> infoList = fireFightingSystemMapper.getWaterInfoBySuper(bizOrgCode);
List<Map<String, Object>> normalList = new ArrayList<>(); List<Map<String, Object>> normalList = new ArrayList<>();
List<Map<String, Object>> abNormalList = new ArrayList<>(); List<Map<String, Object>> abNormalList = new ArrayList<>();
...@@ -140,10 +140,14 @@ public class PoolStatisticController { ...@@ -140,10 +140,14 @@ public class PoolStatisticController {
BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))).multiply(new BigDecimal(String.valueOf(transResult.get("abs")))).divide(divide, 0, RoundingMode.HALF_UP); BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))).multiply(new BigDecimal(String.valueOf(transResult.get("abs")))).divide(divide, 0, RoundingMode.HALF_UP);
m.put("volume", bigDecimal + "m³"); m.put("volume", bigDecimal + "m³");
m.put("levelAbs", transResult.get("abs") + "%"); m.put("levelAbs", transResult.get("abs") + "%");
// 预警使用以下字段
m.put("volumeBigDecimal", bigDecimal);
} else if (String.valueOf(transResult.get("abs")).equals("100") && String.valueOf(transResult.get("status")).equals("1")) { } else if (String.valueOf(transResult.get("abs")).equals("100") && String.valueOf(transResult.get("status")).equals("1")) {
BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))); BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume")));
m.put("volume", bigDecimal + "m³"); m.put("volume", bigDecimal + "m³");
m.put("levelAbs", transResult.get("abs") + "%"); m.put("levelAbs", transResult.get("abs") + "%");
// 预警使用以下字段
m.put("volumeBigDecimal", bigDecimal);
} else { } else {
m.put("levelAbs", transResult.get("abs")); m.put("levelAbs", transResult.get("abs"));
} }
......
...@@ -212,7 +212,7 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -212,7 +212,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
levelAbsLiter = volume.multiply(new BigDecimal(1000)); levelAbsLiter = volume.multiply(new BigDecimal(1000));
}else { }else {
BigDecimal abs = new BigDecimal(String.valueOf(transResult.get("abs"))); BigDecimal abs = new BigDecimal(String.valueOf(transResult.get("abs")));
levelAbsLiter = volume.multiply(abs.divide(new BigDecimal(100),2, RoundingMode.HALF_UP)); levelAbsLiter = volume.multiply(new BigDecimal(1000)).multiply(abs.divide(new BigDecimal(100),2, RoundingMode.HALF_UP));
} }
float outputFlowRate = Float.parseFloat(String.valueOf(m.get("outputFlowRate"))); float outputFlowRate = Float.parseFloat(String.valueOf(m.get("outputFlowRate")));
if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && outputFlowRate != 0) { if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && outputFlowRate != 0) {
......
...@@ -231,17 +231,7 @@ public class WlCarMileageController { ...@@ -231,17 +231,7 @@ public class WlCarMileageController {
} }
/**
* 获取轨迹
*
* @return
*/
@RequestMapping(value = "/travel", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取轨迹", notes = "获取轨迹")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
public List<Coordinate> travel(long id) {
return iWlCarMileageService.getCoordinateList(id);
}
/** /**
* 获取日历 * 获取日历
......
...@@ -86,4 +86,12 @@ public interface IotFeign { ...@@ -86,4 +86,12 @@ public interface IotFeign {
ResponseModel<Map<String ,Object>> queryIotDataNum(@RequestParam("timeStart") String timeStart, ResponseModel<Map<String ,Object>> queryIotDataNum(@RequestParam("timeStart") String timeStart,
@RequestParam("timeEnd") String timeEnd); @RequestParam("timeEnd") String timeEnd);
@RequestMapping(value = "v1/livedata/queryIotDataNumByIndex", method = RequestMethod.GET, consumes = "application/json")
ResponseModel<Map<String ,Integer>> queryIotDataNumByIndex(@RequestParam(value = "timeStart") String timeStart,
@RequestParam(value = "timeEnd") String timeEnd,
@RequestParam(value = "productKey") String productKey,
@RequestParam(value = "deviceName") String deviceName,
@RequestParam(value = "indexKeys") String indexKeys,
@RequestParam(value = "value") String value);
} }
...@@ -21,7 +21,6 @@ public interface IWlCarMileageService extends IService<WlCarMileage> { ...@@ -21,7 +21,6 @@ public interface IWlCarMileageService extends IService<WlCarMileage> {
Double totalMileage(String iotCode); Double totalMileage(String iotCode);
List<Coordinate> getCoordinateList(long id);
Map<String,Boolean> getCalender(long id,Date date); Map<String,Boolean> getCalender(long id,Date date);
......
...@@ -1971,8 +1971,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1971,8 +1971,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
Date now = new Date(); Date now = new Date();
String scrapTime = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(calendar.getTime()); String scrapTime = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(calendar.getTime());
int day = DateUtils.dateBetween(now, calendar.getTime()); int day = DateUtils.dateBetween(now, calendar.getTime());
log.info("报废时间:{}" , day);
log.info("报废时间ID:{}" , e.get("id").toString());
if (day < Integer.parseInt(equipmentScrapDay) && day > -1) { if (day < Integer.parseInt(equipmentScrapDay) && day > -1) {
syncSystemctlMsg(e, scrapTime, day); syncSystemctlMsg(e, scrapTime, day);
} else if (day == -1) { } else if (day == -1) {
......
...@@ -2263,9 +2263,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2263,9 +2263,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// 日告警设备数 // 日告警设备数
listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum"))); listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum")));
// 日告警条数 // 日告警条数
log.info("==========sbco={}", weekItem.get("type_code").toString()); if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) {
log.info("==========sbCC={}", weekItem.get("code").toString());
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) {
Integer integer = fireFightingSystemMapper.selectAlarms(valueOf(system.get("id")), valueOf(weekItem.get("type_code")), valueOf(weekItem.get("code")), startDate, endDate, new ArrayList<>()); Integer integer = fireFightingSystemMapper.selectAlarms(valueOf(system.get("id")), valueOf(weekItem.get("type_code")), valueOf(weekItem.get("code")), startDate, endDate, new ArrayList<>());
listItem.put("trueNum", String.valueOf(integer)); listItem.put("trueNum", String.valueOf(integer));
} else { } else {
......
...@@ -197,30 +197,4 @@ public class SpeechTranscriberDemo { ...@@ -197,30 +197,4 @@ public class SpeechTranscriberDemo {
public void shutdown() { public void shutdown() {
client.shutdown(); client.shutdown();
} }
public static void main(String[] args) throws Exception {
String appKey = "89KKwpGXXN37Pn1G";
String id = "LTAI5t8F2oYwmfoYXjCx5vbf";
String secret = "du6jOpdxlKNCkCo5QN6EVFiI5zSaAv";
String url = "wss://nls-gateway.cn-shanghai.aliyuncs.com/ws/v1"; // 默认值:wss://nls-gateway.cn-shanghai.aliyuncs.com/ws/v1。
/* if (args.length == 3) {
appKey = args[0];
id = args[1];
secret = args[2];
} else if (args.length == 4) {
appKey = args[0];
id = args[1];
secret = args[2];
url = args[3];
} else {
System.err.println("run error, need params(url is optional): " + "<app-key> <AccessKeyId> <AccessKeySecret> [url]");
System.exit(-1);
}*/
//本案例使用本地文件模拟发送实时流数据。您在实际使用时,可以实时采集或接收语音流并发送到ASR服务端。
String filepath = ""; // * 此处写的文件路径地址不要提交到git, 国网电科院SCA扫描会报告为漏洞: 存在“便携性缺陷”
SpeechTranscriberDemo demo = new SpeechTranscriberDemo(appKey, id, secret, url);
demo.process(filepath);
demo.shutdown();
}
} }
\ No newline at end of file
...@@ -1537,10 +1537,10 @@ ...@@ -1537,10 +1537,10 @@
AND wlesal.create_date LIKE CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d' ), '%' ) AND wlesal.create_date LIKE CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d' ), '%' )
</if> </if>
<if test="startDate != null and startDate != ''"> <if test="startDate != null and startDate != ''">
AND wlesal.create_date >= DATE_FORMAT( ${startDate}, '%Y-%m-%d %H:%i:%s' ) AND wlesal.create_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d %H:%i:%s' )
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
AND DATE_FORMAT( ${endDate}, '%Y-%m-%d %H:%i:%s' ) >= wlesal.create_date AND DATE_FORMAT( #{endDate}, '%Y-%m-%d %H:%i:%s' ) >= wlesal.create_date
</if> </if>
<if test="systemCode != null and systemCode != ''"> <if test="systemCode != null and systemCode != ''">
and fs.code = #{systemCode} and fs.code = #{systemCode}
......
...@@ -7005,10 +7005,10 @@ ...@@ -7005,10 +7005,10 @@
<if test="sortField != null and sortField != ''"> <if test="sortField != null and sortField != ''">
<choose> <choose>
<when test="sortOrder == 'ascend'"> <when test="sortOrder == 'ascend'">
${sortField} ASC _sortField ASC
</when> </when>
<otherwise> <otherwise>
${sortField} DESC _sortField DESC
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
......
...@@ -135,9 +135,9 @@ fire-rescue=1432549862557130753 ...@@ -135,9 +135,9 @@ fire-rescue=1432549862557130753
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
#阿里云实时语音识别参数 #阿里云实时语音识别参数
speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho speech-config.access-key-id=ENC(bgO92hxidPL5U5gKK94aEHvWAQ9db9wjb/7XgkCsw6J+t9gTD20xsWrxF2tPY90Kw2fM/25m4ER7K5SQLsdi9g==)
speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n speech-config.access-key-secret=ENC(GZthiafYoLwmNWRgT97aiVEBM6NkBnAx9tPyLKlUo/Qoh1r6A3R1u0x4WxSMcuGPqb1OlA/4DsZWpJ5kpONuQA==)
speech-config.app-key=FC84bGUpbNFrexoL speech-config.app-key=ENC(AR74B7pRjlZVPInZ9RsZroQRHjuU/6rkGamtcp2O5XMLbEgk8NMEEAksnLrNaKFmrUlkfMnNkC5bIiwjVisx3w==)
mqtt.topic.command.car.jw=carCoordinates mqtt.topic.command.car.jw=carCoordinates
......
...@@ -1523,13 +1523,13 @@ ...@@ -1523,13 +1523,13 @@
UNION ALL UNION ALL
SELECT SELECT
ifnull( count( DISTINCT LEFT(p_plan_task.point_num, 18) ), 0 ) AS value, COUNT(DISTINCT LEFT(p_plan_task.org_code, 18)) AS value,
'今日已巡查站' AS name, '今日已巡查站' AS name,
'JRYXCZ' AS code 'JRYXCZ' AS code
FROM FROM
p_plan_task p_plan_task
<where> <where>
finish_status = 2 (finish_status = 2 OR finish_status = 3)
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
......
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