Commit 8c66a79b authored by chenzhao's avatar chenzhao

Merge branch 'developer' into developer_bw

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/BasicGridAcceptanceDto.java # amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/WorkOrderController.java
parents 78917e80 13501e0c
......@@ -74,4 +74,7 @@ public class BasicGridAcceptanceDto extends BaseDto {
private Long fonGridId;
// 电站安装规模(kW)
private String scale;
}
......@@ -158,6 +158,12 @@ public class HygfIcbcRecordDTO {
* */
@ApiModelProperty(value = "区域公司名称")
private String regionalCompaniesName;
/*
* 商务信息-电站安装规模
* */
@ApiModelProperty(value = "电站安装规模(kW)")
private String scale;
}
}
\ No newline at end of file
......@@ -94,4 +94,7 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "合同状态")
private String status;
@ApiModelProperty(value = "电站安装规模")
private String scale;
}
......@@ -83,4 +83,7 @@ public class WorkOrderPage {
private String auditIdea ;
@ApiModelProperty(value = "实例id")
private String instanceId ;
@ApiModelProperty(value = "电站安装规模")
private String scale ;
}
......@@ -257,4 +257,7 @@ public class HouseholdContract extends BaseEntity {
//查询一个农户拥有的合同是否全是已废弃
@TableField(exist = false)
private Boolean isAllDisuse;
@TableField(exist = false)
private String scale;
}
......@@ -215,4 +215,10 @@ public class PeasantHousehold extends BaseEntity {
*/
@TableField(exist = false)
private Integer isAllRevoke;
/**
* 商务信息安装规模
*/
@TableField(exist = false)
private String scale;
}
......@@ -19,4 +19,6 @@ public interface HouseholdContractMapper extends BaseMapper<HouseholdContract> {
@UserEmpower(field ={"hygf_household_contract.regional_companies_code"} ,dealerField={"dealer_code","hygf_household_contract.regional_companies_code","developer_user_id"} ,fieldConditions ={"eq","in","eq"} ,relationship="and")
IPage<HouseholdContract> selectPage(@Param("dto") HouseholdContractPageDto dto);
String getHygfCommercialScale(String peasantHouseholdNumber);
}
......@@ -50,4 +50,6 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
void deleteHphByNo(String peasantHouseholdNo);
void deleteHhcByNo(String peasantHouseholdNo);
String getHygfCommercialScale(Long surveyInformationId);
}
......@@ -53,4 +53,10 @@
ORDER BY hygf_household_contract.rec_date DESC, hygf_household_contract.${orderBy} ${dto.isAsc}
</if>
</select>
<select id="getHygfCommercialScale" resultType="String">
select scale from hygf_commercial where survey_information_id = (select survey_information_id from hygf_peasant_household where peasant_household_no = #{peasantHouseholdNumber} )
</select>
</mapper>
......@@ -133,4 +133,8 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
<select id="deleteHhcByNo">
DELETE FROM hygf_household_contract WHERE peasant_household_number=#{peasantHouseholdNo}
</select>
<select id="getHygfCommercialScale" resultType="String">
select scale from hygf_commercial where survey_information_id=${surveyInformationId}
</select>
</mapper>
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney;
import com.yeejoin.amos.boot.module.hygf.api.mapper.DocumentStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HouseholdContractMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PreparationMoneyMapper;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
......@@ -53,6 +54,8 @@ public class PreparationMoneyController extends BaseController {
PreparationMoneyServiceImpl preparationMoneyServiceImpl;
@Autowired
PreparationMoneyMapper preparationMoneyMapper;
@Autowired
HouseholdContractMapper householdContractMapper;
@Autowired
DesignInformationServiceImpl designInformationService;
@Autowired
......@@ -226,6 +229,16 @@ public class PreparationMoneyController extends BaseController {
) {
List<PeasantHousehold> list=preparationMoneyMapper.getPeasantHouseholdData(sequenceNbr,ownersName);
if(list != null && list.size() > 0) {
list.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
Page<PeasantHousehold> pagenew = new Page<>();
pagenew.setRecords(list);
pagenew.setTotal(list.size());
......
......@@ -9,10 +9,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationConstructionDataMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.WorkOrderMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.WorkOrderPowerStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.*;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.WorkOrderServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -47,6 +44,8 @@ public class WorkOrderController extends BaseController {
WorkOrderPowerStationMapper workOrderPowerStationMapper;
@Autowired
WorkOrderMapper workOrderMapper;
@Autowired
HouseholdContractMapper householdContractMapper;
@Autowired
PersonnelBusinessMapper personnelBusinessMapper;
......@@ -225,6 +224,8 @@ public class WorkOrderController extends BaseController {
if (workOrder.getType().equals("3") && workOrderPowerStationNodes != null){
workOrderPagePage.getRecords().forEach(e->{
if (workOrderPowerStationNodes.contains(e.getWorkOrderPowerStationNode()) && (roleIds.contains(areaId) ||roleIds.contains(designId) || roleIds.contains(engineeringId)) ){
if (workOrderPowerStationNodes.contains(e.getWorkOrderPowerStationNode())){
e.setIsAudit("0");
}
else {
......@@ -233,6 +234,12 @@ public class WorkOrderController extends BaseController {
});
}
workOrderPagePage.getRecords().forEach(e->{
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
return ResponseHelper.buildResponse(workOrderPagePage);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -70,6 +70,8 @@ public class BasicGridAcceptanceServiceImpl
@Autowired
PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired
HouseholdContractMapper householdContractMapper;
@Autowired
private CommonServiceImpl commonService;
@Autowired
RectificationOrderAuditingServiceImpl rectificationOrderAuditingService;
......@@ -112,6 +114,15 @@ public class BasicGridAcceptanceServiceImpl
pageNew.setCurrent(current);
pageNew.setTotal(page.getTotal());
pageNew.setSize(size);
if(page.getList() != null && page.getList().size() > 0) {
page.getList().forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
pageNew.setRecords(page.getList());
return pageNew;
}
......
......@@ -93,6 +93,16 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD
// }
IPage<HouseholdContract> warningQuestionInfoIPage = householdContractMapper.selectPage(dto);
if(warningQuestionInfoIPage.getRecords() != null && warningQuestionInfoIPage.getRecords().size() > 0) {
warningQuestionInfoIPage.getRecords().forEach(e -> {
if(e.getPeasantHouseholdNumber() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNumber()));
}
});
}
return warningQuestionInfoIPage;
}
......
......@@ -22,6 +22,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HouseholdContractMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -62,6 +64,9 @@ import lombok.extern.slf4j.Slf4j;
@Service
@Slf4j
public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbcRecord, HygfIcbcRecordMapper>
implements IHygfIcbcService {
private static final String trxChannel = "05"; // 05表示小程序
......@@ -126,6 +131,9 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
@Resource(type = HygfIcbcRecordMapper.class)
private HygfIcbcRecordMapper hygfIcbcRecordMapper;
@Resource(type = HouseholdContractMapper.class)
private HouseholdContractMapper householdContractMapper;
@Resource(type = HygfIcbcRequestMapper.class)
private HygfIcbcRequestMapper hygfIcbcRequestMapper;
......@@ -411,6 +419,15 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
Map<String, List<PeasantHousehold>> peasantHouseholdMap = peasantHouseholds.stream()
.collect(Collectors.groupingBy(PeasantHousehold::getAmosUserId));// 根据农户 ID 分组
List<PeasantHousehold> peasantHouseholdList = peasantHouseholdMap.get(amosUserId);
if(peasantHouseholdList != null && peasantHouseholdList.size() > 0) {
peasantHouseholdList.forEach(e -> {
if(e.getSurveyInformationId() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
hygfIcbcRecordDTO.setPeasantHouseholds(
Bean.toModels(peasantHouseholdList, HygfIcbcRecordDTO.IcbcPeasantHousehold.class));
return hygfIcbcRecordDTO;
......
......@@ -271,6 +271,16 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
pagenew.setCurrent(current);
pagenew.setTotal(objectPageInfo.getTotal());
pagenew.setSize(size);
if(newRecords != null && newRecords.size() > 0) {
newRecords.forEach(e -> {
if(e.getSurveyInformationId() != null) {
e.setScale(peasantHouseholdMapper.getHygfCommercialScale(e.getSurveyInformationId()));
}
});
}
pagenew.setRecords(newRecords);
return pagenew;
......@@ -914,6 +924,18 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
queryWrapper.like(StrUtil.isNotEmpty(peasantHouseholdPageDto.getRegionalCompaniesName()),"regional_companies_name", "%"+peasantHouseholdPageDto.getRegionalCompaniesName()+"%");
queryWrapper.like(StrUtil.isNotEmpty(peasantHouseholdPageDto.getDeveloperName()),"developer_name", "%"+peasantHouseholdPageDto.getDeveloperName()+"%");
queryWrapper.orderByDesc("rec_date");
return this.baseMapper.selectPage(new Page<>(peasantHouseholdPageDto.getCurrent(),peasantHouseholdPageDto.getSize()),queryWrapper);
IPage<PeasantHousehold> peasantHouseholdIPage = this.baseMapper.selectPage(new Page<>(peasantHouseholdPageDto.getCurrent(), peasantHouseholdPageDto.getSize()), queryWrapper);
if(peasantHouseholdIPage.getRecords() != null && peasantHouseholdIPage.getRecords().size() > 0) {
peasantHouseholdIPage.getRecords().forEach(e -> {
if(e.getSurveyInformationId() != null) {
e.setScale(peasantHouseholdMapper.getHygfCommercialScale(e.getSurveyInformationId()));
}
});
}
return peasantHouseholdIPage;
}
}
\ No newline at end of file
......@@ -94,7 +94,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
private RedisLockUtil redisLockUtil;
public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode,
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName, String processStatus) {
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName, String processStatus) {
// Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles();
// Collection<List<RoleModel>> roleModels = orgRoles.values();
// if(roleModels !=null){
......@@ -118,13 +118,26 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
// return
// this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent);
return this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName,
serviceAgent,regionalCompaniesName,processStatus);
Page<PowerStationDto> powerStationDtoPage = this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName,
serviceAgent, regionalCompaniesName, processStatus);
if(powerStationDtoPage.getRecords() != null && powerStationDtoPage.getRecords().size() > 0) {
powerStationDtoPage.getRecords().forEach(e -> {
if(e.getPowerStationCode() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPowerStationCode()));
}
});
}
return powerStationDtoPage;
}
// 查询电站审核记录
public Page<PowerStationDto> queryPage(int current, int size, String powerStationCode, String ownersName,
String serviceAgent,String regionalCompaniesName,String processStatus) {
String serviceAgent,String regionalCompaniesName,String processStatus) {
PageHelper.startPage(current, size);
List<PowerStationDto> list = powerStationMapper.queryPage(powerStationCode, ownersName, serviceAgent,regionalCompaniesName,processStatus);
......@@ -241,7 +254,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
@Override
public String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId,
String planInstanceId, Map<String, Object> kv) {
String planInstanceId, Map<String, Object> kv) {
String lockName = String.format("LockName:powerStationExamine:%s", stationId);
Boolean isLocked = redisLockUtil.tryLock(lockName, lockName, 10, 1);
if (BooleanUtils.isNotTrue(isLocked)) {
......@@ -266,33 +279,33 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
}
PowerStationProcessStateEnum resultObj = PowerStationProcessStateEnum.getStateByResult(result);
switch (nodeByCode) {
case 设计审核:
powerStation.setTechnologyStatus(resultObj.getName());
break;
case 投融审核:
powerStation.setDesignStatus(resultObj.getName());
break;
case 法务审核:
powerStation.setBusinessStatus(resultObj.getName());
if (VERIFY_RESULT_YES.equals(result)) {
LambdaUpdateWrapper<HouseholdContract> lambdaUw = new LambdaUpdateWrapper<>();
lambdaUw.eq(HouseholdContract::getPeasantHouseholdId, powerStation.getPeasantHouseholdId());
lambdaUw.set(HouseholdContract::getSurveyStatus, HouseholdContractEnum.勘察状态_已勘察.getCode());
householdContractServiceImpl.update(lambdaUw);
}
case 设计审核:
powerStation.setTechnologyStatus(resultObj.getName());
break;
case 投融审核:
powerStation.setDesignStatus(resultObj.getName());
break;
case 法务审核:
powerStation.setBusinessStatus(resultObj.getName());
if (VERIFY_RESULT_YES.equals(result)) {
LambdaUpdateWrapper<HouseholdContract> lambdaUw = new LambdaUpdateWrapper<>();
lambdaUw.eq(HouseholdContract::getPeasantHouseholdId, powerStation.getPeasantHouseholdId());
lambdaUw.set(HouseholdContract::getSurveyStatus, HouseholdContractEnum.勘察状态_已勘察.getCode());
householdContractServiceImpl.update(lambdaUw);
}
break;
case 文件审核:
if (VERIFY_RESULT_YES.equals(result)) {
flag = false;
powerStation.setProcessStatus(PowerStationProcessStateEnum.完成.getName());
}
powerStation.setDrawingReview(resultObj.getName());
break;
default:
break;
break;
case 文件审核:
if (VERIFY_RESULT_YES.equals(result)) {
flag = false;
powerStation.setProcessStatus(PowerStationProcessStateEnum.完成.getName());
}
powerStation.setDrawingReview(resultObj.getName());
break;
default:
break;
}
}
meg = "任务明细:" + nodeByCode + (VERIFY_RESULT_YES.equals(result) ? "通过" : "不通过");
......@@ -462,45 +475,45 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
public WorkDto getNodeInfoCode(String flowTaskId) {
WorkDto workDto = null;
FeignClientResult<JSONObject> jSONObject = workflowFeignClient.getNodeInfo(flowTaskId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.getStatus()))) {
JSONObject js = jSONObject.getResult();
if (js == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
LinkedHashMap taskInfo = js.get("taskInfo") != null ? (LinkedHashMap) js.get("taskInfo") : null;
String nextProcessNode = taskInfo != null ? taskInfo.get("taskDefinitionKey").toString() : null;
List<LinkedHashMap> executor = js.get("executor") != null ? (List<LinkedHashMap>) js.get("executor")
: null;
String nodeRole = null;
if (!executor.isEmpty()) {
List<String> idList = executor.stream().map(e -> e.get("groupId").toString())
.collect(Collectors.toList());
nodeRole = StringUtils.join(idList, ",");
}
LinkedHashMap extensionInfo = js.get("extensionInfo") != null ? (LinkedHashMap) js.get("extensionInfo")
: null;
String nodeRouting = extensionInfo != null ? extensionInfo.get("nodeRole").toString() : null;
workDto = new WorkDto(nodeRouting, nodeRole, nextProcessNode);
FeignClientResult<JSONObject> jSONObject = workflowFeignClient.getNodeInfo(flowTaskId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.getStatus()))) {
JSONObject js = jSONObject.getResult();
if (js == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
LinkedHashMap taskInfo = js.get("taskInfo") != null ? (LinkedHashMap) js.get("taskInfo") : null;
String nextProcessNode = taskInfo != null ? taskInfo.get("taskDefinitionKey").toString() : null;
List<LinkedHashMap> executor = js.get("executor") != null ? (List<LinkedHashMap>) js.get("executor")
: null;
String nodeRole = null;
if (!executor.isEmpty()) {
List<String> idList = executor.stream().map(e -> e.get("groupId").toString())
.collect(Collectors.toList());
nodeRole = StringUtils.join(idList, ",");
}
LinkedHashMap extensionInfo = js.get("extensionInfo") != null ? (LinkedHashMap) js.get("extensionInfo")
: null;
String nodeRouting = extensionInfo != null ? extensionInfo.get("nodeRole").toString() : null;
workDto = new WorkDto(nodeRouting, nodeRole, nextProcessNode);
}
return workDto;
return workDto;
}
public String getTaskNoAuth(String processInstanceId) {
String flowTaskId = null;
JSONObject jSONObject = workflowFeignClient.getTaskNoAuth(processInstanceId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.get("code")))) {
LinkedHashMap jsd = jSONObject.get("data") != null ? (LinkedHashMap) jSONObject.get("data") : null;
flowTaskId = jsd != null ? jsd.get("id").toString() : null;
}
if (flowTaskId == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
return flowTaskId;
JSONObject jSONObject = workflowFeignClient.getTaskNoAuth(processInstanceId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.get("code")))) {
LinkedHashMap jsd = jSONObject.get("data") != null ? (LinkedHashMap) jSONObject.get("data") : null;
flowTaskId = jsd != null ? jsd.get("id").toString() : null;
}
if (flowTaskId == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
return flowTaskId;
}
......
......@@ -101,7 +101,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
PowerStationEngineeringInfoMapper powerStationEngineeringInfoMapper;
@Autowired
PowerStationEngineeringInfoServiceImpl powerStationEngineeringInfoService;
@Autowired
HouseholdContractMapper householdContractMapper;
@Autowired
HygfOnGridMapper hygfOnGridMapper;
@Autowired
......@@ -279,6 +280,9 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
for (PeasantHousehold documentStation : lih) {
ids.add(documentStation.getSequenceNbr());
}
QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>();
designInformationQueryWrapper.in("peasant_household_id", ids);
List<DesignInformation> li = designInformationMapper.selectList(designInformationQueryWrapper);
......@@ -306,6 +310,13 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
}
}
List<PeasantHousehold> list = workOrderPowerStationMapper.selectPeasantHousehold(sequenceNbr, null);
if(list != null && list.size() > 0) {
list.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
Map<String, Object> map = new HashMap<>();
designInformation.setAssembly(assembly);
designInformation.setInverter(inverter);
......
......@@ -724,7 +724,7 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
@RequestParam(value = "stationId", required = true) String stationId,
@RequestParam(value = "tableName2", required = false) String tableName2) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName, stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName, stationBasic.getFanGatewayId());
int num = idxBizFanHealthIndexMapper.getIsWarningByPointId(indexAddress, stationBasic.getFanGatewayId(), tableName2,stationBasic.getBoosterGatewayId());
......@@ -742,7 +742,7 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
@RequestParam(value = "stationId") String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName, stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName, stationBasic.getFanGatewayId());
FeignClientResult<List<String>> sevenEntityMcb = null;
try {
sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc);
......
......@@ -101,7 +101,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
@Param("equipmentName") String equipmentName,@Param("syzGatewayId") String syzGatewayId);
String getPointNameByIndexAddress(@Param("varDesc") String varDesc, @Param("tableName") String tableName,
@Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
@Param("gatewayId") String gatewayId);
List<FullViewRecallDataDTO> getFullViewRecall(@Param("gatewayIds") List<String> gatewayIds);
......@@ -152,7 +152,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
Map<String, Object> getPvEquipStatusByStation(String station);
String getRecDateByIndexAddress(@Param("fanGatewayId") String fanGatewayId,
@Param("indexAddress") String indexAddress, @Param("tableName") String tableName,@Param("syzGatewayId") String syzGatewayId);
@Param("indexAddress") String indexAddress, @Param("tableName") String tableName);
List<Map<String, Object>> getInfoListByTableName(@Param("fanGatewayId") String fanGatewayId,
@Param("indexAddress") String indexAddress, @Param("tableName") String tableName,
......@@ -164,7 +164,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> queryIndexByArae(String ARAE, String ANALYSISTYPE, String startTimeTop,
String endTimeTop);
Map<String, Object> getHealthIndexByIndexAddress(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress,@Param("syzGatewayId") String syzGatewayId);
Map<String, Object> getHealthIndexByIndexAddress(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress);
Map<String, Object> getHealthIndexByIndexAddressPv(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress,@Param("syzGatewayId") String syzGatewayId);
Map<String, Object> getHealthIndexByIndexAddressPv(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress);
}
......@@ -62,7 +62,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "5");
idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getIndexAddress() + o.getStation() + o.getAnalysisObjType() + o.getAnalysisObjSeq() + o.getWeight() + o.getArea() + o.getSubSystem() + o.getEquipmentName() + o.getNumber() + o.getPointName() + o.getKks() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
......@@ -120,7 +120,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "5");
idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubSystem() + o.getEquipmentName() + o.getNumber() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
......@@ -173,7 +173,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "4");
idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizFanWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getNumber() + o.getEquipmentName() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
......@@ -225,7 +225,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "3");
idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizFanWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
......@@ -276,7 +276,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "2");
idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizFanWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
......@@ -325,7 +325,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "1");
idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizFanWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
......@@ -354,11 +354,11 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
public List<HealthIndexDTO> getInfoListByGroupByQy(String startTime, String fanTableName, String pvTableName, String analysisObjectType) {
List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.getInfoList(startTime, fanTableName, analysisObjectType);
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(new QueryWrapper<IdxBizFanWeight>().eq("type", "2").isNotNull("value"));
Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae() + o.getStation(), IdxBizFanWeight::getValue));
Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae() + o.getStation(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, pvTableName, analysisObjectType);
List<IdxBizPvWeight> pvIdxBizFanWeights = idxBizPvWeightMapper.selectList(new QueryWrapper<IdxBizPvWeight>().eq("type", "2").isNotNull("value"));
Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae() + o.getStation(), IdxBizPvWeight::getValue));
Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae() + o.getStation(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
List<HealthIndexDTO> healthIndexDTOS = new ArrayList<>();
healthIndexDTOS.addAll(fanHealthIndices.stream().map(this::toHealthIndexDTO).collect(Collectors.toList()));
......@@ -396,11 +396,11 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
public List<HealthIndexDTO> getInfoListByGroupByQg(String startTime, String fanTableName, String pvTableName, String analysisObjectType) {
List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.getInfoList(startTime, fanTableName, analysisObjectType);
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(new QueryWrapper<IdxBizFanWeight>().eq("type", "1").isNotNull("value"));
Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae(), IdxBizFanWeight::getValue));
Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, pvTableName, analysisObjectType);
List<IdxBizPvWeight> pvIdxBizFanWeights = idxBizPvWeightMapper.selectList(new QueryWrapper<IdxBizPvWeight>().eq("type", "1").isNotNull("value"));
Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae(), IdxBizPvWeight::getValue));
Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
List<HealthIndexDTO> healthIndexDTOS = new ArrayList<>();
healthIndexDTOS.addAll(fanHealthIndices.stream().map(this::toHealthIndexDTO).collect(Collectors.toList()));
......
......@@ -50,7 +50,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "5");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getIndexAddress() + o.getStation() + o.getAnalysisObjType() + o.getAnalysisObjSeq() + o.getWeight() + o.getArea() + o.getSubarray() + o.getManufacturer() + o.getEquipmentName() + o.getPointName() + o.getDeviceType() + o.getKks() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
......@@ -111,7 +111,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "5");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubarray() + o.getOrgCode() + o.getEquipmentName()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
......@@ -165,7 +165,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "4");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizPvWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubarray() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
......@@ -218,7 +218,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "3");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizPvWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
......@@ -270,7 +270,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "2");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizPvWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
......@@ -320,7 +320,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "1");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizPvWeight::getValue));
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
......
......@@ -757,7 +757,7 @@ FROM (
select POINT_NAME
from ${tableName}
where INDEX_ADDRESS = #{varDesc}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
AND GATEWAY_ID = #{gatewayId}
limit 1
......@@ -1354,7 +1354,7 @@ FROM (
WHERE
INDEX_ADDRESS = #{indexAddress}
AND DISPOSOTION_STATE = '待确认'
AND (GATEWAY_ID = #{fanGatewayId} or GATEWAY_ID = #{syzGatewayId})
AND GATEWAY_ID = #{fanGatewayId}
ORDER BY
sort DESC,
REC_DATE DESC
......@@ -1770,7 +1770,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
from fan_health_index_latest_data
where
INDEX_ADDRESS = #{indexAddress}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
AND GATEWAY_ID = #{gatewayId}
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天'
limit 1
......@@ -1782,7 +1782,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
from pv_health_index_latest_data
where
INDEX_ADDRESS = #{indexAddress}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
AND GATEWAY_ID = #{gatewayId}
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天'
limit 1
......
......@@ -86,6 +86,7 @@ public class Constants {
public static final String get_quota_complate_info="method=scene_screen.large_screen.get_quota_complate_info";
public static final String resovleRule_data = "data";
public static final String areaChinese="区域";
public static final String get_big_screen_point_url="http://iiet-jepcc.powerchina.cn:8088/core/datastorage/gateway/point/list?groupId=1827987484823289857&dataType=analog";
}
......@@ -19,6 +19,10 @@ import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.Aggregations;
......@@ -26,9 +30,11 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.metrics.ParsedAvg;
import org.elasticsearch.search.aggregations.metrics.ParsedSum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.component.emq.EmqKeeper;
import com.alibaba.fastjson.JSON;
......@@ -50,6 +56,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.DateUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
/**
* @description:
......@@ -58,6 +65,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.utils.DateUtil;
*/
@Service
//@RequiredArgsConstructor
@Slf4j
public class LargeScreenImpl {
@Autowired
CommonServiceImpl commonServiceImpl;
......@@ -75,6 +83,10 @@ public class LargeScreenImpl {
SjglZsjZsbtzServiceImpl SjglZsjZsbtzServiceImpl;
@Autowired
private HttpRequestUtil httpRequestUtil;
@Autowired
AmosRequestContext amosRequestContext;
@Autowired
RestTemplate restTemplate;
private final String SS = "瞬时风速";
private final String ZFS = "WTX-801_25_WTX-801_总辐射";
......@@ -149,10 +161,13 @@ public class LargeScreenImpl {
// Constants.REQUEST_GET, "", Constants.resovleRule_data);
// }
mapdta.put("SS", data.getDouble("average_wind_speed"));
mapdta.put("ZFS", data.getDouble("avg_irradiance"));
mapdta.put("ZFSLJ", data.getDouble("sum_irradiance"));
// mapdta.put("ZFS", data.getDouble("avg_irradiance"));
// mapdta.put("ZFSLJ", data.getDouble("sum_irradiance"));
}
//平均辐照度和利用小时数采用合成测点的值
Map<String, Double> pointValue = getPointValue();
mapdta.put("ZFS", pointValue.get("ZFS"));
mapdta.put("ZFSLJ", pointValue.get("ZFSLJ"));
// //日发电量
// AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
// //月发电量
......@@ -242,7 +257,62 @@ public class LargeScreenImpl {
return mapdta;
}
/**
* 获取平均辐照度和利用小时数
* @return
*/
private Map<String,Double> getPointValue() {
Map<String,Double> resultMap=new HashMap();
JSONObject jsonObject = sendCoreGetRequest(Constants.get_big_screen_point_url);
if (!Objects.isNull(jsonObject)) {
if (jsonObject.getInteger("status") == HttpStatus.OK.value()) {
JSONArray resultJsonArray = jsonObject.getJSONArray("result");
if (CollectionUtil.isNotEmpty(resultJsonArray)) {
for (Object o : resultJsonArray) {
if (o instanceof Map) {
Map map = (Map) o;
JSONObject result = new JSONObject(map);
String pointName = (String) map.get("pointName");
if ("大屏监控平均辐照度".equals(pointName)) {
resultMap.put("ZFS",result.getDouble("value"));
}
if ("大屏监控利用小时数".equals(pointName)) {
resultMap.put("ZFSLJ",result.getDouble("value"));
}
}
}
}
}
}
return resultMap;
}
/**
* 发送GET请求
* @param url
* @return
*/
private JSONObject sendCoreGetRequest(String url) {
HttpHeaders headers = new HttpHeaders();
headers.set("Token", amosRequestContext.getToken());
headers.set("Product", amosRequestContext.getProduct());
headers.set("Appkey", amosRequestContext.getAppKey());
HttpEntity entity = new HttpEntity<>(headers);
log.info("发送GET请求,请求地址{}", url);
try {
ResponseEntity<JSONObject> response = restTemplate.exchange(url, HttpMethod.GET, entity, JSONObject.class);
if (HttpStatus.OK == response.getStatusCode()) {
log.info("发送请求成功,请求返回体{}", response.getBody());
return response.getBody();
} else {
throw new BadRequest("返回接口异常,失败原因[" + response + "]");
}
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new BadRequest("发送GET请求失败,失败原因[" + e.getMessage() + "]");
}
}
@Scheduled(cron = "0/10 * * * * ?")
//@PostConstruct
private void sendQYYXZBMqtt() {
......@@ -440,8 +510,11 @@ public class LargeScreenImpl {
// "", Constants.resovleRule_data);
// }
mapdta.put("SS", data.getString("average_wind_speed"));
mapdta.put("ZFS", data.getString("avg_irradiance"));
mapdta.put("ZFSLJ", data.getString("sum_irradiance"));
// mapdta.put("ZFS", data.getString("avg_irradiance"));
// mapdta.put("ZFSLJ", data.getString("sum_irradiance"));
Map<String, Double> pointValue = getPointValue();
mapdta.put("ZFS", String.valueOf(pointValue.get("ZFS")));
mapdta.put("ZFSLJ", String.valueOf(pointValue.get("ZFSLJ")));
try {
System.out.println(JSON.toJSONString(mapdta));
......@@ -458,7 +531,7 @@ public class LargeScreenImpl {
}
// 全国发电趋势
@Scheduled(cron = "0/10 * * * * ? ")
// @Scheduled(cron = "0/10 * * * * ? ")
public SeriesData getSeriesDataqg() {
// 获取今年当月 日发电趋势
......@@ -634,7 +707,7 @@ public class LargeScreenImpl {
}
//全国月发电量趋势
//全国月发电量趋势
@Scheduled(cron = "0/10 * * * * ?")
public Map<String, Object> gettimedateyfd() {
......@@ -838,7 +911,7 @@ public class LargeScreenImpl {
}
public Map<String, Object> gettimedateqyyfdqs(Date date, List<String> gatewayId, String areaCode,
List<String> idsStationId) {
List<String> idsStationId) {
SimpleDateFormat myFmt2 = new SimpleDateFormat("yyyy");
String monthy = myFmt2.format(date);
......@@ -979,7 +1052,7 @@ public class LargeScreenImpl {
// CommonConstans.kwToMv;
Double vl = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData.getValueF()))
+ Double.valueOf(String.format(CommonConstans.Twodecimalplaces,
indicatorData2.getValueF() * CommonConstans.kwToMv));
indicatorData2.getValueF() * CommonConstans.kwToMv));
values.add(String.format(CommonConstans.Twodecimalplaces, vl));
}
......@@ -1084,7 +1157,7 @@ public class LargeScreenImpl {
// CommonConstans.kwToMv;
Double vl = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData.getValueF()))
+ Double.valueOf(String.format(CommonConstans.Twodecimalplaces,
indicatorData2.getValueF() * CommonConstans.kwToMv));
indicatorData2.getValueF() * CommonConstans.kwToMv));
values.add(String.format(CommonConstans.Twodecimalplaces, vl));
}
......
......@@ -610,7 +610,7 @@ public class MonitorServiceImpl implements MonitorService {
// }
// return mapdta;
// }
@Scheduled(cron = "0/10 * * * * ?")
// @Scheduled(cron = "0/10 * * * * ?")
private void sendQYYXZBMqtt() {
List<CoreValuesDto> coreValuesDtos = coreCommonService.getValuesByStationNamesAndPointsNames(null, null);
List<StationCacheInfoDto> stationCacheInfoDtoList = getListStationCacheInfoDto();
......
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