Commit a16d0d92 authored by suhuiguang's avatar suhuiguang

1.水源、微型消防站、队伍树调整未公司树

parent 120843e9
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import io.swagger.annotations.Api;
......@@ -181,12 +182,12 @@ public class FireStationController extends BaseController {
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/tree/companyTreeByUserAndType")
@ApiOperation(httpMethod = "GET", value = "微型消防站单位部门树", notes = "微型消防站单位部门树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType(@RequestParam(required = false) String type) {
@ApiOperation(httpMethod = "GET", value = "微型消防站单位树", notes = "微型消防站单位树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType() {
// 获取登陆人角色
ReginParams reginParams = getSelectedOrgInfo();
// 权限赋值
PermissionInterceptorContext.setDataAuthRule(authKey);
return ResponseHelper.buildResponse(iOrgUsrService.companyTreeByUserAndType(reginParams,type));
return ResponseHelper.buildResponse(iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey()));
}
}
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import io.swagger.annotations.Api;
......@@ -288,13 +289,13 @@ public class FireTeamController extends BaseController {
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUserAndType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司部门树", notes = "根据登录人及类型获取公司部门树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType(@RequestParam(required = false) String type) throws Exception {
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司树", notes = "根据登录人及类型获取公司树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType() {
// 获取登陆人角色
ReginParams reginParams = getSelectedOrgInfo();
// 权限赋值
PermissionInterceptorContext.setDataAuthRule(authKey);
List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(reginParams, type);
List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey());
return ResponseHelper.buildResponse(menus);
}
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceCraneDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDyDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceHydrantDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceNaturalDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourcePoolDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResource;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceCrane;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceHydrant;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceIndex;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceNatural;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourcePool;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.api.enums.WaterResourceTypeEnum;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceCraneServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceHydrantServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceIndexServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceIotServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceNaturalServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -185,8 +146,8 @@ public class WaterResourceController extends BaseController {
break;
}
// 新增物联信息
if (null != model.getWaterResourceIotDto() && model.getWaterResourceIotDto().size()>0) {
Map<String,Object> map = model.getWaterResourceIotDto();
if (null != model.getWaterResourceIotDto() && model.getWaterResourceIotDto().size() > 0) {
Map<String, Object> map = model.getWaterResourceIotDto();
List<WaterResourceIndex> list = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
WaterResourceIndex waterResourceIndex1 = new WaterResourceIndex();
......@@ -200,8 +161,8 @@ public class WaterResourceController extends BaseController {
} else {
waterResourceServiceImpl.createWithModel(model);
}
if (model.getAttachments() != null){
sourceFileService.saveAttachments(model.getSequenceNbr(),model.getAttachments());
if (model.getAttachments() != null) {
sourceFileService.saveAttachments(model.getSequenceNbr(), model.getAttachments());
}
return ResponseHelper.buildResponse(model);
}
......@@ -225,14 +186,14 @@ public class WaterResourceController extends BaseController {
perfQuotaIotDTO.setGroupName("");
perfQuotaIotDTO.setPage(page);
ResponseModel<List<EquipmentIndexDto>> equipmentIndexDto = equipFeignClient.getEquipmentIndexDto(perfQuotaIotDTO);
if(equipmentIndexDto.getResult().size() == 0) {
if (equipmentIndexDto.getResult().size() == 0) {
return ResponseHelper.buildResponse(null);
}
List<EquipmentIndexDto> result = equipmentIndexDto.getResult();
List<EquipmentIndexDto> list = result.stream().filter(e-> 1== e.getIsIot()).collect(Collectors.toList());
List<EquipmentIndexDto> list = result.stream().filter(e -> 1 == e.getIsIot()).collect(Collectors.toList());
List<WaterResourceDyDto> listWater = new LinkedList<>();
list.stream().forEach(e-> {
list.stream().forEach(e -> {
WaterResourceDyDto dyDto = new WaterResourceDyDto();
dyDto.setKey(e.getPerfQuotaDefinitionId());
dyDto.setBlock(false);
......@@ -246,7 +207,6 @@ public class WaterResourceController extends BaseController {
}
/**
* 根据sequenceNbr更新
*
......@@ -266,8 +226,8 @@ public class WaterResourceController extends BaseController {
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}*/
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
if (model.getAttachments() != null && ! model.getAttachments().isEmpty()){
sourceFileService.saveAttachments(model.getSequenceNbr(),model.getAttachments());
if (model.getAttachments() != null && !model.getAttachments().isEmpty()) {
sourceFileService.saveAttachments(model.getSequenceNbr(), model.getAttachments());
}
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
......@@ -321,15 +281,15 @@ public class WaterResourceController extends BaseController {
}
}
// 更新物联信息
if (null != model.getWaterResourceIotDto() && model.getWaterResourceIotDto().size() > 0){
Map<String,Object> map = model.getWaterResourceIotDto();
if (null != model.getWaterResourceIotDto() && model.getWaterResourceIotDto().size() > 0) {
Map<String, Object> map = model.getWaterResourceIotDto();
List<WaterResourceIndex> list = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
LambdaQueryWrapper<WaterResourceIndex> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WaterResourceIndex::getNameKey,entry.getKey());
queryWrapper.eq(WaterResourceIndex::getWaterId,model.getSequenceNbr());
queryWrapper.eq(WaterResourceIndex::getNameKey, entry.getKey());
queryWrapper.eq(WaterResourceIndex::getWaterId, model.getSequenceNbr());
WaterResourceIndex waterResourceIndex = waterResourceIndexServiceImpl.getOne(queryWrapper);
if(waterResourceIndex != null) {
if (waterResourceIndex != null) {
waterResourceIndex.setPerfValue(entry.getValue().toString());
list.add(waterResourceIndex);
} else {
......@@ -399,13 +359,13 @@ public class WaterResourceController extends BaseController {
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
Map<String, List<AttachmentDto>> attachments = sourceFileService.getAttachments(sequenceNbr);
if (attachments != null){
if (attachments != null) {
waterResourceDto.setAttachments(attachments);
}
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 end*/
waterResourceDto.setRealityImgList(waterResourceDto.getRealityImg()!=null?JSONArray.parseArray(waterResourceDto.getRealityImg()):null);
waterResourceDto.setOrientationImgList(waterResourceDto.getOrientationImg()!=null?JSONArray.parseArray(waterResourceDto.getOrientationImg()):null);
waterResourceDto.setRealityImgList(waterResourceDto.getRealityImg() != null ? JSONArray.parseArray(waterResourceDto.getRealityImg()) : null);
waterResourceDto.setOrientationImgList(waterResourceDto.getOrientationImg() != null ? JSONArray.parseArray(waterResourceDto.getOrientationImg()) : null);
Boolean isDelete = waterResourceDto.getIsDelete();
// 查询属性信息
String resourceType = waterResourceDto.getResourceType();
......@@ -443,12 +403,12 @@ public class WaterResourceController extends BaseController {
waterResourceDto.setIsDelete(isDelete);
// 查询物联参数
LambdaQueryWrapper<WaterResourceIndex> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WaterResourceIndex::getWaterId,waterResourceDto.getSequenceNbr());
queryWrapper.eq(WaterResourceIndex::getWaterId, waterResourceDto.getSequenceNbr());
List<WaterResourceIndex> list = waterResourceIndexServiceImpl.list(queryWrapper);
if(list.size()>0) {
Map<String,Object> map = new HashMap<>();
list.stream().forEach(e->{
map.put(e.getNameKey(),e.getPerfValue());
if (list.size() > 0) {
Map<String, Object> map = new HashMap<>();
list.stream().forEach(e -> {
map.put(e.getNameKey(), e.getPerfValue());
});
waterResourceDto.setWaterResourceIotDto(map);
}
......@@ -479,11 +439,11 @@ public class WaterResourceController extends BaseController {
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
Page<WaterResourceDto> waterResourceDtoPage = waterResourceServiceImpl.queryForWaterResourcePage(page, name, resourceType,
belongBuildingId, belongFightingSystemId, sequenceNbr, classifyId,bizOrgCode, equipCateGoryCode);
belongBuildingId, belongFightingSystemId, sequenceNbr, classifyId, bizOrgCode, equipCateGoryCode);
List<WaterResourceDto> records = waterResourceDtoPage.getRecords();
records.forEach(i->{
records.forEach(i -> {
Map<String, List<AttachmentDto>> attachments = sourceFileService.getAttachments(i.getSequenceNbr());
if (attachments != null){
if (attachments != null) {
i.setAttachments(attachments);
}
});
......@@ -551,13 +511,13 @@ public class WaterResourceController extends BaseController {
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUserAndType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司部门树", notes = "根据登录人及类型获取公司部门树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType(@RequestParam(required = false) String type) throws Exception {
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司树", notes = "根据登录人及类型获取公司树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType() {
// 获取登陆人角色
ReginParams reginParams = getSelectedOrgInfo();
// 权限赋值
PermissionInterceptorContext.setDataAuthRule(authKey);
List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(reginParams, type);
List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey());
return ResponseHelper.buildResponse(menus);
}
......@@ -568,6 +528,7 @@ public class WaterResourceController extends BaseController {
List<Menu> list = waterResourceServiceImpl.getwaterResourceTypeTree(bizOrgCode);
return ResponseHelper.buildResponse(list);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/type/XFSYLX", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "点击添加按钮显示的页签数据", notes = "点击添加按钮显示的页签数据")
......
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