Commit 2f4fdd5d authored by 高建强's avatar 高建强

item:添加稳压泵启停状态图详情接口,及bug修改

parent bc61b69b
...@@ -577,7 +577,7 @@ public class EmergencyController extends AbstractBaseController { ...@@ -577,7 +577,7 @@ public class EmergencyController extends AbstractBaseController {
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPressurePumpStatusChart") @GetMapping(value = "/getPressurePumpStatusChart")
@ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵启停状态图", notes = "四横八纵-稳压泵启停状态图") @ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵启停状态图", notes = "四横八纵-稳压泵启停状态图,取舍补点")
public ResponseModel getPressurePumpStatusChart(@RequestParam String startTime, @RequestParam String endTime, public ResponseModel getPressurePumpStatusChart(@RequestParam String startTime, @RequestParam String endTime,
@RequestParam(required = false) String bizOrgCode) { @RequestParam(required = false) String bizOrgCode) {
if(StringUtils.isEmpty(bizOrgCode)) { if(StringUtils.isEmpty(bizOrgCode)) {
...@@ -595,6 +595,25 @@ public class EmergencyController extends AbstractBaseController { ...@@ -595,6 +595,25 @@ public class EmergencyController extends AbstractBaseController {
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPressurePumpStatusDetailChart")
@ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵启停状态图", notes = "四横八纵-稳压泵启停状态图,分钟级补点")
public ResponseModel getPressurePumpStatusDetailChart(@RequestParam String startTime, @RequestParam String endTime,
@RequestParam(required = false) String bizOrgCode) {
if(StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(Collections.EMPTY_MAP);
}
}
}
return CommonResponseUtil.success(iEmergencyService.getPressurePumpStatusDetailChart(startTime, endTime, bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPressurePumpDiagnosticAnalysis") @GetMapping(value = "/getPressurePumpDiagnosticAnalysis")
@ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵诊断分析", notes = "四横八纵-稳压泵诊断分析") @ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵诊断分析", notes = "四横八纵-稳压泵诊断分析")
public ResponseModel getPressurePumpDiagnosticAnalysis(@RequestParam(required = false) String bizOrgCode) { public ResponseModel getPressurePumpDiagnosticAnalysis(@RequestParam(required = false) String bizOrgCode) {
......
...@@ -57,6 +57,8 @@ public interface IEmergencyService { ...@@ -57,6 +57,8 @@ public interface IEmergencyService {
Map<String, Object> getPressurePumpStatusChart(String startTime, String endTime, String bizOrgCode); Map<String, Object> getPressurePumpStatusChart(String startTime, String endTime, String bizOrgCode);
Map<String, Object> getPressurePumpStatusDetailChart(String startTime, String endTime, String bizOrgCode);
List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode); List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode);
Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus); Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus);
......
...@@ -178,4 +178,11 @@ public interface IPressurePumpService { ...@@ -178,4 +178,11 @@ public interface IPressurePumpService {
* @return * @return
*/ */
List<OrgUsrDto> getOrgUsrDtoInfo(Map<String, String> map); List<OrgUsrDto> getOrgUsrDtoInfo(Map<String, String> map);
/**
* 获取公司顶级bizOrgCode
* @param bizOrgCode
* @return
*/
String getCompanyBizOrgCode(String bizOrgCode);
} }
...@@ -58,13 +58,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -58,13 +58,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
@Async @Async
public void saveDataToRedis(List<IotDataVO> iotDatalist, String iotCode, String bizOrgCode) { public void saveDataToRedis(List<IotDataVO> iotDatalist, String iotCode, String bizOrgCode) {
// 获取公司顶级bizOrgCode // 获取公司顶级bizOrgCode
Map<String, String> params = new HashMap<>(); bizOrgCode = getCompanyBizOrgCode(bizOrgCode);
params.put("bizOrgType", PressurePumpRelateEnum.BIZ_ORG_TYPE_COMPANY.getValue()); if (StringUtils.isNotBlank(bizOrgCode)) {
params.put("bizOrgCode", bizOrgCode);
List<OrgUsrDto> orgUsrDtoList = getOrgUsrDtoInfo(params);
if (CollectionUtils.isNotEmpty(orgUsrDtoList)) {
bizOrgCode = orgUsrDtoList.get(0).getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
String pressurePumpValue = PressurePumpRelateEnum.PRESSURE_PUMP.getValue(); String pressurePumpValue = PressurePumpRelateEnum.PRESSURE_PUMP.getValue();
// 获取配置JSON信息集合 // 获取配置JSON信息集合
List<Map> list = getNameKeyInfoList(pressurePumpValue); List<Map> list = getNameKeyInfoList(pressurePumpValue);
...@@ -84,6 +79,17 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -84,6 +79,17 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
} }
} }
} }
@Override
public String getCompanyBizOrgCode(String bizOrgCode) {
Map<String, String> params = new HashMap<>();
params.put("bizOrgType", PressurePumpRelateEnum.BIZ_ORG_TYPE_COMPANY.getValue());
params.put("bizOrgCode", bizOrgCode);
List<OrgUsrDto> orgUsrDtoList = getOrgUsrDtoInfo(params);
if (CollectionUtils.isNotEmpty(orgUsrDtoList)) {
bizOrgCode = orgUsrDtoList.get(orgUsrDtoList.size() - 1).getBizOrgCode();
}
return bizOrgCode;
} }
@Override @Override
...@@ -303,6 +309,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -303,6 +309,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
PressurePumpCountVo countVo = new PressurePumpCountVo(); PressurePumpCountVo countVo = new PressurePumpCountVo();
countVo.setTime(time); countVo.setTime(time);
countVo.setValue(dataMap.get(time).size()); countVo.setValue(dataMap.get(time).size());
// 获取公司顶级bizOrgCode
bizOrgCode = getCompanyBizOrgCode(bizOrgCode);
// 获取的数据存储到redis // 获取的数据存储到redis
String topic = String.join(":", infoCode, bizOrgCode, countRedisKey, fieldKey, iotCode, time); String topic = String.join(":", infoCode, bizOrgCode, countRedisKey, fieldKey, iotCode, time);
countVo.setIotCode(topic); countVo.setIotCode(topic);
......
...@@ -64,8 +64,9 @@ ...@@ -64,8 +64,9 @@
biz_org_type = #{bizOrgType} biz_org_type = #{bizOrgType}
</if> </if>
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND locate( #{bizOrgCode}, biz_org_code ) > 0 AND locate( biz_org_code, #{bizOrgCode} ) > 0
</if> </if>
</where> </where>
ORDER BY sequence_nbr
</select> </select>
</mapper> </mapper>
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