Commit df154c53 authored by tangwei's avatar tangwei

增加物联设备

parent 2ea72259
......@@ -57,4 +57,7 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> {
@ApiModelProperty(value = "队伍id")
private String teamId;
@ApiModelProperty(value = "是否物联")
private String isIot;
}
......@@ -193,6 +193,12 @@ public class CarController extends AbstractBaseController {
@Value("${auth-key-fire-car}")
private String carAuthKey;
@Value("${auth-key-fire-iot-equip:fire_iot-equip_info}")
private String iotAuthKey;
@Autowired
JcsFeign jcsFeign;
@Autowired
......@@ -1315,4 +1321,13 @@ public class CarController extends AbstractBaseController {
FeignClientResult<List<OrgMenuDto>> menusList = jcsFeign.getCompanyDeptTreeWithAuth(carAuthKey, null);
return ResponseHelper.buildResponse(menusList.getResult());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/iot/companyTreeByUserAndType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司部门树", notes = "根据登录人及类型获取公司部门树")
public ResponseModel<Object> iotcompanyTreeByUserAndType() throws Exception {
FeignClientResult<List<OrgMenuDto>> menusList = jcsFeign.getCompanyDeptTreeWithAuth(iotAuthKey, null);
return ResponseHelper.buildResponse(menusList.getResult());
}
}
......@@ -303,7 +303,47 @@ public class FireFightingSystemController extends AbstractBaseController {
@PostMapping(value = "/iot/getEquipTypeAmount")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "九大类下装备,通过code截取", notes = "九大类下装备信息列表")
public IPage<EquipTypeImgAmountVO> iotgetEquipTypeAmount(@RequestBody EquipTypeAmountPageDTO equipTypeAmountPage) {
equipTypeAmountPage.setIsIot("1");
String[] result = hierarchy.split(",");
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < result.length; i++) {
map.put(i, Integer.valueOf(result[i]));
}
if (StringUtil.isNotEmpty(equipTypeAmountPage.getEquipmentClassificationCode())) {
QueryWrapper<EquipmentCategory> equipmentCategoryQueryWrapper = new QueryWrapper<>();
equipmentCategoryQueryWrapper.eq("code", equipTypeAmountPage.getEquipmentClassificationCode());
equipmentCategoryQueryWrapper.eq("industry_code", equipTypeAmountPage.getIndustryCode());
EquipmentCategory equipmentCategory = equipmentCategoryService.getOne(equipmentCategoryQueryWrapper);
if (equipmentCategory == null) {
throw new RuntimeException("装备定义code有误");
}
int inhierarchy = 1;
for (int i = 0; i < result.length + 1; i++) {
//进来先判断是否默认就是空,如果为空第一层
if (equipmentCategory.getParentId() == null) {
//判断是否是最下面的子节点
if (i >= 4) {
inhierarchy = 8;
} else {
inhierarchy = map.get(i);
}
break;
} else {
//查找到循环几次为空
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
}
}
return fireFightingSystemService.getColaCategoryAmountList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
} else {
return fireFightingSystemService.getColaCategoryAmountList(0, null, equipTypeAmountPage);
}
}
......
......@@ -103,4 +103,8 @@ auth-key-fire-building=fire_building_info
redis_car_type_count = carTypeAndCount
redis_equip_type_count = equipTypeAndCount
\ No newline at end of file
redis_equip_type_count = equipTypeAndCount
# 权限标识-物联装备
auth-key-fire-iot-equip=fire_iot-equip_info
\ No newline at end of file
......@@ -611,6 +611,11 @@
<if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
</if>
<if test="equipTypeAmountPage.isIot!=null">
and wle.is_iot=1
</if>
<if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
......@@ -713,6 +718,9 @@
<if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
<if test="equipTypeAmountPage.isIot!=null">
and wle.is_iot=1
</if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
And wlc.`NAME` LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
......
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