Commit 5be5f52c authored by 王鹿鹿's avatar 王鹿鹿

任务 7948 7949 7953

parent 3818c18b
......@@ -701,10 +701,10 @@ GROUP BY
FROM cb_dynamic_form_instance GROUP BY instance_id) b
on b.instance_id=a.sequence_nbr
LEFT JOIN cb_firefighters_contacts fc ON a.sequence_nbr = fc.org_usr_id
LEFT JOIN cb_firefighters_workexperience fw ON a.sequence_nbr = fw.org_usr_id
LEFT JOIN cb_firefighters_education fe ON a.sequence_nbr = fe.org_usr_id
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
LEFT JOIN cb_firefighters_contacts fc ON CAST(a.sequence_nbr as char) = fc.org_usr_id
LEFT JOIN cb_firefighters_workexperience fw ON CAST(a.sequence_nbr as char) = fw.org_usr_id
LEFT JOIN cb_firefighters_education fe ON CAST(a.sequence_nbr as char) = fe.org_usr_id
LEFT JOIN cb_firefighters_post fp ON CAST(a.sequence_nbr as char) = fp.org_usr_id
where a.biz_org_name is not null and a.is_delete = 0 and a.biz_org_type = 'PERSON'
<if test="parentId != null and parentId != '' and parentId != '-1'">
......
......@@ -12,4 +12,5 @@ public class IotIndexItemVo {
private String id;
private String key;
private String name;
private String color;
}
......@@ -383,7 +383,7 @@ public class EquipmentSpecificController extends AbstractBaseController {
}
ResponseModel entity = null;
try {
entity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), beginDate, endDate, prefix, suffix);
entity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), beginDate, endDate, prefix, suffix, null);
} catch (Exception e) {
e.printStackTrace();
log.error("调用iot服务出错");
......
......@@ -1005,19 +1005,18 @@ public class TopographyController extends AbstractBaseController {
equipmentSpecifics.stream().forEach((e)->{
IotIndexItemVo itemVo = new IotIndexItemVo();
map.put(e.getPerfQuotaDefinitionId(),e.getPerfQuotaName());
itemVo.setKey(e.getPerfQuotaDefinitionId());
itemVo.setName(e.getPerfQuotaName());
iotIndexItemVos.add(itemVo);
if(!e.getIsTrend()) {
map.put(e.getPerfQuotaDefinitionId(),e.getPerfQuotaName());
itemVo.setKey(e.getPerfQuotaDefinitionId());
itemVo.setName(e.getPerfQuotaName());
itemVo.setColor(e.getEmergencyLevelColor());
iotIndexItemVos.add(itemVo);
}
});
if ( "true".equals(isTrend)) {
allKeys = equipmentSpecifics.stream().filter(equipmentIndex -> equipmentIndex.getIsTrend()).map(EquipmentIndex::getPerfQuotaDefinitionId).collect(Collectors.joining(","));
names = equipmentSpecifics.stream().filter(equipmentIndex -> equipmentIndex.getIsTrend()).map(EquipmentIndex::getPerfQuotaName).collect(Collectors.joining(","));
} else {
allKeys = equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getPerfQuotaDefinitionId).collect(Collectors.joining(","));
names = equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getPerfQuotaName).collect(Collectors.joining(","));
}
allKeys = equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getPerfQuotaDefinitionId).collect(Collectors.joining(","));
names = equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getPerfQuotaName).collect(Collectors.joining(","));
String parmfieldKey = "";
String parmfieldName = "";
......@@ -1030,9 +1029,6 @@ public class TopographyController extends AbstractBaseController {
}
}
String prefix = null;
String suffix = null;
if (iotCode.length() > 8) {
......@@ -1080,32 +1076,37 @@ public class TopographyController extends AbstractBaseController {
dates.add(value);
}
List<IotDataVO> dataList = new ArrayList<>();
if (isTrend.equals("true")) {
// 处理遥测
// 处理遥信 时间处理
if (totalType.equals("hour")) {
handle(datesFinal, dates, beginDate, st, dataList, timeAndValue);
} else if (totalType.equals("day")) {
handleDay(datesFinal, beginDate, endDate, st, dates, dataList, timeAndValue);
} else if (totalType.equals("week")) {
handWeek(beginDate, st,dates,dataList,timeAndValue);
} else {
// 处理遥信
// 时间处理
if (totalType.equals("hour")) {
handle(datesFinal, dates, beginDate, st, dataList, timeAndValue);
} else if (totalType.equals("day")) {
handleDay(datesFinal, beginDate, endDate, st, dates, dataList, timeAndValue);
} else if (totalType.equals("week")) {
handWeek(beginDate, st,dates,dataList,timeAndValue);
} else {
handMonth(beginDate, st,dates,dataList,timeAndValue);
}
handMonth(beginDate, st,dates,dataList,timeAndValue);
}
IotIndexResMinotVo iotIndexResVo = new IotIndexResMinotVo();
iotIndexResVo.setIotData(dataList);
res.add(iotIndexResVo);
IotIndexResMinotVo iotIndexResVo = new IotIndexResMinotVo();
iotIndexResVo.setIotData(dataList);
res.add(iotIndexResVo);
}
}
}
List<IotIndexResItemVo> iotData = new ArrayList<>();
for(IotIndexResMinotVo s : res) {
IotIndexResItemVo itemVo = new IotIndexResItemVo();
List<Integer> list = new ArrayList<>();
for (IotDataVO v: s.getIotData()) {
list.add(Integer.parseInt(v.getValue().toString()));
itemVo.setName(map.get(v.getKey()));
itemVo.setKey(v.getKey());
}
itemVo.setData(list.stream().mapToInt(i->i).toArray());
iotData.add(itemVo);
}
if(totalType.equals("week") || totalType.equals("month") || totalType.equals("hour") || totalType.equals("day")) {
......@@ -1150,20 +1151,10 @@ public class TopographyController extends AbstractBaseController {
}
}
List<IotIndexResItemVo> iotData = new ArrayList<>();
for(IotIndexResMinotVo s : res) {
IotIndexResItemVo itemVo = new IotIndexResItemVo();
List<Integer> list = new ArrayList<>();
for (IotDataVO v: s.getIotData()) {
list.add(Integer.parseInt(v.getValue().toString()));
itemVo.setName(map.get(v.getKey()));
itemVo.setKey(v.getKey());
}
itemVo.setData(list.stream().mapToInt(i->i).toArray());
iotData.add(itemVo);
if(iotData.size() == 0) {
fullData(iotIndexItemVos,iotData,times,map);
}
indexResMinotFinalVo.setTimes(times);
indexResMinotFinalVo.setNameKey(StringUtils.isEmpty(fieldKey) ? allKeys.split(",") : fieldKey.split(","));
indexResMinotFinalVo.setName(StringUtils.isEmpty(fieldKey) ? names.split(",") : parmfieldName.split(","));
......@@ -1174,6 +1165,20 @@ public class TopographyController extends AbstractBaseController {
return CommonResponseUtil.success(indexResMinotFinalVo);
}
private void fullData(List<IotIndexItemVo> iotIndexItemVos, List<IotIndexResItemVo> iotData, List<String> times, Map<String, String> map ) {
for(IotIndexItemVo iVo: iotIndexItemVos) {
IotIndexResItemVo itVo = new IotIndexResItemVo();
itVo.setName(map.get(iVo.getKey()));
itVo.setKey(iVo.getKey());
List<Integer> list = new ArrayList<>();
for (int i = 1; i <= times.size() ; i++) {
list.add(0);
}
itVo.setData(list.stream().mapToInt(i->i).toArray());
iotData.add(itVo);
}
}
private void handMonth( String beginDate, String nameKey, List<String> dates, List<IotDataVO> dataList, Map<String, String> timeAndValue) throws Exception {
for(int i =1; i <= 12; i++) {
int num = 0;
......
......@@ -751,11 +751,7 @@ public class ExcelServiceImpl {
logger.error("日期转换失败");
}
}
if ("peopleType".equals(key)) {
dynamicFormInstanceDto.setFieldValue("1");
dynamicFormInstanceDto.setFieldValueLabel("非消防人员");
orgUsrExcelDto.setPeopleType("1");
}
DynamicFormInstance dynamicFormInstance = new DynamicFormInstance();
BeanUtils.copyProperties(dynamicFormInstanceDto, dynamicFormInstance);
dynamicFormInstancelist.add(dynamicFormInstance);
......
......@@ -224,7 +224,7 @@
group_name
</select>
<select id="getPerfQutoaIotList" resultType="com.yeejoin.equipmanage.common.entity.EquipmentIndex">
select id,name as perfQuotaName, name_key as perfQuotaDefinitionId,is_trend as isTrend from wl_equipment_index s where equipment_id = (
select id,name as perfQuotaName, name_key as perfQuotaDefinitionId,is_trend as isTrend,emergency_level_color as emergencyLevelColor from wl_equipment_index s where equipment_id = (
select equipment_id from wl_equipment_detail wei where id = (
select equipment_detail_id from wl_equipment_specific where id = #{id})
)
......
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