包头bug修复
This commit is contained in:
parent
fae66d7b0c
commit
2580e777eb
@ -1,11 +1,18 @@
|
|||||||
package com.zhgd.xmgl.modules.basicdata.controller;
|
package com.zhgd.xmgl.modules.basicdata.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.BaseAuthority;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseMenu;
|
import com.zhgd.xmgl.modules.basicdata.entity.BaseMenu;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
|
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.BaseRole;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseAuthorityService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseMenuService;
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseMenuService;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseRoleService;
|
||||||
|
import com.zhgd.xmgl.util.MapBuilder;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@ -14,10 +21,11 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,9 +42,16 @@ import java.util.Map;
|
|||||||
public class BaseMenuController {
|
public class BaseMenuController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBaseMenuService baseMenuService;
|
private IBaseMenuService baseMenuService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IBaseAuthorityService baseAuthorityService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IBaseRoleService baseRoleService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "列表查询系统菜单信息", notes = "列表查询系统菜单信息", httpMethod = "POST")
|
@ApiOperation(value = "列表查询系统菜单信息", notes = "列表查询系统菜单信息", httpMethod = "POST")
|
||||||
@ -59,6 +74,7 @@ public class BaseMenuController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
|
*
|
||||||
* @param baseMenu
|
* @param baseMenu
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -71,6 +87,7 @@ public class BaseMenuController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
|
*
|
||||||
* @param baseMenu
|
* @param baseMenu
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -83,6 +100,7 @@ public class BaseMenuController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除
|
* 通过id删除
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -104,9 +122,9 @@ public class BaseMenuController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -150,4 +168,28 @@ public class BaseMenuController {
|
|||||||
baseMenuService.fixAuthDistribute();
|
baseMenuService.fixAuthDistribute();
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "所有账号都分配党建引领、阳光工程首页、用户中心、文档管理", notes = "所有账号都分配党建引领、阳光工程首页、用户中心、文档管理", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/grantFixedAuthority")
|
||||||
|
public Result grantFixedAuthority(@RequestBody Map<String, Object> map) {
|
||||||
|
List<BaseRole> roleList = baseRoleService.getProjectBaseRolePageList(new MapBuilder<String, Object>()
|
||||||
|
.put("projectSn", MapUtils.getString(map, "projectSn"))
|
||||||
|
.put("pageNo", 1)
|
||||||
|
.put("pageSize", -1)
|
||||||
|
.build()).getRecords();
|
||||||
|
List<String> authIds = Arrays.asList("149", "1857361972801216517", "1857361972801216518", "1857361972801216519", "1857361972801216520", "1857361972801216521", "1882030939467436033", "1877735641188544513", "1877344022396334082", "1828615037974118406", "1828615045519671300", "1828615045519671301", "1849007627789611009", "1828615036669689858", "1828615036669689859", "1828615036669689860");
|
||||||
|
for (BaseRole role : roleList) {
|
||||||
|
List<BaseAuthority> authorityList = baseAuthorityService.getRoleAuthorityList(new MapBuilder<String, Object>()
|
||||||
|
.put("roleId", role.getRoleId())
|
||||||
|
.build());
|
||||||
|
Set<String> aids = authorityList.stream().map(m -> Convert.toStr(m.getAuthorityId())).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||||
|
aids.addAll(authIds);
|
||||||
|
baseAuthorityService.addAuthorityRole(new MapBuilder<String, Object>()
|
||||||
|
.put("roleId", role.getRoleId())
|
||||||
|
.put("authorityIds", StrUtil.join(",", aids))
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.xmgl.constant.Cts;
|
import com.zhgd.xmgl.constant.Cts;
|
||||||
@ -10,14 +11,17 @@ import com.zhgd.xmgl.modules.basicdata.entity.BaseMenu;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.mapper.BaseAuthorityMapper;
|
import com.zhgd.xmgl.modules.basicdata.mapper.BaseAuthorityMapper;
|
||||||
import com.zhgd.xmgl.modules.basicdata.mapper.BaseAuthorityRoleMapper;
|
import com.zhgd.xmgl.modules.basicdata.mapper.BaseAuthorityRoleMapper;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseActionService;
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseActionService;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseAuthorityRoleService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseAuthorityService;
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseAuthorityService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseMenuService;
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseMenuService;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -32,6 +36,9 @@ import java.util.Map;
|
|||||||
public class BaseAuthorityServiceImpl extends ServiceImpl<BaseAuthorityMapper, BaseAuthority> implements IBaseAuthorityService {
|
public class BaseAuthorityServiceImpl extends ServiceImpl<BaseAuthorityMapper, BaseAuthority> implements IBaseAuthorityService {
|
||||||
public static final String MENU = "menu";
|
public static final String MENU = "menu";
|
||||||
public static final String ACTION = "action";
|
public static final String ACTION = "action";
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
IBaseAuthorityRoleService baseAuthorityRoleService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BaseAuthorityRoleMapper baseAuthorityRoleMapper;
|
private BaseAuthorityRoleMapper baseAuthorityRoleMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -67,6 +74,7 @@ public class BaseAuthorityServiceImpl extends ServiceImpl<BaseAuthorityMapper, B
|
|||||||
}
|
}
|
||||||
return baseAuthority;
|
return baseAuthority;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建权限对象
|
* 构建权限对象
|
||||||
*
|
*
|
||||||
@ -84,6 +92,7 @@ public class BaseAuthorityServiceImpl extends ServiceImpl<BaseAuthorityMapper, B
|
|||||||
}
|
}
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeAuthority(Long resourceId, String resourceType) {
|
public void removeAuthority(Long resourceId, String resourceType) {
|
||||||
QueryWrapper<BaseAuthority> queryWrapper = buildQueryWrapper(resourceId, resourceType);
|
QueryWrapper<BaseAuthority> queryWrapper = buildQueryWrapper(resourceId, resourceType);
|
||||||
@ -112,6 +121,7 @@ public class BaseAuthorityServiceImpl extends ServiceImpl<BaseAuthorityMapper, B
|
|||||||
roleQueryWrapper.lambda().eq(BaseAuthorityRole::getRoleId, roleId);
|
roleQueryWrapper.lambda().eq(BaseAuthorityRole::getRoleId, roleId);
|
||||||
baseAuthorityRoleMapper.delete(roleQueryWrapper);
|
baseAuthorityRoleMapper.delete(roleQueryWrapper);
|
||||||
BaseAuthorityRole authority = null;
|
BaseAuthorityRole authority = null;
|
||||||
|
List<BaseAuthorityRole> addAuths = new ArrayList<>();
|
||||||
String authorityIds = MapUtils.getString(map, "authorityIds");
|
String authorityIds = MapUtils.getString(map, "authorityIds");
|
||||||
if (authorityIds != null && authorityIds.length() > 0) {
|
if (authorityIds != null && authorityIds.length() > 0) {
|
||||||
for (String id : authorityIds.split(Cts.COMMA)) {
|
for (String id : authorityIds.split(Cts.COMMA)) {
|
||||||
@ -120,9 +130,12 @@ public class BaseAuthorityServiceImpl extends ServiceImpl<BaseAuthorityMapper, B
|
|||||||
authority.setAuthorityId(Long.valueOf(id));
|
authority.setAuthorityId(Long.valueOf(id));
|
||||||
authority.setRoleId(Long.valueOf(roleId));
|
authority.setRoleId(Long.valueOf(roleId));
|
||||||
// 批量添加授权
|
// 批量添加授权
|
||||||
baseAuthorityRoleMapper.insert(authority);
|
addAuths.add(authority);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (CollUtil.isNotEmpty(addAuths)) {
|
||||||
|
baseAuthorityRoleService.saveBatch(addAuths);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,7 @@ public class ConcreteMonitorCurrentDataServiceImpl extends ServiceImpl<ConcreteM
|
|||||||
String projectSn = dev.getProjectSn();
|
String projectSn = dev.getProjectSn();
|
||||||
if (concreteMonitorCurrentDataVo.getList().size() > 0) {
|
if (concreteMonitorCurrentDataVo.getList().size() > 0) {
|
||||||
for (ConcreteMonitorCurrentData currentData : concreteMonitorCurrentDataVo.getList()) {
|
for (ConcreteMonitorCurrentData currentData : concreteMonitorCurrentDataVo.getList()) {
|
||||||
if (NumberUtil.equals(currentData.getTemperature(), -100D)) {
|
if (currentData.getTemperature() == null || NumberUtil.equals(currentData.getTemperature(), -100D)) {
|
||||||
//忽略数据,-100这个是特殊数据,有两种情况,第一种就是没有插传感器,第二种就是传感器损坏。如果接收到-100这种数据,就判定为空数据。
|
//忽略数据,-100这个是特殊数据,有两种情况,第一种就是没有插传感器,第二种就是传感器损坏。如果接收到-100这种数据,就判定为空数据。
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -648,6 +648,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
workerInfoMapper.update(null, new LambdaUpdateWrapper<WorkerInfo>()
|
workerInfoMapper.update(null, new LambdaUpdateWrapper<WorkerInfo>()
|
||||||
|
.set(WorkerInfo::getDepartmentId, workerInfo.getDepartmentId())
|
||||||
.set(WorkerInfo::getBranchId, workerInfo.getBranchId())
|
.set(WorkerInfo::getBranchId, workerInfo.getBranchId())
|
||||||
.set(WorkerInfo::getProjectGroup, workerInfo.getProjectGroup())
|
.set(WorkerInfo::getProjectGroup, workerInfo.getProjectGroup())
|
||||||
.eq(WorkerInfo::getId, workerInfo.getId())
|
.eq(WorkerInfo::getId, workerInfo.getId())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user