Commit b77ef8a8 authored by tangwei's avatar tangwei

拉取

parents 68b668fa 35692258
......@@ -66,6 +66,9 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
@Autowired
CommerceInfoServiceImpl commerceInfoService;
@Value("${hygf.user.group.id}")
private long userGroupId;
/**
* 分页查询
*/
......@@ -252,9 +255,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
if (userResult == null || userResult.getResult() == null) {
throw new BadRequest("单位注册失败");
}
String[] userIds = { userResult.getResult().getUserId() };
// String[] userIds = { userResult.getResult().getUserId() };
regUnitInfo.setAdminUserId(userResult.getResult().getUserId());
regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr());
List<String> userId = new ArrayList<>();
userId.add(userResult.getResult().getUserId());
// 将创建用户加入用户组
Privilege.groupUserClient.create(userGroupId, userId);
} catch (Exception e) {
// 删除已经创建的 企业信息
if (companyInfo != null && companyInfo.getSequenceNbr() != null) {
......
......@@ -104,6 +104,8 @@ sms.huawei.sender=1069368924410006092
sms.huawei.signature=华为云短信测试
# 电站审核pageId
power.station.examine.pageId=1679778420550037506
power.station.examine.pageId=1680853427061551106
# 电站审核计划id
power.station.examine.planId=c4ed1873-0dc6-4518-a7a9-dbc588ef35e5
# 用户组userGroupId
hygf.user.group.id=1679755750924120066
\ No newline at end of file
package com.yeejoin.amos.boot.module.jxiop.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum KGName {
DLQ("断路器","dlq"),
DAZ("刀闸","daz"),
DCK("低测控","dck"),
GCK("高测控","gck"),
CK("测控","ck"),
MXDZ("母线PT刀闸","mxdc"),
BTCK("本体测控","btck");
private String name;
private String code;
public static String getCode(String name) {
for (KGName electricQuantity : KGName.values())
{
if (electricQuantity.getName().equals(name))
{
return electricQuantity.getCode();
}
}
return null;
}
}
......@@ -302,6 +302,37 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "升压站光字牌/压板状态API-通用")
@GetMapping("/getStatusGzpAndYb")
public ResponseModel getStatusGzp(@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "frontModule") String frontModule) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getBoosterGatewayId();
Map<String, String> map = monitorFanIndicatorMapper.getMajorBoosterStationInfoBySort(gatewayId, frontModule);
String name = map.get("text").contains("主变")?map.get("text").substring(0,3):map.get("text");
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("gzp", "光字牌");
stringStringHashMap.put("ybzt", "压板状态");
stringStringHashMap.put("agzp", "A套保护光字牌");
stringStringHashMap.put("bgzp", "B套保护光字牌");
for (Map.Entry<String, String> stringStringEntry : stringStringHashMap.entrySet()) {
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,stringStringEntry.getValue(), name);
IPage<Map<String,Object>> result = new Page<>();
result.setRecords(statusMonitoring);
result.setCurrent(1);
result.setTotal(statusMonitoring.size());
try {
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, frontModule, stringStringEntry.getKey()), JSON.toJSONString(result).getBytes(),0,false);
} catch (MqttException e) {
e.printStackTrace();
}
}
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "集电线路图左侧 集电线列表")
@GetMapping("/jdTree")
public ResponseModel<IPage<Map<String, Object>>> getStatusJDX(@RequestParam(value = "stationId")String stationId) {
......@@ -452,11 +483,11 @@ public class MonitorFanIdxController extends BaseController {
String gatewayId = stationBasic.getBoosterGatewayId();
Map<String, String> map = monitorFanIndicatorMapper.getMajorBoosterStationInfoBySort(stationId, equipName);
Map<String, String> map = monitorFanIndicatorMapper.getMajorBoosterStationInfoBySort(gatewayId, equipName);
String name = map.get("text").contains("主变")?map.get("text").substring(0,3):map.get("text");
Map<String, Object> switchUrl = monitorFanIndicatorImpl.getSwitchUrl(stationId, name);
Map<String, Object> switchUrl = monitorFanIndicatorImpl.getSwitchUrl(gatewayId, name);
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,"光字牌",name);
IPage<Map<String, Object>> result = new Page<>();
switchUrl.put("records",statusMonitoring);
......
......@@ -28,6 +28,7 @@ public class IndicatorsDto {
private String displayName;
private String pictureName;
private String title;
private String state;
public String getTime() {
......
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.ElectricQuantity;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.KGName;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
......@@ -32,6 +33,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.common.recycler.Recycler;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -669,10 +671,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<Map<String,Object>> statusMaps = new ArrayList<>();
for (IndicatorsDto listDatum : listData) {
Map<String, Object> statusMap = new HashMap<>();
statusMap.put("data",statusMap.get("displayName"));
statusMap.put("title",statusMap.get("displayName"));
statusMap.put("state",statusMap.get("state").equals("true")? 1:0);
statusMap.put("title",statusMap.get("state").equals("true")?"断":"通");
statusMap.put("data",listDatum.getDisplayName());
statusMap.put("state",listDatum.getState().equals("true")? 1:0);
statusMap.put("title",listDatum.getState().equals("true")?"断":"通");
statusMaps.add(statusMap);
}
return statusMaps;
......@@ -1020,6 +1021,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap.put("records", resultList);
resultMap.put("current", 1);
resultMap.put("size", resultList.size());
// 开关信息
Map<String, Object> switchUrl = getSwitchUrl(gatewayId, null);
BeanUtils.copyProperties(switchUrl, resultMap);
List<Map<String, Object>> finallyResultList = Collections.singletonList(resultMap);
// 主屏下方重复列表数据
IPage<Map<String, Object>> resultPage = new Page<>();
......@@ -1077,8 +1083,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
url =pictureUrl+ urls[1];;
}
photoUrls.put(datass.getDisplayName().split("_")[0]+"jddwz",url);
}
for (IndicatorsDto data : listDatas) {
String url = "";
String[] urls = data.getPictureName().split(",");
......@@ -1087,8 +1093,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}else {
url =pictureUrl+ urls[1];;
}
if (data.getDisplayName().split("_").length > 2){
photoUrls.put(KGName.getCode(data.getDisplayName().split("_")[1]),url);
}else {
photoUrls.put(data.getDisplayName().split("_")[0]+"yfjdkgurl",url);
}
}
for (IndicatorsDto listDatum : listData) {
String url = "";
......
......@@ -103,4 +103,4 @@ myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
# ?????????
fan.statuts.stattuspath=upload/jxiop/device_status
pictureUrl=
pictureUrl=upload/jxiop/syz/
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