Commit 1b6ac106 authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java # amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
parents 16e866a2 8cbb0c18
...@@ -469,22 +469,36 @@ public class DataDictionaryController extends BaseController { ...@@ -469,22 +469,36 @@ public class DataDictionaryController extends BaseController {
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/saveFireEquipConfig", method = RequestMethod.POST) @RequestMapping(value = "/saveFireEquipConfig", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "存储默认展示视频", notes = "存储默认展示视频") @ApiOperation(httpMethod = "POST", value = "存储消防器材配置数据", notes = "存储消防器材配置数据")
public boolean saveFireEquipConfig(@RequestParam String ids) { public ResponseModel saveFireEquipConfig(@RequestParam(value = "codes", required = false) String codes) {
String type = "ZYGL_XFQC"; String type = "ZYGL_XFQC";
LambdaUpdateWrapper<DataDictionary> lambda = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<DataDictionary> lambda = new LambdaUpdateWrapper<>();
lambda.eq(DataDictionary::getType, type); lambda.eq(DataDictionary::getType, type);
iDataDictionaryService.remove(lambda); iDataDictionaryService.remove(lambda);
List<DataDictionary> insertList = new ArrayList<>(); if (StringUtils.isNotEmpty(codes)) {
String[] split = ids.split(","); List<DataDictionary> insertList = new ArrayList<>();
for (int i = 0; i < split.length; i++) { String[] split = codes.split(",");
DataDictionary dataDictionary = new DataDictionary(); for (int i = 0; i < split.length; i++) {
dataDictionary.setName(split[i]); DataDictionary dataDictionary = new DataDictionary();
dataDictionary.setCode(split[i]); dataDictionary.setName(split[i]);
dataDictionary.setType(type); dataDictionary.setCode(split[i]);
insertList.add(dataDictionary); dataDictionary.setType(type);
dataDictionary.setSortNum(i + 1);
insertList.add(dataDictionary);
}
iDataDictionaryService.saveBatch(insertList);
} }
iDataDictionaryService.saveBatch(insertList); return ResponseHelper.buildResponse(Boolean.TRUE);
return Boolean.TRUE; }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getDictListByType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel<List<DataDictionary>> getDictListByType(@RequestParam String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
List<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
return ResponseHelper.buildResponse(list);
} }
} }
...@@ -26,4 +26,6 @@ public class EquipCountBySystemVO { ...@@ -26,4 +26,6 @@ public class EquipCountBySystemVO {
private String unitName; private String unitName;
@ApiModelProperty(value = "图标") @ApiModelProperty(value = "图标")
private String img; private String img;
@ApiModelProperty(value = "排序字段")
private int sortNum;
} }
...@@ -145,6 +145,13 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -145,6 +145,13 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize); return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize);
} }
@RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据字典查询相关信息")
public List<EquipCountBySystemVO> getFireEquipConfigInfo() {
return fireFightingSystemService.getFireEquipConfigInfo();
}
@RequestMapping(value = "/getOneById", method = RequestMethod.GET) @RequestMapping(value = "/getOneById", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过id查询消防系统信息") @ApiOperation("通过id查询消防系统信息")
......
...@@ -209,4 +209,6 @@ public interface JcsFeign { ...@@ -209,4 +209,6 @@ public interface JcsFeign {
@GetMapping(value = "/data-dictionary/dataDictionaryIdFillMenu") @GetMapping(value = "/data-dictionary/dataDictionaryIdFillMenu")
FeignClientResult<List<DataDictionary>> dataDictionaryIdFillMenu(@RequestParam(value = "type") String type); FeignClientResult<List<DataDictionary>> dataDictionaryIdFillMenu(@RequestParam(value = "type") String type);
@GetMapping(value = "/data-dictionary/getDictListByType")
FeignClientResult<List<DataDictionary>> getDictListByType(@RequestParam(value = "type") String type);
} }
...@@ -744,5 +744,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -744,5 +744,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
@Param("fireEquipmentName") String fireEquipmentName, @Param("startTime") String startTime, @Param("endTime") String endTime); @Param("fireEquipmentName") String fireEquipmentName, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> getFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode); List<Map<String, Object>> getFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo(@Param("codes") List<String> codes);
} }
...@@ -359,4 +359,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -359,4 +359,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<Map<String, Object>> getFEquipInfoList(String bizOrgCode); List<Map<String, Object>> getFEquipInfoList(String bizOrgCode);
List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode); List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo();
} }
...@@ -2361,6 +2361,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2361,6 +2361,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
List<List<String>> yaxisList = new ArrayList<>(); List<List<String>> yaxisList = new ArrayList<>();
EquipTrendResultVo equipTrendResultVo = new EquipTrendResultVo(); EquipTrendResultVo equipTrendResultVo = new EquipTrendResultVo();
//横坐标数据
List<String> allTimeListNew = new ArrayList<>();
for (EquipTrendInfoVo equipInfo : equipList) { for (EquipTrendInfoVo equipInfo : equipList) {
//返回数据组装 //返回数据组装
List<String> maxMinInfo = new ArrayList<>(); List<String> maxMinInfo = new ArrayList<>();
...@@ -2407,7 +2409,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2407,7 +2409,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
yaxisList.add(values); yaxisList.add(values);
} }
equipTrendResultVo.setxAxisData(allTimeList); List<String> collect = allTimeList.stream().map(item -> item + ":00").collect(Collectors.toList());
equipTrendResultVo.setxAxisData(collect);
equipTrendResultVo.setLegends(legends); equipTrendResultVo.setLegends(legends);
equipTrendResultVo.setThreshold(threshold); equipTrendResultVo.setThreshold(threshold);
equipTrendResultVo.setyAxisData(yaxisList); equipTrendResultVo.setyAxisData(yaxisList);
......
...@@ -2989,4 +2989,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2989,4 +2989,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}); });
return listNew; return listNew;
} }
@Override
public List<EquipCountBySystemVO> getFireEquipConfigInfo() {
List<DataDictionary> fireConfigInfoList = jcsFeignClient.getDictListByType("ZYGL_XFQC").getResult();
if (CollUtil.isEmpty(fireConfigInfoList)) {
return new ArrayList<>();
}
Map<String, Integer> collect = fireConfigInfoList.stream().collect(Collectors.toMap(DataDictionary::getCode, DataDictionary::getSortNum));
List<String> codes = fireConfigInfoList.stream().map(DataDictionary::getCode).collect(Collectors.toList());
List<EquipCountBySystemVO> fireEquipConfigInfo = this.baseMapper.getFireEquipConfigInfo(codes);
fireEquipConfigInfo.forEach(item -> item.setSortNum(collect.getOrDefault(item.getEquipmentCode(), 1)));
return fireEquipConfigInfo.stream().sorted(Comparator.comparingInt(EquipCountBySystemVO::getSortNum)).collect(Collectors.toList());
}
} }
...@@ -6843,4 +6843,27 @@ ...@@ -6843,4 +6843,27 @@
AND wes.biz_org_code like concat (#{bizOrgCode},'%') AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if> </if>
</select> </select>
<select id="getFireEquipConfigInfo" resultMap="EquipCountBySystemId">
SELECT
wle.id equipment_id,
wle.code equipment_code,
wle.NAME equipment_name,
count(spe.id) num,
unit.name unit_name,
wle.shbz_img img,
cate.NAME AS equipmentCateGoryName
FROM
wl_equipment_specific AS spe
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
where
wle.code in
<foreach collection="codes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
group by wle.id
</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