Commit 76cf9c14 authored by KeYong's avatar KeYong

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

parent 1c585cf0
......@@ -160,8 +160,12 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据字典查询相关信息")
public List<EquipCountBySystemVO> getFireEquipConfigInfo() {
return fireFightingSystemService.getFireEquipConfigInfo();
public List<EquipCountBySystemVO> getFireEquipConfigInfo(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
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)
......
......@@ -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<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
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
}
@Override
public List<EquipCountBySystemVO> getFireEquipConfigInfo() {
public List<EquipCountBySystemVO> getFireEquipConfigInfo(String bizOrgCode) {
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);
List<EquipCountBySystemVO> fireEquipConfigInfo = this.baseMapper.getFireEquipConfigInfo(codes, bizOrgCode);
fireEquipConfigInfo.forEach(item -> item.setSortNum(collect.getOrDefault(item.getEquipmentCode(), 1)));
return fireEquipConfigInfo.stream().sorted(Comparator.comparingInt(EquipCountBySystemVO::getSortNum)).collect(Collectors.toList());
}
......
......@@ -6810,7 +6810,7 @@
) a ON a.`code` = wes.equipment_code
LEFT JOIN wl_unit wu ON wu.id = a.unit_id
WHERE
a.`name` IS NOT NULL
a.`name` IS NOT NULL AND wes.system_id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
......@@ -6845,7 +6845,7 @@
</where>
) a ON a.`code` = wes.equipment_code
WHERE
a.`name` IS NOT NULL
a.`name` IS NOT NULL AND wes.system_id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
......@@ -6866,11 +6866,16 @@
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
<where>
spe.system_id IS NOT NULL AND wle.code in
<foreach collection="codes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</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
</select>
</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