Commit 83cc9cf7 authored by xfxmcy's avatar xfxmcy

使用sbpt 2.1.7

parent a4c08b85
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<dependency> <dependency>
<groupId>org.91isoft</groupId> <groupId>org.91isoft</groupId>
<artifactId>91isoft_spbt</artifactId> <artifactId>91isoft_spbt</artifactId>
<version>2.1.5.6_beta13</version> <version>2.1.6_beta7</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -12,6 +12,7 @@ CREATE TABLE `b_space` ( ...@@ -12,6 +12,7 @@ CREATE TABLE `b_space` (
`del_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记(0:正常;1:删除;2:审核)', `del_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记(0:正常;1:删除;2:审核)',
`flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '启用标记(0:停用;1:启用)', `flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '启用标记(0:停用;1:启用)',
`remarks` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '注释', `remarks` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '注释',
`space_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '空间编号', `space_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '空间编号',
`space_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '空间名', `space_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '空间名',
`realm_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '域名', `realm_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '域名',
......
...@@ -2,7 +2,6 @@ package org.rcisoft.business.bspace.controller; ...@@ -2,7 +2,6 @@ package org.rcisoft.business.bspace.controller;
/*固定导入*/ /*固定导入*/
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -27,9 +26,8 @@ import org.rcisoft.business.bspace.service.BSpaceService; ...@@ -27,9 +26,8 @@ import org.rcisoft.business.bspace.service.BSpaceService;
import java.util.List; import java.util.List;
/** /**
* Created by cy on 2018-12-17 13:50:52. * Created by cy on 2020-7-13 9:26:39.
*/ */
@Api(tags = "空间管理")
@RestController @RestController
@RequestMapping("/bspace") @RequestMapping("/bspace")
public class BSpaceController extends CyPaginationController<BSpace> { public class BSpaceController extends CyPaginationController<BSpace> {
...@@ -42,13 +40,12 @@ public class BSpaceController extends CyPaginationController<BSpace> { ...@@ -42,13 +40,12 @@ public class BSpaceController extends CyPaginationController<BSpace> {
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) //@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add") @PostMapping(value = "/add")
public CyResult add(@Valid BSpace bSpace, BindingResult bindingResult) { public CyResult add(@Valid BSpace bSpace, BindingResult bindingResult) {
CyPersistModel data = bSpaceServiceImpl.save(bSpace); CyPersistModel data = bSpaceServiceImpl.persist(bSpace);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
bSpace); bSpace);
} }
@ApiOperation(value="逻辑删除", notes="逻辑删除") @ApiOperation(value="逻辑删除", notes="逻辑删除")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/deleteLogical/{businessId:\\w+}") @DeleteMapping("/deleteLogical/{businessId:\\w+}")
......
...@@ -5,12 +5,14 @@ import org.rcisoft.business.bspace.entity.BSpace; ...@@ -5,12 +5,14 @@ import org.rcisoft.business.bspace.entity.BSpace;
import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.rcisoft.core.model.CyPageInfo;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List; import java.util.List;
/** /**
* Created with cy on 2018-12-17 13:50:52. * Created with cy on 2020-7-13 9:26:39.
*/ */
@Repository @Repository
public interface BSpaceRepository extends CyBaseMapper<BSpace> { public interface BSpaceRepository extends CyBaseMapper<BSpace> {
...@@ -25,5 +27,12 @@ public interface BSpaceRepository extends CyBaseMapper<BSpace> { ...@@ -25,5 +27,12 @@ public interface BSpaceRepository extends CyBaseMapper<BSpace> {
+ "</script>") + "</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BSpace> queryBSpaces(BSpace bSpace); List<BSpace> queryBSpaces(BSpace bSpace);
@Select("<script>select * from b_space where 1=1 "
+ "<if test=\"entity.delFlag !=null and entity.delFlag != '' \">and del_flag = #{entity.delFlag} </if> "
+ "<if test=\"entity.flag !=null and entity.flag != '' \">and flag = #{entity.flag} </if> "
+ "</script>")
@ResultMap(value = "BaseResultMap" )
IPage<BSpace> queryBSpacesPaged(CyPageInfo cyPageInfo, @Param("entity") BSpace bSpace);
} }
...@@ -3,21 +3,18 @@ package org.rcisoft.business.bspace.entity; ...@@ -3,21 +3,18 @@ package org.rcisoft.business.bspace.entity;
import lombok.*; import lombok.*;
import org.rcisoft.core.entity.CyIdEntity; import org.rcisoft.core.entity.CyIdEntity;
import javax.persistence.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.annotation.TableName;
/** /**
* Created with cy on 2018-12-17 13:50:51. * Created with cy on 2020-7-13 9:26:39.
*/ */
@Entity
@Data @Data
@NoArgsConstructor @TableName("b_space")
@AllArgsConstructor
@Table(name = "b_space")
public class BSpace extends CyIdEntity<BSpace> { public class BSpace extends CyIdEntity<BSpace> {
......
package org.rcisoft.business.bspace.service; package org.rcisoft.business.bspace.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.rcisoft.business.bspace.entity.BSpace; import org.rcisoft.business.bspace.entity.BSpace;
import org.rcisoft.core.model.CyPersistModel; import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.aop.CyPageUtil; import org.rcisoft.core.aop.CyPageUtil;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List; import java.util.List;
/** /**
* Created by cy on 2018-12-17 13:50:52. * Created by cy on 2020-7-13 9:26:39.
*/ */
public interface BSpaceService { public interface BSpaceService {
...@@ -16,7 +19,7 @@ public interface BSpaceService { ...@@ -16,7 +19,7 @@ public interface BSpaceService {
* @param bSpace * @param bSpace
* @return * @return
*/ */
CyPersistModel save(BSpace bSpace); CyPersistModel persist(BSpace bSpace);
/** /**
* 删除 * 删除
...@@ -24,14 +27,12 @@ public interface BSpaceService { ...@@ -24,14 +27,12 @@ public interface BSpaceService {
* @return * @return
*/ */
CyPersistModel remove(BSpace bSpace); CyPersistModel remove(BSpace bSpace);
/** /**
* 逻辑删除 * 逻辑删除
* @param bSpace * @param bSpace
* @return * @return
*/ */
CyPersistModel removeLogical(BSpace bSpace); CyPersistModel removeLogical(BSpace bSpace);
/** /**
* 修改 * 修改
* @param bSpace * @param bSpace
...@@ -51,8 +52,8 @@ public interface BSpaceService { ...@@ -51,8 +52,8 @@ public interface BSpaceService {
* @param bSpace * @param bSpace
* @return * @return
*/ */
List<BSpace> findAllByPagination(CyPageUtil<BSpace> paginationUtility, IPage<BSpace> findAllByPagination(CyPageInfo<BSpace> paginationUtility,
BSpace bSpace); BSpace bSpace);
/** /**
......
package org.rcisoft.business.bspace.service.impl; package org.rcisoft.business.bspace.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.rcisoft.core.util.CyLogPstUtil;
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.rcisoft.core.util.CyUserUtil; import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.aop.CyPageUtil; import org.rcisoft.core.aop.CyPageUtil;
import org.rcisoft.core.model.CyPersistModel; import org.rcisoft.core.model.CyPersistModel;
...@@ -13,22 +19,18 @@ import org.springframework.stereotype.Service; ...@@ -13,22 +19,18 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List; import java.util.List;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
* Created by cy on 2018-12-17 13:50:52. * Created by cy on 2020-7-13 9:26:39.
*/ */
@Service @Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED) @Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
@Slf4j @Slf4j
public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { public class BSpaceServiceImpl extends ServiceImpl<BSpaceRepository,BSpace> implements BSpaceService {
private static final long serialVersionUID = -3485875433825192456L;
@Autowired
private BSpaceRepository bSpaceRepository;
/** /**
...@@ -38,11 +40,12 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { ...@@ -38,11 +40,12 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
*/ */
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public CyPersistModel save(BSpace bSpace){ public CyPersistModel persist(BSpace bSpace){
//增加操作 //增加操作
CyUserUtil.setCurrentPersistOperation(bSpace); CyUserUtil.setCurrentPersistOperation(bSpace);
int line = bSpaceRepository.insertSelective(bSpace); int line = baseMapper.insert(bSpace);
this.dbInfo(CyUserUtil.getAuthenUsername() + "新增了ID为"+bSpace.getBusinessId()+"的信息","新增"); CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"新增了ID为"+
bSpace.getBusinessId()+"的信息","新增");
log.info(CyUserUtil.getAuthenUsername()+"新增了ID为"+ log.info(CyUserUtil.getAuthenUsername()+"新增了ID为"+
bSpace.getBusinessId()+"的信息"); bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line); return new CyPersistModel(line);
...@@ -56,12 +59,13 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { ...@@ -56,12 +59,13 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public CyPersistModel remove(BSpace bSpace){ public CyPersistModel remove(BSpace bSpace){
int line = bSpaceRepository.deleteByPrimaryKey(bSpace.getBusinessId()); int line = baseMapper.realDelete(bSpace);
this.dbInfo(CyUserUtil.getAuthenUsername()+"删除了ID为"+bSpace.getBusinessId()+"的信息","删除"); CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"删除了ID为"+
log.info(CyUserUtil.getAuthenUsername()+"删除了ID为"+bSpace.getBusinessId()+"的信息"); bSpace.getBusinessId()+"的信息","删除");
log.info(CyUserUtil.getAuthenUsername()+"删除了ID为"+
bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line); return new CyPersistModel(line);
} }
/** /**
* 逻辑删除 * 逻辑删除
* @param bSpace * @param bSpace
...@@ -72,13 +76,14 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { ...@@ -72,13 +76,14 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
public CyPersistModel removeLogical(BSpace bSpace){ public CyPersistModel removeLogical(BSpace bSpace){
CyUserUtil.setCurrentMergeOperation(bSpace); CyUserUtil.setCurrentMergeOperation(bSpace);
bSpace.setDeleted(); bSpace.setDeleted();
int line = bSpaceRepository.logicalDelete(bSpace); int line = baseMapper.deleteById(bSpace);
this.dbInfo(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+bSpace.getBusinessId()+"的信息","逻辑删除"); CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
log.info(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+bSpace.getBusinessId()+"的信息"); bSpace.getBusinessId()+"的信息","逻辑删除");
log.info(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line); return new CyPersistModel(line);
} }
/** /**
* 修改 * 修改
* @param bSpace * @param bSpace
...@@ -88,9 +93,9 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { ...@@ -88,9 +93,9 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
@Override @Override
public CyPersistModel merge(BSpace bSpace){ public CyPersistModel merge(BSpace bSpace){
CyUserUtil.setCurrentMergeOperation(bSpace); CyUserUtil.setCurrentMergeOperation(bSpace);
int line = bSpaceRepository.updateByPrimaryKeySelective(bSpace); int line = baseMapper.updateById(bSpace);
this.dbInfo(CyUserUtil.getAuthenUsername()+"修改了ID为"+bSpace.getBusinessId()+"的信息","修改"); CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"修改了ID为"+bSpace.getBusinessId()+"的信息","修改");
log.info(CyUserUtil.getAuthenUsername()+"修改了ID为"+bSpace.getBusinessId()+"的信息"); log.info(CyUserUtil.getAuthenUsername()+"修改了ID为"+ bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line); return new CyPersistModel(line);
} }
...@@ -101,7 +106,7 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { ...@@ -101,7 +106,7 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
*/ */
@Override @Override
public BSpace findById(String id){ public BSpace findById(String id){
return bSpaceRepository.selectByPrimaryKey(id); return baseMapper.selectById(id);
} }
/** /**
...@@ -110,10 +115,10 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { ...@@ -110,10 +115,10 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
* @return * @return
*/ */
@Override @Override
public List<BSpace> findAllByPagination(CyPageUtil<BSpace> paginationUtility, public IPage<BSpace> findAllByPagination(CyPageInfo<BSpace> paginationUtility,
BSpace bSpace){ BSpace bSpace){
bSpace.setNormal(); return baseMapper.queryBSpacesPaged(paginationUtility,bSpace);
return bSpaceRepository.queryBSpaces(bSpace);
} }
/** /**
* 查询list * 查询list
...@@ -122,8 +127,8 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService { ...@@ -122,8 +127,8 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
*/ */
@Override @Override
public List<BSpace> findAll(BSpace bSpace){ public List<BSpace> findAll(BSpace bSpace){
bSpace.setNormal(); return baseMapper.queryBSpaces(bSpace);
return bSpaceRepository.queryBSpaces(bSpace);
} }
} }
...@@ -6,20 +6,13 @@ server: ...@@ -6,20 +6,13 @@ server:
context-path: / context-path: /
session: session:
timeout: PT480M timeout: PT480M
mybatis:
mapper-locations: "classpath*:mapper/**/**/*.xml"
mapper:
mappers:
- org.rcisoft.core.base.CyBaseMapper
not-empty: false
identity: MYSQL
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
mybatis-plus:
mapper-locations: "classpath*:mapper/**/**/*.xml"
global-config:
db-config:
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
spring: spring:
multipart: multipart:
...@@ -36,9 +29,9 @@ spring: ...@@ -36,9 +29,9 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://${MYSQL_HOST:103.249.252.28}:${MYSQL_PORT:10701}/cyTest?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT%2B8 url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/cyTest?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT%2B8
username: root username: root
password: spcl password: cy
main: main:
allow-bean-definition-overriding: true allow-bean-definition-overriding: true
springfox: springfox:
...@@ -68,33 +61,42 @@ cy: ...@@ -68,33 +61,42 @@ cy:
user_undelete: ["admin","333e421d32d9425ea99afce95b603902"] user_undelete: ["admin","333e421d32d9425ea99afce95b603902"]
model: model:
schema: spbt schema: spbt
druid: false
multipleDs: false multipleDs: false
quartz: false quartz: false
redis: false redis: false
entityParam: true entityParam: true
decryptParam: false decryptParam: false
decryptSm4Param: false
decryptSm4Secret: 'FFFAAA333666DDDB'
swagger2Config: true swagger2Config: true
activiti: true activiti:
enable: false
schemaUpdate: true
databaseType: mysql
code:
enable: true
author: cy
database: mysql
basePackage: org.rcisoft.business
security: security:
enable: true enable: true
defaultFilter: true
permit-all: permit-all:
permitUnStatic: permitUnStatic:
- "/static/**" - "/static/**"
- "/webjars/**" - "/webjars/**"
- "/v2/**" - "/v2/**"
- "/swagger-resources/**" - "/swagger-resources/**"
- "/api-docs/**" - "/api-docs/**"
- "/auth/**" - "/auth/**"
- "/code/**/**" - "/code/**/**"
- "/excelUtil/**" - "/excelUtil/**"
- "/cros/**" - "/cros/**"
- "/**/**" - "/**/**"
permitStatic: ["/", "/*.html", "/favicon.ico", "/**/*.html", "/**/*.js", "/**/*.css"] permitStatic: ["/", "/*.html", "/favicon.ico", "/**/*.html", "/**/*.js", "/**/*.css"]
logoutSuccessUrl: "/login" logoutSuccessUrl: "/login"
loginPage: "/login" loginPage: "/login"
loginfailureUrl: "/login-error.html" loginfailureUrl: "/login-error.html"
global: global:
path: path:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment