Commit 83cc9cf7 authored by xfxmcy's avatar xfxmcy

使用sbpt 2.1.7

parent a4c08b85
......@@ -33,7 +33,7 @@
<dependency>
<groupId>org.91isoft</groupId>
<artifactId>91isoft_spbt</artifactId>
<version>2.1.5.6_beta13</version>
<version>2.1.6_beta7</version>
</dependency>
</dependencies>
......
......@@ -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:审核)',
`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 '注释',
`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 '空间名',
`realm_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '域名',
......
......@@ -2,7 +2,6 @@ package org.rcisoft.business.bspace.controller;
/*固定导入*/
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
......@@ -27,9 +26,8 @@ import org.rcisoft.business.bspace.service.BSpaceService;
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
@RequestMapping("/bspace")
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")})
@PostMapping(value = "/add")
public CyResult add(@Valid BSpace bSpace, BindingResult bindingResult) {
CyPersistModel data = bSpaceServiceImpl.save(bSpace);
CyPersistModel data = bSpaceServiceImpl.persist(bSpace);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
bSpace);
}
@ApiOperation(value="逻辑删除", notes="逻辑删除")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/deleteLogical/{businessId:\\w+}")
......
......@@ -5,12 +5,14 @@ import org.rcisoft.business.bspace.entity.BSpace;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
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;
/**
* Created with cy on 2018-12-17 13:50:52.
* Created with cy on 2020-7-13 9:26:39.
*/
@Repository
public interface BSpaceRepository extends CyBaseMapper<BSpace> {
......@@ -25,5 +27,12 @@ public interface BSpaceRepository extends CyBaseMapper<BSpace> {
+ "</script>")
@ResultMap(value = "BaseResultMap" )
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;
import lombok.*;
import org.rcisoft.core.entity.CyIdEntity;
import javax.persistence.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.io.Serializable;
import java.util.Date;
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
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "b_space")
@TableName("b_space")
public class BSpace extends CyIdEntity<BSpace> {
......
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.core.model.CyPersistModel;
import org.rcisoft.core.aop.CyPageUtil;
import org.rcisoft.core.model.CyPageInfo;
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 {
......@@ -16,7 +19,7 @@ public interface BSpaceService {
* @param bSpace
* @return
*/
CyPersistModel save(BSpace bSpace);
CyPersistModel persist(BSpace bSpace);
/**
* 删除
......@@ -24,14 +27,12 @@ public interface BSpaceService {
* @return
*/
CyPersistModel remove(BSpace bSpace);
/**
* 逻辑删除
* @param bSpace
* @return
*/
CyPersistModel removeLogical(BSpace bSpace);
/**
* 修改
* @param bSpace
......@@ -51,8 +52,8 @@ public interface BSpaceService {
* @param bSpace
* @return
*/
List<BSpace> findAllByPagination(CyPageUtil<BSpace> paginationUtility,
BSpace bSpace);
IPage<BSpace> findAllByPagination(CyPageInfo<BSpace> paginationUtility,
BSpace bSpace);
/**
......
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.aop.CyPageUtil;
import org.rcisoft.core.model.CyPersistModel;
......@@ -13,22 +19,18 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List;
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
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
@Slf4j
public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
private static final long serialVersionUID = -3485875433825192456L;
@Autowired
private BSpaceRepository bSpaceRepository;
public class BSpaceServiceImpl extends ServiceImpl<BSpaceRepository,BSpace> implements BSpaceService {
/**
......@@ -38,11 +40,12 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel save(BSpace bSpace){
public CyPersistModel persist(BSpace bSpace){
//增加操作
CyUserUtil.setCurrentPersistOperation(bSpace);
int line = bSpaceRepository.insertSelective(bSpace);
this.dbInfo(CyUserUtil.getAuthenUsername() + "新增了ID为"+bSpace.getBusinessId()+"的信息","新增");
int line = baseMapper.insert(bSpace);
CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"新增了ID为"+
bSpace.getBusinessId()+"的信息","新增");
log.info(CyUserUtil.getAuthenUsername()+"新增了ID为"+
bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line);
......@@ -56,12 +59,13 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel remove(BSpace bSpace){
int line = bSpaceRepository.deleteByPrimaryKey(bSpace.getBusinessId());
this.dbInfo(CyUserUtil.getAuthenUsername()+"删除了ID为"+bSpace.getBusinessId()+"的信息","删除");
log.info(CyUserUtil.getAuthenUsername()+"删除了ID为"+bSpace.getBusinessId()+"的信息");
int line = baseMapper.realDelete(bSpace);
CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"删除了ID为"+
bSpace.getBusinessId()+"的信息","删除");
log.info(CyUserUtil.getAuthenUsername()+"删除了ID为"+
bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line);
}
/**
* 逻辑删除
* @param bSpace
......@@ -72,13 +76,14 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
public CyPersistModel removeLogical(BSpace bSpace){
CyUserUtil.setCurrentMergeOperation(bSpace);
bSpace.setDeleted();
int line = bSpaceRepository.logicalDelete(bSpace);
this.dbInfo(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+bSpace.getBusinessId()+"的信息","逻辑删除");
log.info(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+bSpace.getBusinessId()+"的信息");
int line = baseMapper.deleteById(bSpace);
CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
bSpace.getBusinessId()+"的信息","逻辑删除");
log.info(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line);
}
/**
* 修改
* @param bSpace
......@@ -88,9 +93,9 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
@Override
public CyPersistModel merge(BSpace bSpace){
CyUserUtil.setCurrentMergeOperation(bSpace);
int line = bSpaceRepository.updateByPrimaryKeySelective(bSpace);
this.dbInfo(CyUserUtil.getAuthenUsername()+"修改了ID为"+bSpace.getBusinessId()+"的信息","修改");
log.info(CyUserUtil.getAuthenUsername()+"修改了ID为"+bSpace.getBusinessId()+"的信息");
int line = baseMapper.updateById(bSpace);
CyLogPstUtil.dbInfo(CyUserUtil.getAuthenUsername()+"修改了ID为"+bSpace.getBusinessId()+"的信息","修改");
log.info(CyUserUtil.getAuthenUsername()+"修改了ID为"+ bSpace.getBusinessId()+"的信息");
return new CyPersistModel(line);
}
......@@ -101,7 +106,7 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
*/
@Override
public BSpace findById(String id){
return bSpaceRepository.selectByPrimaryKey(id);
return baseMapper.selectById(id);
}
/**
......@@ -110,10 +115,10 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
* @return
*/
@Override
public List<BSpace> findAllByPagination(CyPageUtil<BSpace> paginationUtility,
public IPage<BSpace> findAllByPagination(CyPageInfo<BSpace> paginationUtility,
BSpace bSpace){
bSpace.setNormal();
return bSpaceRepository.queryBSpaces(bSpace);
return baseMapper.queryBSpacesPaged(paginationUtility,bSpace);
}
/**
* 查询list
......@@ -122,8 +127,8 @@ public class BSpaceServiceImpl extends CyBaseService implements BSpaceService {
*/
@Override
public List<BSpace> findAll(BSpace bSpace){
bSpace.setNormal();
return bSpaceRepository.queryBSpaces(bSpace);
return baseMapper.queryBSpaces(bSpace);
}
}
......@@ -6,20 +6,13 @@ server:
context-path: /
session:
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:
multipart:
......@@ -36,9 +29,9 @@ spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
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
password: spcl
password: cy
main:
allow-bean-definition-overriding: true
springfox:
......@@ -68,33 +61,42 @@ cy:
user_undelete: ["admin","333e421d32d9425ea99afce95b603902"]
model:
schema: spbt
druid: false
multipleDs: false
quartz: false
redis: false
entityParam: true
decryptParam: false
decryptSm4Param: false
decryptSm4Secret: 'FFFAAA333666DDDB'
swagger2Config: true
activiti: true
activiti:
enable: false
schemaUpdate: true
databaseType: mysql
code:
enable: true
author: cy
database: mysql
basePackage: org.rcisoft.business
security:
enable: true
defaultFilter: true
permit-all:
permitUnStatic:
- "/static/**"
- "/webjars/**"
- "/v2/**"
- "/swagger-resources/**"
- "/api-docs/**"
- "/auth/**"
- "/code/**/**"
- "/excelUtil/**"
- "/cros/**"
- "/**/**"
permitStatic: ["/", "/*.html", "/favicon.ico", "/**/*.html", "/**/*.js", "/**/*.css"]
logoutSuccessUrl: "/login"
loginPage: "/login"
loginfailureUrl: "/login-error.html"
permitUnStatic:
- "/static/**"
- "/webjars/**"
- "/v2/**"
- "/swagger-resources/**"
- "/api-docs/**"
- "/auth/**"
- "/code/**/**"
- "/excelUtil/**"
- "/cros/**"
- "/**/**"
permitStatic: ["/", "/*.html", "/favicon.ico", "/**/*.html", "/**/*.js", "/**/*.css"]
logoutSuccessUrl: "/login"
loginPage: "/login"
loginfailureUrl: "/login-error.html"
global:
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