Merge branch 'develop_2' into develop_sync_1
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<version>2.2.0.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.adc</groupId>-->
|
||||
<!-- <artifactId>adc-da-search</artifactId>-->
|
||||
|
||||
@@ -22,11 +22,11 @@ public class CodeGen {
|
||||
|
||||
// x.x.x.x:3306/xxxx --MYSQL
|
||||
// 192.168.10.140:1521:foton_slrs_test
|
||||
private static final String DB_IP="101.36.227.22:33050/foton_slrs_test";
|
||||
private static final String DB_IP="192.168.10.47:3306/foton_slrs_test";
|
||||
|
||||
private static final String DB_USER="root";
|
||||
|
||||
private static final String DB_PWD="1q2w3e4r";
|
||||
private static final String DB_PWD="root";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
# 数据库配置
|
||||
#=============================================
|
||||
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url = jdbc:mysql://192.168.10.47:3306/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||
spring.datasource.url = jdbc:mysql://101.36.227.22:33050/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||
spring.datasource.username = root
|
||||
spring.datasource.password = root
|
||||
spring.datasource.password = 1q2w3e4r
|
||||
|
||||
#==============================================
|
||||
# 应用设置
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.adc.da.slrs.sarInstitution.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|机构管理|")
|
||||
@RequestMapping("/SarInstitution/institution")
|
||||
public class TsInstitutionController extends BaseController<TsInstitution> {
|
||||
@Autowired
|
||||
private ITsInstitutionService tsInstitutionService;
|
||||
@Autowired
|
||||
private ITsUserService tsUserService;
|
||||
|
||||
/**
|
||||
* 查询所有机构
|
||||
* @return ResponseMessage<List<TsInstitution>>
|
||||
*/
|
||||
@ApiOperation("查询所有机构")
|
||||
@GetMapping
|
||||
public ResponseMessage<List<TsInstitution>> getInstitution(){
|
||||
List<TsInstitution> institutions=tsInstitutionService.getInstitution();
|
||||
return Result.success(institutions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询机构人员
|
||||
* @param institutionId:机构ID
|
||||
* @return ResponseMessage<List<TsUser>>
|
||||
*/
|
||||
@ApiOperation("查询机构的人员")
|
||||
@GetMapping("/user")
|
||||
public ResponseMessage<List<TsUser>> getUserByInstitutionId(@RequestParam String institutionId){
|
||||
List<TsUser> tsUsers=tsUserService.getUserByInstitutionId(institutionId);
|
||||
return Result.success(tsUsers);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarInstitution.dao;
|
||||
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface TsInstitutionDao extends BaseMapper<TsInstitution> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.adc.da.slrs.sarInstitution.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsInstitution对象", description="")
|
||||
public class TsInstitution extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "上级机构")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "机构层级")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty(value = "机构名")
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "子机构")
|
||||
private List<TsInstitution> children;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.adc.da.slrs.sarInstitution.service;
|
||||
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zxy
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface ITsInstitutionService extends IService<TsInstitution> {
|
||||
|
||||
/**
|
||||
* 查询所有机构
|
||||
*/
|
||||
List<TsInstitution> getInstitution();
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.adc.da.slrs.sarInstitution.service.impl;
|
||||
|
||||
|
||||
import com.adc.da.slrs.sarInstitution.dao.TsInstitutionDao;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Service
|
||||
public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsInstitution> implements ITsInstitutionService {
|
||||
@Autowired
|
||||
private TsInstitutionDao tsInstitutionDao;
|
||||
|
||||
/**
|
||||
* 查询所有机构
|
||||
*/
|
||||
@Override
|
||||
public List<TsInstitution> getInstitution() {
|
||||
//查询第一层机构
|
||||
QueryWrapper<TsInstitution> institutionQueryWrapper=new QueryWrapper<>();
|
||||
institutionQueryWrapper.eq("level",1);
|
||||
List<TsInstitution> institutionRoot=tsInstitutionDao.selectList(institutionQueryWrapper);
|
||||
for(TsInstitution tsInstitution:institutionRoot){
|
||||
tsInstitution.setChildren(recursionGetInstitution(tsInstitution));
|
||||
}
|
||||
return institutionRoot;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 递归获取子机构
|
||||
* @param tsInstitution:父机构
|
||||
* @return List<TsInstitution>
|
||||
*/
|
||||
private List<TsInstitution> recursionGetInstitution(TsInstitution tsInstitution){
|
||||
QueryWrapper<TsInstitution> institutionQueryWrapper=new QueryWrapper<>();
|
||||
institutionQueryWrapper.eq("parent_id",tsInstitution.getId());
|
||||
institutionQueryWrapper.eq("level",tsInstitution.getLevel()+1);
|
||||
List<TsInstitution> tsInstitutions=tsInstitutionDao.selectList(institutionQueryWrapper);
|
||||
for(TsInstitution tsInstitutionNode:tsInstitutions){
|
||||
tsInstitutionNode.setChildren(recursionGetInstitution(tsInstitutionNode));
|
||||
}
|
||||
return tsInstitutions;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserPersonalMenuEO;
|
||||
import com.adc.da.slrs.sarPersonalCenter.service.ISarUserPersonalMenuService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserPersonalMenu;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--个人中心--我的板块")
|
||||
@RequestMapping("/${restPath}/sarPersonalCenter/sar-user-personal-menu")
|
||||
public class SarUserPersonalMenuController extends BaseController<SarUserPersonalMenu> {
|
||||
|
||||
@Autowired
|
||||
private ISarUserPersonalMenuService iSarUserPersonalMenuService;
|
||||
|
||||
@ApiOperation("获取用户的板块列表")
|
||||
@GetMapping("/getList")
|
||||
public ResponseMessage<IPage<SarUserPersonalMenu>> getList(SarUserPersonalMenuEO eo){
|
||||
return iSarUserPersonalMenuService.getUserPersonalMenu(eo);
|
||||
}
|
||||
|
||||
@ApiOperation("更新用户的板块列表")
|
||||
@PostMapping("/update")
|
||||
public ResponseMessage<IPage<SarUserPersonalMenu>> update(@RequestBody SarUserPersonalMenuEO eo){
|
||||
return iSarUserPersonalMenuService.updateUserPersonalMenu(eo);
|
||||
}
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStarEO;
|
||||
import com.adc.da.slrs.sarPersonalCenter.service.ISarUserStarService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStar;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-21
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--个人中心--我的收藏")
|
||||
@RequestMapping("/${restPath}/sarPersonalCenter/sar-user-star")
|
||||
public class SarUserStarController extends BaseController<SarUserStar> {
|
||||
|
||||
@Autowired
|
||||
private ISarUserStarService iSarUserStarService;
|
||||
|
||||
@ApiOperation("获取用户收藏列表")
|
||||
@GetMapping("/getList")
|
||||
public ResponseMessage<IPage<SarUserStar>> getUserStarList(SarUserStarEO sarUserStarEO) {
|
||||
return iSarUserStarService.getUserStarList(sarUserStarEO);
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除用户收藏")
|
||||
@PostMapping("/deleteList")
|
||||
public ResponseMessage<IPage<SarUserStar>> deleteList(@RequestBody SarUserStarEO sarUserStars) {
|
||||
return iSarUserStarService.deleteList(sarUserStars);
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户收藏")
|
||||
@PostMapping("/delete")
|
||||
public ResponseMessage<Boolean> deleteById(@RequestBody SarUserStarEO sarUserStars) {
|
||||
return iSarUserStarService.deleteById(sarUserStars);
|
||||
}
|
||||
|
||||
@ApiOperation("添加用户收藏")
|
||||
@PostMapping("/addStar")
|
||||
public ResponseMessage<Boolean> addStar(@RequestBody SarUserStar sarUserStar) {
|
||||
return iSarUserStarService.addStar(sarUserStar);
|
||||
}
|
||||
|
||||
@ApiOperation("获取当前用户是否收藏该页面")
|
||||
@GetMapping("/isStar")
|
||||
public ResponseMessage<Boolean> isStar(String userId, String url) {
|
||||
return iSarUserStarService.isStar(userId,url);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.dao;
|
||||
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserPersonalMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface SarUserPersonalMenuDao extends BaseMapper<SarUserPersonalMenu> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.dao;
|
||||
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStar;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-21
|
||||
*/
|
||||
public interface SarUserStarDao extends BaseMapper<SarUserStar> {
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarUserPersonalMenu对象", description="")
|
||||
public class SarUserPersonalMenu extends BaseEntity {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
private String menuName;
|
||||
|
||||
private String menuId;
|
||||
|
||||
private Integer state;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String menuUrl;
|
||||
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarUserPersonalMenu批量操作对象", description="")
|
||||
public class SarUserPersonalMenuEO extends SarUserPersonalMenu {
|
||||
|
||||
@ApiModelProperty("当页数量")
|
||||
private Integer size=20;
|
||||
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer current=1;
|
||||
|
||||
@ApiModelProperty("操作信息")
|
||||
private List<SarUserPersonalMenu> sarUserPersonalMenus;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-21
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel(value="SarUserStar对象", description="")
|
||||
public class SarUserStar extends BaseEntity {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "收藏名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "收藏类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "收藏具体信息")
|
||||
private String info;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "所属模块")
|
||||
private String modular;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "该收藏对应的路由")
|
||||
private String url;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarUserStar批量操作对象", description="")
|
||||
public class SarUserStarEO extends SarUserStar{
|
||||
|
||||
@ApiModelProperty("当页数量")
|
||||
private Integer size=20;
|
||||
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer current=1;
|
||||
|
||||
@ApiModelProperty("操作信息")
|
||||
private List<SarUserStar> sarUserStars;
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserPersonalMenu;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserPersonalMenuEO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface ISarUserPersonalMenuService extends IService<SarUserPersonalMenu> {
|
||||
|
||||
public ResponseMessage<IPage<SarUserPersonalMenu>> getUserPersonalMenu(SarUserPersonalMenuEO eo);
|
||||
|
||||
public ResponseMessage<IPage<SarUserPersonalMenu>> updateUserPersonalMenu(SarUserPersonalMenuEO eo);
|
||||
|
||||
public void updateUserPersonalMenuForRole(List<SarUserPersonalMenu> menus,String userId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStar;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStarEO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-21
|
||||
*/
|
||||
public interface ISarUserStarService extends IService<SarUserStar> {
|
||||
public ResponseMessage<IPage<SarUserStar>> getUserStarList(SarUserStarEO sarUserStarEO);
|
||||
public ResponseMessage<IPage<SarUserStar>> deleteList(@RequestBody SarUserStarEO sarUserStars);
|
||||
public ResponseMessage<Boolean> deleteById(@RequestBody SarUserStarEO sarUserStars);
|
||||
public ResponseMessage<Boolean> addStar(@RequestBody SarUserStar sarUserStar);
|
||||
public ResponseMessage<Boolean> isStar(String userId, String url);
|
||||
}
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.service.impl;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserPersonalMenu;
|
||||
import com.adc.da.slrs.sarPersonalCenter.dao.SarUserPersonalMenuDao;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserPersonalMenuEO;
|
||||
import com.adc.da.slrs.sarPersonalCenter.service.ISarUserPersonalMenuService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Service
|
||||
public class SarUserPersonalMenuServiceImpl extends ServiceImpl<SarUserPersonalMenuDao, SarUserPersonalMenu> implements ISarUserPersonalMenuService {
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseMessage<IPage<SarUserPersonalMenu>> getUserPersonalMenu(SarUserPersonalMenuEO eo) {
|
||||
if(eo.getUserId()==null||eo.getUserId().trim().length()==0){
|
||||
return Result.error("userId不能为空");
|
||||
}
|
||||
QueryWrapper<SarUserPersonalMenu> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id",queryWrapper);
|
||||
if(eo.getMenuUrl()!=null)queryWrapper.eq("menu_url",eo.getMenuUrl());
|
||||
if(eo.getMenuName()!=null&&eo.getMenuName().trim().length()>0)queryWrapper.like("menu_name",eo.getMenuName().trim());
|
||||
if(eo.getState()!=null)queryWrapper.eq("state",eo.getState());
|
||||
|
||||
IPage<SarUserPersonalMenu> iPage=new Page<>(eo.getCurrent(),eo.getSize());
|
||||
IPage<SarUserPersonalMenu> page = page(iPage, queryWrapper);
|
||||
while (page.getRecords().remove(null));
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<IPage<SarUserPersonalMenu>> updateUserPersonalMenu(SarUserPersonalMenuEO eo) {
|
||||
if(eo.getUserId()==null||eo.getUserId().trim().length()==0){
|
||||
return Result.error("userId不能为空");
|
||||
}
|
||||
List<SarUserPersonalMenu> menus=new ArrayList<>();
|
||||
if(eo.getSarUserPersonalMenus()!=null){
|
||||
for (SarUserPersonalMenu menu : eo.getSarUserPersonalMenus()) {
|
||||
if(menu.getId()!=null&&menu.getId().trim().length()>0&&menu.getState()!=null){
|
||||
|
||||
SarUserPersonalMenu sarUserPersonalMenu=new SarUserPersonalMenu();
|
||||
sarUserPersonalMenu.setState(menu.getState()==0?0:1);
|
||||
QueryWrapper<SarUserPersonalMenu> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id",eo.getUserId());
|
||||
queryWrapper.eq("id",menu.getId());
|
||||
|
||||
update(sarUserPersonalMenu,queryWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return getUserPersonalMenu(eo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserPersonalMenuForRole(List<SarUserPersonalMenu> menuList,String userId) {
|
||||
|
||||
Set<String> ids=new HashSet<>();
|
||||
|
||||
for (SarUserPersonalMenu menu : menuList) {
|
||||
if(menu.getMenuId()!=null&&menu.getMenuId().trim().length()>0){
|
||||
|
||||
QueryWrapper<SarUserPersonalMenu> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id",userId);
|
||||
queryWrapper.eq("menu_id",menu.getMenuId());
|
||||
List<SarUserPersonalMenu> menus = getBaseMapper().selectList(queryWrapper);
|
||||
if (menus.size()>0) {
|
||||
ids.add(menus.get(0).getId());
|
||||
continue;
|
||||
}
|
||||
|
||||
SarUserPersonalMenu sarUserPersonalMenu=new SarUserPersonalMenu();
|
||||
sarUserPersonalMenu.setMenuName(menu.getMenuName());
|
||||
sarUserPersonalMenu.setMenuUrl(menu.getMenuUrl());
|
||||
sarUserPersonalMenu.setUserId(menu.getUserId());
|
||||
sarUserPersonalMenu.setMenuId(menu.getMenuId());
|
||||
sarUserPersonalMenu.setState(0);
|
||||
|
||||
getBaseMapper().insert(sarUserPersonalMenu);
|
||||
ids.add(sarUserPersonalMenu.getId());
|
||||
}
|
||||
}
|
||||
QueryWrapper<SarUserPersonalMenu> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.notIn("id",ids);
|
||||
queryWrapper.eq("user_id",userId);
|
||||
getBaseMapper().delete(queryWrapper);
|
||||
|
||||
}
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
package com.adc.da.slrs.sarPersonalCenter.service.impl;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStar;
|
||||
import com.adc.da.slrs.sarPersonalCenter.dao.SarUserStarDao;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStarEO;
|
||||
import com.adc.da.slrs.sarPersonalCenter.service.ISarUserStarService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-21
|
||||
*/
|
||||
@Service
|
||||
public class SarUserStarServiceImpl extends ServiceImpl<SarUserStarDao, SarUserStar> implements ISarUserStarService {
|
||||
|
||||
@Autowired
|
||||
private ISarUserStarService iSarUserStarService;
|
||||
|
||||
@Override
|
||||
public ResponseMessage<IPage<SarUserStar>> getUserStarList(SarUserStarEO sarUserStarEO) {
|
||||
if (sarUserStarEO.getUserId() == null) {
|
||||
return Result.error("userId不能为空");
|
||||
} else {
|
||||
if (sarUserStarEO.getSize() == null || sarUserStarEO.getSize() <= 0) sarUserStarEO.setSize(20);
|
||||
if (sarUserStarEO.getCurrent() == null || sarUserStarEO.getCurrent() <= 0) sarUserStarEO.setCurrent(1);
|
||||
QueryWrapper<SarUserStar> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("user_id", sarUserStarEO.getUserId());
|
||||
if(sarUserStarEO.getType()!=null)wrapper.like("type",sarUserStarEO.getType());
|
||||
if(sarUserStarEO.getName()!=null)wrapper.like("name",sarUserStarEO.getName());
|
||||
if(sarUserStarEO.getModular()!=null)wrapper.like("modular",sarUserStarEO.getModular());
|
||||
if(sarUserStarEO.getInfo()!=null)wrapper.like("info",sarUserStarEO.getInfo());
|
||||
if(sarUserStarEO.getUrl()!=null)wrapper.like("url",sarUserStarEO.getUrl());
|
||||
IPage<SarUserStar> page = iSarUserStarService.page(new Page<>(sarUserStarEO.getCurrent(), sarUserStarEO.getSize()), wrapper);
|
||||
while (page.getRecords().remove(null)) ;
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseMessage<IPage<SarUserStar>> deleteList(@RequestBody SarUserStarEO sarUserStars) {
|
||||
if (sarUserStars.getUserId() == null) {
|
||||
return Result.error("userId不能为空");
|
||||
}
|
||||
if (!(sarUserStars.getSarUserStars() == null || sarUserStars.getSarUserStars().size() <= 0)) {
|
||||
for (SarUserStar sarUserStar : sarUserStars.getSarUserStars()) {
|
||||
if (sarUserStar.getId() != null) {
|
||||
QueryWrapper<SarUserStar> sarUserStarQueryWrapper = new QueryWrapper<>();
|
||||
sarUserStarQueryWrapper.eq("id", sarUserStar.getId());
|
||||
sarUserStarQueryWrapper.eq("user_id", sarUserStars.getUserId());
|
||||
iSarUserStarService.remove(sarUserStarQueryWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
return getUserStarList(sarUserStars);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<Boolean> deleteById(@RequestBody SarUserStarEO sarUserStars) {
|
||||
if (sarUserStars.getUserId() == null) {
|
||||
return Result.error("userId不能为空");
|
||||
}
|
||||
if ((sarUserStars.getId() == null && sarUserStars.getUrl() == null)) {
|
||||
return Result.error("url或id不能为空");
|
||||
}
|
||||
QueryWrapper<SarUserStar> sarUserStarQueryWrapper = new QueryWrapper<>();
|
||||
if(sarUserStars.getId()!=null)sarUserStarQueryWrapper.eq("id", sarUserStars.getId());
|
||||
else sarUserStarQueryWrapper.eq("url", sarUserStars.getUrl());
|
||||
sarUserStarQueryWrapper.eq("user_id", sarUserStars.getUserId());
|
||||
|
||||
|
||||
return Result.success(iSarUserStarService.remove(sarUserStarQueryWrapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<Boolean> addStar(@RequestBody SarUserStar sarUserStar) {
|
||||
if (sarUserStar.getUserId() == null) {
|
||||
return Result.error("userId不能为空");
|
||||
}
|
||||
if (sarUserStar.getUrl() == null
|
||||
&& sarUserStar.getModular() == null
|
||||
&& sarUserStar.getName() == null
|
||||
&& sarUserStar.getType() == null) {
|
||||
return Result.error("数据有误");
|
||||
}
|
||||
|
||||
sarUserStar.setId(null);
|
||||
sarUserStar.setCreateTime(new Date());
|
||||
|
||||
return Result.success(iSarUserStarService.save(sarUserStar));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<Boolean> isStar(String userId, String url) {
|
||||
if (userId == null) {
|
||||
return Result.error("userId不能为空");
|
||||
}
|
||||
if (url == null) {
|
||||
return Result.error("url不能为空");
|
||||
}
|
||||
|
||||
QueryWrapper<SarUserStar> sarUserStarQueryWrapper = new QueryWrapper<>();
|
||||
sarUserStarQueryWrapper.eq("user_id", userId);
|
||||
sarUserStarQueryWrapper.eq("url", url);
|
||||
int count = iSarUserStarService.count(sarUserStarQueryWrapper);
|
||||
|
||||
return Result.success(count > 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.adc.da.slrs.sarRole.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zxy
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|角色管理|")
|
||||
@RequestMapping("/sarRole/role")
|
||||
public class TsRoleController extends BaseController<TsRole> {
|
||||
@Autowired
|
||||
private ITsRoleService tsRoleService;
|
||||
|
||||
@ApiOperation("查询所有角色")
|
||||
@GetMapping
|
||||
public ResponseMessage<List<TsRole>> getAll(){
|
||||
List<TsRole> tsRoles=tsRoleService.getAll();
|
||||
return Result.success(tsRoles);
|
||||
}
|
||||
|
||||
@ApiOperation("根据角色名筛选角色")
|
||||
@GetMapping("/name")
|
||||
public ResponseMessage<List<TsRole>> getByName(String name){
|
||||
List<TsRole> tsRoles=tsRoleService.getByName(name);
|
||||
return Result.success(tsRoles);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarRole.dao;
|
||||
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface TsRoleDao extends BaseMapper<TsRole> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.adc.da.slrs.sarRole.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsRole对象", description="")
|
||||
public class TsRole extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "角色类型")
|
||||
@TableField("ROLE_TYPE")
|
||||
private String roleType;
|
||||
|
||||
@ApiModelProperty(value = "角色状态")
|
||||
@TableField("USE_FLAG")
|
||||
private BigDecimal useFlag;
|
||||
|
||||
@ApiModelProperty(value = "是否默认")
|
||||
@TableField("IS_DEFAULT")
|
||||
private BigDecimal isDefault;
|
||||
|
||||
@ApiModelProperty(value = "角色描述")
|
||||
@TableField("REMARKS")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp operateTime;
|
||||
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String operator;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@TableField("EXT_INFO")
|
||||
private String extInfo;
|
||||
|
||||
@TableField("OPER_USER")
|
||||
private String operUser;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private BigDecimal validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "上级节点id")
|
||||
@TableField("PARENT_ID")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "角色层级")
|
||||
@TableField("role_level")
|
||||
private Integer roleLevel;
|
||||
|
||||
@ApiModelProperty(value = "对应部门id")
|
||||
@TableField("DY_ORG_ID")
|
||||
private String dyOrgId;
|
||||
|
||||
@ApiModelProperty(value = "对应部门名称")
|
||||
@TableField("DY_ORG_NAME")
|
||||
private String dyOrgName;
|
||||
|
||||
@ApiModelProperty(value = "子角色")
|
||||
@TableField(exist = false)
|
||||
private List<TsRole> children;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.adc.da.slrs.sarRole.service;
|
||||
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface ITsRoleService extends IService<TsRole> {
|
||||
|
||||
/**
|
||||
* 查询所有角色
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
List<TsRole> getAll();
|
||||
|
||||
/**
|
||||
* 通过名字查询角色
|
||||
* @param name:角色名
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
List<TsRole> getByName(String name);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.adc.da.slrs.sarRole.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.adc.da.slrs.sarRole.dao.TsRoleDao;
|
||||
import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Service
|
||||
public class TsRoleServiceImpl extends ServiceImpl<TsRoleDao, TsRole> implements ITsRoleService {
|
||||
@Autowired
|
||||
private TsRoleDao tsRoleDao;
|
||||
|
||||
/**
|
||||
* 查询所有角色
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
@Override
|
||||
public List<TsRole> getAll() {
|
||||
QueryWrapper<TsRole> tsRoleQueryWrapper=new QueryWrapper<>();
|
||||
tsRoleQueryWrapper.eq("role_level",1);
|
||||
List<TsRole> rootRole=tsRoleDao.selectList(tsRoleQueryWrapper);
|
||||
for(TsRole tsRole:rootRole){
|
||||
tsRole.setChildren(recursionGetRole(tsRole));
|
||||
}
|
||||
return rootRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查询子角色
|
||||
* @param tsRole:父角色
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
private List<TsRole> recursionGetRole(TsRole tsRole){
|
||||
QueryWrapper<TsRole> tsRoleQueryWrapper=new QueryWrapper<>();
|
||||
tsRoleQueryWrapper.eq("parent_id",tsRole.getId());
|
||||
tsRoleQueryWrapper.eq("role_level",tsRole.getRoleLevel()+1);
|
||||
List<TsRole> tsRoles=tsRoleDao.selectList(tsRoleQueryWrapper);
|
||||
for(TsRole tsRoleNode:tsRoles){
|
||||
tsRoleNode.setChildren(recursionGetRole(tsRoleNode));
|
||||
}
|
||||
return tsRoles;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过名字查询角色
|
||||
* @param name:角色名
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
@Override
|
||||
public List<TsRole> getByName(String name) {
|
||||
QueryWrapper<TsRole> tsRoleQueryWrapper=new QueryWrapper<>();
|
||||
tsRoleQueryWrapper.like("name","%"+name+"%");
|
||||
return tsRoleDao.selectList(tsRoleQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+9
-6
@@ -41,11 +41,12 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
|
||||
@Override
|
||||
public IPage<SarStandUnqualified> getSarStandUnqualifiedPage(SarStandUnqualifiedPage sarStandUnqualifiedPage) {
|
||||
QueryWrapper<SarStandUnqualified> sarStandUnqualifiedQueryWrapper=new QueryWrapper<>();
|
||||
if(sarStandUnqualifiedPage.getStandId()!=null){
|
||||
sarStandUnqualifiedQueryWrapper.and(wrapper->wrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId()).or().like("stand_name","%"+sarStandUnqualifiedPage.getStandId()+"%"));
|
||||
// sarStandUnqualifiedQueryWrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId()).or().like("stand_name","%"+sarStandUnqualifiedPage.getStandId()+"%");
|
||||
}
|
||||
//仅查询未关闭的
|
||||
sarStandUnqualifiedQueryWrapper.eq("close_state",1);
|
||||
if(sarStandUnqualifiedPage.getStandId()!=null){
|
||||
sarStandUnqualifiedQueryWrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId()).or().like("stand_name","%"+sarStandUnqualifiedPage.getStandId()+"%");
|
||||
}
|
||||
if(sarStandUnqualifiedPage.getProductName()!=null){
|
||||
sarStandUnqualifiedQueryWrapper.like("product_name","%"+sarStandUnqualifiedPage.getProductName()+"%");
|
||||
}
|
||||
@@ -68,11 +69,13 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
|
||||
@Override
|
||||
public IPage<SarStandUnqualified> getSarStandUnqualifiedHistoryPage(SarStandUnqualifiedPage sarStandUnqualifiedPage) {
|
||||
QueryWrapper<SarStandUnqualified> sarStandUnqualifiedQueryWrapper=new QueryWrapper<>();
|
||||
if(sarStandUnqualifiedPage.getStandId()!=null){
|
||||
sarStandUnqualifiedQueryWrapper.and(wrapper->wrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId()).or().like("stand_name","%"+sarStandUnqualifiedPage.getStandId()+"%"));
|
||||
// sarStandUnqualifiedQueryWrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId()).or().like("stand_name","%"+sarStandUnqualifiedPage.getStandId()+"%");
|
||||
}
|
||||
|
||||
//仅查询关闭的
|
||||
sarStandUnqualifiedQueryWrapper.eq("close_state",2);
|
||||
if(sarStandUnqualifiedPage.getStandId()!=null){
|
||||
sarStandUnqualifiedQueryWrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId()).or().like("stand_name","%"+sarStandUnqualifiedPage.getStandId()+"%");
|
||||
}
|
||||
if(sarStandUnqualifiedPage.getProductName()!=null){
|
||||
sarStandUnqualifiedQueryWrapper.like("product_name","%"+sarStandUnqualifiedPage.getProductName()+"%");
|
||||
}
|
||||
|
||||
+1
@@ -20,4 +20,5 @@ import com.adc.da.base.web.BaseController;
|
||||
@RequestMapping("/sarStandardComplianceAssessResult/sar-interpretation-foreign-standard")
|
||||
public class SarInterpretationForeignStandardController extends BaseController<SarInterpretationForeignStandard> {
|
||||
|
||||
|
||||
}
|
||||
|
||||
+27
-6
@@ -61,7 +61,11 @@ public class SarStandardComplianceAssessResultController {
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
|
||||
}
|
||||
return Result.success(iSarStandardComplianceProductAssessService.page(iPage,queryWrapper));
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
|
||||
while(page.getRecords().remove(null));
|
||||
|
||||
return Result.success(page);
|
||||
}else {
|
||||
if(eo.getPosition()==1){
|
||||
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
|
||||
@@ -73,7 +77,10 @@ public class SarStandardComplianceAssessResultController {
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
|
||||
}
|
||||
return Result.success(iSarInterpretationNationalStandardService.page(iPage,queryWrapper));
|
||||
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
|
||||
while(page.getRecords().remove(null));
|
||||
|
||||
return Result.success(page);
|
||||
}else{
|
||||
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
|
||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
@@ -84,7 +91,10 @@ public class SarStandardComplianceAssessResultController {
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
|
||||
}
|
||||
return Result.success(iSarInterpretationForeignStandardService.page(iPage,queryWrapper));
|
||||
|
||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||
while(page.getRecords().remove(null));
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,7 +106,12 @@ public class SarStandardComplianceAssessResultController {
|
||||
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
|
||||
if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId());
|
||||
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
return Result.success(iSarStandardComplianceProductAssessService.page(iPage, queryWrapper));
|
||||
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
|
||||
while(page.getRecords().remove(null));
|
||||
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "条件查询技术审核符合性清单")
|
||||
@@ -107,13 +122,19 @@ public class SarStandardComplianceAssessResultController {
|
||||
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
|
||||
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
if(eo.getStandId()!=null)queryWrapper.eq("STAND_ID",eo.getStandId());
|
||||
return Result.success(iSarInterpretationNationalStandardService.page(iPage, queryWrapper));
|
||||
|
||||
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
|
||||
while(page.getRecords().remove(null));
|
||||
return Result.success(page);
|
||||
} else {
|
||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
|
||||
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
if(eo.getStandId()!=null)queryWrapper.eq("STAND_ID",eo.getStandId());
|
||||
return Result.success(iSarInterpretationForeignStandardService.page(iPage, queryWrapper));
|
||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||
while(page.getRecords().remove(null));
|
||||
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.slrs.sarUser.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zxy
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|人员管理|")
|
||||
@RequestMapping("/sarUser/user")
|
||||
public class TsUserController extends BaseController<TsUser> {
|
||||
@Autowired
|
||||
private ITsUserService tsUserService;
|
||||
|
||||
@ApiOperation("禁用/解禁人员")
|
||||
@PostMapping("/disable")
|
||||
public ResponseMessage<Object> disable(@Validated(TsUser.disable.class) @RequestBody TsUser tsUser){
|
||||
//判断disableFlag是否填入正确
|
||||
if((!tsUser.getDisableFlag().equals("1"))&&(!tsUser.getDisableFlag().equals("0"))){
|
||||
return Result.error("disableFlag只能是0或1");
|
||||
}
|
||||
return tsUserService.disable(tsUser);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarUser.dao;
|
||||
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface TsUserDao extends BaseMapper<TsUser> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.adc.da.slrs.sarUser.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zxy
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsUser对象", description="")
|
||||
public class TsUser extends BaseEntity {
|
||||
|
||||
public interface disable{
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键Id")
|
||||
@NotNull(message = "userId不能为空",groups = {disable.class})
|
||||
@TableId(value = "USID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "帐户")
|
||||
@TableField("ACCOUNT")
|
||||
private String account;
|
||||
|
||||
@ApiModelProperty(value = "密码")
|
||||
@TableField("PASSWORD")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "用户姓名")
|
||||
@TableField("UNAME")
|
||||
private String uname;
|
||||
|
||||
@ApiModelProperty(value = "用户性别(1为男,2为女)")
|
||||
@TableField("SEX")
|
||||
private String sex;
|
||||
|
||||
@ApiModelProperty(value = "用户来源")
|
||||
@TableField("USER_SOURCE")
|
||||
private String userSource;
|
||||
|
||||
@ApiModelProperty(value = "用户邮箱")
|
||||
@TableField("EMAIL")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "所属部门名称")
|
||||
@TableField("INSTITUTION_NAME")
|
||||
private String institutionName;
|
||||
|
||||
@ApiModelProperty(value = "所属部门ID")
|
||||
@TableField("INSTITUTION_ID")
|
||||
private String institutionId;
|
||||
|
||||
@ApiModelProperty(value = "岗位名")
|
||||
@TableField("POSITION_NAME")
|
||||
private String positionName;
|
||||
|
||||
@ApiModelProperty(value = "岗位ID")
|
||||
@TableField("POSITION_ID")
|
||||
private String positionId;
|
||||
|
||||
@ApiModelProperty(value = "工号")
|
||||
@TableField("WORK_NUM")
|
||||
private String workNum;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@TableField("EXT_INFO")
|
||||
private String extInfo;
|
||||
|
||||
@TableField("OPER_USER")
|
||||
private String operUser;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "是否禁用(0为未禁用,1为已禁用)")
|
||||
@NotNull(message = "disableFlag不能为空",groups = {disable.class})
|
||||
@TableField("DISABLE_FLAG")
|
||||
private String disableFlag;
|
||||
|
||||
@ApiModelProperty(value = "是否锁定")
|
||||
@TableField("UNLOCK_FLAG")
|
||||
private String unlockFlag;
|
||||
|
||||
@ApiModelProperty(value = "用户类型")
|
||||
@TableField("USER_TYPE")
|
||||
private String userType;
|
||||
|
||||
@ApiModelProperty(value = "对接单点登录用户ID")
|
||||
@TableField("SSO_ID")
|
||||
private String ssoId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.adc.da.slrs.sarUser.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
public interface ITsUserService extends IService<TsUser> {
|
||||
|
||||
|
||||
/**
|
||||
* 通过机构ID查询人员
|
||||
* @param institutionId:机构ID
|
||||
* @return List<TsUser>
|
||||
*/
|
||||
List<TsUser> getUserByInstitutionId(String institutionId);
|
||||
|
||||
/**
|
||||
* 封禁、解禁用户
|
||||
* @param tsUser:目标用户
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<Object> disable(TsUser tsUser);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.adc.da.slrs.sarUser.service.impl;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-22
|
||||
*/
|
||||
@Service
|
||||
public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements ITsUserService {
|
||||
@Autowired
|
||||
private TsUserDao tsUserDao;
|
||||
|
||||
/**
|
||||
* 通过机构ID查询人员
|
||||
* @param institutionId:机构ID
|
||||
* @return List<TsUser>
|
||||
*/
|
||||
@Override
|
||||
public List<TsUser> getUserByInstitutionId(String institutionId) {
|
||||
QueryWrapper<TsUser> userQueryWrapper=new QueryWrapper<>();
|
||||
userQueryWrapper.eq("institution_id",institutionId);
|
||||
return tsUserDao.selectList(userQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 封禁、解禁用户
|
||||
* @param tsUser:目标用户
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<Object> disable(TsUser tsUser) {
|
||||
TsUser user=tsUserDao.selectById(tsUser.getUserId());
|
||||
if(user==null){
|
||||
return Result.error("该用户不存在");
|
||||
}
|
||||
//解禁
|
||||
if(tsUser.getDisableFlag().equals("0")){
|
||||
if(user.getDisableFlag().equals("0")){
|
||||
return Result.error("该用户已被解禁,请勿重复操作");
|
||||
}
|
||||
user.setDisableFlag("0");
|
||||
//封禁
|
||||
}else {
|
||||
if(user.getDisableFlag().equals("1")){
|
||||
return Result.error("该用户已被封禁,请勿重复操作");
|
||||
}
|
||||
user.setDisableFlag("1");
|
||||
}
|
||||
tsUserDao.updateById(user);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.sarInstitution.dao.TsInstitutionDao">
|
||||
|
||||
</mapper>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?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.sarPersonalCenter.dao.SarUserPersonalMenuDao">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.sarPersonalCenter.dao.SarUserStarDao">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.sarRole.dao.TsRoleDao">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.sarUser.dao.TsUserDao">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user