Commit 3f776163 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 6bd093d1 14566838
...@@ -83,7 +83,9 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -83,7 +83,9 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
} else if (item.getSurveyOrNot() == 1) { } else if (item.getSurveyOrNot() == 1) {
item.setSurveyOrNotText("已勘察"); item.setSurveyOrNotText("已勘察");
} else if (item.getSurveyOrNot() == 2) { } else if (item.getSurveyOrNot() == 2) {
item.setSurveyOrNotText("提交审核"); item.setSurveyOrNotText("审核中");
} else if (item.getSurveyOrNot() == 3) {
item.setSurveyOrNotText("审核完成");
} }
} }
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.WorkDto; import com.yeejoin.amos.boot.module.hygf.api.dto.WorkDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation; import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation; import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation;
import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService; import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService;
import com.yeejoin.amos.boot.module.hygf.api.mapper.DesignInformationMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.DesignInformationMapper;
...@@ -55,6 +56,8 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -55,6 +56,8 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
DesignInformationMapper designInformationMapper; DesignInformationMapper designInformationMapper;
@Autowired @Autowired
DesignInformationServiceImpl designInformationService; DesignInformationServiceImpl designInformationService;
@Autowired
PeasantHouseholdServiceImpl peasantHouseholdService;
private static final String IDX_REQUEST_STATE="200"; private static final String IDX_REQUEST_STATE="200";
private static final String VERIFY_RESULT_YES="0"; private static final String VERIFY_RESULT_YES="0";
...@@ -84,7 +87,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -84,7 +87,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
* 分页查询 * 分页查询
*/ */
public Page<PowerStationDto> queryForPowerStationPage(Page<PowerStationDto> page,@Condition(Operator.like) String powerStationCode,@Condition(Operator.like) String ownersName,String serviceAgent) { public Page<PowerStationDto> queryForPowerStationPage(Page<PowerStationDto> page,@Condition(Operator.like) String powerStationCode,@Condition(Operator.like) String ownersName,String serviceAgent) {
return this.queryForPage(page, null, false,powerStationCode,ownersName,serviceAgent); return this.queryForPage(page, "rec_date", false,powerStationCode,ownersName,serviceAgent);
} }
/** /**
...@@ -174,6 +177,13 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -174,6 +177,13 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
powerStation.setFlowTaskId(flowTaskId); powerStation.setFlowTaskId(flowTaskId);
} }
powerStationService.savePowerStation(powerStation, flag); powerStationService.savePowerStation(powerStation, flag);
if(!flag){
//更新农户状态
String peasantHouseholdId = powerStation.getPeasantHouseholdId();
PeasantHousehold peasantHousehold = peasantHouseholdService.getBaseMapper().selectById(Long.valueOf(peasantHouseholdId));
peasantHousehold.setSurveyOrNot(3);
peasantHouseholdService.saveOrUpdate(peasantHousehold);
}
} }
}catch (Exception e){ }catch (Exception e){
throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!"); throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
......
...@@ -93,7 +93,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -93,7 +93,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
* 分页查询 * 分页查询
*/ */
public Page<SurveyInformationDto> queryForSurveyInformationPage(Page<SurveyInformationDto> page) { public Page<SurveyInformationDto> queryForSurveyInformationPage(Page<SurveyInformationDto> page) {
return this.queryForPage(page, null, false); return this.queryForPage(page, "rec_date", false);
} }
/** /**
......
...@@ -97,7 +97,10 @@ public class DemoController extends BaseController { ...@@ -97,7 +97,10 @@ public class DemoController extends BaseController {
// 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<MonitorFanIndicator> QueryWrapper = new QueryWrapper<>();
QueryWrapper.eq("gateway", "1668801435891929089"); // 夏造风电
// QueryWrapper.eq("gateway", "1668801435891929089");
// 泰和光伏
QueryWrapper.eq("gateway", "1669524885619085313");
long DATE = new Date().getTime(); long DATE = new Date().getTime();
System.out.println(DATE); System.out.println(DATE);
List<MonitorFanIndicator> list = monitorFanIndicatorregionMapper.selectList(QueryWrapper); List<MonitorFanIndicator> list = monitorFanIndicatorregionMapper.selectList(QueryWrapper);
...@@ -151,7 +154,10 @@ public class DemoController extends BaseController { ...@@ -151,7 +154,10 @@ public class DemoController extends BaseController {
public void demoTest5() { public void demoTest5() {
//!!!!!!!!!!!!!!注意 初始化升压站的时候需要先更新monitor_fan_indicator_copy2表数据 且修改entity的表映射为monitor_fan_indicator_copy2 //!!!!!!!!!!!!!!注意 初始化升压站的时候需要先更新monitor_fan_indicator_copy2表数据 且修改entity的表映射为monitor_fan_indicator_copy2
QueryWrapper<MonitorFanIndicator> QueryWrapper = new QueryWrapper<>(); QueryWrapper<MonitorFanIndicator> QueryWrapper = new QueryWrapper<>();
QueryWrapper.eq("gateway", "1668801570352926721"); // 夏造风电升压站
// QueryWrapper.eq("gateway", "1668801570352926721");
// 泰和前进光伏站
QueryWrapper.eq("gateway", "1669525017559306241");
// QueryWrapper.eq("gateway", "1668801570352926721").eq("front_module","电量表计"); // QueryWrapper.eq("gateway", "1668801570352926721").eq("front_module","电量表计");
long DATE = new Date().getTime(); long DATE = new Date().getTime();
System.out.println(DATE); System.out.println(DATE);
......
...@@ -443,7 +443,11 @@ public class MonitorFanIdxController extends BaseController { ...@@ -443,7 +443,11 @@ public class MonitorFanIdxController extends BaseController {
List<StationBasic> stationBasics = stationBasicMapper.selectList(wrapper); List<StationBasic> stationBasics = stationBasicMapper.selectList(wrapper);
for (StationBasic stationBasic : stationBasics) { for (StationBasic stationBasic : stationBasics) {
String gatewayId = stationBasic.getBoosterGatewayId(); String gatewayId = stationBasic.getBoosterGatewayId();
if ("夏造风电站".equals(stationBasic.getStationName())) {
monitorFanIndicator.getMajorAnalogQuantityByPage(gatewayId, stationBasic.getSequenceNbr().toString()); monitorFanIndicator.getMajorAnalogQuantityByPage(gatewayId, stationBasic.getSequenceNbr().toString());
} else if ("泰和前进光伏站".equals(stationBasic.getStationName())) {
monitorFanIndicator.getMajorAnalogQuantityByPageByTHGF(gatewayId, stationBasic.getSequenceNbr().toString());
}
} }
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
......
...@@ -123,8 +123,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -123,8 +123,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
String table = gateway; String table = gateway;
StringBuffer querysql = new StringBuffer("SELECT createdTime ,equipmentNumber,gatewayId,address,valueLabel,equipmentSpecificName,value FROM indicators_%s WHERE isAlarm='1' and value!='0.0' and gatewayId= %s ORDER BY time desc LIMIT %d OFFSET %d "); StringBuffer querysql = new StringBuffer("SELECT createdTime ,equipmentNumber,gatewayId,address,valueLabel,equipmentSpecificName,value FROM indicators_%s WHERE isAlarm='1' and value!='0.0' and value!=valueLabel and gatewayId= %s ORDER BY time desc LIMIT %d OFFSET %d ");
StringBuffer querysqlcount = new StringBuffer("SELECT count(value) FROM indicators_%s WHERE isAlarm='1' and value!='0.0' and gatewayId= %s "); StringBuffer querysqlcount = new StringBuffer("SELECT count(value) FROM indicators_%s WHERE isAlarm='1' and value!='0.0' and value!=valueLabel and gatewayId= %s ");
if (StringUtils.isNotEmpty(equipmentNumber)) { if (StringUtils.isNotEmpty(equipmentNumber)) {
String date = "'%s' and equipmentNumber = '%s' "; String date = "'%s' and equipmentNumber = '%s' ";
gateway = String.format(date, gateway, equipmentNumber); gateway = String.format(date, gateway, equipmentNumber);
...@@ -138,7 +138,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -138,7 +138,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<IndexDto> list1 = influxDButils.getListData(querysqlcountn, IndexDto.class); List<IndexDto> list1 = influxDButils.getListData(querysqlcountn, IndexDto.class);
page.setRecords(list); page.setRecords(list);
//构建平台数据 //构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, list1 != null ? list1.get(0).getCount() : 0, false, current, list); DataGridMock DataGridMock = new DataGridMock(current, !list1.isEmpty()? list1.get(0).getCount() : 0, false, current, list);
ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "风机号", "风机号", "dataGrid", "equipmentNumber"); ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "风机号", "风机号", "dataGrid", "equipmentNumber");
ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid", "valueLabel"); ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid", "valueLabel");
ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid", "createdTime"); ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid", "createdTime");
...@@ -160,8 +160,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -160,8 +160,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
String table = gateway; String table = gateway;
StringBuffer querysql = new StringBuffer("SELECT createdTime ,gatewayId,address,valueLabel,equipmentSpecificName,value FROM iot_data_%s WHERE isAlarm='1' and value!='0.0' and gatewayId= %s ORDER BY time desc LIMIT %d OFFSET %d "); StringBuffer querysql = new StringBuffer("SELECT createdTime ,gatewayId,address,valueLabel,equipmentSpecificName,value FROM iot_data_%s WHERE isAlarm='1' and value!=valueLabel and value!='0.0' and gatewayId= %s ORDER BY time desc LIMIT %d OFFSET %d ");
StringBuffer querysqlcount = new StringBuffer("SELECT count(value) FROM iot_data_%s WHERE isAlarm='1' and value!='0.0' and gatewayId= %s "); StringBuffer querysqlcount = new StringBuffer("SELECT count(value) FROM iot_data_%s WHERE isAlarm='1' and value!='0.0' and value!=valueLabel and gatewayId= %s ");
if (StringUtils.isNotEmpty(equipmentNumber)) { if (StringUtils.isNotEmpty(equipmentNumber)) {
String date = " '%s' and equipmentSpecificName=~/.*%s风机.*/ "; String date = " '%s' and equipmentSpecificName=~/.*%s风机.*/ ";
gateway = String.format(date, gateway, equipmentNumber); gateway = String.format(date, gateway, equipmentNumber);
...@@ -175,7 +175,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -175,7 +175,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<IndexDto> list1 = influxDButils.getListData(querysqlcountn, IndexDto.class); List<IndexDto> list1 = influxDButils.getListData(querysqlcountn, IndexDto.class);
page.setRecords(list); page.setRecords(list);
//构建平台数据 //构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, list1 != null ? list1.get(0).getCount() : 0, false, current, list); DataGridMock DataGridMock = new DataGridMock(current, !list1.isEmpty() ? list1.get(0).getCount() : 0, false, current, list);
ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentSpecificName", "风机号", "风机号", "dataGrid", "equipmentNumber"); ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentSpecificName", "风机号", "风机号", "dataGrid", "equipmentNumber");
ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid", "valueLabel"); ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid", "valueLabel");
ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid", "createdTime"); ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid", "createdTime");
...@@ -917,7 +917,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -917,7 +917,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("name", stringListEntry.getKey()); stringStringHashMap.put("name", stringListEntry.getKey());
for (IndicatorsDto indicatorsDto : stringListEntry.getValue()) { for (IndicatorsDto indicatorsDto : stringListEntry.getValue()) {
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), indicatorsDto.getValue()); stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), String.format("%.3f",ObjectUtils.isEmpty(indicatorsDto.getValue())?0.0:Double.parseDouble(indicatorsDto.getValue())));
} }
resultList.add(stringStringHashMap); resultList.add(stringStringHashMap);
} }
...@@ -951,7 +951,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -951,7 +951,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
listData.forEach(item -> { listData.forEach(item -> {
HashMap<String, String> zbMap = new HashMap<>(); HashMap<String, String> zbMap = new HashMap<>();
zbMap.put("title", item.getDisplayName()); zbMap.put("title", item.getDisplayName());
zbMap.put("grade2", item.getValue()); zbMap.put("grade1", item.getValue());
if (StringUtils.isNotEmpty(item.getUnit())) { if (StringUtils.isNotEmpty(item.getUnit())) {
zbMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit())); zbMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit()));
} }
...@@ -983,21 +983,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -983,21 +983,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
e.printStackTrace(); e.printStackTrace();
} }
} }
if (CollectionUtils.isNotEmpty(zbList)) {
Map<String, String> finalZbGYC = zbGYC; Map<String, String> finalZbGYC = zbGYC;
zbList.forEach(item -> item.put("grade1", finalZbGYC.getOrDefault(item.get("titleYuanShi"), "0.0"))); zbList.forEach(item -> item.put("grade2", finalZbGYC.getOrDefault(item.get("titleYuanShi"), "0.0")));
IPage<Map<String, String>> zbResult = new Page<>(); IPage<Map<String, String>> zbResult = new Page<>();
zbResult.setRecords(zbList); zbResult.setRecords(zbList);
zbResult.setCurrent(1); zbResult.setCurrent(1);
zbResult.setTotal(zbList.size()); zbResult.setTotal(zbList.size());
try { try {
log.info("主变消息内容:{}", JSON.toJSONString(zbResult)); log.info("主变消息内容:{}", JSON.toJSONString(zbResult));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, 2, "mnl"), JSON.toJSONString(zbResult).getBytes(),2,false); emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, 2, "mnl"), JSON.toJSONString(zbResult).getBytes(), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
log.info("消息发送失败"); log.info("消息发送失败");
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
}
public void getMajorAnalogQuantityByPage(String gatewayId, String stationId) { public void getMajorAnalogQuantityByPage(String gatewayId, String stationId) {
if (StringUtils.isNotEmpty(gatewayId)) { if (StringUtils.isNotEmpty(gatewayId)) {
...@@ -1030,7 +1032,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1030,7 +1032,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
String zb1Sql = String.format("SELECT * FROM \"indicators_%s\" WHERE frontModule = '1主变' and systemType = '模拟量' and (displayName = '档位' or displayName = '油面温1' or displayName = '油面温2' or displayName = '绕组温度' ) ", gatewayId); String zb1Sql = String.format("SELECT * FROM \"indicators_%s\" WHERE frontModule = '1主变' and systemType = '模拟量' and (displayName = '档位' or displayName = '油面温1' or displayName = '油面温2' or displayName = '绕组温度' ) ", gatewayId);
List<IndicatorsDto> zb1SqlData = influxDButils.getListData(zb1Sql, IndicatorsDto.class); List<IndicatorsDto> zb1SqlData = influxDButils.getListData(zb1Sql, IndicatorsDto.class);
// TODO: 2023/7/14 数据未整理 ---> 油面温1 油面温2 绕组温度
resultMap.put("value1", "0.0"); resultMap.put("value1", "0.0");
resultMap.put("value2", "0.0"); resultMap.put("value2", "0.0");
resultMap.put("value3", "0.0"); resultMap.put("value3", "0.0");
...@@ -1115,6 +1116,82 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1115,6 +1116,82 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
} }
public void getMajorAnalogQuantityByPageByTHGF(String gatewayId, String stationId) {
if (StringUtils.isNotEmpty(gatewayId)) {
// 10kVⅡ段母线数据
String xianSql = String.format("SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '模拟量' and frontModule = '10kVⅡ段母线'", gatewayId);
List<IndicatorsDto> xianData = influxDButils.getListData(xianSql, IndicatorsDto.class);
HashMap<String, Object> resultMap = new HashMap<>();
xianData.forEach(item -> resultMap.put(item.getDisplayName(), item.getValue()));
String xyxSql = String.format("SELECT value, displayName FROM \"indicators_%s\" WHERE systemType = '模拟量' and frontModule = '35kV前万线' and (displayName = 'Ia' or displayName = 'P' or displayName = 'Q' ", gatewayId);
List<IndicatorsDto> xyxSqlData = influxDButils.getListData(xyxSql, IndicatorsDto.class);
xyxSqlData.forEach(item -> resultMap.put("35qwx" + item.getDisplayName(), item.getValue()));
// 主线路图上各个路线名称
resultMap.put("35qwx", "35kV前万线");
resultMap.put("35qg1x", "35kV前光Ⅰ线");
resultMap.put("35qg2x", "35kV前光Ⅱ线");
resultMap.put("1svg", "1SVG");
resultMap.put("1zyb", "1站用变");
resultMap.put("35mxpt", "35kV母线PT");
resultMap.put("thsvg", "泰和SVG");
resultMap.put("thglyc", "泰和功率预测");
resultMap.put("thgyxh", "泰和公用信号");
resultMap.put("thjzlp", "泰和交直流屏");
//下方重复列表数据
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 5);
ArrayList<Map<String, String>> resultList = new ArrayList<>();
for (Map<String, String> map : boosterStationInfo) {
String sql = String.format("SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '%s' and frontModule =~/%s/ and (displayName = 'Ia' or displayName = 'P' or displayName = 'Q') ", gatewayId, "模拟量", map.get("boosterName"));
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("value1", "0.0");
stringStringHashMap.put("value2", "0.0");
stringStringHashMap.put("value3", "0.0");
listData.forEach(item -> {
if (item.getDisplayName().equals("Ia")) {
stringStringHashMap.put("value1", item.getValue());
}
if (item.getDisplayName().equals("P")) {
stringStringHashMap.put("value2", item.getValue());
}
if (item.getDisplayName().equals("Q")) {
stringStringHashMap.put("value3", item.getValue());
}
});
resultList.add(stringStringHashMap);
}
resultMap.put("records", resultList);
resultMap.put("current", 1);
resultMap.put("size", resultList.size());
// 开关信息
Map<String, Object> switchUrl = getSwitchUrl(gatewayId, null);
resultMap.putAll(switchUrl);
List<Map<String, Object>> finallyResultList = Collections.singletonList(resultMap);
// 主屏下方重复列表数据
IPage<Map<String, Object>> resultPage = new Page<>();
resultPage.setRecords(finallyResultList);
resultPage.setCurrent(1);
resultPage.setTotal(finallyResultList.size());
try {
log.info("消息内容:{}", JSON.toJSONString(resultPage));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, "major", "data"), JSON.toJSONString(resultPage).getBytes(),0,false);
} catch (MqttException e) {
log.info("消息发送失败");
e.printStackTrace();
}
}
}
public void getSwitchUrlAll(StationBasic stationBasic){ public void getSwitchUrlAll(StationBasic stationBasic){
String gatewayId = stationBasic.getBoosterGatewayId(); String gatewayId = stationBasic.getBoosterGatewayId();
......
...@@ -294,7 +294,7 @@ public class MonitoringServiceImpl { ...@@ -294,7 +294,7 @@ public class MonitoringServiceImpl {
TabDto tab1 = new TabDto("集电线路图", "1"); TabDto tab1 = new TabDto("集电线路图", "1");
TabDto tab2 = new TabDto("运行列表", "2"); TabDto tab2 = new TabDto("运行列表", "2");
TabDto tab3 = new TabDto("升压站监控", "3"); TabDto tab3 = new TabDto("升压站监控", "3");
TabDto tab4 = new TabDto("电量表", "4"); TabDto tab4 = new TabDto("电量表", "4");
TabDto tab5 = new TabDto("故障信息", "5"); TabDto tab5 = new TabDto("故障信息", "5");
tabDtoList.add(tab0); tabDtoList.add(tab0);
tabDtoList.add(tab1); tabDtoList.add(tab1);
...@@ -307,7 +307,7 @@ public class MonitoringServiceImpl { ...@@ -307,7 +307,7 @@ public class MonitoringServiceImpl {
TabDto tab7 = new TabDto("集电线路图", "7"); TabDto tab7 = new TabDto("集电线路图", "7");
TabDto tab8 = new TabDto("运行列表", "8"); TabDto tab8 = new TabDto("运行列表", "8");
TabDto tab9 = new TabDto("升压站监控", "9"); TabDto tab9 = new TabDto("升压站监控", "9");
TabDto tab10 = new TabDto("电量表", "10"); TabDto tab10 = new TabDto("电量表", "10");
TabDto tab11 = new TabDto("故障信息", "11"); TabDto tab11 = new TabDto("故障信息", "11");
TabDto tab12 = new TabDto("集中式-离散率", "12"); TabDto tab12 = new TabDto("集中式-离散率", "12");
TabDto tab13 = new TabDto("组串式-离散率", "13"); TabDto tab13 = new TabDto("组串式-离散率", "13");
......
...@@ -64,7 +64,7 @@ emqx.max-inflight=1000 ...@@ -64,7 +64,7 @@ emqx.max-inflight=1000
## influxDB ## influxDB
#spring.influx.url= http://139.9.170.47:8086 #spring.influx.url= http://172.16.3.155:8186
#spring.influx.password=admin #spring.influx.password=admin
#spring.influx.user=admin #spring.influx.user=admin
#spring.influx.database=iot_platform #spring.influx.database=iot_platform
......
...@@ -389,13 +389,20 @@ public class EquipmentCategoryController extends BaseController { ...@@ -389,13 +389,20 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/exportImage") @GetMapping(value = "/exportImage")
@ApiOperation(httpMethod = "GET", value = "设备监管码下载", notes = "设备监管码下载") @ApiOperation(httpMethod = "GET", value = "设备监管码下载", notes = "设备监管码下载")
public void exportImage(HttpServletResponse response, @RequestParam("code") String code, @RequestParam("type") String type) throws IOException, FileNotFoundException { public void exportImage(HttpServletResponse response, @RequestParam("code") String code, @RequestParam("type") String type, @RequestParam(value = "elevatorCode", required = false) String elevatorCode) throws IOException, FileNotFoundException {
ImageSizeEnums imageSizeEnums = ImageSizeEnums.getEnumByCode(type); ImageSizeEnums imageSizeEnums = ImageSizeEnums.getEnumByCode(type);
// 获取resources目录下的文件输入流 // 获取resources目录下的文件输入流
InputStream bgImgFile = getClass().getClassLoader().getResourceAsStream("temp/"+imageSizeEnums.getBgPath()); InputStream bgImgFile = getClass().getClassLoader().getResourceAsStream("temp/" + imageSizeEnums.getBgPath());
File QrCodeFile = File.createTempFile(code, ".png"); File QrCodeFile;
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()); if (ImageSizeEnums.DT.getCode().equals(type)) {
QrCodeFile = File.createTempFile(elevatorCode, ".png");
ImageUtils.creatQRCode(QrCodeFile, bgImgFile, imageSizeEnums.getWith(), imageSizeEnums.getHeight(), REGULATORY_CODE_PREFIX + code, "", elevatorCode, imageSizeEnums.getSize(), imageSizeEnums.getImagesX(), imageSizeEnums.getImagesY(), imageSizeEnums.getText1X(), imageSizeEnums.getText1Y(), imageSizeEnums.getText2X(), imageSizeEnums.getText2Y());
ImageUtils.downloadResource(elevatorCode + ".png", QrCodeFile.getAbsolutePath(), response);
} else {
QrCodeFile = File.createTempFile(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", QrCodeFile.getAbsolutePath(), response); ImageUtils.downloadResource(code + ".png", QrCodeFile.getAbsolutePath(), response);
}
QrCodeFile.delete(); QrCodeFile.delete();
} }
...@@ -434,9 +441,9 @@ public class EquipmentCategoryController extends BaseController { ...@@ -434,9 +441,9 @@ public class EquipmentCategoryController extends BaseController {
} }
for (EquipExportVo equipExportDatum : unique) { for (EquipExportVo equipExportDatum : unique) {
InputStream bgImgFile = getClass().getClassLoader().getResourceAsStream("temp/" + imageSizeEnums.getBgPath()); InputStream bgImgFile = getClass().getClassLoader().getResourceAsStream("temp/" + imageSizeEnums.getBgPath());
if ("DT".equals(type) && !ObjectUtils.isEmpty(equipExportDatum.getCode96333())) { if (ImageSizeEnums.DT.getCode().equals(type) && !ObjectUtils.isEmpty(equipExportDatum.getCode96333()) && !ObjectUtils.isEmpty(equipExportDatum.getSupervisoryCode())) {
File QrCodeFile = File.createTempFile(equipExportDatum.getCode96333() + "+", ".png"); File QrCodeFile = File.createTempFile(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()); ImageUtils.creatQRCode(QrCodeFile, bgImgFile, imageSizeEnums.getWith(), imageSizeEnums.getHeight(), REGULATORY_CODE_PREFIX + equipExportDatum.getSupervisoryCode(), "", equipExportDatum.getCode96333(), imageSizeEnums.getSize(), imageSizeEnums.getImagesX(), imageSizeEnums.getImagesY(), imageSizeEnums.getText1X(), imageSizeEnums.getText1Y(), imageSizeEnums.getText2X(), imageSizeEnums.getText2Y());
fileList.add(new File(QrCodeFile.getAbsolutePath())); fileList.add(new File(QrCodeFile.getAbsolutePath()));
} else if (!ObjectUtils.isEmpty(equipExportDatum.getSupervisoryCode())) { } else if (!ObjectUtils.isEmpty(equipExportDatum.getSupervisoryCode())) {
File QrCodeFile = File.createTempFile(equipExportDatum.getSupervisoryCode() + "+", ".png"); File QrCodeFile = File.createTempFile(equipExportDatum.getSupervisoryCode() + "+", ".png");
......
...@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
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 org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/** /**
* @author zjw * @author zjw
...@@ -18,7 +20,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -18,7 +20,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
*/ */
@RestController @RestController
@RequestMapping(value = "/weapp/api") @RequestMapping(value = "/wechat/api")
@Api(tags = "小程序登录api") @Api(tags = "小程序登录api")
public class LoginController { public class LoginController {
...@@ -103,7 +105,7 @@ public class LoginController { ...@@ -103,7 +105,7 @@ public class LoginController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "获取机器人登录token", notes = "获取机器人登录token") @ApiOperation(value = "获取机器人登录token", notes = "获取机器人登录token")
@GetMapping(value = "/acquireToken") @GetMapping(value = "/acquireToken")
synchronized public String getRobotLoginToken() { synchronized public ResponseModel<String> getRobotLoginToken() {
return amosRequestContext.getToken(); return ResponseHelper.buildResponse(amosRequestContext.getToken());
} }
} }
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