Merge branch 'dev_20231101_TXSS' into 'dev_20230829_change'
Dev 20231101 txss See merge request laws-foton-slrs/foton-slrs-system-rest!136
This commit is contained in:
@@ -142,10 +142,10 @@ public class LoginRestController {
|
||||
if(userEO.getDisableFlag()==1){
|
||||
return Result.error("r0011", "帐号已禁用");
|
||||
}
|
||||
String position = userService.selectPositionByUserId(account);
|
||||
if(StringUtils.isBlank(position)){
|
||||
return Result.error("r0011", "无配置岗位");
|
||||
}
|
||||
// String position = userService.selectPositionByUserId(account);
|
||||
// if(StringUtils.isBlank(position)){
|
||||
// return Result.error("r0011", "无配置岗位");
|
||||
// }
|
||||
String token = jwtUtils.generateToken(userEO.getUsid());
|
||||
userEO.setToken(token);
|
||||
// 加密重要信息
|
||||
@@ -212,10 +212,10 @@ public class LoginRestController {
|
||||
if(userEO.getDisableFlag()==1){
|
||||
return Result.error("r0011", "帐号已禁用");
|
||||
}
|
||||
String position = userService.selectPositionByUserId(account);
|
||||
if(StringUtils.isBlank(position)){
|
||||
return Result.error("r0011", "无配置岗位");
|
||||
}
|
||||
// String position = userService.selectPositionByUserId(account);
|
||||
// if(StringUtils.isBlank(position)){
|
||||
// return Result.error("r0011", "无配置岗位");
|
||||
// }
|
||||
String token = jwtUtils.generateToken(userEO.getUsid());
|
||||
userEO.setToken(token);
|
||||
// 加密重要信息
|
||||
|
||||
@@ -208,6 +208,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
// 政策资料模板下载
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportTemplateFile");
|
||||
|
||||
// 标准体系列表导出
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarMenuStandardLimit/standardSystemListExport");
|
||||
|
||||
// // 添加自定义拦截器,并拦截对应 url
|
||||
addInterceptor.addPathPatterns("/**");
|
||||
}
|
||||
|
||||
+10
-8
@@ -5,12 +5,12 @@ import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.dao.FileMaterialDao;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import com.adc.da.slrs.tsRoleMeunData.service.ITsRoleMenuDataService;
|
||||
import com.adc.da.slrs.zlTree.service.IZlTreeService;
|
||||
import com.adc.da.sys.service.IUserRoleEOService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.management.Query;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -44,12 +45,11 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
|
||||
@Autowired
|
||||
private TsUserDao tsUserDao;
|
||||
@Autowired
|
||||
private ITsPositionService tsPositionService;
|
||||
@Autowired
|
||||
private ITsRoleMenuDataService iTsRoleMenuDataService;
|
||||
@Autowired
|
||||
private IZlTreeService zlTreeService;
|
||||
|
||||
@Resource
|
||||
private IUserRoleEOService userRoleEOService;
|
||||
|
||||
@Override
|
||||
public IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage) {
|
||||
@@ -63,8 +63,9 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
|
||||
// 获取当前登录人
|
||||
String loginUserId = LoginUserUtil.getUserId();
|
||||
|
||||
List<String> positionIds = tsUserDao.selectPositionIds(loginUserId);
|
||||
List<String> roleIds = tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds = tsUserDao.selectPositionIds(loginUserId);
|
||||
// List<String> roleIds = tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(loginUserId);
|
||||
QueryWrapper<TsRoleMenuData> wrapper = new QueryWrapper<>();
|
||||
wrapper.in("ROLE_ID", roleIds);
|
||||
List<TsRoleMenuData> tsRoleMenuData = iTsRoleMenuDataService.list(wrapper);
|
||||
@@ -105,8 +106,9 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
|
||||
userId = LoginUserUtil.getUserId();
|
||||
}
|
||||
|
||||
List<String> positionIds = tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds = tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds = tsUserDao.selectPositionIds(userId);
|
||||
// List<String> roleIds = tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
QueryWrapper<TsRoleMenuData> wrapper = new QueryWrapper<>();
|
||||
wrapper.in("ROLE_ID", roleIds);
|
||||
List<TsRoleMenuData> tsRoleMenuData = iTsRoleMenuDataService.list(wrapper);
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.controller;
|
||||
|
||||
import com.adc.da.slrs.roleReplacePosition.service.UserPositionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/11/14 13:46
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--角色替换岗位")
|
||||
@RequestMapping("/api/roleReplacePosition")
|
||||
public class RoleReplacePositionController {
|
||||
|
||||
@Resource
|
||||
private UserPositionService userPositionService;
|
||||
|
||||
/**
|
||||
* 角色替换岗位
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/start")
|
||||
public void roleReplacePosition() {
|
||||
userPositionService.roleReplacePosition();
|
||||
}
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.dao;
|
||||
|
||||
import com.adc.da.slrs.roleReplacePosition.domain.PositionRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【ts_position_role】的数据库操作Mapper
|
||||
* @createDate 2023-11-14 13:53:47
|
||||
* @Entity com.adc.da.slrs.roleReplacePosition.domain.PositionRole
|
||||
*/
|
||||
@Repository
|
||||
public interface PositionRoleMapper extends BaseMapper<PositionRole> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.dao;
|
||||
|
||||
import com.adc.da.slrs.roleReplacePosition.domain.UserPosition;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【ts_user_position】的数据库操作Mapper
|
||||
* @createDate 2023-11-14 13:49:37
|
||||
* @Entity com.adc.da.slrs.roleReplacePosition.domain.UserPosition
|
||||
*/
|
||||
@Repository
|
||||
public interface UserPositionMapper extends BaseMapper<UserPosition> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName ts_position_role
|
||||
*/
|
||||
@TableName(value ="ts_position_role")
|
||||
public class PositionRole implements Serializable {
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@TableId
|
||||
private String positionId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
public String getPositionId() {
|
||||
return positionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
public void setPositionId(String positionId) {
|
||||
this.positionId = positionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
PositionRole other = (PositionRole) that;
|
||||
return (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId()))
|
||||
&& (this.getPositionId() == null ? other.getPositionId() == null : this.getPositionId().equals(other.getPositionId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
|
||||
result = prime * result + ((getPositionId() == null) ? 0 : getPositionId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", roleId=").append(roleId);
|
||||
sb.append(", positionId=").append(positionId);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName ts_user_position
|
||||
*/
|
||||
@TableName(value ="ts_user_position")
|
||||
public class UserPosition implements Serializable {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private String positionId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
public String getPositionId() {
|
||||
return positionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
public void setPositionId(String positionId) {
|
||||
this.positionId = positionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
UserPosition other = (UserPosition) that;
|
||||
return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
|
||||
&& (this.getPositionId() == null ? other.getPositionId() == null : this.getPositionId().equals(other.getPositionId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
|
||||
result = prime * result + ((getPositionId() == null) ? 0 : getPositionId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", userId=").append(userId);
|
||||
sb.append(", positionId=").append(positionId);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.service;
|
||||
|
||||
import com.adc.da.slrs.roleReplacePosition.domain.PositionRole;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【ts_position_role】的数据库操作Service
|
||||
* @createDate 2023-11-14 13:53:47
|
||||
*/
|
||||
public interface PositionRoleService extends IService<PositionRole> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.service;
|
||||
|
||||
import com.adc.da.slrs.roleReplacePosition.domain.UserPosition;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【ts_user_position】的数据库操作Service
|
||||
* @createDate 2023-11-14 13:49:37
|
||||
*/
|
||||
public interface UserPositionService extends IService<UserPosition> {
|
||||
|
||||
void roleReplacePosition();
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.adc.da.slrs.roleReplacePosition.domain.PositionRole;
|
||||
import com.adc.da.slrs.roleReplacePosition.service.PositionRoleService;
|
||||
import com.adc.da.slrs.roleReplacePosition.dao.PositionRoleMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【ts_position_role】的数据库操作Service实现
|
||||
* @createDate 2023-11-14 13:53:47
|
||||
*/
|
||||
@Service
|
||||
public class PositionRoleServiceImpl extends ServiceImpl<PositionRoleMapper, PositionRole>
|
||||
implements PositionRoleService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.adc.da.slrs.roleReplacePosition.service.impl;
|
||||
|
||||
import com.adc.da.slrs.roleReplacePosition.domain.PositionRole;
|
||||
import com.adc.da.slrs.roleReplacePosition.service.PositionRoleService;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.sys.service.IUserRoleEOService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.adc.da.slrs.roleReplacePosition.domain.UserPosition;
|
||||
import com.adc.da.slrs.roleReplacePosition.service.UserPositionService;
|
||||
import com.adc.da.slrs.roleReplacePosition.dao.UserPositionMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【ts_user_position】的数据库操作Service实现
|
||||
* @createDate 2023-11-14 13:49:37
|
||||
*/
|
||||
@Service
|
||||
public class UserPositionServiceImpl extends ServiceImpl<UserPositionMapper, UserPosition>
|
||||
implements UserPositionService{
|
||||
|
||||
@Resource
|
||||
private PositionRoleService positionRoleService;
|
||||
|
||||
@Resource
|
||||
private IUserRoleEOService userRoleEOService;
|
||||
|
||||
@Override
|
||||
public void roleReplacePosition() {
|
||||
// 找到所有对应关系
|
||||
List<UserPosition> userPositions = this.list();
|
||||
|
||||
// 转换对应关系
|
||||
Map<String, List<PositionRole>> positionRoleMap = positionRoleService.list().stream()
|
||||
.collect(Collectors.groupingBy(PositionRole::getPositionId));
|
||||
|
||||
Set<UserRoleEO> userRoleEOSet = new HashSet<>();
|
||||
for (UserPosition userPosition : userPositions) {
|
||||
// 去除空指针异常
|
||||
if (positionRoleMap.get(userPosition.getPositionId()) == null) {
|
||||
continue;
|
||||
}
|
||||
List<String> roleIds = positionRoleMap.get(userPosition.getPositionId()).stream()
|
||||
.map(PositionRole::getRoleId).collect(Collectors.toList());
|
||||
for (String roleId : roleIds) {
|
||||
UserRoleEO userRoleEO = new UserRoleEO();
|
||||
userRoleEO.setUserId(userPosition.getUserId());
|
||||
userRoleEO.setRoleId(roleId);
|
||||
userRoleEOSet.add(userRoleEO);
|
||||
}
|
||||
}
|
||||
// 保存对应关系
|
||||
// 先找出所有用户角色,然后和构建好的用户角色去重后再进行添加,避免出现多条重复数据
|
||||
List<UserRoleEO> userRoleEOList = userRoleEOService.list();
|
||||
userRoleEOList.forEach(userRoleEOSet::remove);
|
||||
userRoleEOService.saveBatch(userRoleEOSet, userRoleEOSet.size());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+1
@@ -37,4 +37,5 @@ public interface SarBussStandMenuDao extends BaseMapper<SarBussStandMenu> {
|
||||
|
||||
int updateMenuidByMenuid (@Param("oldMenuid") String oldMenuid ,@Param("newMenuid") String newMenuid);
|
||||
|
||||
List<SarBussStandMenu> getESStandMenu();
|
||||
}
|
||||
|
||||
+3
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarBussionessStand.dao;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.OldSystem;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStandExport;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.StandSystemDTO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
@@ -138,5 +139,7 @@ public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
|
||||
List<SarBussionessStand> selectAllStandStatus();
|
||||
|
||||
String selectMaxStandSn(String standSort);
|
||||
|
||||
List<StandSystemDTO> getESSystemData(@Param("param") StandSystemDTO standSystemDTO);
|
||||
}
|
||||
|
||||
|
||||
+39
-14
@@ -1,34 +1,38 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.StandSystemDTO;
|
||||
import com.adc.da.slrs.sarMenuStandard.service.ISarMenuStandardNewService;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--标准法规库-菜单标准体系")
|
||||
@RequestMapping("/${restPath}/lawss/sarMenuStandardLimit")
|
||||
@Slf4j
|
||||
public class SarMenuStandardNewController extends BaseController<SarMenuStandardNew> {
|
||||
|
||||
@Autowired
|
||||
@@ -39,16 +43,16 @@ public class SarMenuStandardNewController extends BaseController<SarMenuStandard
|
||||
|
||||
@ApiOperation("查询当前节点所有关联上级")
|
||||
@GetMapping("/getTopMenu")
|
||||
public ResponseMessage<String> getTopMenu(SarMenuStandardNew sarMenuStandardNew){
|
||||
String tsResources= iSarMenuStandardNewService.getTopMenu(sarMenuStandardNew);
|
||||
public ResponseMessage<String> getTopMenu(SarMenuStandardNew sarMenuStandardNew) {
|
||||
String tsResources = iSarMenuStandardNewService.getTopMenu(sarMenuStandardNew);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@ApiOperation("查询有权限资源")
|
||||
@GetMapping("/getListStandLimit")
|
||||
public ResponseMessage<List<SarMenuStandard>> getListStandLimit(SarMenuStandardNew sarMenuStandardNew){
|
||||
public ResponseMessage<List<SarMenuStandard>> getListStandLimit(SarMenuStandardNew sarMenuStandardNew) {
|
||||
List<String> access = tsUserService.getResourceUserId(LoginUserUtil.getUserId());
|
||||
List<SarMenuStandard> tsResources= iSarMenuStandardNewService.getListStandLimit(sarMenuStandardNew,access);
|
||||
List<SarMenuStandard> tsResources = iSarMenuStandardNewService.getListStandLimit(sarMenuStandardNew, access);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@@ -64,7 +68,7 @@ public class SarMenuStandardNewController extends BaseController<SarMenuStandard
|
||||
|
||||
@ApiOperation("根据菜单ID查询菜单")
|
||||
@GetMapping("/getMenuStandardById")
|
||||
public ResponseMessage<SarMenuStandard> getMenuStandardById(@RequestParam String menuId){
|
||||
public ResponseMessage<SarMenuStandard> getMenuStandardById(@RequestParam String menuId) {
|
||||
if (StringUtils.isBlank(menuId)) {
|
||||
return Result.error("获取失败,菜单ID为空");
|
||||
}
|
||||
@@ -86,6 +90,27 @@ public class SarMenuStandardNewController extends BaseController<SarMenuStandard
|
||||
if (StringUtils.isBlank(menuId)) {
|
||||
return Result.error("删除失败,菜单ID为空");
|
||||
}
|
||||
return Result.success(iSarMenuStandardNewService.deleteMenuStandard(menuId));
|
||||
iSarMenuStandardNewService.deleteMenuStandard(menuId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("体系搜索三层树")
|
||||
@GetMapping("/standardSystemTree")
|
||||
public ResponseMessage<?> standardSystemTree() {
|
||||
return Result.success(iSarMenuStandardNewService.standardSystemTree());
|
||||
}
|
||||
|
||||
@ApiOperation("法规弹窗列表")
|
||||
@PostMapping("/standardSystemList")
|
||||
public ResponseMessage<?> standardSystemList(@RequestBody StandSystemDTO standSystemDTO) {
|
||||
return Result.success(iSarMenuStandardNewService.standardSystemList(standSystemDTO));
|
||||
}
|
||||
|
||||
@ApiOperation("法规列表弹窗Excel导出")
|
||||
@GetMapping("/standardSystemListExport")
|
||||
public ResponseMessage<?> standardSystemListExport(StandSystemDTO standSystemDTO,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
iSarMenuStandardNewService.standardSystemListExport(standSystemDTO, response, request);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.entity;
|
||||
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/11/15 17:36
|
||||
*/
|
||||
public enum StandCategoryEnum {
|
||||
// INLAND 类型的枚举实例
|
||||
INLAND_GB("INLAND", "GB", 0),
|
||||
INLAND_GBT("INLAND", "GB/T", 1),
|
||||
INLAND_QCT("INLAND", "QC/T", 2),
|
||||
INLAND_JT("INLAND", "JT", 3),
|
||||
INLAND_JB("INLAND", "JB", 4),
|
||||
INLAND_GA("INLAND", "GA", 5),
|
||||
INLAND_GJB("INLAND", "GJB", 6),
|
||||
INLAND_HJ("INLAND", "HJ", 7),
|
||||
|
||||
// FOREIGN 类型的枚举实例
|
||||
FOREIGN_ECE("FOREIGN", "ECE", 0),
|
||||
FOREIGN_EU("FOREIGN", "EU", 1),
|
||||
FOREIGN_EC("FOREIGN", "EC", 2),
|
||||
FOREIGN_EEC("FOREIGN", "EEC", 3),
|
||||
FOREIGN_ISO("FOREIGN", "ISO", 4),
|
||||
FOREIGN_IEC("FOREIGN", "IEC", 5),
|
||||
FOREIGN_GTR("FOREIGN", "GTR", 6),
|
||||
FOREIGN_CFR("FOREIGN", "CFR", 7),
|
||||
FOREIGN_JASO("FOREIGN", "JASO", 8),
|
||||
FOREIGN_JIS("FOREIGN", "JIS", 9),
|
||||
FOREIGN_GSO("FOREIGN", "GSO", 10),
|
||||
FOREIGN_GOST("FOREIGN", "GOST", 11),
|
||||
FOREIGN_ΓOCT("FOREIGN", "ΓOCT", 12),
|
||||
FOREIGN_TP("FOREIGN", "TP", 13),
|
||||
FOREIGN_SASO("FOREIGN", "SASO", 14),
|
||||
FOREIGN_UAE("FOREIGN", "UAE", 15),
|
||||
FOREIGN_CONTRAN("FOREIGN", "CONTRAN", 16),
|
||||
FOREIGN_DENATRAN("FOREIGN", "DENATRAN", 17),
|
||||
FOREIGN_ABNT_NBR("FOREIGN", "ABNT NBR", 18),
|
||||
FOREIGN_NBR("FOREIGN", "NBR", 19),
|
||||
FOREIGN_INMETRO("FOREIGN", "INMETRO", 20),
|
||||
FOREIGN_CONAMA("FOREIGN", "CONAMA", 21),
|
||||
FOREIGN_Normative_Instruction("FOREIGN", "Normative Instruction", 22),
|
||||
FOREIGN_ADR("FOREIGN", "ADR", 23),
|
||||
;
|
||||
|
||||
private final String standType;
|
||||
private final String standSort;
|
||||
private final int sortValue;
|
||||
|
||||
StandCategoryEnum(String standType, String standSort, int sortValue) {
|
||||
this.standType = standType;
|
||||
this.standSort = standSort;
|
||||
this.sortValue = sortValue;
|
||||
}
|
||||
|
||||
// 根据 standSort 返回 value 的静态方法
|
||||
public static int getSortByStandType(String standType, String standSort) {
|
||||
for (StandCategoryEnum category : StandCategoryEnum.values()) {
|
||||
if (category.getStandType().equals(standType) && category.getStandSort().equals(standSort)) {
|
||||
return category.getSortValue();
|
||||
}
|
||||
// 给国标 外标默认值
|
||||
if (category.getStandType().equals("INLAND")) {
|
||||
return 8;
|
||||
} else if (category.getStandType().equals("FOREIGN")) {
|
||||
return 24;
|
||||
}
|
||||
}
|
||||
throw new AdcDaBaseException("标准类型错误");
|
||||
}
|
||||
|
||||
// Getter 方法
|
||||
public String getStandType() {
|
||||
return standType;
|
||||
}
|
||||
|
||||
public String getStandSort() {
|
||||
return standSort;
|
||||
}
|
||||
|
||||
public int getSortValue() {
|
||||
return sortValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/11/14 17:20
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class StandSystemDTO {
|
||||
|
||||
@ApiModelProperty(value = "节点Id")
|
||||
private String menuId;
|
||||
|
||||
@Excel(name = "体系结构", width = 40, orderNum = "1")
|
||||
@ApiModelProperty(value = "体系结构")
|
||||
private String standSystem;
|
||||
|
||||
@ApiModelProperty(value = "标准Id")
|
||||
private String standId;
|
||||
|
||||
@Excel(name = "标准编号", width = 25, orderNum = "2")
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
private String standNo;
|
||||
|
||||
@Excel(name = "标准名称", width = 25, orderNum = "3")
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
private String standName;
|
||||
|
||||
@ApiModelProperty(value = "标准状态")
|
||||
private String standState;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "开始发布日期")
|
||||
private Date startReleaseDate;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "开始发布日期字符串")
|
||||
private String startReleaseDateString;
|
||||
|
||||
@Excel(name = "发布日期", width = 25, orderNum = "4", exportFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
private Date releaseDate;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "结束发布日期")
|
||||
private Date endReleaseDate;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "结束发布日期字符串")
|
||||
private String endReleaseDateString;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "开始实施日期")
|
||||
private Date startImplementDate;
|
||||
|
||||
@Excel(name = "实施日期", width = 25, orderNum = "5", exportFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
private Date implementDate;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "结束实施日期")
|
||||
private Date endImplementDate;
|
||||
|
||||
@Excel(name = "代替标准", width = 25, orderNum = "5")
|
||||
@ApiModelProperty(value = "代替标准")
|
||||
private String replaceStandardNo;
|
||||
|
||||
@Excel(name = "编制单位", width = 25, orderNum = "5")
|
||||
@ApiModelProperty(value = "编制单位")
|
||||
private String dept;
|
||||
|
||||
@Excel(name = "起草人", width = 25, orderNum = "5")
|
||||
@ApiModelProperty(value = "起草人")
|
||||
private String draftUserName;
|
||||
|
||||
@Excel(name = "数据来源", width = 25, orderNum = "5")
|
||||
@ApiModelProperty(value = "数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ApiModelProperty(value = "排序字段")
|
||||
private String sortField;
|
||||
|
||||
@ApiModelProperty(value = "排序规则")
|
||||
private String sortMode;
|
||||
|
||||
@ApiModelProperty(value = "标准类型(数据排序用)")
|
||||
private String standSort;
|
||||
|
||||
private String selectIds;
|
||||
|
||||
private List<String> selectIdList;
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private int page;
|
||||
|
||||
@ApiModelProperty(value = "每页数量")
|
||||
private int pageSize;
|
||||
|
||||
@ApiModelProperty(value = "体系排序顺序号")
|
||||
private int systemSort;
|
||||
|
||||
@ApiModelProperty(value = "国标外表企标排序号")
|
||||
private int standTypeSort;
|
||||
|
||||
@ApiModelProperty(value = "标准类别排序号")
|
||||
private int standCategorySort;
|
||||
|
||||
@ApiModelProperty(value = "相关联的节点ID列表(数据库查询用)")
|
||||
private List<String> menuIdList;
|
||||
|
||||
@ApiModelProperty(value = "导出文件名称")
|
||||
private String exportName;
|
||||
|
||||
public void setSelectIds(String selectIds) {
|
||||
this.selectIds = selectIds;
|
||||
this.selectIdList = java.util.Arrays.asList(selectIds.split(","));
|
||||
}
|
||||
|
||||
public void setStartReleaseDate(Date startReleaseDate) {
|
||||
this.startReleaseDate = startReleaseDate;
|
||||
if (startReleaseDate != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
this.startReleaseDateString = sdf.format(startReleaseDate);
|
||||
}
|
||||
}
|
||||
|
||||
public void setEndReleaseDate(Date endReleaseDate) {
|
||||
this.endReleaseDate = endReleaseDate;
|
||||
if (endReleaseDate != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
this.endReleaseDateString = sdf.format(endReleaseDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
-1
@@ -1,9 +1,13 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.service;
|
||||
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.StandSystemDTO;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -26,7 +30,13 @@ public interface ISarMenuStandardNewService extends IService<SarMenuStandardNew>
|
||||
|
||||
Integer updateMenuStandard(SarMenuStandardNew sarMenuStandardNew);
|
||||
|
||||
Integer deleteMenuStandard(String menuId);
|
||||
void deleteMenuStandard(String menuId);
|
||||
|
||||
SarMenuStandard getMenuStandardById(String menuId);
|
||||
|
||||
List<SarMenuStandard> standardSystemTree();
|
||||
|
||||
IPage<StandSystemDTO> standardSystemList(StandSystemDTO standSystemDTO);
|
||||
|
||||
void standardSystemListExport(StandSystemDTO standSystemDTO, HttpServletResponse response, HttpServletRequest request);
|
||||
}
|
||||
|
||||
+271
-5
@@ -1,22 +1,54 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.scheduled.dao.SarStandardInfoDao;
|
||||
import com.adc.da.slrs.sarBussStandMenu.dao.SarBussStandMenuDao;
|
||||
import com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu;
|
||||
import com.adc.da.slrs.sarBussStandMenu.service.ISarBussStandMenuService;
|
||||
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
|
||||
import com.adc.da.slrs.sarMenuStandard.dao.SarMenuStandardNewDao;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.StandCategoryEnum;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.StandSystemDTO;
|
||||
import com.adc.da.slrs.sarMenuStandard.service.ISarMenuStandardNewService;
|
||||
import com.adc.da.slrs.sarResource.dao.TsResourceDao;
|
||||
import com.adc.da.slrs.sarRole.dao.TsRoleDao;
|
||||
import com.adc.da.slrs.sarStandMenu.dao.SarStandMenuDao;
|
||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||
import com.adc.da.slrs.sarStandMenu.service.ISarStandMenuService;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
|
||||
import com.adc.da.sys.sarMenuStandard.dao.SarMenuStandardDao;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.StandMenuRelation;
|
||||
import com.adc.da.sys.util.BeanCopyUtils;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -28,6 +60,7 @@ import java.util.stream.Collectors;
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandardNewDao, SarMenuStandardNew> implements ISarMenuStandardNewService {
|
||||
|
||||
@@ -37,7 +70,22 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
private TsRoleDao tsRoleDao;
|
||||
@Resource
|
||||
private TsResourceDao resourceDao;
|
||||
@Resource
|
||||
private ISarStandMenuService sarStandMenuService;
|
||||
@Resource
|
||||
private ISarBussStandMenuService sarBussStandMenuService;
|
||||
@Resource
|
||||
private SarStandMenuDao sarStandMenuDao;
|
||||
@Resource
|
||||
private SarStandardInfoDao sarStandardInfoDao;
|
||||
@Resource
|
||||
private SarBussionessStandDao sarBussionessStandDao;
|
||||
|
||||
@Resource
|
||||
private ITsDicTypeService dicItemService;
|
||||
|
||||
@Resource
|
||||
private SarBussStandMenuDao sarBussStandMenuDao;
|
||||
|
||||
@Override
|
||||
public String getTopMenu(SarMenuStandardNew sarMenuStandardNew){
|
||||
@@ -112,6 +160,211 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
return sarMenuStandard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarMenuStandard> standardSystemTree() {
|
||||
// 构造树
|
||||
List<SarMenuStandard> TsResources;
|
||||
QueryWrapper<SarMenuStandard> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("DIC_ID", "9m4qqqaansxmox5e82zm");
|
||||
queryWrapper.eq("VALID_FLAG", 0);
|
||||
queryWrapper.isNull("PARENT_ID");
|
||||
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
TsResources = dao.selectList(queryWrapper);
|
||||
|
||||
for (SarMenuStandard resource : TsResources) {
|
||||
resource.setTreeType("sarMs");
|
||||
QueryWrapper<SarMenuStandard> TsResourceQueryWrapper = new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.like("PARENT_IDS", resource.getId());
|
||||
TsResourceQueryWrapper.eq("VALID_FLAG", 0);
|
||||
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<SarMenuStandard> children = dao.selectList(TsResourceQueryWrapper);
|
||||
resource.setChildren(recursionGetListChildrenStand((resource), (children)));
|
||||
}
|
||||
// 把所有关联表中的数据拉出来
|
||||
// 国标
|
||||
List<SarStandMenu> gbStandMenu = sarStandMenuDao.getGBStandMenu().stream().filter(item -> item.getStandId() != null).collect(Collectors.toList());
|
||||
List<StandMenuRelation> gbRelations = BeanCopyUtils.copyBeanList(gbStandMenu, StandMenuRelation.class);
|
||||
|
||||
// 外标
|
||||
List<SarStandMenu> fbStandMenu = sarStandMenuDao.getFBStandMenu().stream().filter(item -> item.getStandId() != null).collect(Collectors.toList());;
|
||||
List<StandMenuRelation> fbRelations = BeanCopyUtils.copyBeanList(fbStandMenu, StandMenuRelation.class);
|
||||
|
||||
// 企标
|
||||
List<SarBussStandMenu> esStandMenu = sarBussStandMenuDao.getESStandMenu().stream().filter(item -> item.getBussStandId() != null).collect(Collectors.toList());
|
||||
List<StandMenuRelation> esRelations = new ArrayList<>();
|
||||
for (SarBussStandMenu s : esStandMenu) {
|
||||
StandMenuRelation standMenuRelation = new StandMenuRelation(s.getBussStandId(), s.getMenuId());
|
||||
esRelations.add(standMenuRelation);
|
||||
}
|
||||
// 计算每个节点的数值
|
||||
TsResources.get(0).calculateAndSetCounts(gbRelations, fbRelations, esRelations, 0);
|
||||
// 拼接返回
|
||||
return TsResources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<StandSystemDTO> standardSystemList(StandSystemDTO standSystemDTO) {
|
||||
boolean select = standSystemDTO.getSelectIdList() != null;
|
||||
String menuId = standSystemDTO.getMenuId();
|
||||
// 校验menuId不能为空
|
||||
if (StringUtils.isBlank(menuId)) {
|
||||
throw new AdcDaBaseException("menuId不能为空");
|
||||
}
|
||||
|
||||
// 体系树
|
||||
SarMenuStandard sarMenuStandard = this.standardSystemTree().get(0);
|
||||
|
||||
// 找到menuId对应的节点
|
||||
SarMenuStandard targetNode = SarMenuStandard.findNodeById(sarMenuStandard, menuId);
|
||||
|
||||
// 收集目标节点及其所有子节点的ID
|
||||
List<String> childIds = new ArrayList<>();
|
||||
targetNode.collectChildIds(childIds);
|
||||
standSystemDTO.setMenuIdList(childIds);
|
||||
if (!select) {
|
||||
standSystemDTO.setSelectIdList(targetNode.getGbStandIdList());
|
||||
}
|
||||
// 查国标
|
||||
Set<StandSystemDTO> gbList = new HashSet<>(sarStandMenuDao.getStandInfoSystemData(standSystemDTO, "INLAND"));
|
||||
if (!select) {
|
||||
standSystemDTO.setSelectIdList(targetNode.getFbStandIdList());
|
||||
}
|
||||
// 查外标
|
||||
Set<StandSystemDTO> fbList = new HashSet<>(sarStandMenuDao.getStandInfoSystemData(standSystemDTO, "FOREIGN"));
|
||||
if (!select) {
|
||||
standSystemDTO.setSelectIdList(targetNode.getEsStandIdList());
|
||||
}
|
||||
// 查企标
|
||||
Set<StandSystemDTO> esList = new HashSet<>(sarBussionessStandDao.getESSystemData(standSystemDTO));
|
||||
// 数据转换后整合
|
||||
List<StandSystemDTO> resultList = new ArrayList<>();
|
||||
resultList.addAll(gbList);
|
||||
resultList.addAll(fbList);
|
||||
resultList.addAll(esList);
|
||||
|
||||
// 构造体系路径映射
|
||||
Map<String, String> pathMap = new HashMap<>();
|
||||
sarMenuStandard.buildPathMap(pathMap, "");
|
||||
|
||||
// 为树设置systemSort
|
||||
SarMenuStandard.setSystemSort(sarMenuStandard, "");
|
||||
|
||||
// 国标外标标准状态字典
|
||||
List<TsDicType> gbStateDictList = dicItemService.selectAllDicTypeNameByDicCode("STANDSTATE");
|
||||
// 企标标准状态字典
|
||||
List<TsDicType> esStateDictList = dicItemService.selectAllDicTypeNameByDicCode("TEXTSTATUSBUSS");
|
||||
|
||||
// 构造体系路径 && 设置标准内部类别排序号 && 翻译
|
||||
for (StandSystemDTO dto : resultList) {
|
||||
String fullPath = pathMap.get(dto.getMenuId());
|
||||
dto.setStandSystem(fullPath);
|
||||
dto.setStandCategorySort(StandCategoryEnum.getSortByStandType(dto.getDataSource(), dto.getStandSort()));
|
||||
// 设置体系排序号
|
||||
SarMenuStandard node = SarMenuStandard.findNodeById(targetNode, dto.getMenuId());
|
||||
dto.setSystemSort(node.getSystemSort());
|
||||
// 翻译
|
||||
this.translateStandardSystemDTO(dto, gbStateDictList, esStateDictList);
|
||||
}
|
||||
|
||||
// 根据排序字段对 resultList 进行排序
|
||||
// 按照标准体系排序
|
||||
// 体系内部按照国内/海外/企业排序
|
||||
// 每个类别的标准内部按照类别排序
|
||||
resultList.sort(Comparator.comparingInt(StandSystemDTO::getSystemSort)
|
||||
.thenComparingInt(StandSystemDTO::getStandTypeSort)
|
||||
.thenComparingInt(StandSystemDTO::getStandCategorySort));
|
||||
// 两个时间排序
|
||||
String sortField = standSystemDTO.getSortField();
|
||||
if (StringUtils.isNotBlank(sortField)) {
|
||||
String sortMode = standSystemDTO.getSortMode();
|
||||
if (sortField.equals("releaseDate") && sortMode.equals("desc")) {
|
||||
resultList.sort(Comparator.comparing(StandSystemDTO::getStartImplementDate));
|
||||
} else {
|
||||
resultList.sort(Comparator.comparing(StandSystemDTO::getStartImplementDate).reversed());
|
||||
}
|
||||
if (sortField.equals("implementDate") && sortMode.equals("desc")) {
|
||||
resultList.sort(Comparator.comparing(StandSystemDTO::getStartImplementDate));
|
||||
} else {
|
||||
resultList.sort(Comparator.comparing(StandSystemDTO::getStartImplementDate).reversed());
|
||||
}
|
||||
}
|
||||
|
||||
// 手动分页
|
||||
int pageNum = standSystemDTO.getPage();
|
||||
int pageSize = standSystemDTO.getPageSize();
|
||||
|
||||
// 计算总页数
|
||||
int total = resultList.size();
|
||||
int totalPages = (total + pageSize - 1) / pageSize;
|
||||
|
||||
// 计算当前页应该显示的数据的起始和结束索引
|
||||
int start = (pageNum - 1) * pageSize;
|
||||
int end = Math.min(start + pageSize, total);
|
||||
|
||||
// 获取当前页面的数据
|
||||
List<StandSystemDTO> pageList = resultList.subList(start, end);
|
||||
|
||||
// 使用MyBatis Plus的Page类来构造分页对象
|
||||
Page<StandSystemDTO> page = new Page<>(pageNum, pageSize, total);
|
||||
page.setRecords(pageList); // 设置当前页面的记录
|
||||
page.setTotal(total); // 设置总记录数
|
||||
page.setPages(totalPages); // 设置总页数
|
||||
return page;
|
||||
}
|
||||
|
||||
private void translateStandardSystemDTO(StandSystemDTO dto, List<TsDicType> gbStateDictList, List<TsDicType> esStateDictList) {
|
||||
// 翻译数据来源、标准状态
|
||||
switch (dto.getDataSource()) {
|
||||
case "INLAND":
|
||||
dto.setDataSource("国内标准库");
|
||||
dto.setStandState(gbStateDictList.stream()
|
||||
.filter(dict -> dict.getDicTypeCode().equals(dto.getStandState()))
|
||||
.findFirst().orElse(new TsDicType()).getDicTypeName());
|
||||
break;
|
||||
case "FOREIGN":
|
||||
dto.setDataSource("海外标准库");
|
||||
dto.setStandState(gbStateDictList.stream()
|
||||
.filter(dict -> dict.getDicTypeCode().equals(dto.getStandState()))
|
||||
.findFirst().orElse(new TsDicType()).getDicTypeName());
|
||||
break;
|
||||
case "ENTERPRISE":
|
||||
dto.setDataSource("企业标准库");
|
||||
dto.setStandState(esStateDictList.stream()
|
||||
.filter(dict -> dict.getDicTypeCode().equals(dto.getStandState()))
|
||||
.findFirst().orElse(new TsDicType()).getDicTypeName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void standardSystemListExport(StandSystemDTO standSystemDTO, HttpServletResponse response, HttpServletRequest request) {
|
||||
OutputStream os = null;
|
||||
Workbook workbook;
|
||||
List<StandSystemDTO> dataList;
|
||||
standSystemDTO.setPage(1);
|
||||
standSystemDTO.setPageSize(Integer.MAX_VALUE);
|
||||
try {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(standSystemDTO.getExportName()+".xlsx",
|
||||
request));
|
||||
// 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出
|
||||
IPage<StandSystemDTO> page = this.standardSystemList(standSystemDTO);
|
||||
dataList = page.getRecords();
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setSheetName(standSystemDTO.getExportName());
|
||||
workbook = ExcelExportUtil.exportExcel(exportParams, StandSystemDTO.class, dataList);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateMenuStandard(SarMenuStandardNew sarMenuStandardNew) {
|
||||
SarMenuStandard menuStandarddb = dao.selectById(sarMenuStandardNew.getId());
|
||||
@@ -122,12 +375,25 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
return dao.updateById(menuStandarddb);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Integer deleteMenuStandard(String menuId) {
|
||||
SarMenuStandard menuStandard = new SarMenuStandard();
|
||||
menuStandard.setId(menuId);
|
||||
menuStandard.setValidFlag(1);
|
||||
return dao.updateById(menuStandard);
|
||||
public void deleteMenuStandard(String menuId) {
|
||||
// 删除主表中的节点
|
||||
LambdaUpdateWrapper<SarMenuStandard> menuUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
menuUpdateWrapper.eq(SarMenuStandard::getId, menuId);
|
||||
this.dao.delete(menuUpdateWrapper);
|
||||
log.info("删除主表中的节点成功");
|
||||
// 删除国标外标体系关联关系
|
||||
LambdaUpdateWrapper<SarStandMenu> gbWrapper = new LambdaUpdateWrapper<>();
|
||||
gbWrapper.eq(SarStandMenu::getMenuId, menuId);
|
||||
sarStandMenuService.remove(gbWrapper);
|
||||
log.info("删除国标外标主表中的相应字段成功");
|
||||
// 删除企标体系关联关系
|
||||
LambdaUpdateWrapper<SarBussStandMenu> esWrapper = new LambdaUpdateWrapper<>();
|
||||
esWrapper.eq(SarBussStandMenu::getMenuId, menuId);
|
||||
sarBussStandMenuService.remove(esWrapper);
|
||||
log.info("删除企标主表中的相应字段成功");
|
||||
// TODO 理论上这里应该删除国标外标企标主表中的中文字段
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,20 +72,20 @@ public interface TsPositionDao extends BaseMapper<TsPosition> {
|
||||
Integer countPositionAndRole(TsPosition tsPosition);
|
||||
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
||||
// /**
|
||||
// * 通过岗位列表查询绑定的角色列表
|
||||
// * @param positionIds:岗位列表
|
||||
// * @return List<String>
|
||||
// */
|
||||
// List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
||||
|
||||
long pageTotal();
|
||||
|
||||
/**
|
||||
* 通过roleId查询岗位ID列表
|
||||
* @param roleId:角色ID
|
||||
* @return List<String>
|
||||
*/
|
||||
@Select("select position_id from ts_position_role where role_id=#{roleId}")
|
||||
List<String> getPositionIdsByRoleId(String roleId);
|
||||
// /**
|
||||
// * 通过roleId查询岗位ID列表
|
||||
// * @param roleId:角色ID
|
||||
// * @return List<String>
|
||||
// */
|
||||
// @Select("select position_id from ts_position_role where role_id=#{roleId}")
|
||||
// List<String> getPositionIdsByRoleId(String roleId);
|
||||
}
|
||||
|
||||
+13
-13
@@ -67,17 +67,17 @@ public interface ITsPositionService extends IService<TsPosition> {
|
||||
*/
|
||||
ResponseMessage<Object> deletePosition(String positionId);
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
||||
|
||||
/**
|
||||
* 通过roleId查询岗位ID列表
|
||||
* @param roleId:角色ID
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getPositionIdsByRoleId(String roleId);
|
||||
// /**
|
||||
// * 通过岗位列表查询绑定的角色列表
|
||||
// * @param positionIds:岗位列表
|
||||
// * @return List<String>
|
||||
// */
|
||||
// List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
||||
//
|
||||
// /**
|
||||
// * 通过roleId查询岗位ID列表
|
||||
// * @param roleId:角色ID
|
||||
// * @return List<String>
|
||||
// */
|
||||
// List<String> getPositionIdsByRoleId(String roleId);
|
||||
}
|
||||
|
||||
+21
-21
@@ -195,26 +195,26 @@ public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
* @return List<String>
|
||||
*/
|
||||
@Override
|
||||
public List<String> getRoleIdsByPositionIds(List<String> positionIds) {
|
||||
if(positionIds!=null&&positionIds.size()>0){
|
||||
return tsPositionDao.getRoleIdsByPositionIds(positionIds);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// /**
|
||||
// * 通过岗位列表查询绑定的角色列表
|
||||
// * @param positionIds:岗位列表
|
||||
// * @return List<String>
|
||||
// */
|
||||
// @Override
|
||||
// public List<String> getRoleIdsByPositionIds(List<String> positionIds) {
|
||||
// if(positionIds!=null&&positionIds.size()>0){
|
||||
// return tsPositionDao.getRoleIdsByPositionIds(positionIds);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 通过roleId查询岗位ID列表
|
||||
* @param roleId:角色ID
|
||||
* @return List<String>
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPositionIdsByRoleId(String roleId) {
|
||||
return tsPositionDao.getPositionIdsByRoleId(roleId);
|
||||
}
|
||||
// /**
|
||||
// * 通过roleId查询岗位ID列表
|
||||
// * @param roleId:角色ID
|
||||
// * @return List<String>
|
||||
// */
|
||||
// @Override
|
||||
// public List<String> getPositionIdsByRoleId(String roleId) {
|
||||
// return tsPositionDao.getPositionIdsByRoleId(roleId);
|
||||
// }
|
||||
}
|
||||
|
||||
+4
-4
@@ -163,10 +163,10 @@ public class TsRoleServiceImpl extends ServiceImpl<TsRoleDao, TsRole> implements
|
||||
if(childrenRole!=null&&childrenRole.size()>0){
|
||||
return Result.error("该角色有下属角色,无法删除");
|
||||
}
|
||||
List<String> positionIds=tsRoleDao.getPositionIds(roleId);
|
||||
if(positionIds!=null&&positionIds.size()>0){
|
||||
return Result.error("该角色已绑定岗位,无法删除");
|
||||
}
|
||||
// List<String> positionIds=tsRoleDao.getPositionIds(roleId);
|
||||
// if(positionIds!=null&&positionIds.size()>0){
|
||||
// return Result.error("该角色已绑定岗位,无法删除");
|
||||
// }
|
||||
tsRoleDao.deleteById(roleId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.adc.da.slrs.sarStandMenu.dao;
|
||||
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.StandSystemDTO;
|
||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -31,4 +33,9 @@ public interface SarStandMenuDao extends BaseMapper<SarStandMenu> {
|
||||
|
||||
List<SarStandMenu> getMenuByStandId(SarStandMenu sarStandMenu);
|
||||
|
||||
List<SarStandMenu> getGBStandMenu();
|
||||
|
||||
List<SarStandMenu> getFBStandMenu();
|
||||
|
||||
List<StandSystemDTO> getStandInfoSystemData(@Param("param") StandSystemDTO standSystemDTO, @Param("dataSource") String dataSource);
|
||||
}
|
||||
|
||||
+3
@@ -19,4 +19,7 @@ public interface ISarStandMenuService extends IService<SarStandMenu> {
|
||||
|
||||
List<SarStandMenu> selectAllMenuByStandId(SarStandMenu sarStandMenuEO);
|
||||
|
||||
void deleteStandSystemByStandId(String id);
|
||||
|
||||
void addStandSystemRelation(String standSystem, String id);
|
||||
}
|
||||
|
||||
+18
@@ -5,6 +5,8 @@ import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||
import com.adc.da.slrs.sarStandMenu.dao.SarStandMenuDao;
|
||||
import com.adc.da.slrs.sarStandMenu.service.ISarStandMenuService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -40,4 +42,20 @@ public class SarStandMenuServiceImpl extends ServiceImpl<SarStandMenuDao, SarSta
|
||||
return dao.selectAllMenuByStandId(sarStandMenuEO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStandSystemByStandId(String id) {
|
||||
LambdaUpdateWrapper<SarStandMenu> sarStandMenuWrapper = new LambdaUpdateWrapper<>();
|
||||
sarStandMenuWrapper.eq(SarStandMenu::getStandId, id);
|
||||
remove(sarStandMenuWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStandSystemRelation(String standSystem, String id) {
|
||||
SarStandMenu sarStandMenu = new SarStandMenu();
|
||||
// 生成不带横杠的UUID
|
||||
sarStandMenu.setId(java.util.UUID.randomUUID().toString().replaceAll("-", ""));
|
||||
sarStandMenu.setStandId(id).setMenuId(standSystem).setValidFlag(0);
|
||||
save(sarStandMenu);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -243,6 +243,8 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String standSystemName;
|
||||
@TableField(exist = false)
|
||||
private String standSystemId;
|
||||
|
||||
public static long getSerialVersionUID() {
|
||||
return serialVersionUID;
|
||||
|
||||
+18
-12
@@ -17,7 +17,7 @@ import com.adc.da.slrs.sarBussionessStand.entity.OldSystem;
|
||||
import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao;
|
||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarFindDto;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
//import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarStandFile.service.ISarStandFileService;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.adc.da.slrs.sarStandWarning.service.Impl.WarningDateServiceImpl;
|
||||
@@ -114,6 +114,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -150,8 +151,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Autowired
|
||||
WarningDateServiceImpl warningDateService;
|
||||
|
||||
@Autowired
|
||||
private ITsPositionService iTsPositionService;
|
||||
// @Autowired
|
||||
// private ITsPositionService iTsPositionService;
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao dao;
|
||||
@@ -1027,15 +1028,15 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
value = String.join(",", stringList.isEmpty() ? valArr : stringList);
|
||||
break;
|
||||
}
|
||||
//通过id绑定责任部门师名称
|
||||
case "ZRBM": {
|
||||
QueryWrapper<TsPosition> tsPositionQW = new QueryWrapper<>();
|
||||
tsPositionQW.select("name")
|
||||
.in("id", valArr);
|
||||
List<String> stringList = iTsPositionService.listObjs(tsPositionQW, o -> o.toString());
|
||||
value = String.join(",", stringList.isEmpty() ? valArr : stringList);
|
||||
break;
|
||||
}
|
||||
// //通过id绑定责任部门师名称
|
||||
// case "ZRBM": {
|
||||
// QueryWrapper<TsPosition> tsPositionQW = new QueryWrapper<>();
|
||||
// tsPositionQW.select("name")
|
||||
// .in("id", valArr);
|
||||
// List<String> stringList = iTsPositionService.listObjs(tsPositionQW, o -> o.toString());
|
||||
// value = String.join(",", stringList.isEmpty() ? valArr : stringList);
|
||||
// break;
|
||||
// }
|
||||
default:
|
||||
value = dicTypeEODao.getDicNamesByCodes(valArr, "");
|
||||
}
|
||||
@@ -1996,6 +1997,11 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
* @Return: com.adc.da.util.http.ResponseMessage<com.adc.da.lawss.entity.SarStandardsInfoEO>
|
||||
*/
|
||||
public int updateSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception {
|
||||
// 标准体系
|
||||
sarStandMenuService.deleteStandSystemByStandId(sarStandardsInfoEO.getId());
|
||||
if (StringUtils.isNotEmpty(sarStandardsInfoEO.getStandSystemId())) {
|
||||
sarStandMenuService.addStandSystemRelation(sarStandardsInfoEO.getStandSystemId(), sarStandardsInfoEO.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 加入对应"国家/地区"的清单列表
|
||||
|
||||
+61
-39
@@ -7,9 +7,9 @@ import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||
import com.adc.da.slrs.sarPosition.dao.TsPositionDao;
|
||||
//import com.adc.da.slrs.sarPosition.dao.TsPositionDao;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
//import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||
import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
@@ -20,10 +20,13 @@ import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import com.adc.da.slrs.tsRoleMeunData.service.ITsRoleMenuDataService;
|
||||
import com.adc.da.sync.service.SyncUserService;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.sys.service.IUserRoleEOService;
|
||||
import com.adc.da.utils.util.ListUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -34,6 +37,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -54,8 +58,8 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
private TsUserDao tsUserDao;
|
||||
@Autowired
|
||||
private ITsUserService tsUserService;
|
||||
@Autowired
|
||||
private ITsPositionService tsPositionService;
|
||||
// @Autowired
|
||||
// private ITsPositionService tsPositionService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private ITsRoleService tsRoleService;
|
||||
@@ -65,12 +69,15 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
private ITsResourceService tsResourceService;
|
||||
@Autowired
|
||||
private SyncUserService syncUserService;
|
||||
@Autowired
|
||||
private TsPositionDao tsPositionDao;
|
||||
// @Autowired
|
||||
// private TsPositionDao tsPositionDao;
|
||||
@Autowired
|
||||
private ITsInstitutionService tsInstitutionService;
|
||||
@Autowired
|
||||
ITsRoleMenuDataService iTsRoleMenuDataService;
|
||||
@Resource
|
||||
private IUserRoleEOService userRoleEOService;
|
||||
|
||||
|
||||
|
||||
public void deleteUser(){
|
||||
@@ -289,16 +296,17 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
public List<SarMenu> getMenu() {
|
||||
UserEO userEO=UserUtils.getUser();
|
||||
String userId= userEO.getUsid();
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
// List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
/**
|
||||
* 当用户没有所属岗位,默认给一个other岗位,适用于特定权限外的其他用户
|
||||
* 用户同步时需要将用户配置的系统内的岗位保留
|
||||
*/
|
||||
|
||||
if(positionIds == null || positionIds.isEmpty()){
|
||||
positionIds = Arrays.asList(new String[]{"other"});
|
||||
}
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// if(positionIds == null || positionIds.isEmpty()){
|
||||
// positionIds = Arrays.asList(new String[]{"other"});
|
||||
// }
|
||||
// List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
List<String> menuIds=tsRoleService.getMenuIdsByRoleIds(roleIds);
|
||||
return sarMenuService.getMenuByIds(menuIds);
|
||||
}
|
||||
@@ -313,8 +321,9 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
UserEO userEO=UserUtils.getUser();
|
||||
String userId= userEO.getUsid();
|
||||
System.out.println(userId);
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
// List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
List<String> resourceIds=tsRoleService.getResourceIdsByRoleIds(roleIds);
|
||||
return tsResourceService.getResourceByIds(resourceIds,tsResource.getSorDivide());
|
||||
}
|
||||
@@ -326,8 +335,16 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
*/
|
||||
@Override
|
||||
public List<String> getUserIdsByRoleId(String roleId) {
|
||||
List<String> positionIds=tsPositionService.getPositionIdsByRoleId(roleId);
|
||||
return tsUserDao.getUserIdsByPositionIds(positionIds);
|
||||
LambdaQueryWrapper<UserRoleEO> userRoleEOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userRoleEOLambdaQueryWrapper.eq(UserRoleEO::getRoleId,roleId);
|
||||
// 根据角色ID查询用户ID
|
||||
List<UserRoleEO> list = userRoleEOService.list(userRoleEOLambdaQueryWrapper);
|
||||
// 判空
|
||||
if (list == null || list.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 获取用户ID
|
||||
return list.stream().map(UserRoleEO::getUserId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,8 +354,9 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
*/
|
||||
@Override
|
||||
public List<SarMenu> getMenusByUserId(String userId){
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
// List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
List<String> menuIds=tsRoleService.getMenuIdsByRoleIds(roleIds);
|
||||
return sarMenuService.getMenuByIds(menuIds);
|
||||
}
|
||||
@@ -353,8 +371,9 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
UserEO userEO=UserUtils.getUser();
|
||||
String userId= userEO.getUsid();
|
||||
System.out.println(userId);
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
// List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
return tsRoleService.getResourceIdsByRoleIds(roleIds);
|
||||
|
||||
}
|
||||
@@ -365,8 +384,9 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
*/
|
||||
@Override
|
||||
public List<String> getResourceUserId(String userId) {
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
// List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
return tsRoleService.getResourceIdsByRoleIds(roleIds);
|
||||
|
||||
}
|
||||
@@ -376,8 +396,9 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
*/
|
||||
@Override
|
||||
public List<String> getResourceDataUserId(String userId) {
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
// List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
QueryWrapper<TsRoleMenuData> wrapper=new QueryWrapper<>();
|
||||
wrapper.select("MENU_ID");
|
||||
wrapper.in("ROLE_ID",roleIds);
|
||||
@@ -420,15 +441,15 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
for(SyncUser syncUser:syncUsers){
|
||||
QueryWrapper<TsPosition> positionQueryWrapper=new QueryWrapper<>();
|
||||
positionQueryWrapper.eq("name",syncUser.getTitle());
|
||||
TsPosition tsPosition=tsPositionDao.selectOne(positionQueryWrapper);
|
||||
if(tsPosition==null){
|
||||
tsPosition=new TsPosition();
|
||||
tsPosition.setName(syncUser.getTitle());
|
||||
tsPosition.setType("1");
|
||||
tsPositionDao.insert(tsPosition);
|
||||
}
|
||||
// TsPosition tsPosition=tsPositionDao.selectOne(positionQueryWrapper);
|
||||
// if(tsPosition==null){
|
||||
// tsPosition=new TsPosition();
|
||||
// tsPosition.setName(syncUser.getTitle());
|
||||
// tsPosition.setType("1");
|
||||
// tsPositionDao.insert(tsPosition);
|
||||
// }
|
||||
TsUser tsUser=SyncUser.toUser(syncUser);
|
||||
tsUser.setPositionId(tsPosition.getId());
|
||||
// tsUser.setPositionId(tsPosition.getId());
|
||||
tsUserDao.insert(tsUser);
|
||||
|
||||
}
|
||||
@@ -436,8 +457,9 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
|
||||
@Override
|
||||
public List<SarMenu> getSecondMenusByUserId(String userId) {
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
// List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
// List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> roleIds = userRoleEOService.getRoleIdsByUserId(userId);
|
||||
List<String> menuIds=tsRoleService.getMenuIdsByRoleIds(roleIds);
|
||||
return sarMenuService.getSecondMenuByIds(menuIds);
|
||||
}
|
||||
@@ -506,12 +528,12 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
}
|
||||
ids.removeIf(s -> null==s);
|
||||
List<TsUser> tsUsers = tsUserDao.userUnderInstitution((tsUser.getCurrent() - 1) * tsUser.getSize(), tsUser.getSize(), tsUser, ids);
|
||||
if(tsUsers!=null && !tsUsers.isEmpty()){
|
||||
for (TsUser user:tsUsers) {
|
||||
List<TsPosition> positionList = tsPositionService.getPositionDataByUserId(user.getUserId());
|
||||
user.setPositions(positionList);
|
||||
}
|
||||
}
|
||||
// if(tsUsers!=null && !tsUsers.isEmpty()){
|
||||
// for (TsUser user:tsUsers) {
|
||||
// List<TsPosition> positionList = tsPositionService.getPositionDataByUserId(user.getUserId());
|
||||
// user.setPositions(positionList);
|
||||
// }
|
||||
// }
|
||||
|
||||
Page<TsUser> tsUserPage = new Page<>();
|
||||
tsUserPage.setCurrent(tsUser.getCurrent());
|
||||
|
||||
@@ -144,5 +144,118 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getGBStandMenu" resultType="com.adc.da.slrs.sarStandMenu.entity.SarStandMenu">
|
||||
select
|
||||
DISTINCT
|
||||
sms.ID AS menuId,
|
||||
stand.ID as standId
|
||||
from SAR_STAND_MENU AS sm
|
||||
LEFT JOIN sar_standards_info AS stand ON sm.STAND_ID = stand.ID AND stand.VALID_FLAG = '0'
|
||||
LEFT JOIN sar_menu_standard sms on sm.MENU_ID = sms.ID
|
||||
where stand.STAND_TYPE = 'INLAND'
|
||||
AND sms.MENU_NAME IS NOT NULL
|
||||
AND LENGTH(sm.MENU_ID) > 30
|
||||
AND sm.VALID_FLAG = '0'
|
||||
AND sms.id in (select id from sar_menu_standard where valid_flag = 0)
|
||||
group by stand.ID
|
||||
</select>
|
||||
|
||||
<select id="getFBStandMenu" resultType="com.adc.da.slrs.sarStandMenu.entity.SarStandMenu">
|
||||
select
|
||||
DISTINCT
|
||||
sms.ID AS menuId,
|
||||
stand.ID as standId
|
||||
from SAR_STAND_MENU AS sm
|
||||
LEFT JOIN sar_standards_info AS stand ON sm.STAND_ID = stand.ID AND stand.VALID_FLAG = '0'
|
||||
LEFT JOIN sar_menu_standard sms on sm.MENU_ID = sms.ID
|
||||
where stand.STAND_TYPE = 'FOREIGN'
|
||||
AND sms.MENU_NAME IS NOT NULL
|
||||
AND LENGTH(sm.MENU_ID) > 30
|
||||
AND sm.VALID_FLAG = '0'
|
||||
AND sms.id in (select id from sar_menu_standard where valid_flag = 0)
|
||||
group by stand.ID
|
||||
</select>
|
||||
|
||||
<select id="getStandInfoSystemData" resultType="com.adc.da.slrs.sarMenuStandard.entity.StandSystemDTO">
|
||||
SELECT
|
||||
gb.ID AS standId,
|
||||
CONCAT(gb.STAND_SORT, ' ', gb.STAND_NUMBER) AS standNo,
|
||||
gb.STAND_NAME AS standName,
|
||||
gb.STAND_STATE AS standState,
|
||||
gb.ISSUE_TIME AS releaseDate,
|
||||
gb.PUT_TIME AS implementDate,
|
||||
gb.REPLACE_STAND_NUM AS replaceStandardNo,
|
||||
gba.QCDW AS dept,
|
||||
gba.WSSMR AS draftUserName,
|
||||
gb.STAND_TYPE AS dataSource,
|
||||
gb.STAND_SORT AS standSort,
|
||||
CASE
|
||||
WHEN gb.STAND_TYPE = 'INLAND' THEN 1
|
||||
WHEN gb.STAND_TYPE = 'FOREIGN' THEN 2
|
||||
END AS standTypeSort,
|
||||
sms.ID AS menuId
|
||||
FROM
|
||||
`sar_standards_info` AS gb
|
||||
LEFT JOIN `sar_stand_attr_info` AS gba ON gb.ID = gba.STAND_ID
|
||||
LEFT JOIN `sar_stand_menu` AS m ON gb.ID = m.STAND_ID AND LENGTH(m.MENU_ID) > 30
|
||||
LEFT JOIN sar_menu_standard sms on m.MENU_ID = sms.ID
|
||||
WHERE gb.VALID_FLAG = '0'
|
||||
AND sms.id in (select id from sar_menu_standard where valid_flag = 0)
|
||||
<!--国标/外标-->
|
||||
<if test="param.standNo != null and param.standNo != ''">
|
||||
AND gb.STAND_TYPE = #{dataSource}
|
||||
</if>
|
||||
<!--关联的节点IDList-->
|
||||
<if test="param.menuIdList != null and param.menuIdList.size() > 0">
|
||||
AND m.MENU_ID IN
|
||||
<foreach item="item" index="index" collection="param.menuIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--标准编号-->
|
||||
<if test="param.standNo != null and param.standNo != ''">
|
||||
AND gb.STAND_NUMBER LIKE CONCAT('%',#{param.standNo},'%')
|
||||
</if>
|
||||
<!--标准名称-->
|
||||
<if test="param.standName != null and param.standName != ''">
|
||||
AND gb.STAND_NAME LIKE CONCAT('%',#{param.standName},'%')
|
||||
</if>
|
||||
<!--发布时间-->
|
||||
<if test="param.startReleaseDateString != null and param.startReleaseDateString != '' and
|
||||
param.endReleaseDateString != null and param.endReleaseDateString != ''">
|
||||
AND gb.ISSUE_TIME BETWEEN #{param.startReleaseDateString} AND #{param.endReleaseDateString}
|
||||
</if>
|
||||
<!--实施日期-->
|
||||
<if test="param.startImplementDate != null and param.endImplementDate != ''">
|
||||
AND gb.PUT_TIME BETWEEN #{param.startImplementDate} AND #{param.endImplementDate}
|
||||
</if>
|
||||
<!--代替标准-->
|
||||
<if test="param.replaceStandardNo != null and param.replaceStandardNo != ''">
|
||||
AND gb.REPLACE_STAND_NUM LIKE CONCAT('%',#{param.replaceStandardNo},'%')
|
||||
</if>
|
||||
<!--编制单位-->
|
||||
<if test="param.dept != null and param.dept != ''">
|
||||
AND gba.QCDW LIKE CONCAT('%',#{param.dept},'%')
|
||||
</if>
|
||||
<!--起草人-->
|
||||
<if test="param.draftUserName != null and param.draftUserName != ''">
|
||||
AND gba.WSSMR LIKE CONCAT('%',#{param.draftUserName},'%')
|
||||
</if>
|
||||
<!--搜索条件数据来源-->
|
||||
<if test="param.dataSource != null and param.dataSource != ''">
|
||||
AND gb.STAND_TYPE = #{param.dataSource}
|
||||
</if>
|
||||
<!--SQL复用数据来源-->
|
||||
<if test="dataSource != null and dataSource != ''">
|
||||
AND gb.STAND_TYPE = #{dataSource}
|
||||
</if>
|
||||
<if test="param.selectIdList != null and param.selectIdList.size() > 0">
|
||||
AND gb.ID IN
|
||||
<foreach item="item" index="index" collection="param.selectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by gb.ID
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.roleReplacePosition.mapper.PositionRoleMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.roleReplacePosition.domain.PositionRole">
|
||||
<id property="roleId" column="role_id" jdbcType="VARCHAR"/>
|
||||
<id property="positionId" column="position_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
role_id,position_id
|
||||
</sql>
|
||||
</mapper>
|
||||
+18
@@ -203,6 +203,24 @@
|
||||
where buss_stand_id = #{bussStandId} and valid_flag=0
|
||||
</select>
|
||||
|
||||
<select id="getESStandMenu" resultType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu">
|
||||
select
|
||||
DISTINCT
|
||||
sms.ID AS menuId,
|
||||
stand.ID AS bussStandId
|
||||
from sar_buss_stand_menu AS sm
|
||||
LEFT JOIN sar_bussioness_stand AS stand
|
||||
ON sm.BUSS_STAND_ID = stand.ID AND
|
||||
stand.VALID_FLAG = 0
|
||||
LEFT JOIN sar_menu_standard sms on sm.MENU_ID = sms.ID
|
||||
where LENGTH(sm.MENU_ID) > 30
|
||||
AND sms.MENU_NAME IS NOT NULL
|
||||
AND sm.VALID_FLAG = 0
|
||||
AND sm.TREE_TYPE is null
|
||||
AND sms.id in (select id from sar_menu_standard where valid_flag = 0)
|
||||
group by stand.ID
|
||||
</select>
|
||||
|
||||
<delete id="deleteByStandIdAndMenuId" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu">
|
||||
delete from SAR_BUSS_STAND_MENU
|
||||
where buss_stand_id = #{bussStandId, jdbcType=VARCHAR} and MENU_ID = #{menuId, jdbcType=VARCHAR}
|
||||
|
||||
+92
@@ -1267,4 +1267,96 @@
|
||||
where id = #{attfId}
|
||||
</update>
|
||||
|
||||
<select id="getESSystemData" resultType="com.adc.da.slrs.sarMenuStandard.entity.StandSystemDTO">
|
||||
SELECT
|
||||
DISTINCT
|
||||
es.ID AS standId,
|
||||
es.STAND_CODE AS standNo,
|
||||
es.STAND_NAME AS standName,
|
||||
es.TEXT_STATUS_BUSS AS standState,
|
||||
es.ISSUE_TIME AS releaseDate,
|
||||
es.PUT_TIME AS implementDate,
|
||||
es.REPLACE_STAND_NUM AS replaceStandardNo,
|
||||
esa.QCDW AS dept,
|
||||
esa.QCRBUSS AS draftUserName,
|
||||
'ENTERPRISE' AS dataSource,
|
||||
sms.ID AS menuId,
|
||||
3 AS standTypeSort,
|
||||
CASE
|
||||
when es.stand_code like concat('%', 'Q/FT A', '%') THEN 0
|
||||
when es.stand_code like concat('%', 'Q/FT B', '%') THEN 1
|
||||
when es.stand_code like concat('%', 'Q/FT E', '%') THEN 2
|
||||
when es.stand_code like concat('%', 'Q/FT F', '%') THEN 3
|
||||
when es.stand_code like concat('%', 'Q/FT G', '%') THEN 4
|
||||
when es.stand_code like concat('%', 'Q/FT M', '%') THEN 5
|
||||
when es.stand_code like concat('%', 'Q/FT Q', '%') THEN 6
|
||||
when es.stand_code like concat('%', 'Q/FT R', '%') THEN 7
|
||||
when es.stand_code like concat('%', 'Q/FT S', '%') THEN 8
|
||||
when es.stand_code like concat('%', 'Q/FT T', '%') THEN 9
|
||||
when es.stand_code like concat('%', 'Q/FT V', '%') THEN 10
|
||||
when es.stand_code like concat('%', 'Q/FT X', '%') THEN 11
|
||||
when es.stand_code like concat('%', 'Q/FT Y', '%') THEN 12
|
||||
when es.stand_code like concat('%', 'Q/FT Z', '%') THEN 13
|
||||
when es.stand_code like concat('%', 'Q/QCBFC', '%') THEN 14
|
||||
when es.stand_code like concat('%', '雷萨企标Q/FL', '%') THEN 15
|
||||
when es.stand_code like concat('%', 'Q/QCFLC', '%') THEN 16
|
||||
ELSE 17
|
||||
END AS standCategorySort
|
||||
FROM
|
||||
`sar_bussioness_stand` AS es
|
||||
LEFT JOIN `sar_buss_stand_attr_info` AS esa ON es.ID = esa.STAND_ID
|
||||
LEFT JOIN `sar_buss_stand_menu` AS m ON es.ID = m.BUSS_STAND_ID
|
||||
AND LENGTH(m.MENU_ID) > 30
|
||||
AND m.TREE_TYPE is null
|
||||
AND m.VALID_FLAG = 0
|
||||
LEFT JOIN sar_menu_standard sms on m.MENU_ID = sms.ID
|
||||
WHERE 1 = 1
|
||||
AND sms.id in (select id from sar_menu_standard where valid_flag = 0)
|
||||
<!--标准编号-->
|
||||
<if test="param.standNo != null and param.standNo != ''">
|
||||
AND es.STAND_CODE LIKE CONCAT('%',#{param.standNo},'%')
|
||||
</if>
|
||||
<!--关联的节点IDList-->
|
||||
<if test="param.menuIdList != null and param.menuIdList.size() > 0">
|
||||
AND m.MENU_ID IN
|
||||
<foreach item="item" index="index" collection="param.menuIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--标准名称-->
|
||||
<if test="param.standName != null and param.standName != ''">
|
||||
AND es.STAND_NAME LIKE CONCAT('%',#{param.standName},'%')
|
||||
</if>
|
||||
<!--发布时间-->
|
||||
<if test="param.startReleaseDate != null and param.endReleaseDate != null">
|
||||
AND es.ISSUE_TIME BETWEEN #{param.startReleaseDate} AND #{param.endReleaseDate}
|
||||
</if>
|
||||
<!--实施日期-->
|
||||
<if test="param.startImplementDate != null and param.endImplementDate != null">
|
||||
AND es.PUT_TIME BETWEEN #{param.startImplementDate} AND #{param.endImplementDate}
|
||||
</if>
|
||||
<!--代替标准-->
|
||||
<if test="param.replaceStandardNo != null and param.replaceStandardNo != ''">
|
||||
AND es.REPLACE_STAND_NUM LIKE CONCAT('%',#{param.replaceStandardNo},'%')
|
||||
</if>
|
||||
<!--编制单位-->
|
||||
<if test="param.dept != null and param.dept != ''">
|
||||
AND esa.QCDW LIKE CONCAT('%',#{param.dept},'%')
|
||||
</if>
|
||||
<!--起草人-->
|
||||
<if test="param.draftUserName != null and param.draftUserName != ''">
|
||||
AND esa.QCRBUSS LIKE CONCAT('%',#{param.draftUserName},'%')
|
||||
</if>
|
||||
<!--数据来源-->
|
||||
<if test="param.dataSource != null and param.dataSource != ''">
|
||||
AND 'ENTERPRISE' = #{param.dataSource}
|
||||
</if>
|
||||
<if test="param.selectIdList != null and param.selectIdList.size() > 0">
|
||||
AND es.ID IN
|
||||
<foreach item="item" index="index" collection="param.selectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by es.ID
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.roleReplacePosition.mapper.UserPositionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.roleReplacePosition.domain.UserPosition">
|
||||
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
|
||||
<result property="positionId" column="position_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
user_id,position_id
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.sys.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
@@ -9,6 +10,7 @@ import com.adc.da.base.entity.BaseEntity;
|
||||
* <b>日期:</b> 2018-09-03 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
@TableName("TS_USER_ROLE")
|
||||
public class UserRoleEO extends BaseEntity {
|
||||
|
||||
private String roleId;
|
||||
|
||||
@@ -15,8 +15,10 @@ import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -64,6 +66,10 @@ public class SarMenuStandard extends BaseEntity {
|
||||
@TableField("DISPLAY_SEQ")
|
||||
private Integer displaySeq;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
@TableField(exist = false)
|
||||
private Integer systemSort;
|
||||
|
||||
@ApiModelProperty(value = "路径")
|
||||
@TableField("HREF")
|
||||
private String href;
|
||||
@@ -107,4 +113,109 @@ public class SarMenuStandard extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String treeType;
|
||||
|
||||
@ApiModelProperty(value = "树层级")
|
||||
@TableField(exist = false)
|
||||
private Integer level;
|
||||
@TableField(exist = false)
|
||||
|
||||
private Integer gbStandCount;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer fbStandCount;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer esStandCount;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> gbStandIdList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> fbStandIdList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> esStandIdList;
|
||||
|
||||
// 添加用于计算和设置关联关系数量的方法
|
||||
// 添加用于计算和设置关联关系数量的方法
|
||||
public void calculateAndSetCounts(List<StandMenuRelation> gbStandMenu, List<StandMenuRelation> fbStandMenu, List<StandMenuRelation> esStandMenu, Integer curLevel) {
|
||||
this.gbStandIdList = new ArrayList<>();
|
||||
this.fbStandIdList = new ArrayList<>();
|
||||
this.esStandIdList = new ArrayList<>();
|
||||
this.level = curLevel;
|
||||
this.gbStandCount = countMatches(gbStandMenu, this.id, gbStandIdList);
|
||||
this.fbStandCount = countMatches(fbStandMenu, this.id, fbStandIdList);
|
||||
this.esStandCount = countMatches(esStandMenu, this.id, esStandIdList);
|
||||
|
||||
for (SarMenuStandard child : children) {
|
||||
child.calculateAndSetCounts(gbStandMenu, fbStandMenu, esStandMenu, curLevel + 1);
|
||||
this.gbStandCount += child.gbStandCount;
|
||||
this.gbStandIdList.addAll(child.gbStandIdList);
|
||||
this.fbStandCount += child.fbStandCount;
|
||||
this.fbStandIdList.addAll(child.fbStandIdList);
|
||||
this.esStandCount += child.esStandCount;
|
||||
this.esStandIdList.addAll(child.esStandIdList);
|
||||
}
|
||||
}
|
||||
|
||||
private int countMatches(List<StandMenuRelation> standMenuList, String menuId, List<String> standIdList) {
|
||||
int count = 0;
|
||||
// 计算与menuId匹配的项的数量
|
||||
for (StandMenuRelation standMenu : standMenuList) {
|
||||
if (standMenu.getMenuId().equals(menuId)) {
|
||||
count++;
|
||||
standIdList.add(standMenu.getStandId());
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
// 添加用于构建映射的方法
|
||||
public void buildPathMap(Map<String, String> pathMap, String parentPath) {
|
||||
String currentPath = parentPath.isEmpty() ? this.menuName : parentPath + "/" + this.menuName;
|
||||
pathMap.put(this.id, currentPath);
|
||||
for (SarMenuStandard child : children) {
|
||||
child.buildPathMap(pathMap, currentPath);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加用于收集子节点ID的方法
|
||||
public void collectChildIds(List<String> childIds) {
|
||||
childIds.add(this.id);
|
||||
for (SarMenuStandard child : children) {
|
||||
child.collectChildIds(childIds);
|
||||
}
|
||||
}
|
||||
|
||||
public static SarMenuStandard findNodeById(SarMenuStandard node, String menuId) {
|
||||
if (node == null) {
|
||||
return null;
|
||||
}
|
||||
// 检查当前节点的ID是否匹配
|
||||
if (menuId.equals(node.getId())) {
|
||||
return node;
|
||||
}
|
||||
// 在子节点中递归搜索
|
||||
for (SarMenuStandard child : node.getChildren()) {
|
||||
SarMenuStandard found = findNodeById(child, menuId);
|
||||
if (found != null) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
// 如果在当前节点及其子节点中都没有找到,返回null
|
||||
return null;
|
||||
}
|
||||
|
||||
// 递归方法来设置每个节点的 systemSort
|
||||
public static void setSystemSort(SarMenuStandard node, String parentSort) {
|
||||
// 计算当前节点的 systemSort
|
||||
String currentSort = parentSort.isEmpty() ? String.valueOf(node.getDisplaySeq()) : parentSort + node.getDisplaySeq();
|
||||
|
||||
// 设置当前节点的 systemSort
|
||||
node.setSystemSort(Integer.parseInt(currentSort));
|
||||
|
||||
// 递归设置子节点的 systemSort
|
||||
for (SarMenuStandard child : node.getChildren()) {
|
||||
setSystemSort(child, currentSort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.sys.sarMenuStandard.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/11/14 16:31
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StandMenuRelation {
|
||||
|
||||
private String standId;
|
||||
|
||||
private String menuId;
|
||||
|
||||
}
|
||||
@@ -3,5 +3,9 @@ package com.adc.da.sys.service;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IUserRoleEOService extends IService<UserRoleEO> {
|
||||
|
||||
List<String> getRoleIdsByUserId(String userId);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,16 @@ package com.adc.da.sys.service.impl;
|
||||
import com.adc.da.sys.dao.UserRoleEODao;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.sys.service.IUserRoleEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21,4 +26,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class UserRoleEOServiceImpl extends ServiceImpl<UserRoleEODao, UserRoleEO> implements IUserRoleEOService {
|
||||
|
||||
@Override
|
||||
public List<String> getRoleIdsByUserId(String userId) {
|
||||
return this.list(new LambdaQueryWrapper<UserRoleEO>()
|
||||
.eq(UserRoleEO::getUserId, userId))
|
||||
.stream().map(UserRoleEO::getRoleId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.adc.da.sys.util;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Mzaxd
|
||||
* @since 2022-11-22 15:36
|
||||
*/
|
||||
public class BeanCopyUtils {
|
||||
|
||||
private BeanCopyUtils() {
|
||||
}
|
||||
|
||||
public static <V> V copyBean(Object source, Class<V> clazz){
|
||||
V result = null;
|
||||
//创建目标对象
|
||||
try {
|
||||
result = clazz.newInstance();
|
||||
//实现属性copy
|
||||
BeanUtils.copyProperties(source, result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//返回结果
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <O,V> List<V> copyBeanList(List<O> list, Class<V> clazz) {
|
||||
return list.stream()
|
||||
.map(o -> copyBean(o, clazz))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user