Commit ae731566 authored by litengwei's avatar litengwei

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

# Conflicts: # amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/application-dev3.properties
parents 3b39edbb ca2dda60
package com.yeejoin.amos.boot.biz.common;
public class Test {
public static void main(String[] args) {
System.out.println("dddddddddddddd");
}
}
...@@ -17,7 +17,17 @@ public class IndexDto { ...@@ -17,7 +17,17 @@ public class IndexDto {
private String address;// 指标地址 private String address;// 指标地址
private String createdTime;// '上报时间', private String createdTime;// '上报时间',
private String equipmentSpecificName;// private String equipmentSpecificName;//
private String equipmentNumber;
private String value; private String value;
private int count; private int count;
private String equipmentsIdx; private String equipmentsIdx;
private String equipmentIndexName; // 指标名称【风机状态名称】
private String longitude; // 经度
private String latitude; // 纬度
private String frontModule;
private String unit; // 单位
private String F;//风机编号 -- 适应大屏
private String state; // 指标名称【风机状态名称】
private String countString;
private String color;
} }
...@@ -99,5 +99,8 @@ public class StationBasicDto extends BaseDto { ...@@ -99,5 +99,8 @@ public class StationBasicDto extends BaseDto {
//新增 场站第三方编号 //新增 场站第三方编号
private String stationNumber; private String stationNumber;
//新增场站 设备检测网关 //新增场站 设备检测网关
private String gatewayId; private String fanGatewayId;
//升压站网管
private String boosterGatewayId;
} }
...@@ -45,7 +45,8 @@ public class MonitorFanIndicator extends BaseEntity { ...@@ -45,7 +45,8 @@ public class MonitorFanIndicator extends BaseEntity {
private String addressGateway;//地址加网管 private String addressGateway;//地址加网管
@TableField("equipment_number") @TableField("equipment_number")
private String equipmentNumber; //设备编号 private String equipmentNumber; //设备编号
@TableField("data_type")
private String dataType; //设备编号
} }
...@@ -144,11 +144,12 @@ public class StationBasic extends BaseEntity { ...@@ -144,11 +144,12 @@ public class StationBasic extends BaseEntity {
//新增 场站第三方编号 //新增 场站第三方编号
@TableField("station_number") @TableField("station_number")
private String stationNumber; private String stationNumber;
//新增场站 设备检测网关 //风机网管
@TableField("gateway_id") @TableField("fan_gateway_id")
private String gatewayId; private String fanGatewayId;
//升压站网管
@TableField("booster_gateway_id")
private String boosterGatewayId;
} }
...@@ -30,11 +30,6 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato ...@@ -30,11 +30,6 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
@Param("offset") int offset); @Param("offset") int offset);
Object getIndicatoralueAvage(String gateway,String indicator); Object getIndicatoralueAvage(String gateway,String indicator);
List<RunRecord> queryRunRecord(@Param("size") long size,
@Param("list") String[] list,
@Param("offset") long offset);
int queryRunRecordTotal( @Param("list") String[] list);
Object getIndicatoralueTotal(String gateway,String indicator); Object getIndicatoralueTotal(String gateway,String indicator);
......
...@@ -78,34 +78,6 @@ ...@@ -78,34 +78,6 @@
WHERE gateway=#{gateway} and WHERE gateway=#{gateway} and
indicator like concat('%',#{indicator},'%') indicator like concat('%',#{indicator},'%')
</select> </select>
<select id="queryRunRecord" resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.RunRecord">
SELECT
t.equipment_number AS FanName,
(SELECT indicator_value FROM monitor_fan_indicator WHERE equipment_number=t.equipment_number AND gateway=t.gateway and indicator="有功功率") AS 'power',
(SELECT indicator_value FROM monitor_fan_indicator WHERE equipment_number=t.equipment_number AND gateway=t.gateway and indicator="瞬时风速") AS 'windSpeed',
(SELECT indicator_value FROM monitor_fan_indicator WHERE equipment_number=t.equipment_number AND gateway=t.gateway and indicator="60秒平均风向角") AS 'windDirection',
(SELECT indicator_value FROM monitor_fan_indicator WHERE equipment_number=t.equipment_number AND gateway=t.gateway and indicator="日发电量") AS 'PowerGeneration'
FROM
(select
DISTINCT a.equipment_number,a.gateway
from monitor_fan_indicator a where a.equipment_number is not null and a.gateway in
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
#{item}
</foreach>
ORDER BY a.equipment_number ) AS t
limit #{offset}, #{size}
</select>
<select id="queryRunRecordTotal" resultType="java.lang.Integer">
select
count(DISTINCT a.equipment_number) num
from monitor_fan_indicator a where a.equipment_number is not null and a.gateway in
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
station_basic.station_type stationType, station_basic.station_type stationType,
station_basic.station_flag stationFlag, station_basic.station_flag stationFlag,
station_basic.area_code areaCode, station_basic.area_code areaCode,
station_basic.jumpPath, station_basic.jump_path,
station_basic.risk_level riskLevel, station_basic.risk_level riskLevel,
station_basic.belong_area belongArea, station_basic.belong_area belongArea,
station_coordinate.longitude, station_coordinate.longitude,
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<select id="getStationListByRegionCode" resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto"> <select id="getStationListByRegionCode" resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto">
select select
station_name as name, station_name as name,
station_code as code, sequence_nbr as code,
station_type as parentCode, station_type as parentCode,
sequence_nbr as id, sequence_nbr as id,
'1' as isOnclick '1' as isOnclick
......
...@@ -175,7 +175,7 @@ public class StationBasicController extends BaseController { ...@@ -175,7 +175,7 @@ public class StationBasicController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "场站地图数据", notes = "场站地图数据") @ApiOperation(httpMethod = "GET", value = "场站地图数据", notes = "场站地图数据")
@GetMapping(value = "/listforMap") @GetMapping(value = "/listforMap")
public ResponseModel<List<StationInfoDto>> getStationList(@RequestParam(value = "areaCode", required = false) String areaCode,@RequestParam(value = "type", required = false) String type) { public ResponseModel<List<StationInfoDto>> getStationList(@RequestParam(value = "areaCode", required = false) String areaCode,@RequestParam(value = "type", required = false,defaultValue = "qj") String type) {
return ResponseHelper.buildResponse(stationBasicServiceImpl.getStationList(areaCode,type)); return ResponseHelper.buildResponse(stationBasicServiceImpl.getStationList(areaCode,type));
} }
} }
...@@ -19,9 +19,9 @@ public class MapUtils { ...@@ -19,9 +19,9 @@ public class MapUtils {
double radLat = Math.toRadians(latitude); double radLat = Math.toRadians(latitude);
// 计算x、y、z坐标值 // 计算x、y、z坐标值
double x = EARTH_RADIUS * Math.cos(radLat) * Math.cos(radLng)+ Math.random()*1000 ; double x = EARTH_RADIUS * Math.cos(radLat) * Math.cos(radLng)+ 100 ;
double y = EARTH_RADIUS * Math.cos(radLat) * Math.sin(radLng)-Math.random()*1000; double y = EARTH_RADIUS * Math.cos(radLat) * Math.sin(radLng)+10;
double z = EARTH_RADIUS * Math.sin(radLat)+Math.random()*1000; double z = EARTH_RADIUS * Math.sin(radLat)+2;
arrayList.add(x); arrayList.add(x);
arrayList.add(y); arrayList.add(y);
arrayList.add(z); arrayList.add(z);
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
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.mapper.MonitorFanIndicatorMapper;
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.entity.Test; import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
...@@ -15,24 +19,25 @@ import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils; ...@@ -15,24 +19,25 @@ import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection; import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; import org.slf4j.Logger;
import org.influxdb.dto.QueryResult; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.ArrayList; import java.util.*;
import java.util.Date; import java.util.concurrent.TimeUnit;
import java.util.List; import java.util.*;
import java.util.Map;
@RestController @RestController
@Api(tags = "Demo-test") @Api(tags = "Demo-test")
@RequestMapping(value = "/demo") @RequestMapping(value = "/demo")
public class DemoController extends BaseController { public class DemoController extends BaseController {
Logger logger = LoggerFactory.getLogger(DemoController.class);
@Autowired @Autowired
StationBasicServiceImpl stationBasicServiceimpl; StationBasicServiceImpl stationBasicServiceimpl;
...@@ -53,7 +58,11 @@ public class DemoController extends BaseController { ...@@ -53,7 +58,11 @@ public class DemoController extends BaseController {
MonitorFanIndicatorImpl monitorFanIndicatorImpl; MonitorFanIndicatorImpl monitorFanIndicatorImpl;
@Autowired @Autowired
InfluxDButils influxDButils; InfluxDButils influxDButils;
@Autowired
EmqKeeper emqKeeper;
@Autowired
private MonitorFanIndicatorMapper monitorFanIndicatorregionMapper;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "demo测试prodcutcion 库") @ApiOperation(value = "demo测试prodcutcion 库")
...@@ -79,10 +88,57 @@ public class DemoController extends BaseController { ...@@ -79,10 +88,57 @@ public class DemoController extends BaseController {
@ApiOperation(value = "测试获取风速平均值") @ApiOperation(value = "测试获取风速平均值")
@GetMapping("/test4") @GetMapping("/test4")
public void demoTest3() { public void demoTest3() {
Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速"); // Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速");
System.out.println(o.toString()); // System.out.println(o.toString());
QueryWrapper<MonitorFanIndicator> QueryWrapper= new QueryWrapper<>();
QueryWrapper.eq("gateway","1668801435891929089");
long DATE =new Date().getTime();
System.out.println(DATE);
List<MonitorFanIndicator> list=monitorFanIndicatorregionMapper.selectList(QueryWrapper);
for (MonitorFanIndicator monitorFanIndicator : list) {
Map<String, String> tag = new HashMap<>();
Map<String, Object> maps2 = new HashMap<>();
tag.put("address",monitorFanIndicator.getIndexAddress() );
tag.put("dataType", monitorFanIndicator.getDataType());
tag.put("equipmentSpecificName",monitorFanIndicator.getFanCode() );
tag.put("equipmentsIdx",monitorFanIndicator.getAddressGateway() );
tag.put("gatewayId", monitorFanIndicator.getGateway());
tag.put("isAlarm", monitorFanIndicator.getIsAlarm());
maps2.put("createdTime", "2023-07-05 18:30:26");
maps2.put("unit", monitorFanIndicator.getUnit());
maps2.put("value", "");
maps2.put("valueLabel","" );
maps2.put("traceId", "");
maps2.put("equipmentIndexName", monitorFanIndicator.getIndicator());
maps2.put("equipmentNumber", monitorFanIndicator.getEquipmentNumber());
maps2.put("frontModule", monitorFanIndicator.getFrontModule());
maps2.put("systemType", monitorFanIndicator.getSystemType());
influxDbConnection.insert("indicators_"+monitorFanIndicator.getGateway(), tag, maps2,1688558007051L, TimeUnit.MILLISECONDS);
}
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "测试消息发送")
@GetMapping("/test5")
public void demoTest4() {
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("test", String.valueOf(Math.random() *1000));
hashMap.put("test1", String.valueOf(Math.random() *100));
try {
emqKeeper.getMqttClient().publish("test_topic", JSON.toJSON(hashMap).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish("test_topic1", JSON.toJSON(hashMap).toString().getBytes("UTF-8"), 1, true);
logger.info("++++++++++++++++++++++++++++++++++发送消息成功++++++++++++++++++++++++++++++++++++++");
} catch (Exception exception) {
logger.error("============================================================发送消息报错");
}
}
} }
...@@ -2,10 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -2,10 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.PersonAccountDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.ColModel;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.DataGridMock;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils; import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -20,6 +21,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -20,6 +21,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -34,50 +36,27 @@ import java.util.List; ...@@ -34,50 +36,27 @@ import java.util.List;
public class DeviceController extends BaseController { public class DeviceController extends BaseController {
@Autowired @Autowired
InfluxDButils influxDButils; MonitorFanIndicatorImpl monitorFanIndicatorImpl;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取告警数据") @ApiOperation(value = "获取每个风机实时告警数据")
@GetMapping("/nationwide") @GetMapping("/nationwide")
public ResponseModel<Page<IndexDto>> getNationWideInfo(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<ResultsData> getNationWideInfo(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size,@RequestParam(value = "gateway") String gateway) { (value = "size") int size,@RequestParam(value = "stationBasicId") String stationBasicId,@RequestParam(value = "equipmentNumber" , required = false ) String equipmentNumber) {
Page<IndexDto> page = new Page<IndexDto>(); ResultsData resultsData=monitorFanIndicatorImpl.getNationWideInfo( current, size, stationBasicId, equipmentNumber);
page.setCurrent(current); return ResponseHelper.buildResponse(resultsData);
page.setSize(size);
StringBuffer querysql = new StringBuffer("SELECT createdTime ,gatewayId,address,valueLabel,equipmentSpecificName,value FROM iot_data WHERE isAlarm='1' and value!='0.0' and time > now() - 1d ");
StringBuffer querysqlcount = new StringBuffer("SELECT count(value) FROM iot_data WHERE isAlarm='1' and value!='0.0' and time > now() - 1d ");
if(StringUtils.isNotEmpty(gateway)){
String[] da= gateway.split(",");
for (int i = 0; i < da.length; i++) {
if(i==0){
querysql.append("and ( gatewayId = ").append("'"+da[i]+"'");
querysqlcount.append("and ( gatewayId = ").append("'"+da[i]+"'");
}else if(i==da.length-1){
querysql.append(" or gatewayId = ").append("'"+da[i]+"'").append(") ");
querysqlcount.append(" or gatewayId = ").append("'"+da[i]+"'").append(") ");
}else{
querysql.append(" or gatewayId = ").append("'"+da[i]+"'");
querysqlcount.append(" or gatewayId = ").append("'"+da[i]+"'");
}
}
}
querysql.append(" ORDER BY time desc LIMIT ").append(page.getSize()).append(" OFFSET ").append((page.getCurrent() - 1)*page.getSize());
//每个分机的指标数据
List<IndexDto> list = influxDButils.getListData(querysql.toString(),IndexDto.class);
List<IndexDto> list1 = influxDButils.getListData(querysqlcount.toString(),IndexDto.class);
page.setRecords(list);
if(list1!=null&&list1.size()>0){
page.setTotal(list1.get(0).getCount());
}
return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取历史告警数据")
@GetMapping("/historyNationwide")
public ResponseModel<ResultsData> getLSNationWideInfo(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size,@RequestParam(value = "stationBasicId") String stationBasicId,@RequestParam(value = "equipmentNumber" , required = false ) String equipmentNumber) {
ResultsData resultsData=monitorFanIndicatorImpl.getLsNationWideInfo( current, size, stationBasicId, equipmentNumber);
return ResponseHelper.buildResponse(resultsData);
}
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
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.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.RunRecord; import com.yeejoin.amos.boot.module.jxiop.api.dto.RunRecord;
import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator; import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
...@@ -19,7 +20,10 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -19,7 +20,10 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController @RestController
@Api(tags = "大屏相关API") @Api(tags = "大屏相关API")
...@@ -34,14 +38,15 @@ public class MonitorFanIdxController extends BaseController { ...@@ -34,14 +38,15 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据设备编号、网关ID、前段展示模块查询表数据") @ApiOperation(value = "根据设备编号、场站id、前段展示模块、系统类型查询表数据")
@GetMapping("/getFanIdxInfoByPage") @GetMapping("/getFanIdxInfoByPage")
public ResponseModel<IPage<MonitorFanIndicator>> getFanIdxInfoByPage(@RequestParam(value = "equipmentNumber", required = false) String equipmentNumber, public ResponseModel<IPage<IndexDto>> getFanIdxInfoByPage(@RequestParam(value = "equipNum", required = false) String equipNum,
@RequestParam(value = "gateway", required = false) String gateway, @RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "frontModule", required = false) String frontModule, @RequestParam(value = "frontModule", required = false) String frontModule,
@RequestParam(value = "current", required = false) int current, @RequestParam(value = "systemType", required = false) String systemType,
@RequestParam(value = "size", required = false) int size) { @RequestParam(value = "current", required = false) int current,
return ResponseHelper.buildResponse(monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, gateway, frontModule, current, size)); @RequestParam(value = "size", required = false) int size) {
return ResponseHelper.buildResponse(monitorFanIndicator.getFanIdxInfoByPage(equipNum, stationId, frontModule, current, size, systemType));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
...@@ -53,19 +58,54 @@ public class MonitorFanIdxController extends BaseController { ...@@ -53,19 +58,54 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "运行记录") @ApiOperation(value = "风机布置图 - 风机状态列表")
@GetMapping("/runRecord") @GetMapping("/getFanStatusList")
public ResponseModel<IPage<RunRecord>> runRecord( public ResponseModel<IPage<IndexDto>> getFanStatusList(@RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "gateway", required = false) String gateway, @RequestParam(value = "current", required = false) int current,
@RequestParam(value = "current", required = false) int current, @RequestParam(value = "size", required = false) int size) {
@RequestParam(value = "size", required = false) int size) { List<IndexDto> fanStatusList = monitorFanIndicator.getFanStatusList(stationId);
Page<IndexDto> page = new Page<>(current, size);
String[] gateways=gateway.split(","); List<IndexDto> collect = fanStatusList.stream()
IPage<RunRecord> page= monitorFanIndicator.queryRunRecord( size,gateways, current); .skip((long) (current - 1) * size)
.limit(size)
.collect(Collectors.toList());
page.setTotal(fanStatusList.size());
page.setRecords(collect);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风机布置图 - 风机状态统计")
@GetMapping("/getFanStatusStatistics")
public ResponseModel<IPage<IndexDto>> getFanStatusStatistics(@RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "current", required = false) int current,
@RequestParam(value = "size", required = false) int size) {
List<IndexDto> fanStatusStatistics = monitorFanIndicator.getFanStatusStatistics(stationId);
Page<IndexDto> page = new Page<>(current, size);
List<IndexDto> collect = fanStatusStatistics.stream()
.skip((long) (current - 1) * size)
.limit(size)
.collect(Collectors.toList());
page.setTotal(fanStatusStatistics.size());
page.setRecords(collect);
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风机布置图 - 风机基础信息")
@GetMapping("/getFanBasicInfoByEquipNum")
public ResponseModel<IndexDto> getFanBasicInfoByEquipNum(@RequestParam(value = "equipNum", required = false) String equipNum,
@RequestParam(value = "stationId", required = false) String stationId) {
return ResponseHelper.buildResponse(monitorFanIndicator.getFanBasicInfoByEquipNum(equipNum, stationId));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取当前表记的实时温度")
@GetMapping("/getRealTimeTemperature")
public ResponseModel<HashMap<String, List<String>>> getRealTimeTemperature(@RequestParam(value = "equipNum", required = false) String equipNum,
@RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "frontModule", required = false) String frontModule) {
return ResponseHelper.buildResponse(monitorFanIndicator.getRealTimeTemperature(equipNum, stationId, frontModule)) ;
}
} }
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
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.api.service.IMapRegionService; import com.yeejoin.amos.boot.module.jxiop.api.service.IMapRegionService;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test; import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl;
...@@ -40,17 +41,17 @@ public class MonitoringMapController extends BaseController { ...@@ -40,17 +41,17 @@ public class MonitoringMapController extends BaseController {
@Autowired @Autowired
MonitoringServiceImpl monitoringServiceImpl; MonitoringServiceImpl monitoringServiceImpl;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取监盘全国地图数据") @ApiOperation(value = "获取监盘全国地图数据")
@GetMapping("/nationwide") @GetMapping("/nationwide")
public ResponseModel<List<RegionNationWideDto>> getNationWideInfo(@RequestParam (value = "provinceName", required = false)String provinceName) { public ResponseModel<List<RegionNationWideDto>> getNationWideInfo(@RequestParam (value = "provinceName", required = false)String provinceName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getNationWideInfo(provinceName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getNationWideInfo(provinceName));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取社会贡献") @ApiOperation(value = "获取区域电量指标完成情况")
@GetMapping("/getTotalSocialContribution") @GetMapping("/getCompletionOfPowerIndicatorsByProvinceName")
public ResponseModel<List<SocialContributionDto>> getTotalSocialContribution() { public ResponseModel<ResultsData> getCompletionOfPowerIndicatorsByProvinceName(@RequestParam(required = true) int current, @RequestParam(required = true) int size, @RequestParam(required = true) String provinceName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getTotalSocialContribution()); return ResponseHelper.buildResponse(monitoringServiceImpl.getCompletionOfPowerIndicatorsByProvinceName(current,size,provinceName));
} }
} }
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
/**
* @description:
* @author: tw
* @createDate: 2023/7/6
*/
@Data
public class ColModel {
private String fid;
private String dataIndex;
private String name;
private String title;
private String type;
private String key;
public ColModel(String fid, String dataIndex, String name, String title, String type, String key) {
this.fid = fid;
this.dataIndex = dataIndex;
this.name = name;
this.title = title;
this.type = type;
this.key = key;
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
@Data
public class CompletionOfPowerIndicatorsDto {
//场站名称
private String stationName;
//装机容量
private String installCapactity;
//风速或者辐照度
private String windSpeedOrIrradiance;
// 有功功率
private String activePower;
//日发电量
private String dailyPower;
//月发电量
private String monthlyPower;
//年发电量
private String annualPower;
}
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
/**
* @description:
* @author: tw
* @createDate: 2023/7/6
*/
@Data
public class DataGridMock {
private int current;
private int total;
private boolean pagination;
private int totalPage;
private List dataList;
public DataGridMock(int current, int total, boolean pagination, int totalPage, List dataList) {
this.current = current;
this.total = total;
this.pagination = pagination;
this.totalPage = totalPage;
this.dataList = dataList;
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
/**
* 指标dto-用于接收influxdb里边查询的到的数据
*/
@Data
public class IndicatorsDto {
private String address;
private String createdTime;
private String dataType;
private String equipmentIndex;
private String equipmentIndexName;
private String equipmentNumber;
private String equipmentSpecificName;
private String equipmentsIdx;
private String frontModule;
private String gatewayId;
private String isAlarm;
private String systemType;
private String traceId;
private String unit;
private String value;
private String valueLabel;
}
...@@ -10,6 +10,8 @@ import java.util.HashMap; ...@@ -10,6 +10,8 @@ import java.util.HashMap;
public class RegionNationWideDto { public class RegionNationWideDto {
@ApiModelProperty(value = "省份名称") @ApiModelProperty(value = "省份名称")
private String name; private String name;
@ApiModelProperty(value = "省份名称")
private String staitionId;
@ApiModelProperty(value = "光伏电站数量") @ApiModelProperty(value = "光伏电站数量")
private String guangfu = "0"; private String guangfu = "0";
@ApiModelProperty(value = "风机电站数量") @ApiModelProperty(value = "风机电站数量")
......
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
/**
* @description:
* @author: tw
* @createDate: 2023/7/6
*/
@Data
public class ResultsData {
private DataGridMock dataGridMock;
private List<ColModel> colModel;
public ResultsData(DataGridMock dataGridMock, List<ColModel> colModel) {
this.dataGridMock = dataGridMock;
this.colModel = colModel;
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
@Data
public class TestDto {
// "date": "2020-12-12 12:12:12",
// "address": "陕西省西安市雁塔区太白南路A座C区",
// "level": "紧急",
// "name": "咸阳机场项目",
// "id": "1",
// "status": "研发中"
private String createdTime;
private String equipmentIndex;
private String equipmentIndexName;
private String traceId;
private String value;
private String valueLabel;
private String unit;
}
package com.yeejoin.amos.boot.module.jxiop.api.service; package com.yeejoin.amos.boot.module.jxiop.biz.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mysql.cj.x.protobuf.MysqlxCrud;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator; import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -16,4 +15,6 @@ public interface IMonitorFanIndicator { ...@@ -16,4 +15,6 @@ public interface IMonitorFanIndicator {
//批量修改指标值 //批量修改指标值
void UpdateMonitorFanIndicator(List<IndexDto> list); void UpdateMonitorFanIndicator(List<IndexDto> list);
ResultsData getNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
ResultsData getLsNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
} }
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class CommonServiceImpl {
@Autowired
InfluxDButils influxDButils;
/**
* @deprecated 获取指标值总和
* @param gatewayId 网关id 用于拼接sql语句
* @param indicator 指标名称 查询条件-根据指标名称获取风速
* @return 指标值总和
*/
public Double getTotalByIndicatior(String gatewayId,String indicator){
String sql = "SELECT * FROM indicators_"+gatewayId+" where equipmentIndexName='"+indicator+"'";
Double totalvalue = 0.0;
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql,IndicatorsDto.class);
List<Double> doubleList = indicatorsDtoList.stream().map(indicatorsDto -> Double.parseDouble(indicatorsDto.getValue())).collect(Collectors.toList());
totalvalue = doubleList.stream().mapToDouble(Double::doubleValue).sum();
return totalvalue;
}
/**
* @deprecated 获取指标值平均值
* @param gatewayId 网关id 用于拼接sql语句
* @param indicator 指标名称 查询条件-根据指标名称获取风速
* @return 指标值总和
*/
public Double getAvgvalueByIndicatior(String gatewayId,String indicator){
String sql = "SELECT * FROM indicators_"+gatewayId+" where equipmentIndexName='"+indicator+"'";
Double avageValue = 0.0;
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql,IndicatorsDto.class);
List<Double> doubleList = indicatorsDtoList.stream().map(indicatorsDto -> Double.parseDouble(indicatorsDto.getValue())).collect(Collectors.toList());
avageValue = doubleList.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
return avageValue;
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.api.entity.Region;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
@Async
@Service
public class MonitoringServiceIMQTTmpl {
Logger logger = LoggerFactory.getLogger(MonitoringServiceIMQTTmpl.class);
/**
* 场站mapper
*/
@Autowired
StationBasicMapper stationBasicMapper;
@Autowired
CommonServiceImpl commonServiceImpl;
@Autowired
RegionMapper regionMapper;
@Autowired
EmqKeeper emqKeeper;
@Scheduled(cron = "0 0/1 * * * *")
public void getTotalSocialContribution() {
Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
logger.error("--------------------------社会贡献定时执行----------------------------------------------");
List<SocialContributionDto> socialContributionDtoList = new ArrayList<>();
//定义社会贡献列表
AtomicReference<Double> totalSocialContribution = new AtomicReference<>(0.0);
//获取所有网关id不为空的数据
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("fan_gateway_id"));
stationBasicList.forEach(stationBasic -> {
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量"));
});
//二氧化碳贡献数
SocialContributionDto co2 = new SocialContributionDto();
//标准煤贡献度
SocialContributionDto coal = new SocialContributionDto();
//碳粉尘计算公式
SocialContributionDto toner = new SocialContributionDto();
//二氧化硫贡献度
SocialContributionDto so2 = new SocialContributionDto();
/** 社会贡献原始计算公式,后边的数据已经经过处理
//二氧化碳计算公式 *10000*832/10000/1000/1000
//标准煤计算公式 *10000*304.9/10000/1000/1000
//碳粉尘计算公式 *10000*0.032/1000/1000
//二氧化硫计算公式 =A2*10000*0.16/1000/1000
*/
co2.setUnit("二氧化碳减排量(万t)");
co2.setTitle(totalSocialContribution.get() * 0.000832);
socialContributionDtoList.add(co2);
coal.setUnit("节约标准煤(万t)");
coal.setTitle(totalSocialContribution.get() * 0.0003049);
socialContributionDtoList.add(coal);
toner.setUnit("碳粉尘减排量(万t)");
toner.setTitle(totalSocialContribution.get() * 0.00032);
socialContributionDtoList.add(toner);
so2.setUnit("二氧化硫减排量(万t)");
so2.setTitle(totalSocialContribution.get() * 0.0016);
socialContributionDtoList.add(so2);
socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1);
try {
emqKeeper.getMqttClient().publish("socialcontribution_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true);
logger.info("-----------------发送社会贡献消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage));
} catch (Exception exception) {
logger.error("-----------------发送社会贡献消息=================== 失败!");
}
}
@Scheduled(cron = "0/30 * * * * *")
public void getCompletionOfPowerIndicatorsByProvinceName() {
Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
logger.error("--------------------------区域实时数据消息开始发送----------------------------------------------");
List<SocialContributionDto> socialContributionDtoList = new ArrayList<>();
Region region = this.regionMapper.selectOne(new QueryWrapper<Region>().eq("level", 1).eq("region_name", "江西省"));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().like("belong_area", region.getRegionCode()));
//日发电量
AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
//月发电量
AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
//年发电量
AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
//年发电量完成比例
Double completionRatio = 23.11;
//年利用小时数
AtomicReference<Double> useHours = new AtomicReference<>(0.01);
stationBasicList.forEach(stationBasic -> {
dailyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "日发电量"));
monthlyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "月发电量"));
annualPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量"));
useHours.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "日工作时间"));
});
SocialContributionDto dailyPowerdto = new SocialContributionDto();
dailyPowerdto.setTitle(dailyPower.get());
dailyPowerdto.setUnit("万kWh");
SocialContributionDto monthlyPowerdto = new SocialContributionDto();
monthlyPowerdto.setTitle(monthlyPower.get());
monthlyPowerdto.setUnit("万kWh");
SocialContributionDto annualPowerdto = new SocialContributionDto();
annualPowerdto.setTitle(annualPower.get());
annualPowerdto.setUnit("万kWh");
SocialContributionDto completionRatioDto = new SocialContributionDto();
completionRatioDto.setTitle(completionRatio);
completionRatioDto.setUnit("%");
SocialContributionDto useHoursDto = new SocialContributionDto();
useHoursDto.setTitle(useHours.get());
useHoursDto.setUnit("h");
socialContributionDtoList.add(dailyPowerdto);
socialContributionDtoList.add(monthlyPowerdto);
socialContributionDtoList.add(annualPowerdto);
socialContributionDtoList.add(completionRatioDto);
socialContributionDtoList.add(useHoursDto);
socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1);
try {
emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true);
logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage));
} catch (Exception exception) {
logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
}
}
}
...@@ -78,7 +78,7 @@ public class StationDataTaskImpl { ...@@ -78,7 +78,7 @@ public class StationDataTaskImpl {
return deviceDtoList; return deviceDtoList;
} }
@Async("jxiopAsyncExecutor") // @Async("jxiopAsyncExecutor")
public List<IndexDto> getIndexDto(DeviceDto deviceDto) { public List<IndexDto> getIndexDto(DeviceDto deviceDto) {
String querysql ="SELECT createdTime ,gatewayId,address,valueLabel ,equipmentsIdx FROM iot_data WHERE equipmentSpecificName=~/.*"+deviceDto.getNumberName()+"风机"+".*/ and gatewayId='"+deviceDto.getGateway()+"' ORDER BY time desc LIMIT 600"; String querysql ="SELECT createdTime ,gatewayId,address,valueLabel ,equipmentsIdx FROM iot_data WHERE equipmentSpecificName=~/.*"+deviceDto.getNumberName()+"风机"+".*/ and gatewayId='"+deviceDto.getGateway()+"' ORDER BY time desc LIMIT 600";
//每个分机的指标数据 //每个分机的指标数据
......
...@@ -26,7 +26,7 @@ public class StationDataTask { ...@@ -26,7 +26,7 @@ public class StationDataTask {
//定时获取场站指标最新数据 //定时获取场站指标最新数据
@Scheduled(cron = "${station.task.cron}") // @Scheduled(cron = "${station.task.cron}")
public void getStationDataTask(){ public void getStationDataTask(){
//获取所有场站信息 //获取所有场站信息
List<StationTaksDto> list=stationDataTask.getListStationBasic(); List<StationTaksDto> list=stationDataTask.getListStationBasic();
......
...@@ -5,6 +5,7 @@ import org.influxdb.dto.QueryResult; ...@@ -5,6 +5,7 @@ import org.influxdb.dto.QueryResult;
import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -48,4 +49,46 @@ public class InfluxDButils { ...@@ -48,4 +49,46 @@ public class InfluxDButils {
} }
return list; return list;
} }
public <T> List<T> getListData1(String sql, Class<T> clazz) {
List<T> list = new ArrayList<>();
try {
QueryResult query = influxDbConnection.query(sql);
List<QueryResult.Result> queryResults = query.getResults();
for (QueryResult.Result result : queryResults) {
List<QueryResult.Series> series = result.getSeries();
if (series == null) {
continue;
}
for (QueryResult.Series serie : series) {
List<List<Object>> values = serie.getValues();
List<String> columns = serie.getColumns();
for (int i = 0; i < values.size(); ++i) {
T object = clazz.newInstance();
BeanWrapperImpl bean = new BeanWrapperImpl(object);
for (int j = 0; j < columns.size(); ++j) {
String k = columns.get(j).replace("last_","");
Object v = values.get(i).get(j);
System.out.println(k);
System.out.println(v);
if ("time".equals(k)) {
continue;
} else {
// if(ObjectUtils.isEmpty(v)){
// bean.setPropertyValue(k, "");
// }else{
bean.setPropertyValue(k, v);
// }
}
}
list.add(object);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
} }
...@@ -53,9 +53,13 @@ lettuce.timeout=10000 ...@@ -53,9 +53,13 @@ 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://172.16.3.18:2883 emqx.broker=tcp://172.16.10.220:1883
emqx.user-name=super emqx.user-name=admin
emqx.password=a123456 emqx.password=public
mqtt.scene.host=mqtt://172.16.10.220:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
emqx.max-inflight=1000 emqx.max-inflight=1000
......
...@@ -66,8 +66,8 @@ privilege.fegin.name=AMOS-API-PRIVILEGE ...@@ -66,8 +66,8 @@ privilege.fegin.name=AMOS-API-PRIVILEGE
feign.client.config.default.connect-timeout=20000 feign.client.config.default.connect-timeout=20000
feign.client.config.default.read-timeout=20000 feign.client.config.default.read-timeout=20000
#场站实时数据 #场站实时数据
station.task.cron=0/10 * * * * ? station.task.cron=* * */10 * * ?
#是否切片 #是否切片
station.isok=true station.isok=false
#风机更新数据切片量 #风机更新数据切片量
station.section=10 station.section=1000
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,11 @@ public class UseUnitCreditCodeCategoryDto { ...@@ -12,6 +12,11 @@ public class UseUnitCreditCodeCategoryDto {
* 使用单位编码 * 使用单位编码
*/ */
private String useUnitCreditCode; private String useUnitCreditCode;
/**
* 管辖机构编码
*/
private String orgBranchCode;
/** /**
* 状态 * 状态
*/ */
......
package com.yeejoin.amos.boot.module.tzs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum ImageSizeEnums {
/**
* 导出监管码、96333码尺寸
*/
// 监管码-大
JG_BIG("JG_BIG", "bigBg.png", 350, 350, 60, 720, 190, 0, 0, 780, 680),
// 监管码-中
JG_MID("JG_MID", "centreBg.png", 230, 230, 40, 480, 170, 0, 0, 520, 525),
// 监管码-小
JG_MIN("JG_MIN", "smallBg.png", 170, 170, 30, 360, 110, 0, 0, 380, 355),
// 96333电梯码
DT("DT", "dt.png", 170, 170, 30, 30, 110, 0, 0, 330, 355);
String code;
String bgPath;
Integer with;
Integer height;
Integer size;
Integer imagesX;
Integer imagesY;
Integer text1X;
Integer text1Y;
Integer text2X;
Integer text2Y;
public static ImageSizeEnums getEnumByCode(String code) {
for (ImageSizeEnums value : ImageSizeEnums.values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
}
...@@ -39,7 +39,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -39,7 +39,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
Map<String, Object> getCategoryAndDefineByRecord(@Param("record") String record); Map<String, Object> getCategoryAndDefineByRecord(@Param("record") String record);
List<Map<String, Object>> getAllUnit(@Param("unitCodes")List<String> unitCodes); List<Map<String, Object>> getAllUnit(@Param("unitCodes")List<String> unitCodes,@Param("orgBranchCodes")List<String> orgBranchCodes);
List<Map<String, Object>> getCategoryData(String level, String orgCode, String companyCode); List<Map<String, Object>> getCategoryData(String level, String orgCode, String companyCode);
......
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo; ...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 特种设备基本信息-监督管理信息 Mapper 接口 * 特种设备基本信息-监督管理信息 Mapper 接口
...@@ -16,7 +17,7 @@ public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> { ...@@ -16,7 +17,7 @@ public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> {
void updateRecordBatch(@Param("recordList") List<String> recordList); void updateRecordBatch(@Param("recordList") List<String> recordList);
List<String> selectUnitCodeList(@Param("records") List<String> records); List<Map<String,Object>> selectUnitCodeList(@Param("records") List<String> records);
List<String> selectSuperviseCodeList(@Param("records") List<String> records); List<String> selectSuperviseCodeList(@Param("records") List<String> records);
void deleteDataAll(@Param("records") List<String> records); void deleteDataAll(@Param("records") List<String> records);
......
...@@ -84,6 +84,7 @@ public interface IdxFeignService { ...@@ -84,6 +84,7 @@ public interface IdxFeignService {
FeignClientResult<String> submit(@RequestParam(value = "pageId") long pageId, FeignClientResult<String> submit(@RequestParam(value = "pageId") long pageId,
@RequestParam(value = "taskId",required = false) String taskId, @RequestParam(value = "taskId",required = false) String taskId,
@RequestParam(value = "planInstanceId", required = false) String planInstanceId, @RequestParam(value = "planInstanceId", required = false) String planInstanceId,
@RequestParam(value = "bizField", required = false) String bizField,
@RequestParam(value = "topic", required = false) String topic, @RequestParam(value = "topic", required = false) String topic,
@RequestParam(value = "tableName", required = false) String tableName, @RequestParam(value = "tableName", required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception; @RequestBody Map<String, Object> kv) throws Exception;
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and status = #{status} and status = #{status}
</if> </if>
ORDER BY CODE96333 DESC LIMIT 1 <if test="status != 2 ">ORDER BY CODE96333 DESC LIMIT 1 </if>
<if test="status == 2 ">ORDER BY CODE96333 ASC LIMIT 1 </if>
</select> </select>
<select id="selectEquipInfo" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto"> <select id="selectEquipInfo" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto">
......
...@@ -129,22 +129,27 @@ ...@@ -129,22 +129,27 @@
<select id="getAllUnit" resultType="java.util.Map"> <select id="getAllUnit" resultType="java.util.Map">
SELECT SELECT
DISTINCT (USE_UNIT_CREDIT_CODE) use_code, ibjui.USE_UNIT_CREDIT_CODE use_code,
ifnull(ORG_BRANCH_CODE,50) supervise_org_code ibjsi.ORG_BRANCH_CODE supervise_org_code
FROM FROM
idx_biz_jg_use_info ibjui idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD" LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
WHERE WHERE
USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> '' ibjui.USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> ''
AND (lengthb(USE_UNIT_CREDIT_CODE)= 15 or lengthb(USE_UNIT_CREDIT_CODE)= 18) AND (lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 15 or lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 18)
<if test="unitCodes !=null and unitCodes.size>0"> <if test="unitCodes !=null and unitCodes.size>0">
and USE_UNIT_CREDIT_CODE in and ibjui.USE_UNIT_CREDIT_CODE in
<foreach collection="unitCodes" separator="," item="unitCode" open="(" close=")"> <foreach collection="unitCodes" separator="," item="unitCode" open="(" close=")">
#{unitCode} #{unitCode}
</foreach> </foreach>
</if> </if>
GROUP BY use_code <if test="orgBranchCodes !=null and orgBranchCodes.size>0">
ORDER BY use_code and ibjsi.ORG_BRANCH_CODE in
<foreach collection="orgBranchCodes" separator="," item="orgBranchCode" open="(" close=")">
#{orgBranchCode}
</foreach>
</if>
GROUP BY use_code,supervise_org_code
</select> </select>
<select id="getCategoryData" resultType="java.util.Map"> <select id="getCategoryData" resultType="java.util.Map">
...@@ -301,6 +306,7 @@ ...@@ -301,6 +306,7 @@
<select id="useUnitCreditCodeCategoryCount" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitCreditCodeCategoryDto"> <select id="useUnitCreditCodeCategoryCount" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitCreditCodeCategoryDto">
SELECT SELECT
ibjsi."ORG_BRANCH_CODE",
ibjui."USE_UNIT_CREDIT_CODE", ibjui."USE_UNIT_CREDIT_CODE",
ibjoi."CLAIM_STATUS", ibjoi."CLAIM_STATUS",
ibjri."EQU_LIST", ibjri."EQU_LIST",
...@@ -309,12 +315,12 @@ ...@@ -309,12 +315,12 @@
idx_biz_jg_use_info ibjui idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi."RECORD" = ibjui."RECORD"
where where
ibjoi."CLAIM_STATUS" <![CDATA[ <> ]]> '' ibjoi."CLAIM_STATUS" <![CDATA[ <> ]]> ''
and ibjui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> '' and ibjui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> ''
and ibjri."EQU_LIST" <![CDATA[ <> ]]> '' and ibjri."EQU_LIST" <![CDATA[ <> ]]> ''
GROUP BY ibjui."USE_UNIT_CREDIT_CODE", ibjoi."CLAIM_STATUS",ibjri."EQU_LIST" GROUP BY ibjui."USE_UNIT_CREDIT_CODE",ibjsi."ORG_BRANCH_CODE", ibjoi."CLAIM_STATUS",ibjri."EQU_LIST"
ORDER BY ibjui."USE_UNIT_CREDIT_CODE"
</select> </select>
<select id="getEquipExportData" resultType="com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo"> <select id="getEquipExportData" resultType="com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo">
select ORG_BRANCH_NAME as orgBranchName, select ORG_BRANCH_NAME as orgBranchName,
...@@ -345,6 +351,7 @@ ...@@ -345,6 +351,7 @@
<if test="dto.ORG_BRANCH_NAME != '' and dto.ORG_BRANCH_NAME != null">and ORG_BRANCH_NAME = #{dto.ORG_BRANCH_NAME}</if> <if test="dto.ORG_BRANCH_NAME != '' and dto.ORG_BRANCH_NAME != null">and ORG_BRANCH_NAME = #{dto.ORG_BRANCH_NAME}</if>
<if test="dto.USE_PLACE != '' and dto.USE_PLACE != null">and USE_PLACE = #{dto.USE_PLACE}</if> <if test="dto.USE_PLACE != '' and dto.USE_PLACE != null">and USE_PLACE = #{dto.USE_PLACE}</if>
<if test="dto.STATUS != '' and dto.STATUS != null">and STATUS = #{dto.STATUS}</if> <if test="dto.STATUS != '' and dto.STATUS != null">and STATUS = #{dto.STATUS}</if>
<if test="dto.EQU_CATEGORY != '' and dto.EQU_CATEGORY != null">and EQU_CATEGORY = #{dto.EQU_CATEGORY}</if>
<if test="dto.USE_UNIT_CREDIT_CODE != '' and dto.USE_UNIT_CREDIT_CODE != null">and USE_UNIT_CREDIT_CODE like concat('%', #{dto.USE_UNIT_CREDIT_CODE},'%')</if> <if test="dto.USE_UNIT_CREDIT_CODE != '' and dto.USE_UNIT_CREDIT_CODE != null">and USE_UNIT_CREDIT_CODE like concat('%', #{dto.USE_UNIT_CREDIT_CODE},'%')</if>
<if test="dto.ORG_BRANCH_CODE != '' and dto.ORG_BRANCH_CODE != null">and ORG_BRANCH_CODE like concat('%', #{dto.ORG_BRANCH_CODE},'%')</if> <if test="dto.ORG_BRANCH_CODE != '' and dto.ORG_BRANCH_CODE != null">and ORG_BRANCH_CODE like concat('%', #{dto.ORG_BRANCH_CODE},'%')</if>
<if test='dto.ids != null'> and SEQUENCE_NBR in <if test='dto.ids != null'> and SEQUENCE_NBR in
......
...@@ -9,15 +9,18 @@ ...@@ -9,15 +9,18 @@
</foreach> </foreach>
</update> </update>
<select id="selectUnitCodeList" resultType="java.lang.String"> <select id="selectUnitCodeList" resultType="java.util.Map">
SELECT SELECT
DISTINCT ( USE_UNIT_CREDIT_CODE ) unitCode ui."USE_UNIT_CREDIT_CODE" unitCode,
si."ORG_BRANCH_CODE" orgBranchCode
FROM FROM
idx_biz_jg_use_info ui idx_biz_jg_use_info ui
left join idx_biz_jg_supervision_info si ON ui."RECORD" = si."RECORD"
WHERE ui."RECORD" in WHERE ui."RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=")"> <foreach collection="records" separator="," item="record" open="(" close=")">
#{record} #{record}
</foreach> </foreach>
GROUP BY unitCode,orgBranchCode
</select> </select>
<select id="selectSuperviseCodeList" resultType="java.lang.String"> <select id="selectSuperviseCodeList" resultType="java.lang.String">
......
package com.yeejoin.amos.boot.module.tzs.biz.controller; package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -13,13 +14,16 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.EquipExportDto; ...@@ -13,13 +14,16 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto; import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo; import com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.tzs.api.enums.ImageSizeEnums;
import com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService; import com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo; import com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.EquipmentCategoryServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.EquipmentCategoryServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.ImageUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -30,10 +34,12 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -30,10 +34,12 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.io.*;
import java.util.Collection; import java.net.URL;
import java.util.List; import java.util.*;
import java.util.Map; import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/** /**
* 装备分类 * 装备分类
...@@ -55,6 +61,13 @@ public class EquipmentCategoryController extends BaseController { ...@@ -55,6 +61,13 @@ public class EquipmentCategoryController extends BaseController {
EquipmentCategoryMapper equipmentCategoryMapper; EquipmentCategoryMapper equipmentCategoryMapper;
@Value("${regulatory_code_prefix}")
String REGULATORY_CODE_PREFIX ;
/**
* 监管码背景图路径
*/
private static final String BASE_PATH = "amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/temp/";
/** /**
* 新增装备分类 * 新增装备分类
...@@ -374,6 +387,64 @@ public class EquipmentCategoryController extends BaseController { ...@@ -374,6 +387,64 @@ public class EquipmentCategoryController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/exportImage")
@ApiOperation(httpMethod = "GET", value = "设备监管码下载", notes = "设备监管码下载")
public void exportImage(HttpServletResponse response, @RequestParam("code") String code, @RequestParam("type") String type) throws IOException {
FileInputStream bgImgFile = null;
ImageSizeEnums imageSizeEnums = ImageSizeEnums.getEnumByCode(type);
try {
bgImgFile = new FileInputStream(BASE_PATH + imageSizeEnums.getBgPath());
} catch (FileNotFoundException e) {
e.printStackTrace();
}
File QrCodeFile = new File(BASE_PATH + code + ".png");
ImageUtils.creatQRCode(QrCodeFile, bgImgFile, imageSizeEnums.getWith(), imageSizeEnums.getHeight(), REGULATORY_CODE_PREFIX+code, "", code, imageSizeEnums.getSize(), imageSizeEnums.getImagesX(), imageSizeEnums.getImagesY(), imageSizeEnums.getText1X(), imageSizeEnums.getText1Y(), imageSizeEnums.getText2X(), imageSizeEnums.getText2Y());
ImageUtils.downloadResource(code + ".png", BASE_PATH + code + ".png", response);
QrCodeFile.delete();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/exportImageZip")
@ApiOperation(httpMethod = "GET", value = "设备信息导出", notes = "设备信息导出")
public void exportImageZip(HttpServletResponse response, EquipExportDto dto, @RequestParam("type") String type) throws IOException {
File delete = new File(BASE_PATH + "images");
if (!delete.exists()) {
delete.mkdir();
}
ImageSizeEnums imageSizeEnums = ImageSizeEnums.getEnumByCode(type);
//创建list 存放图片
List<File> fileList = new ArrayList<>();
List<EquipExportVo> equipExportData = equipmentCategoryServiceImpl.getEquipExportData(dto);
List<EquipExportVo> unique = equipExportData.stream().collect(
Collectors. collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getSupervisoryCode() + ";" + o.getCode96333()))), ArrayList::new)
);
for (EquipExportVo equipExportDatum : unique) {
FileInputStream bgImgFile = new FileInputStream(BASE_PATH + imageSizeEnums.getBgPath());
if ("DT".equals(type) && !ObjectUtils.isEmpty(equipExportDatum.getCode96333())) {
File QrCodeFile = new File(BASE_PATH + "images/" + equipExportDatum.getCode96333() + ".png");
ImageUtils.creatQRCode(QrCodeFile, bgImgFile, imageSizeEnums.getWith(), imageSizeEnums.getHeight(), REGULATORY_CODE_PREFIX+equipExportDatum.getCode96333(), "", equipExportDatum.getCode96333(), imageSizeEnums.getSize(), imageSizeEnums.getImagesX(), imageSizeEnums.getImagesY(), imageSizeEnums.getText1X(), imageSizeEnums.getText1Y(), imageSizeEnums.getText2X(), imageSizeEnums.getText2Y());
fileList.add(new File(BASE_PATH + "images/" + equipExportDatum.getCode96333() + ".png"));
} else if (!ObjectUtils.isEmpty(equipExportDatum.getSupervisoryCode())) {
File QrCodeFile = new File(BASE_PATH + "images/" + equipExportDatum.getSupervisoryCode() + ".png");
ImageUtils.creatQRCode(QrCodeFile, bgImgFile, imageSizeEnums.getWith(), imageSizeEnums.getHeight(), REGULATORY_CODE_PREFIX+equipExportDatum.getSupervisoryCode(), "", equipExportDatum.getSupervisoryCode(), imageSizeEnums.getSize(), imageSizeEnums.getImagesX(), imageSizeEnums.getImagesY(), imageSizeEnums.getText1X(), imageSizeEnums.getText1Y(), imageSizeEnums.getText2X(), imageSizeEnums.getText2Y());
fileList.add(new File(BASE_PATH + "images/" + equipExportDatum.getSupervisoryCode() + ".png"));
}
bgImgFile.close();
}
File zipFile = new File(BASE_PATH + "images/imageZip.zip");
zipFile.createTempFile("imageZip", ".zip");
// 调用压缩方法
ImageUtils.zipFiles(fileList, zipFile);
ImageUtils.downloadResourceZip("imageZip.zip", BASE_PATH + "images/imageZip.zip", response);
zipFile.delete();
ImageUtils.deleteAllFilesOfDir(delete);
if (delete.exists()) {
ImageUtils.deleteAllFilesOfDir(delete);
}
}
} }
...@@ -780,18 +780,19 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -780,18 +780,19 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
String userIdsTask = String.join(",", task); String userIdsTask = String.join(",", task);
// 添加被检查企业下的人员id // 添加被检查企业下的人员id
objectMap.put("CHECKED_COMPANY_USERS", userIds); objectMap.put("CHECKED_COMPANY_USERS", userIds);
objectMap.put("CHECKED_COMPANY_USER_ids", userIdsTask);
// 表单信息提交 // 表单信息提交
FeignClientResult<String> submit = idxFeignService.submit(pageId, taskId, planInstanceId, topic, tableName, objectMap); FeignClientResult<String> submit = idxFeignService.submit(pageId, taskId, planInstanceId,"CHECKED_COMPANY_USER_ids", topic, tableName, objectMap);
if ("200".equals(String.valueOf(submit.getStatus()))) { // if ("200".equals(String.valueOf(submit.getStatus()))) {
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("title", "企业整改"); // jsonObject.put("title", "企业整改");
jsonObject.put("userIds", userIdsTask); // jsonObject.put("userIds", userIdsTask);
logger.info("idx执行任务更新参数,{}", JSONObject.toJSONString(jsonObject)); // logger.info("idx执行任务更新参数,{}", JSONObject.toJSONString(jsonObject));
//FeignClientResult<JSONObject> jsonObjectFeignClientResult = idxFeignService.updateAmosTask(taskId, jsonObject); // //FeignClientResult<JSONObject> jsonObjectFeignClientResult = idxFeignService.updateAmosTask(taskId, jsonObject);
updateAmosTask(taskId, jsonObject); // updateAmosTask(taskId, jsonObject);
//logger.info("idx执行任务更新任务返回参数,{}", JSONObject.toJSONString(jsonObjectFeignClientResult)); // //logger.info("idx执行任务更新任务返回参数,{}", JSONObject.toJSONString(jsonObjectFeignClientResult));
//
} // }
return "ok"; return "ok";
} }
......
...@@ -153,6 +153,9 @@ tzs.cylinder.info.cron=0 0 1 * * ? ...@@ -153,6 +153,9 @@ tzs.cylinder.info.cron=0 0 1 * * ?
# ?????????? # ??????????
minio.url.path=http://172.16.10.210:9000/ minio.url.path=http://172.16.10.210:9000/
## ɼǰ׺
regulatory_code_prefix=https://nav.sspai.top/tzs?code=
outSystem.user.password=a1234560 outSystem.user.password=a1234560
amos.system.user.app-key=AMOS_STUDIO amos.system.user.app-key=AMOS_STUDIO
......
...@@ -12,7 +12,8 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl ...@@ -12,7 +12,8 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled= true spring.liquibase.enabled= true
feign.client.config.default.connect-timeout=30000
feign.client.config.default.read-timeout=30000
## eureka properties: ## eureka properties:
eureka.client.registry-fetch-interval-seconds=5 eureka.client.registry-fetch-interval-seconds=5
......
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