Commit 76cf9c14 authored by KeYong's avatar KeYong

修改消防器材接口增加bizOrgCode过滤

parent 1c585cf0
...@@ -160,8 +160,12 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -160,8 +160,12 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET) @RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据字典查询相关信息") @ApiOperation("根据字典查询相关信息")
public List<EquipCountBySystemVO> getFireEquipConfigInfo() { public List<EquipCountBySystemVO> getFireEquipConfigInfo(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
return fireFightingSystemService.getFireEquipConfigInfo(); if (org.apache.commons.lang3.StringUtils.isBlank(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && org.apache.commons.lang3.StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
return fireFightingSystemService.getFireEquipConfigInfo(bizOrgCode);
} }
@RequestMapping(value = "/getOneById", method = RequestMethod.GET) @RequestMapping(value = "/getOneById", method = RequestMethod.GET)
......
...@@ -745,6 +745,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -745,6 +745,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
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); List<EquipCountBySystemVO> getFireEquipConfigInfo(@Param("codes") List<String> codes, @Param("bizOrgCode")String bizOrgCode);
} }
...@@ -360,6 +360,6 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -360,6 +360,6 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode); List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo(); List<EquipCountBySystemVO> getFireEquipConfigInfo(String bizOrgCode);
} }
...@@ -2993,14 +2993,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2993,14 +2993,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public List<EquipCountBySystemVO> getFireEquipConfigInfo() { public List<EquipCountBySystemVO> getFireEquipConfigInfo(String bizOrgCode) {
List<DataDictionary> fireConfigInfoList = jcsFeignClient.getDictListByType("ZYGL_XFQC").getResult(); List<DataDictionary> fireConfigInfoList = jcsFeignClient.getDictListByType("ZYGL_XFQC").getResult();
if (CollUtil.isEmpty(fireConfigInfoList)) { if (CollUtil.isEmpty(fireConfigInfoList)) {
return new ArrayList<>(); return new ArrayList<>();
} }
Map<String, Integer> collect = fireConfigInfoList.stream().collect(Collectors.toMap(DataDictionary::getCode, DataDictionary::getSortNum)); 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<String> codes = fireConfigInfoList.stream().map(DataDictionary::getCode).collect(Collectors.toList());
List<EquipCountBySystemVO> fireEquipConfigInfo = this.baseMapper.getFireEquipConfigInfo(codes); List<EquipCountBySystemVO> fireEquipConfigInfo = this.baseMapper.getFireEquipConfigInfo(codes, bizOrgCode);
fireEquipConfigInfo.forEach(item -> item.setSortNum(collect.getOrDefault(item.getEquipmentCode(), 1))); fireEquipConfigInfo.forEach(item -> item.setSortNum(collect.getOrDefault(item.getEquipmentCode(), 1)));
return fireEquipConfigInfo.stream().sorted(Comparator.comparingInt(EquipCountBySystemVO::getSortNum)).collect(Collectors.toList()); return fireEquipConfigInfo.stream().sorted(Comparator.comparingInt(EquipCountBySystemVO::getSortNum)).collect(Collectors.toList());
} }
......
...@@ -6810,7 +6810,7 @@ ...@@ -6810,7 +6810,7 @@
) a ON a.`code` = wes.equipment_code ) a ON a.`code` = wes.equipment_code
LEFT JOIN wl_unit wu ON wu.id = a.unit_id LEFT JOIN wl_unit wu ON wu.id = a.unit_id
WHERE WHERE
a.`name` IS NOT NULL a.`name` IS NOT NULL AND wes.system_id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat (#{bizOrgCode},'%') AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if> </if>
...@@ -6845,8 +6845,8 @@ ...@@ -6845,8 +6845,8 @@
</where> </where>
) a ON a.`code` = wes.equipment_code ) a ON a.`code` = wes.equipment_code
WHERE WHERE
a.`name` IS NOT NULL a.`name` IS NOT NULL AND wes.system_id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat (#{bizOrgCode},'%') AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if> </if>
</select> </select>
...@@ -6866,11 +6866,16 @@ ...@@ -6866,11 +6866,16 @@
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_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_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
where <where>
wle.code in spe.system_id IS NOT NULL AND wle.code in
<foreach collection="codes" item="item" index="index" open="(" close=")" separator=","> <foreach collection="codes" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
AND spe.system_id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
group by wle.id group by wle.id
</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