Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("/code") |
| | | @Api(value = "代ç çæ", tags = "代ç çæ") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class CodeController extends BladeController { |
| | | |
| | | private final ICodeService codeService; |
| | |
| | | @RestController |
| | | @RequestMapping("follow") |
| | | @AllArgsConstructor |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class FlowFollowController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | |
| | | @RequestMapping("manager") |
| | | @AllArgsConstructor |
| | | @Api(value = "æµç¨ç®¡çæ¥å£", tags = "æµç¨ç®¡çæ¥å£") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class FlowManagerController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | |
| | | @RestController |
| | | @RequestMapping("model") |
| | | @AllArgsConstructor |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class FlowModelController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/oss") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | @Api(value = "对象å卿¥å£", tags = "对象å卿¥å£") |
| | | public class OssController extends BladeController { |
| | | |
| | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/sms") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | @Api(value = "çä¿¡é
置表", tags = "çä¿¡é
置表æ¥å£") |
| | | public class SmsController extends BladeController { |
| | | |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/make-bucket") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R makeBucket(@RequestParam String bucketName) { |
| | | ossBuilder.template().makeBucket(bucketName); |
| | | return R.success("å建æå"); |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-bucket") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeBucket(@RequestParam String bucketName) { |
| | | ossBuilder.template().removeBucket(bucketName); |
| | | return R.success("å 餿å"); |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-file") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeFile(@RequestParam String fileName) { |
| | | ossBuilder.template().removeFile(fileName); |
| | | return R.success("æä½æå"); |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-files") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeFiles(@RequestParam String fileNames) { |
| | | ossBuilder.template().removeFiles(Func.toStrList(fileNames)); |
| | | return R.success("æä½æå"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.entity; |
| | | |
| | | 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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * å¯ç ç»åæ¹å¼è¡¨(PlSysCombination)å®ä½ç±» |
| | | * |
| | | * @author ldc |
| | | * @since 2023-03-20 14:56:26 |
| | | */ |
| | | @Data |
| | | @TableName("pl_sys_combination") |
| | | @ApiModel(value = "Combination对象", description = "Combination对象") |
| | | public class Combination implements Serializable { |
| | | private static final long serialVersionUID = 905936175743821305L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç»ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç»ååç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | @TableField("\"DESC\"") |
| | | @ApiModelProperty(value = "æè¿°") |
| | | private String desc; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | @ApiModelProperty(value = "ä¿®æ¹äºº") |
| | | private String updateUser; |
| | | |
| | | /** |
| | | * ææäºº |
| | | */ |
| | | @ApiModelProperty(value = "ææäºº") |
| | | private String licensors; |
| | | |
| | | @Override |
| | | public boolean equals(Object o) { |
| | | if (this == o) { |
| | | return true; |
| | | } |
| | | if (o == null || getClass() != o.getClass()) { |
| | | return false; |
| | | } |
| | | Combination that = (Combination) o; |
| | | return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(desc, that.desc) && Objects.equals(createTime, that.createTime) && Objects.equals(createUser, that.createUser) && Objects.equals(updateTime, that.updateTime) && Objects.equals(updateUser, that.updateUser) && Objects.equals(licensors, that.licensors); |
| | | } |
| | | |
| | | @Override |
| | | public int hashCode() { |
| | | return Objects.hash(id, name, desc, createTime, createUser, updateTime, updateUser, licensors); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | /** |
| | | * æºæå
¨ç§° |
| | | */ |
| | | @ApiModelProperty(value = "æºæå
¨ç§°") |
| | | @ApiModelProperty(value = "é¨é¨å
¨ç§°") |
| | | private String fullName; |
| | | |
| | | /** |
| | |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.entity; |
| | | |
| | | 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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * å¯ç çç¥(PlSysStrategy)å®ä½ç±» |
| | | * |
| | | * @author ldc |
| | | * @since 2023-03-20 15:00:22 |
| | | */ |
| | | @Data |
| | | @TableName("pl_sys_strategy") |
| | | @ApiModel(value = "Strategy对象", description = "Strategy对象") |
| | | public class Strategy implements Serializable { |
| | | private static final long serialVersionUID = 420195522547332354L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * çç¥åç§° |
| | | */ |
| | | @ApiModelProperty(value = "çç¥åç§°") |
| | | private String strategyName; |
| | | |
| | | /** |
| | | * å¯ç æå°é¿åº¦ |
| | | */ |
| | | @ApiModelProperty(value = "å¯ç æå°é¿åº¦") |
| | | private Long minPwdLen; |
| | | |
| | | /** |
| | | * å¯ç æå¤§é¿åº¦ |
| | | */ |
| | | @ApiModelProperty(value = "å¯ç æå¤§é¿åº¦") |
| | | private Long maxPwdLen; |
| | | |
| | | /** |
| | | * å¯ç ç»åæ¹å¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¯ç ç»åæ¹å¼") |
| | | private String combinationIds; |
| | | |
| | | /** |
| | | * å¿
å¡«ç§ç±» |
| | | */ |
| | | @ApiModelProperty(value = "å¿
å¡«ç§ç±»") |
| | | private Long requiredType; |
| | | |
| | | /** |
| | | * è¿ææ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "è¿ææ¶é´") |
| | | private Date expirationTime; |
| | | |
| | | /** |
| | | * æéæ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "æéæ¶é´") |
| | | private Date reminderTime; |
| | | |
| | | /** |
| | | * é宿¬¡æ° |
| | | */ |
| | | @ApiModelProperty(value = "é宿¬¡æ°") |
| | | private Long lockingNum; |
| | | |
| | | /** |
| | | * é宿¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "é宿¶é´") |
| | | private Date lockingTime; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | @ApiModelProperty(value = "æè¿°") |
| | | @TableField("\"DESC\"") |
| | | private String desc; |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºé»è®¤çç¥ |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦ä¸ºé»è®¤çç¥,æ¯å¦ä¸ºé»è®¤ï¼1代表é»è®¤ï¼0代表éé»è®¤") |
| | | private Long isDefault; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | @ApiModelProperty(value = "ä¿®æ¹äºº") |
| | | private String updateUser; |
| | | |
| | | /** |
| | | * ææäºº |
| | | */ |
| | | @ApiModelProperty(value = "ææäºº") |
| | | private String licensors; |
| | | |
| | | /** |
| | | * ç»ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç»ååç§°") |
| | | @TableField(exist = false) |
| | | private String combinationNames; |
| | | |
| | | @Override |
| | | public boolean equals(Object o) { |
| | | if (this == o) { |
| | | return true; |
| | | } |
| | | if (o == null || getClass() != o.getClass()) { |
| | | return false; |
| | | } |
| | | if (!super.equals(o)) { |
| | | return false; |
| | | } |
| | | Strategy strategy = (Strategy) o; |
| | | return Objects.equals(id, strategy.id) && Objects.equals(strategyName, strategy.strategyName) && Objects.equals(minPwdLen, strategy.minPwdLen) && Objects.equals(maxPwdLen, strategy.maxPwdLen) && Objects.equals(combinationIds, strategy.combinationIds) && Objects.equals(requiredType, strategy.requiredType) && Objects.equals(expirationTime, strategy.expirationTime) && Objects.equals(reminderTime, strategy.reminderTime) && Objects.equals(lockingNum, strategy.lockingNum) && Objects.equals(lockingTime, strategy.lockingTime) && Objects.equals(desc, strategy.desc) && Objects.equals(isDefault, strategy.isDefault); |
| | | } |
| | | |
| | | @Override |
| | | public int hashCode() { |
| | | return Objects.hash(super.hashCode(), id, strategyName, minPwdLen, maxPwdLen, combinationIds, requiredType, expirationTime, reminderTime, lockingNum, lockingTime, desc, isDefault); |
| | | } |
| | | } |
| | | |
| | |
| | | package org.springblade.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å®ä½ç±» |
| | |
| | | */ |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | private String tenantId; |
| | | |
| | | /** |
| | | * ç§æ·å
¨ç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç§æ·å
¨ç§°") |
| | | private String fullName; |
| | | |
| | | /** |
| | | * ç§æ·åç§° |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * (PlSysValueRange)å®ä½ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 14:59:29 |
| | | */ |
| | | @Data |
| | | @TableName("pl_sys_value_range") |
| | | @ApiModel(value = "ValueRange", description = "ValueRange") |
| | | public class ValueRange implements Serializable { |
| | | private static final long serialVersionUID = -62275902377620042L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * å¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¼") |
| | | private String value; |
| | | |
| | | /** |
| | | * ç»åæ¹å¼ID |
| | | */ |
| | | @ApiModelProperty(value = "ç»åæ¹å¼ID") |
| | | private Long combinationId; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | @ApiModelProperty(value = "ä¿®æ¹äºº") |
| | | private String updateUser; |
| | | |
| | | @Override |
| | | public boolean equals(Object o) { |
| | | if (this == o) { |
| | | return true; |
| | | } |
| | | if (o == null || getClass() != o.getClass()) { |
| | | return false; |
| | | } |
| | | if (!super.equals(o)) { |
| | | return false; |
| | | } |
| | | ValueRange that = (ValueRange) o; |
| | | return Objects.equals(id, that.id) && Objects.equals(value, that.value) && Objects.equals(combinationId, that.combinationId); |
| | | } |
| | | |
| | | @Override |
| | | public int hashCode() { |
| | | return Objects.hash(super.hashCode(), id, value, combinationId); |
| | | } |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.system.entity.ApiScope; |
| | | import org.springblade.system.entity.Tenant; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æ¯å¦å¼å¯ä¸å |
| | | */ |
| | | private Boolean membersFlag; |
| | | private Integer ssaEnable; |
| | | |
| | | } |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.flow.core.entity.FlowEntity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.system.entity.AuthClient; |
| | | import org.springblade.system.service.IAuthClientService; |
| | |
| | | @RequestMapping("/client") |
| | | @ApiIgnore |
| | | @Api(value = "åºç¨ç®¡ç", tags = "æ¥å£") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class AuthClientController extends BladeController { |
| | | |
| | | private final IAuthClientService clientService; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.system.entity.Combination; |
| | | import org.springblade.system.service.ICombinationService; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å¯ç ç»åæ¹å¼è¡¨(Combination)表æ§å¶å± |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:16 |
| | | */ |
| | | @ApiIgnore |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @Api(value = "å¯ç ç»åæ¹å¼", tags = "æ¥å£") |
| | | @RequestMapping("/combination") |
| | | public class CombinationController { |
| | | |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | @Resource |
| | | private final ICombinationService combinationService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param combination ç鿡件 |
| | | * @param query å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "å页æ¥è¯¢", notes = "ä¼ å
¥combinationï¼å页忰query") |
| | | public R<IPage<Combination>> queryByPage(Combination combination, Query query) { |
| | | IPage<Combination> pages = combinationService.page(Condition.getPage(query), Condition.getQueryWrapper(combination)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ææ°æ®æº |
| | | */ |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "ä¸ææ°æ®æº") |
| | | public R<List> select() { |
| | | List<Map<String, Object>> map = combinationService.selectMaps(); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä¸»é®æ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return åæ¡æ°æ® |
| | | */ |
| | | @GetMapping("/one") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "éè¿ä¸»é®æ¥è¯¢åæ¡æ°æ®", notes = "ä¼ å
¥id") |
| | | public ResponseEntity<Combination> queryById(@ApiParam(value = "ç»åæ¹å¼ID", required = true) @RequestParam Long id) { |
| | | return ResponseEntity.ok(this.combinationService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åä¿®æ¹æ°æ® |
| | | * |
| | | * @param combination å®ä½ |
| | | * @return æ°å¢ç»æ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢åä¿®æ¹æ°æ®", notes = "ä¼ å
¥combination") |
| | | public R submit(@Valid @RequestBody Combination combination) { |
| | | return R.status(combinationService.submit(combination)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return å 餿¯å¦æå |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public ResponseEntity<Boolean> deleteById(@ApiParam(value = "主é®éå", required = true) @RequestParam List<String> ids) { |
| | | return ResponseEntity.ok(this.combinationService.deleteByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("/dept") |
| | | @Api(value = "é¨é¨", tags = "é¨é¨") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public class DeptController extends BladeController { |
| | | |
| | | private final IDeptService deptService; |
| | |
| | | /** |
| | | * ä¸ææ°æ®æº |
| | | */ |
| | | @PreAuth(AuthConstant.PERMIT_ALL) |
| | | //@PreAuth(AuthConstant.PERMIT_ALL) |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "ä¸ææ°æ®æº", notes = "ä¼ å
¥idéå") |
| | |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥menu") |
| | | public R<MenuVO> detail(Menu menu) { |
| | |
| | | @ApiImplicitParam(name = "code", value = "èåç¼å·", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "name", value = "èååç§°", paramType = "query", dataType = "string") |
| | | }) |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å表", notes = "ä¼ å
¥menu") |
| | | public R<List<MenuVO>> list(@ApiIgnore @RequestParam Map<String, Object> menu) { |
| | |
| | | @ApiImplicitParam(name = "code", value = "èåç¼å·", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "name", value = "èååç§°", paramType = "query", dataType = "string") |
| | | }) |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æå è½½å表", notes = "ä¼ å
¥menu") |
| | | public R<List<MenuVO>> lazyList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> menu) { |
| | |
| | | @ApiImplicitParam(name = "code", value = "èåç¼å·", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "name", value = "èååç§°", paramType = "query", dataType = "string") |
| | | }) |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "èåå表", notes = "ä¼ å
¥menu") |
| | | public R<List<MenuVO>> menuList(@ApiIgnore @RequestParam Map<String, Object> menu) { |
| | |
| | | @ApiImplicitParam(name = "code", value = "èåç¼å·", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "name", value = "èååç§°", paramType = "query", dataType = "string") |
| | | }) |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "æå è½½èåå表", notes = "ä¼ å
¥menu") |
| | | public R<List<MenuVO>> lazyMenuList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> menu) { |
| | |
| | | * æ°å¢æä¿®æ¹ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥menu") |
| | | public R submit(@Valid @RequestBody Menu menu) { |
| | |
| | | * å é¤ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | |
| | | /** |
| | | * è·åé
ç½®çè§è²æé |
| | | */ |
| | | @GetMapping("auth-routes") |
| | | @GetMapping("/auth-routes") |
| | | @ApiOperationSupport(order = 17) |
| | | @ApiOperation(value = "èåçè§è²æé") |
| | | public R<List<Kv>> authRoutes(BladeUser user) { |
| | |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | | import org.springblade.core.secure.constant.AuthConstant; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.system.cache.SysCache; |
| | | import org.springblade.system.entity.Role; |
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("/role") |
| | | @Api(value = "è§è²", tags = "è§è²") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public class RoleController extends BladeController { |
| | | |
| | | private final IRoleService roleService; |
| | |
| | | /** |
| | | * ä¸ææ°æ®æº |
| | | */ |
| | | @PreAuth(AuthConstant.PERMIT_ALL) |
| | | //@PreAuth(AuthConstant.PERMIT_ALL) |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "ä¸ææ°æ®æº", notes = "ä¼ å
¥idéå") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.system.entity.Strategy; |
| | | import org.springblade.system.service.IStrategyService; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¯ç çç¥(PlSysStrategy)表æ§å¶å± |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 16:45:31 |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/strategy") |
| | | @Api(value = "å¯ç çç¥", tags = "æ¥å£") |
| | | public class StrategyController { |
| | | |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | @Resource |
| | | private IStrategyService strategyService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param strategy ç鿡件 |
| | | * @param query å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "å页æ¥è¯¢", notes = "ä¼ å
¥combinationï¼å页忰query") |
| | | public R<IPage<Strategy>> queryByPage(Strategy strategy, Query query) { |
| | | IPage<Strategy> pages = strategyService.page(Condition.getPage(query), Condition.getQueryWrapper(strategy)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä¸»é®æ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return åæ¡æ°æ® |
| | | */ |
| | | @GetMapping("/one") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "éè¿ä¸»é®æ¥è¯¢åæ¡æ°æ®", notes = "ä¼ å
¥id") |
| | | public ResponseEntity<Strategy> queryById(@ApiParam(value = "å¯ç çç¥ID", required = true) @RequestParam String id) { |
| | | return ResponseEntity.ok(this.strategyService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åä¿®æ¹æ°æ® |
| | | * |
| | | * @param strategy å®ä½ |
| | | * @return æ°å¢ç»æ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹æ°æ®", notes = "ä¼ å
¥strategy") |
| | | public ResponseEntity<Boolean> submit(@Valid @RequestBody Strategy strategy) { |
| | | return ResponseEntity.ok(this.strategyService.submit(strategy)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return å 餿¯å¦æå |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "å é¤", notes = "ä¼ å
¥ids") |
| | | public ResponseEntity<Boolean> deleteById(List<String> ids) { |
| | | return ResponseEntity.ok(this.strategyService.deleteByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.system.entity.Tenant; |
| | |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<Tenant> detail(Tenant tenant) { |
| | | Tenant detail = tenantService.getOne(Condition.getQueryWrapper(tenant)); |
| | | return R.data(detail); |
| | |
| | | }) |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<Tenant>> list(@ApiIgnore @RequestParam Map<String, Object> tenant, Query query, BladeUser bladeUser) { |
| | | QueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant, Tenant.class); |
| | | IPage<Tenant> pages = tenantService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "ä¸ææ°æ®æº", notes = "ä¼ å
¥tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<List<Tenant>> select(Tenant tenant, BladeUser bladeUser) { |
| | | QueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant); |
| | | List<Tenant> list = tenantService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<Tenant>> page(Tenant tenant, Query query) { |
| | | IPage<Tenant> pages = tenantService.selectTenantPage(Condition.getPage(query), tenant); |
| | | return R.data(pages); |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public R submit(@Valid @RequestBody TenantVO tenantVO) { |
| | | System.out.println(tenantVO); |
| | | return R.status(tenantService.submitTenant(tenantVO)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(tenantService.removeTenant(Func.toLongList(ids))); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/datasource") |
| | | @ApiOperationSupport(order = 8) |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperation(value = "æ°æ®æºé
ç½®", notes = "ä¼ å
¥datasource_id") |
| | | public R datasource(@ApiParam(value = "ç§æ·ID", required = true) @RequestParam String tenantId, @ApiParam(value = "æ°æ®æºID", required = true) @RequestParam Long datasourceId){ |
| | | CacheUtil.evict(TENANT_DATASOURCE_CACHE, TENANT_DATASOURCE_EXIST_KEY, tenantId, Boolean.FALSE); |
| | |
| | | @GetMapping("/find-by-name") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<List<Tenant>> findByName(String name) { |
| | | List<Tenant> list = tenantService.list(Wrappers.<Tenant>query().lambda().like(Tenant::getTenantName, name)); |
| | | return R.data(list); |
| | |
| | | @GetMapping("/package-detail") |
| | | @ApiOperationSupport(order = 11) |
| | | @ApiOperation(value = "产åå
详æ
", notes = "ä¼ å
¥tenantId") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public R<TenantPackage> packageDetail(Long tenantId) { |
| | | Tenant tenant = tenantService.getById(tenantId); |
| | | return R.data(tenantPackageService.getById(tenant.getPackageId())); |
| | |
| | | */ |
| | | @PostMapping("/package-setting") |
| | | @ApiOperationSupport(order = 12) |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperation(value = "产åå
é
ç½®", notes = "ä¼ å
¥packageId") |
| | | public R packageSetting(@ApiParam(value = "ç§æ·ID", required = true) @RequestParam String tenantId, @ApiParam(value = "产åå
ID") Long packageId) { |
| | | CacheUtil.evict(SYS_CACHE, TENANT_TENANT_ID, tenantId, Boolean.FALSE); |
| | |
| | | @GetMapping("/find-ssa-enable") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "ä¸æç§æ·ä¿¡æ¯") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public R findIsOpen() { |
| | | boolean isOpen = this.tenantService.findIsOpen(); |
| | | return R.data(isOpen); |
| | |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "ä¸ææ°æ®æº", notes = "ä¼ å
¥tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<List<TenantPackage>> select(TenantPackage tenantPackage) { |
| | | return R.data(tenantPackageService.list(Condition.getQueryWrapper(tenantPackage))); |
| | | } |
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("/topmenu") |
| | | @Api(value = "é¡¶é¨èå表", tags = "é¡¶é¨èå") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public class TopMenuController extends BladeController { |
| | | |
| | | private final ITopMenuService topMenuService; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.system.entity.ValueRange; |
| | | import org.springblade.system.service.IValueRangeService; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ValueRange)表æ§å¶å± |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:24 |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/value-range") |
| | | @Api(value = "å¯ç ç»åæ¹å¼åå¼", tags = "æ¥å£") |
| | | public class ValueRangeController { |
| | | |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | @Resource |
| | | private IValueRangeService valueRangeService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥dataScope") |
| | | public R<List<ValueRange>> queryByList() { |
| | | return R.data(valueRangeService.queryByAll()); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param valueRange ç鿡件 |
| | | * @param query å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页æ¥è¯¢", notes = "ä¼ å
¥valueRangeï¼å页忰query") |
| | | public R<IPage<ValueRange>> queryByPage(ValueRange valueRange, Query query) { |
| | | IPage<ValueRange> pages = valueRangeService.page(Condition.getPage(query), Condition.getQueryWrapper(valueRange)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åä¿®æ¹æ°æ® |
| | | * |
| | | * @param valueRange å®ä½ |
| | | * @return æ°å¢ç»æ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ°å¢åä¿®æ¹æ°æ®", notes = "ä¼ å
¥valueRange") |
| | | public ResponseEntity<Boolean> submit(@Valid @RequestBody ValueRange valueRange) { |
| | | return ResponseEntity.ok(this.valueRangeService.submit(valueRange)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return å 餿¯å¦æå |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public ResponseEntity<Boolean> deleteById(@ApiParam(value = "主é®éå", required = true) @RequestParam List<String> ids) { |
| | | return ResponseEntity.ok(this.valueRangeService.deleteByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.system.entity.Combination; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¯ç ç»åæ¹å¼è¡¨(PlSysCombination)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:17 |
| | | */ |
| | | public interface CombinationMapper extends BaseMapper<Combination> { |
| | | |
| | | /** |
| | | * éè¿IDæ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | Combination queryById(String id); |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * @param page |
| | | * @param combination |
| | | * @return |
| | | */ |
| | | List<Combination> selectCombinationPage(IPage page, Combination combination); |
| | | |
| | | /** |
| | | * ç»è®¡æ»è¡æ° |
| | | * |
| | | * @param combination æ¥è¯¢æ¡ä»¶ |
| | | * @return æ»è¡æ° |
| | | */ |
| | | long count(Combination combination); |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.springblade.system.mapper.CombinationMapper"> |
| | | |
| | | <resultMap type="org.springblade.system.entity.Combination" id="CombinationMap"> |
| | | <result property="id" column="ID" jdbcType="VARCHAR"/> |
| | | <result property="name" column="NAME" jdbcType="VARCHAR"/> |
| | | <result property="desc" column="DESC" jdbcType="VARCHAR"/> |
| | | <result property="createtime" column="CREATETIME" jdbcType="TIMESTAMP"/> |
| | | <result property="createuser" column="CREATEUSER" jdbcType="VARCHAR"/> |
| | | <result property="updatetime" column="UPDATETIME" jdbcType="TIMESTAMP"/> |
| | | <result property="updateuser" column="UPDATEUSER" jdbcType="VARCHAR"/> |
| | | <result property="licensors" column="LICENSORS" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!--æ¥è¯¢å个--> |
| | | <select id="queryById" resultMap="CombinationMap"> |
| | | select ID, |
| | | NAME, DESC, CREATETIME, CREATEUSER, UPDATETIME, UPDATEUSER, LICENSORS |
| | | from PL_SYS_COMBINATION |
| | | where ID = #{id} |
| | | </select> |
| | | |
| | | <!--ç»è®¡æ»è¡æ°--> |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from PL_SYS_COMBINATION |
| | | <where> |
| | | <if test="id != null and id != ''"> |
| | | and ID = #{id} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and NAME = #{name} |
| | | </if> |
| | | <if test="desc != null and desc != ''"> |
| | | and DESC = #{desc} |
| | | </if> |
| | | <if test="createtime != null"> |
| | | and CREATETIME = #{createtime} |
| | | </if> |
| | | <if test="createuser != null and createuser != ''"> |
| | | and CREATEUSER = #{createuser} |
| | | </if> |
| | | <if test="updatetime != null"> |
| | | and UPDATETIME = #{updatetime} |
| | | </if> |
| | | <if test="updateuser != null and updateuser != ''"> |
| | | and UPDATEUSER = #{updateuser} |
| | | </if> |
| | | <if test="licensors != null and licensors != ''"> |
| | | and LICENSORS = #{licensors} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--å页æ¥è¯¢--> |
| | | <select id="selectCombinationPage" resultMap="CombinationMap"> |
| | | select |
| | | ID, NAME, DESC, CREATETIME, CREATEUSER, UPDATETIME, UPDATEUSER, LICENSORS |
| | | from PL_SYS_COMBINATION |
| | | <where> |
| | | <if test="id != null and id != ''"> |
| | | and ID = #{id} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and NAME = #{name} |
| | | </if> |
| | | <if test="desc != null and desc != ''"> |
| | | and DESC = #{desc} |
| | | </if> |
| | | <if test="createtime != null"> |
| | | and CREATETIME = #{createtime} |
| | | </if> |
| | | <if test="createuser != null and createuser != ''"> |
| | | and CREATEUSER = #{createuser} |
| | | </if> |
| | | <if test="updatetime != null"> |
| | | and UPDATETIME = #{updatetime} |
| | | </if> |
| | | <if test="updateuser != null and updateuser != ''"> |
| | | and UPDATEUSER = #{updateuser} |
| | | </if> |
| | | <if test="licensors != null and licensors != ''"> |
| | | and LICENSORS = #{licensors} |
| | | </if> |
| | | </where> |
| | | limit #{pageable.offset}, #{pageable.pageSize} |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | WHERE |
| | | category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM blade_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | ) menu |
| | | |
| | | UNION ALL |
| | |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | blade_scope_data |
| | | pl_auth_scope_data |
| | | WHERE |
| | | is_deleted = 0 |
| | | AND menu_id IS NOT NULL |
| | |
| | | WHERE |
| | | category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM blade_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | ) menu |
| | | |
| | | UNION ALL |
| | |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | blade_scope_api |
| | | pl_auth_scope_api |
| | | WHERE |
| | | is_deleted = 0 |
| | | AND menu_id IS NOT NULL |
| | |
| | | WHERE |
| | | category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM blade_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | AND ( |
| | | id IN ( |
| | | select menu_id from pl_org_role_menu where role_id in |
| | |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | blade_scope_data |
| | | pl_auth_scope_data |
| | | WHERE |
| | | is_deleted = 0 |
| | | AND ( |
| | |
| | | WHERE |
| | | category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM blade_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | AND ( |
| | | id IN ( |
| | | select menu_id from pl_org_role_menu where role_id in |
| | |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | blade_scope_api |
| | | pl_auth_scope_api |
| | | WHERE |
| | | is_deleted = 0 |
| | | AND |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.mapper; |
| | | |
| | | |
| | | import org.springblade.system.entity.Strategy; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.Pageable; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¯ç çç¥(PlSysStrategy)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:16:15 |
| | | */ |
| | | public interface StrategyMapper extends BaseMapper<Strategy> { |
| | | |
| | | /** |
| | | * éè¿IDæ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | Strategy queryById(String id); |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®è¡æ°æ® |
| | | * |
| | | * @param strategy æ¥è¯¢æ¡ä»¶ |
| | | * @param pageable å页对象 |
| | | * @return 对象å表 |
| | | */ |
| | | List<Strategy> queryAllByPage(Strategy strategy, @Param("pageable") Pageable pageable); |
| | | |
| | | /** |
| | | * ç»è®¡æ»è¡æ° |
| | | * |
| | | * @param plSysStrategy æ¥è¯¢æ¡ä»¶ |
| | | * @return æ»è¡æ° |
| | | */ |
| | | long count(Strategy plSysStrategy); |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.springblade.system.mapper.StrategyMapper"> |
| | | |
| | | <resultMap type="org.springblade.system.entity.Strategy" id="StrategyMap"> |
| | | <result property="id" column="ID" jdbcType="VARCHAR"/> |
| | | <result property="strategyName" column="STRATEGY_NAME" jdbcType="VARCHAR"/> |
| | | <result property="minPwdLen" column="MIN_PWD_LEN" jdbcType="VARCHAR"/> |
| | | <result property="maxPwdLen" column="MAX_PWD_LEN" jdbcType="VARCHAR"/> |
| | | <result property="combinationIds" column="COMBINATION " jdbcType="VARCHAR"/> |
| | | <result property="requiredType" column="REQUIRED_TYPE" jdbcType="VARCHAR"/> |
| | | <result property="expirationTime" column="EXPIRATION_TIME" jdbcType="TIMESTAMP"/> |
| | | <result property="reminderTime" column="REMINDER_TIME" jdbcType="TIMESTAMP"/> |
| | | <result property="lockingNum" column="LOCKING_NUM" jdbcType="VARCHAR"/> |
| | | <result property="lockingTime" column="LOCKING_TIME" jdbcType="TIMESTAMP"/> |
| | | <result property="desc" column="DESC" jdbcType="VARCHAR"/> |
| | | <result property="isDefault" column="IS_DEFAULT" jdbcType="VARCHAR"/> |
| | | <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="CREATE_USER" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="UPDATE_USER" jdbcType="TIMESTAMP"/> |
| | | <result property="combinationNames" column="COMBINATIONNAMES"/> |
| | | </resultMap> |
| | | |
| | | <!--æ¥è¯¢å个--> |
| | | <select id="queryById" resultMap="StrategyMap"> |
| | | select |
| | | ID, STRATEGY_NAME, MIN_PWD_LEN, MAX_PWD_LEN, COMBINATION , REQUIRED_TYPE, EXPIRATION_TIME, REMINDER_TIME, LOCKING_NUM, LOCKING_TIME, DESC, IS_DEFAULT, CREATE_DATE, CREATE_USER, UPDATE_DATE, UPDATE_USER |
| | | from PL_SYS_STRATEGY |
| | | where ID = #{id} |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢æå®è¡æ°æ®--> |
| | | <select id="queryAllByPage" resultMap="StrategyMap"> |
| | | select pss.*, |
| | | (select WM_CONCAT(psc.NAME) |
| | | from PL_SYS_COMBINATION psc |
| | | where instr(pss.COMBINATION_IDS,psc.ID) > 0) COMBINATIONNAMES |
| | | from PL_SYS_STRATEGY pss |
| | | </select> |
| | | |
| | | <!--ç»è®¡æ»è¡æ°--> |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from PL_SYS_STRATEGY |
| | | <where> |
| | | <if test="id != null and id != ''"> |
| | | and ID = #{id} |
| | | </if> |
| | | <if test="strategyName != null and strategyName != ''"> |
| | | and STRATEGY_NAME = #{strategyName} |
| | | </if> |
| | | <if test="minPwdLen != null and minPwdLen != ''"> |
| | | and MIN_PWD_LEN = #{minPwdLen} |
| | | </if> |
| | | <if test="maxPwdLen != null and maxPwdLen != ''"> |
| | | and MAX_PWD_LEN = #{maxPwdLen} |
| | | </if> |
| | | <if test="combination != null and combination != ''"> |
| | | and COMBINATION = #{combination } |
| | | </if> |
| | | <if test="requiredType != null and requiredType != ''"> |
| | | and REQUIRED_TYPE = #{requiredType} |
| | | </if> |
| | | <if test="expirationTime != null"> |
| | | and EXPIRATION_TIME = #{expirationTime} |
| | | </if> |
| | | <if test="reminderTime != null"> |
| | | and REMINDER_TIME = #{reminderTime} |
| | | </if> |
| | | <if test="lockingNum != null and lockingNum != ''"> |
| | | and LOCKING_NUM = #{lockingNum} |
| | | </if> |
| | | <if test="lockingTime != null"> |
| | | and LOCKING_TIME = #{lockingTime} |
| | | </if> |
| | | <if test="desc != null and desc != ''"> |
| | | and DESC = #{desc} |
| | | </if> |
| | | <if test="isDefault != null and isDefault != ''"> |
| | | and IS_DEFAULT = #{isDefault} |
| | | </if> |
| | | <if test="createDate != null"> |
| | | and CREATE_DATE = #{createDate} |
| | | </if> |
| | | <if test="createUser != null"> |
| | | and CREATE_USER = #{createUser} |
| | | </if> |
| | | <if test="updateDate != null"> |
| | | and UPDATE_DATE = #{updateDate} |
| | | </if> |
| | | <if test="updateUser != null"> |
| | | and UPDATE_USER = #{updateUser} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--éè¿ä¸»é®ä¿®æ¹æ°æ®--> |
| | | <!--<update id="update"> |
| | | update PL_SYS_STRATEGY |
| | | <set> |
| | | <if test="strategyName != null and strategyName != ''"> |
| | | STRATEGY_NAME = #{strategyName}, |
| | | </if> |
| | | <if test="minPwdLen != null and minPwdLen != ''"> |
| | | MIN_PWD_LEN = #{minPwdLen}, |
| | | </if> |
| | | <if test="maxPwdLen != null and maxPwdLen != ''"> |
| | | MAX_PWD_LEN = #{maxPwdLen}, |
| | | </if> |
| | | <if test="combination != null and combination != ''"> |
| | | COMBINATION = #{combination }, |
| | | </if> |
| | | <if test="requiredType != null and requiredType != ''"> |
| | | REQUIRED_TYPE = #{requiredType}, |
| | | </if> |
| | | <if test="expirationTime != null"> |
| | | EXPIRATION_TIME = #{expirationTime}, |
| | | </if> |
| | | <if test="reminderTime != null"> |
| | | REMINDER_TIME = #{reminderTime}, |
| | | </if> |
| | | <if test="lockingNum != null and lockingNum != ''"> |
| | | LOCKING_NUM = #{lockingNum}, |
| | | </if> |
| | | <if test="lockingTime != null"> |
| | | LOCKING_TIME = #{lockingTime}, |
| | | </if> |
| | | <if test="desc != null and desc != ''"> |
| | | DESC = #{desc}, |
| | | </if> |
| | | <if test="isDefault != null and isDefault != ''"> |
| | | IS_DEFAULT = #{isDefault}, |
| | | </if> |
| | | <if test="createDate != null"> |
| | | CREATE_DATE = #{createDate}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | CREATE_USER = #{createUser}, |
| | | </if> |
| | | <if test="updateDate != null"> |
| | | UPDATE_DATE = #{updateDate}, |
| | | </if> |
| | | <if test="updateUser != null"> |
| | | UPDATE_USER = #{updateUser}, |
| | | </if> |
| | | </set> |
| | | where ID = #{id} |
| | | </update> |
| | | |
| | | <!–éè¿ä¸»é®å 餖> |
| | | <delete id="deleteById"> |
| | | delete from PL_SYS_STRATEGY where ID = #{id} |
| | | </delete>--> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | <result column="tenant_name" property="tenantName"/> |
| | | <result column="full_name" property="fullName"/> |
| | | <result column="domain_url" property="domainUrl"/> |
| | | <result column="background_url" property="backgroundUrl"/> |
| | | <result column="linkman" property="linkman"/> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.system.entity.ValueRange; |
| | | import org.springframework.data.domain.Pageable; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ValueRannge)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:25 |
| | | */ |
| | | public interface ValueRangeMapper extends BaseMapper<ValueRange> { |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®è¡æ°æ® |
| | | * |
| | | * @param valueRannge æ¥è¯¢æ¡ä»¶ |
| | | * @param pageable å页对象 |
| | | * @return 对象å表 |
| | | */ |
| | | List<ValueRange> queryAllByLimit(ValueRange valueRannge, @Param("pageable") Pageable pageable); |
| | | |
| | | /** |
| | | * ç»è®¡æ»è¡æ° |
| | | * |
| | | * @param valueRannge æ¥è¯¢æ¡ä»¶ |
| | | * @return æ»è¡æ° |
| | | */ |
| | | long count(ValueRange valueRannge); |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.springblade.system.mapper.ValueRangeMapper"> |
| | | |
| | | <resultMap type="org.springblade.system.entity.ValueRange" id="ValueRangeMap"> |
| | | <result property="id" column="ID" jdbcType="VARCHAR"/> |
| | | <result property="value" column="VALUE" jdbcType="VARCHAR"/> |
| | | <result property="combinationId" column="COMBINATION_ID" jdbcType="VARCHAR"/> |
| | | <result property="createuser" column="CREATEUSER" jdbcType="VARCHAR"/> |
| | | <result property="updatetime" column="UPDATETIME" jdbcType="TIMESTAMP"/> |
| | | <result property="updateuser" column="UPDATEUSER" jdbcType="VARCHAR"/> |
| | | <result property="createtime" column="CREATETIME" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <!--æ¥è¯¢æå®è¡æ°æ®--> |
| | | <select id="queryAllByLimit" resultMap="ValueRangeMap"> |
| | | select |
| | | ID, VALUE, COMBINATION_ID, CREATEUSER, UPDATETIME, UPDATEUSER, CREATETIME |
| | | from PL_SYS_VALUE_RANGE |
| | | <where> |
| | | <if test="id != null and id != ''"> |
| | | and ID = #{id} |
| | | </if> |
| | | <if test="value != null and value != ''"> |
| | | and VALUE = #{value} |
| | | </if> |
| | | <if test="combinationId != null and combinationId != ''"> |
| | | and COMBINATION_ID = #{combinationId} |
| | | </if> |
| | | <if test="createuser != null and createuser != ''"> |
| | | and CREATEUSER = #{createuser} |
| | | </if> |
| | | <if test="updatetime != null"> |
| | | and UPDATETIME = #{updatetime} |
| | | </if> |
| | | <if test="updateuser != null and updateuser != ''"> |
| | | and UPDATEUSER = #{updateuser} |
| | | </if> |
| | | <if test="createtime != null"> |
| | | and CREATETIME = #{createtime} |
| | | </if> |
| | | </where> |
| | | limit #{pageable.offset}, #{pageable.pageSize} |
| | | </select> |
| | | |
| | | <!--ç»è®¡æ»è¡æ°--> |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from PL_SYS_VALUE_RANGE |
| | | <where> |
| | | <if test="id != null and id != ''"> |
| | | and ID = #{id} |
| | | </if> |
| | | <if test="value != null and value != ''"> |
| | | and VALUE = #{value} |
| | | </if> |
| | | <if test="combinationId != null and combinationId != ''"> |
| | | and COMBINATION_ID = #{combinationId} |
| | | </if> |
| | | <if test="createuser != null and createuser != ''"> |
| | | and CREATEUSER = #{createuser} |
| | | </if> |
| | | <if test="updatetime != null"> |
| | | and UPDATETIME = #{updatetime} |
| | | </if> |
| | | <if test="updateuser != null and updateuser != ''"> |
| | | and UPDATEUSER = #{updateuser} |
| | | </if> |
| | | <if test="createtime != null"> |
| | | and CREATETIME = #{createtime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.system.entity.Combination; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å¯ç ç»åæ¹å¼è¡¨(PlSysCombination)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:21 |
| | | */ |
| | | public interface ICombinationService extends IService<Combination> { |
| | | |
| | | /** |
| | | * éè¿IDæ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | Combination queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param combination ç鿡件 |
| | | * @param page å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | IPage<Combination> selectCombinationPage(Combination combination, IPage<Combination> page); |
| | | |
| | | /** |
| | | * æ°å¢æ°æ®åä¿®æ¹æ°æ® |
| | | * |
| | | * @param combination å®ä¾å¯¹è±¡ |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | boolean submit(Combination combination); |
| | | |
| | | /** |
| | | * éè¿ä¸»é®å 餿°æ® |
| | | * |
| | | * @param ids |
| | | * @return æ¯å¦æå |
| | | */ |
| | | boolean deleteByIds(List<String> ids); |
| | | |
| | | /** |
| | | * ä¸ææ°æ®æºæ¥è¯¢ |
| | | * æ¥è¯¢ç»åidï¼keyï¼ï¼ç»ååï¼valueï¼ |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectMaps(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.system.entity.Strategy; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¯ç çç¥(PlSysStrategy)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:16:18 |
| | | */ |
| | | public interface IStrategyService extends IService<Strategy> { |
| | | |
| | | /** |
| | | * éè¿IDæ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | Strategy queryById(String id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param strategy ç鿡件 |
| | | * @param pageRequest å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | Page<Strategy> queryAllByPage(Strategy strategy, PageRequest pageRequest); |
| | | |
| | | /** |
| | | * æ°å¢æ°æ®æä¿®æ¹æ°æ® |
| | | * |
| | | * @param strategy å®ä¾å¯¹è±¡ |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | boolean submit(Strategy strategy); |
| | | |
| | | /** |
| | | * éè¿ä¸»é®å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return æ¯å¦æå |
| | | */ |
| | | boolean deleteByIds(List<String> ids); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.system.entity.ValueRange; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ValueRange)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:27 |
| | | */ |
| | | public interface IValueRangeService extends IService<ValueRange> { |
| | | |
| | | /** |
| | | * å
¨æ¥è¯¢ |
| | | * @return |
| | | */ |
| | | List<ValueRange> queryByAll(); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param valueRange ç鿡件 |
| | | * @param pageRequest å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | Page<ValueRange> queryByPage(ValueRange valueRange, PageRequest pageRequest); |
| | | |
| | | /** |
| | | * æ°å¢æ°æ®æä¿®æ¹æ°æ® |
| | | * |
| | | * @param valueRange å®ä¾å¯¹è±¡ |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | boolean submit(ValueRange valueRange); |
| | | |
| | | /** |
| | | * éè¿ä¸»é®å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return æ¯å¦æå |
| | | */ |
| | | boolean deleteByIds(List<String> ids); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.system.entity.Combination; |
| | | import org.springblade.system.mapper.CombinationMapper; |
| | | import org.springblade.system.service.ICombinationService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | | /** |
| | | * å¯ç ç»åæ¹å¼è¡¨(PlSysCombination)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:22 |
| | | */ |
| | | @Service |
| | | @Validated |
| | | //@AllArgsConstructor |
| | | public class CombinationServiceImpl extends ServiceImpl<CombinationMapper,Combination> implements ICombinationService { |
| | | |
| | | @Resource |
| | | private CombinationMapper combinationMapper; |
| | | |
| | | /** |
| | | * éè¿IDæ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public Combination queryById(Long id) { |
| | | Combination combination = this.getOne(Wrappers.<Combination>query().lambda().eq(Combination::getId, id)); |
| | | return combination; |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param combination ç鿡件 |
| | | * @param page å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public IPage<Combination> selectCombinationPage(Combination combination, IPage<Combination> page) { |
| | | return page.setRecords(combinationMapper.selectCombinationPage(page,combination)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ°æ®åä¿®æ¹æ°æ® |
| | | * |
| | | * @param combination å®ä¾å¯¹è±¡ |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public boolean submit(Combination combination) { |
| | | //夿æ¯å¦æºå¸¦id |
| | | if(Func.isEmpty(combination.getId())){ |
| | | //æ°å¢ |
| | | Combination dbcombination = this.getOne(Wrappers.<Combination>query().lambda().eq(Combination::getName, combination.getName())); |
| | | //å¦ææ°æ®åºä¸åå¨è¿æ¡ç»ååç§°çè®°å½ç´æ¥è¿å |
| | | if(!Func.isEmpty(dbcombination)){ |
| | | throw new ServiceException("ç»ååç§°å·²åå¨!"); |
| | | } |
| | | if(Func.isEmpty(combination.getCreateTime())){ |
| | | combination.setCreateTime(new Date()); |
| | | } |
| | | if(Func.isEmpty(combination.getUpdateTime())){ |
| | | combination.setUpdateTime(new Date()); |
| | | } |
| | | boolean temp = saveOrUpdate(combination); |
| | | return temp; |
| | | }else { |
| | | if(Func.isEmpty(combination.getUpdateTime())){ |
| | | combination.setUpdateTime(new Date()); |
| | | } |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | return saveOrUpdate(combination); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä¸»é®å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return æ¯å¦æå |
| | | */ |
| | | @Override |
| | | public boolean deleteByIds(List<String> ids) { |
| | | boolean tenantTemp = this.removeBatchByIds(ids); |
| | | return tenantTemp; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¯ç ç»åidï¼ç»ååï¼é®å¼å¯¹ |
| | | * |
| | | * @return é®å¼å¯¹ |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> selectMaps() { |
| | | List<Map<String, Object>> maps = listMaps(new QueryWrapper<Combination>().select("ID", "NAME")); |
| | | return maps; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.system.entity.Strategy; |
| | | import org.springblade.system.mapper.StrategyMapper; |
| | | import org.springblade.system.service.IStrategyService; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | | /** |
| | | * å¯ç çç¥(Strategy)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:25:05 |
| | | */ |
| | | @Service |
| | | public class StrategyServiceImpl extends ServiceImpl<StrategyMapper, Strategy> implements IStrategyService { |
| | | |
| | | @Resource |
| | | private StrategyMapper strategyMapper; |
| | | |
| | | /** |
| | | * éè¿IDæ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public Strategy queryById(String id) { |
| | | return this.strategyMapper.queryById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param strategy ç鿡件 |
| | | * @param pageRequest å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public Page<Strategy> queryAllByPage(Strategy strategy, PageRequest pageRequest) { |
| | | long total = this.strategyMapper.count(strategy); |
| | | return new PageImpl<>(this.strategyMapper.queryAllByPage(strategy, pageRequest), pageRequest, total); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ°æ®æè
ä¿®æ¹æ°æ® |
| | | * |
| | | * @param strategy å®ä¾å¯¹è±¡ |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public boolean submit(Strategy strategy) { |
| | | //夿æ¯å¦æºå¸¦id |
| | | if(Func.isEmpty(strategy.getId())){ |
| | | //æ°å¢ |
| | | Strategy dbstrategy = this.getOne(Wrappers.<Strategy>query().lambda() |
| | | .eq(Strategy::getStrategyName, strategy.getStrategyName())); |
| | | //å¦ææ°æ®åºä¸åå¨è¿æ¡ç»ååç§°çè®°å½ç´æ¥è¿å |
| | | if(!Func.isEmpty(dbstrategy)){ |
| | | throw new ServiceException("该å¯ç çç¥å·²åå¨!"); |
| | | } |
| | | if(Func.isEmpty(strategy.getCreateTime())){ |
| | | strategy.setCreateTime(new Date()); |
| | | } |
| | | if(Func.isEmpty(strategy.getUpdateTime())){ |
| | | strategy.setUpdateTime(new Date()); |
| | | } |
| | | boolean temp = super.saveOrUpdate(strategy); |
| | | return temp; |
| | | }else { |
| | | if(Func.isEmpty(strategy.getUpdateTime())){ |
| | | strategy.setUpdateTime(new Date()); |
| | | } |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | return super.saveOrUpdate(strategy); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä¸»é®å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return æ¯å¦æå |
| | | */ |
| | | @Override |
| | | public boolean deleteByIds(List<String> ids) { |
| | | boolean tenantTemp = this.removeBatchByIds(ids); |
| | | return tenantTemp; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import javafx.geometry.Pos; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.ibatis.mapping.Environment; |
| | | import org.springblade.common.constant.TenantConstant; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.tenant.TenantId; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.DesUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.system.cache.ParamCache; |
| | |
| | | import org.springblade.system.user.enums.UserEnum; |
| | | import org.springblade.system.user.feign.IUserClient; |
| | | import org.springblade.system.vo.TenantVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | List<String> codes = tenants.stream().map(Tenant::getTenantId).collect(Collectors.toList()); |
| | | String tenantId = getTenantId(codes); |
| | | tenant.setTenantId(tenantId); |
| | | // é
置为falseï¼å¹¶ä¸åç«¯ä¼ è¾çåæ°ä¸ºfalseå°±ä¸éè¦å建ä¸å |
| | | if(!this.ssaEnable && !tenant.getMembersFlag()){ |
| | | // é
置为falseï¼å¹¶ä¸åç«¯ä¼ è¾çåæ°ä¸º1(æªéæ©å¼å¯)å°±ä¸éè¦å建ä¸å |
| | | if(!this.ssaEnable && tenant.getSsaEnable()==1){ |
| | | // ä¸å¼å¯ä¸åç®¡çæ¶ç´æ¥å建ä¸ä¸ªæé«æéç管çå |
| | | Role role = new Role(tenantId,BladeConstant.TOP_PARENT_ID,"è¶
级管çå",1,"admin",BladeConstant.DB_NOT_DELETED); |
| | | roleService.save(role); |
| | |
| | | Dept dept = generateDept(tenantId, tenant); |
| | | deptService.save(dept); |
| | | // æ°å»ºç§æ·å¯¹åºçé»è®¤å²ä½ |
| | | Post postInfo = generatePost(tenantId, 1, "ceo", "é¦å¸æ§è¡å®", 1); |
| | | Post postInfo = generatePost(tenantId, 1, "admin", "管çå", 1); |
| | | postService.save(postInfo); |
| | | // æ°å»ºç§æ·å¯¹åºçé»è®¤ä¸å¡åå
¸ |
| | | LinkedList<DictBiz> dictBizs = new LinkedList<>(); |
| | |
| | | Dept dept = generateDept(tenantId, tenant); |
| | | deptService.save(dept); |
| | | // æ°å»ºç§æ·å¯¹åºçé»è®¤å²ä½ |
| | | Post postCeo = generatePost(tenantId, 1, "sysAdmin", "ç³»ç»ç®¡çå", 1); |
| | | Post postCto = generatePost(tenantId,1,"secAdmin","å®å
¨ç®¡çå",4); |
| | | Post postCio = generatePost(tenantId,1,"auditAdmin","审计管çå",5); |
| | | postService.saveBatch(Arrays.asList(postCeo,postCto,postCio)); |
| | | Post postSys = generatePost(tenantId, 1, this.ssaNames.get(0), "ç³»ç»ç®¡çå", 1); |
| | | Post postSec = generatePost(tenantId,1,this.ssaNames.get(1),"å®å
¨ç®¡çå",4); |
| | | Post postAudit = generatePost(tenantId,1,this.ssaNames.get(2),"审计管çå",5); |
| | | postService.saveBatch(Arrays.asList(postSys,postSec,postAudit)); |
| | | // æ°å»ºç§æ·å¯¹åºçé»è®¤ä¸å¡åå
¸ |
| | | LinkedList<DictBiz> dictBizs = new LinkedList<>(); |
| | | List<DictBiz> dictBizList = getDictBizs(tenantId, dictBizs); |
| | | dictBizService.saveBatch(dictBizList); |
| | | // æ°å»ºç§æ·å¯¹åºçé»è®¤ç®¡çç¨æ· |
| | | User userSys = generateUser(tenantId, roleSys, dept, postCeo); |
| | | User userSec = generateUser(tenantId,roleSec,dept,postCto); |
| | | User userAudit = generateUser(tenantId,roleAudit,dept,postCio); |
| | | User userSys = generateUser(tenantId, roleSys, dept, postSys); |
| | | User userSec = generateUser(tenantId,roleSec,dept,postSec); |
| | | User userAudit = generateUser(tenantId,roleAudit,dept,postAudit); |
| | | // å
ä¿åç§æ· |
| | | boolean temp = super.saveOrUpdate(tenant); |
| | | // åå»ºç¨æ· |
| | |
| | | @Override |
| | | public List<Map<String,Object>> selectMaps(){ |
| | | List<Map<String, Object>> maps = listMaps(new QueryWrapper<Tenant>().select("TENANT_ID", "TENANT_NAME")); |
| | | System.out.println(maps); |
| | | return maps; |
| | | } |
| | | |
| | |
| | | private void saveRoleMenus(Role role,List<String> stringMenus){ |
| | | LinkedList<Menu> userMenus = new LinkedList<>(); |
| | | // è·ååæ°é
ç½®çé»è®¤èåéåï¼éå·éå¼ |
| | | List<String> menuCodes = Func.toStrList(ParamCache.getValue(ACCOUNT_MENU_CODE_KEY)); |
| | | List<Menu> menus = getMenus((menuCodes.size() > 0 ? menuCodes : stringMenus), userMenus); |
| | | //List<String> menuCodes = Func.toStrList(ParamCache.getValue(ACCOUNT_MENU_CODE_KEY)); |
| | | List<Menu> menus = getMenus((stringMenus), userMenus); |
| | | List<RoleMenu> roleMenus = new ArrayList<>(); |
| | | //å建ææèåè§è²å
³è对象 |
| | | menus.forEach(menu -> { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.system.entity.ValueRange; |
| | | import org.springblade.system.mapper.ValueRangeMapper; |
| | | import org.springblade.system.service.IValueRangeService; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | | /** |
| | | * (PlSysValueRange)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2023-03-20 15:23:59 |
| | | */ |
| | | @Service |
| | | public class ValueRangeServiceImpl extends ServiceImpl<ValueRangeMapper,ValueRange> implements IValueRangeService { |
| | | |
| | | @Resource |
| | | private ValueRangeMapper valueRangeMapper; |
| | | |
| | | /** |
| | | * å
¨æ¥è¯¢ |
| | | * |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public List<ValueRange> queryByAll() { |
| | | return valueRangeMapper.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param valueRange ç鿡件 |
| | | * @param pageRequest å页对象 |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public Page<ValueRange> queryByPage(ValueRange valueRange, PageRequest pageRequest) { |
| | | long total = this.valueRangeMapper.count(valueRange); |
| | | return new PageImpl<>(this.valueRangeMapper.queryAllByLimit(valueRange, pageRequest), pageRequest, total); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ°æ® |
| | | * |
| | | * @param valueRange å®ä¾å¯¹è±¡ |
| | | * @return å®ä¾å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public boolean submit(ValueRange valueRange) { |
| | | //夿æ¯å¦æºå¸¦id |
| | | if(Func.isEmpty(valueRange.getId())){ |
| | | //æ°å¢ |
| | | ValueRange dbValueRange = this.getOne(Wrappers.<ValueRange>query().lambda() |
| | | .eq(ValueRange::getCombinationId,valueRange.getCombinationId()) |
| | | .eq(ValueRange::getValue, valueRange.getValue())); |
| | | //åä¸ç»åæ¹å¼ä¸ä¸è½åºç°ç¸åçåå¼èå´ |
| | | if(!Func.isEmpty(dbValueRange)){ |
| | | throw new ServiceException("该ç»åæ¹å¼ä¸å·²åå¨ç¸ååå¼èå´!"); |
| | | } |
| | | if(Func.isEmpty(valueRange.getCreateTime())){ |
| | | valueRange.setCreateTime(new Date()); |
| | | } |
| | | if(Func.isEmpty(valueRange.getUpdateTime())){ |
| | | valueRange.setUpdateTime(new Date()); |
| | | } |
| | | boolean temp = saveOrUpdate(valueRange); |
| | | return temp; |
| | | }else { |
| | | if(Func.isEmpty(valueRange.getUpdateTime())){ |
| | | valueRange.setUpdateTime(new Date()); |
| | | } |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | return saveOrUpdate(valueRange); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä¸»é®å 餿°æ® |
| | | * |
| | | * @param ids ä¸»é® |
| | | * @return æ¯å¦æå |
| | | */ |
| | | @Override |
| | | public boolean deleteByIds(List<String> ids) { |
| | | boolean tenantTemp = this.removeBatchByIds(ids); |
| | | return tenantTemp; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "æ¥ç详æ
", notes = "ä¼ å
¥id") |
| | | @GetMapping("/detail") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<UserVO> detail(User user) { |
| | | User detail = userService.getOne(Condition.getQueryWrapper(user)); |
| | | return R.data(UserWrapper.build().entityVO(detail)); |
| | |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å表", notes = "ä¼ å
¥accountårealName") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) { |
| | | QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class); |
| | | IPage<User> pages = userService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å表", notes = "ä¼ å
¥accountårealName") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥User") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R submit(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | return R.status(userService.submit(user)); |
| | |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "å é¤", notes = "ä¼ å
¥idéå") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R remove(@RequestParam String ids) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | return R.status(userService.removeUser(ids)); |
| | |
| | | @PostMapping("/grant") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "æé设置", notes = "ä¼ å
¥roleIdéå以åmenuIdéå") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R grant(@ApiParam(value = "userIdéå", required = true) @RequestParam String userIds, |
| | | @ApiParam(value = "roleIdéå", required = true) @RequestParam String roleIds) { |
| | | boolean temp = userService.grant(userIds, roleIds); |
| | |
| | | @PostMapping("/reset-password") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "åå§åå¯ç ", notes = "ä¼ å
¥userIdéå") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R resetPassword(@ApiParam(value = "userIdéå", required = true) @RequestParam String userIds) { |
| | | boolean temp = userService.resetPassword(userIds); |
| | | return R.status(temp); |
| | |
| | | @ApiOperationSupport(order = 17) |
| | | @ApiOperation(value = "æ¥çå¹³å°è¯¦æ
", notes = "ä¼ å
¥id") |
| | | @GetMapping("/platform-detail") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<UserVO> platformDetail(User user) { |
| | | return R.data(userService.platformDetail(user)); |
| | | } |