Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_spbt_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王淑君
91isoft_spbt_project
Commits
ac208ce9
Commit
ac208ce9
authored
Dec 17, 2018
by
王淑君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
ed60f0b6
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
317 additions
and
527 deletions
+317
-527
pom.xml
pom.xml
+1
-1
readMe.md
readMe.md
+1
-1
system_dept_alone.sql
sql/system_dept_alone.sql
+86
-88
BSpaceController.java
.../rcisoft/business/bspace/controller/BSpaceController.java
+71
-126
BSpaceRepository.java
...ava/org/rcisoft/business/bspace/dao/BSpaceRepository.java
+8
-83
BSpace.java
src/main/java/org/rcisoft/business/bspace/entity/BSpace.java
+29
-18
BSpaceService.java
...va/org/rcisoft/business/bspace/service/BSpaceService.java
+36
-62
BSpaceServiceImpl.java
...isoft/business/bspace/service/impl/BSpaceServiceImpl.java
+58
-121
application-dev.yml
src/main/resources/application-dev.yml
+1
-1
logback-spring.xml
src/main/resources/logback-spring.xml
+6
-8
BSpaceMapper.xml
src/main/resources/mapper.biz/bspace/mapper/BSpaceMapper.xml
+0
-18
BSpaceMapper.xml
src/main/resources/mapper/biz/bspace/mapper/BSpaceMapper.xml
+20
-0
No files found.
pom.xml
View file @
ac208ce9
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<dependency>
<dependency>
<groupId>
org.91isoft
</groupId>
<groupId>
org.91isoft
</groupId>
<artifactId>
91isoft_spbt
</artifactId>
<artifactId>
91isoft_spbt
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0
.1
-SNAPSHOT
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
readMe.md
View file @
ac208ce9
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
<dependency>
<dependency>
<groupId>
org.91isoft
</groupId>
<groupId>
org.91isoft
</groupId>
<artifactId>
91isoft_spbt
</artifactId>
<artifactId>
91isoft_spbt
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0
.1
-SNAPSHOT
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
~~~
~~~
...
...
sql/system_dept_alone.sql
View file @
ac208ce9
This diff is collapsed.
Click to expand it.
src/main/java/org/rcisoft/business/bspace/controller/BSpaceController.java
View file @
ac208ce9
...
@@ -2,136 +2,80 @@ package org.rcisoft.business.bspace.controller;
...
@@ -2,136 +2,80 @@ package org.rcisoft.business.bspace.controller;
/*固定导入*/
/*固定导入*/
import
com.alibaba.fastjson.JSON
;
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
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.bspace.entity.BSpace
;
import
org.rcisoft.business.bspace.service.BSpaceService
;
import
org.rcisoft.config.CySecurityConfig
;
import
org.rcisoft.core.constant.CyMessCons
;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.result.CyResult
;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.sys.user.entity.SysUser
;
import
org.rcisoft.sys.user.service.SysUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.rcisoft.core.result.CyResult
;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.constant.CyMessCons
;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.exception.CyServiceException
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
org.rcisoft.business.bspace.entity.BSpace
;
import
org.rcisoft.business.bspace.service.BSpaceService
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Created by on 2018-6-21 17:10:54
.
* Created by cy on 2018-12-17 13:50:52
.
*/
*/
@RestController
@RestController
@RequestMapping
(
"bspace"
)
@RequestMapping
(
"/bspace"
)
@Slf4j
public
class
BSpaceController
extends
CyPaginationController
<
BSpace
>
{
public
class
BSpaceController
extends
CyPaginationController
<
BSpace
>
{
@Autowired
@Autowired
private
BSpaceService
bSpaceServiceImpl
;
private
BSpaceService
bSpaceServiceImpl
;
@Autowired
private
SysUserService
userServiceImpl
;
@Autowired
private
CySecurityConfig
cySecurityConfig
;
@GetMapping
(
value
=
"/num"
)
@ApiOperation
(
value
=
"查看 集合 不分页"
,
notes
=
"查看 集合"
)
public
CyResult
lists
(
BSpace
bSpace
)
{
// return CyResultGenUtil.builder(new CyPersistModel(1),
// CyMessCons.MESSAGE_ALERT_SUCCESS,
// CyMessCons.MESSAGE_ALERT_ERROR,cySecurityConfig.httpStr());
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
bSpaceServiceImpl
.
listAllSpaces
(
bSpace
));
}
/**
* 查询空间 分页
*
* @param spaceList
* @return
*/
@ApiOperation
(
value
=
"分页查询空间"
,
notes
=
"分页查询空间"
)
@GetMapping
(
value
=
"/querySpaceListsByPagination"
)
public
CyGridModel
querySpaceListsByPagination
(
BSpace
spaceList
){
bSpaceServiceImpl
.
querySpaceListsByPagination
(
getPaginationUtility
(),
spaceList
);
CyGridModel
CyGridModel
=
getGridModelResponse
();
return
CyGridModel
;
}
/**
* 增加/修改空间
*
* @param spaceList
* @return
*/
@ApiOperation
(
value
=
"增加/修改空间"
,
notes
=
"增加/修改空间"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"spaceName"
,
value
=
"空间名称"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"spaceId"
,
value
=
"空间编号"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
value
=
"/spaceAdd"
)
public
CyResult
spaceAdd
(
BSpace
spaceList
)
{
int
line
=
bSpaceServiceImpl
.
persistSpaceList
(
spaceList
,
getToken
());
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
line
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
spaceList
);
}
/**
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
* 通过businessId查询
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
* @param businessId
@PostMapping
(
value
=
"/add"
)
* @return
public
CyResult
add
(
@Valid
BSpace
bSpace
,
BindingResult
bindingResult
)
{
*/
CyPersistModel
data
=
bSpaceServiceImpl
.
save
(
bSpace
);
@ApiOperation
(
value
=
"根据Id查询数据"
,
notes
=
"根据Id查询数据"
)
return
CyResultGenUtil
.
builder
(
data
,
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"空间的businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/querySpaceListByBusinessId"
)
public
CyResult
querySpaceListByBusinessId
(
String
businessId
){
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
bSpaceServiceImpl
.
querySpaceListByBusinessId
(
businessId
));
bSpace
);
}
}
@ApiOperation
(
value
=
"查询空间数"
,
notes
=
"查询空间数"
)
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"逻辑删除"
)
@GetMapping
(
value
=
"/querySpaceNum"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
public
CyResult
querySpaceNum
(
BSpace
spaceList
){
@DeleteMapping
(
"/deleteLogical/{businessId:\\w+}"
)
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
public
CyResult
deleteLogical
(
@PathVariable
String
businessId
,
BSpace
bSpace
)
{
bSpace
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
bSpaceServiceImpl
.
removeLogical
(
bSpace
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
bSpaceServiceImpl
.
querySpaceNum
(
spaceList
)
);
businessId
);
}
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"逻辑删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"id"
,
required
=
false
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/delete/{businessId:\\w+}"
)
@PostMapping
(
"/LogicalDelete"
)
public
CyResult
delete
(
@PathVariable
String
businessId
,
BSpace
bSpace
)
{
public
CyResult
delete
(
String
businessId
)
{
bSpace
.
setBusinessId
(
businessId
);
BSpace
bspqce
=
new
BSpace
();
CyPersistModel
data
=
bSpaceServiceImpl
.
remove
(
bSpace
);
bspqce
.
setBusinessId
(
businessId
);
bspqce
.
setToken
(
getToken
());
CyPersistModel
data
=
bSpaceServiceImpl
.
remove
(
bspqce
);
return
CyResultGenUtil
.
builder
(
data
,
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
businessId
);
businessId
);
}
}
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/update/{
i
d:\\w+}"
)
@PutMapping
(
"/update/{
businessI
d:\\w+}"
)
public
CyResult
update
(
@
Valid
BSpace
bSpace
,
BindingResult
bindingCy
Result
)
{
public
CyResult
update
(
@
PathVariable
String
businessId
,
@Valid
BSpace
bSpace
,
BindingResult
binding
Result
)
{
bSpace
.
set
Token
(
getToken
()
);
bSpace
.
set
BusinessId
(
businessId
);
CyPersistModel
data
=
bSpaceServiceImpl
.
merge
(
bSpace
);
CyPersistModel
data
=
bSpaceServiceImpl
.
merge
(
bSpace
);
return
CyResultGenUtil
.
builder
(
data
,
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
...
@@ -139,28 +83,29 @@ public class BSpaceController extends CyPaginationController<BSpace> {
...
@@ -139,28 +83,29 @@ public class BSpaceController extends CyPaginationController<BSpace> {
bSpace
);
bSpace
);
}
}
@ApiOperation
(
value
=
"查看单 "
,
notes
=
"查看单 "
)
@ApiOperation
(
value
=
"查询单一"
,
notes
=
"查询单一"
)
@GetMapping
(
"/detail/{id:\\w+}"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
public
CyResult
detail
(
@PathVariable
String
id
)
{
@GetMapping
(
"/detail/{businessId:\\w+}"
)
public
CyResult
detail
(
@PathVariable
String
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
bSpaceServiceImpl
.
findById
(
i
d
));
bSpaceServiceImpl
.
findById
(
businessI
d
));
}
}
/**
@ApiOperation
(
value
=
"查询集合"
,
notes
=
"查询集合"
)
* @param bSpace
@GetMapping
(
value
=
"/queryBSpaces"
)
* @return org.rcisoft.common.model.CyGridModel
public
CyResult
queryBSpaces
(
BSpace
bSpace
)
{
* @author ningxy
* @description 不分页查询空间
* @date 2018/7/20 下午1:35
*/
@ApiOperation
(
value
=
"查看 集合 不分页"
,
notes
=
"查看 集合"
)
@GetMapping
(
value
=
"/queryBSpace"
)
public
CyResult
listAllSpaces
(
BSpace
bSpace
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
bSpaceServiceImpl
.
listAllSpaces
(
bSpace
));
CyMessCons
.
MESSAGE_ALERT_ERROR
,
bSpaceServiceImpl
.
findAll
(
bSpace
));
}
}
@ApiOperation
(
value
=
"分页查询集合"
,
notes
=
"分页查询集合"
)
@GetMapping
(
value
=
"/queryBSpaceByPagination"
)
public
CyGridModel
listByPagination
(
BSpace
bSpace
)
{
bSpaceServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
bSpace
);
return
getGridModelResponse
();
}
}
}
src/main/java/org/rcisoft/business/bspace/dao/BSpaceRepository.java
View file @
ac208ce9
package
org
.
rcisoft
.
business
.
bspace
.
dao
;
package
org
.
rcisoft
.
business
.
bspace
.
dao
;
import
org.rcisoft.core.base.CyBaseMapper
;
import
org.rcisoft.business.bspace.entity.BSpace
;
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.rcisoft.core.base.CyBaseMapper
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Created with on 2018-6-21 17:10:54
.
* Created with cy on 2018-12-17 13:50:52
.
*/
*/
@Repository
@Repository
public
interface
BSpaceRepository
extends
CyBaseMapper
<
BSpace
>
{
public
interface
BSpaceRepository
extends
CyBaseMapper
<
BSpace
>
{
...
@@ -21,84 +20,10 @@ public interface BSpaceRepository extends CyBaseMapper<BSpace> {
...
@@ -21,84 +20,10 @@ public interface BSpaceRepository extends CyBaseMapper<BSpace> {
*
*
*/
*/
@Select
(
"<script>select * from b_space where 1=1 "
@Select
(
"<script>select * from b_space where 1=1 "
+
"and del_flag = 0 "
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"and flag = 1 "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"<if test=\"businessId !=null and businessId != '' \">and business_id = #{businessId} </if> "
+
"</script>"
)
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BSpace
>
queryBSpaces
(
BSpace
bSpace
);
List
<
BSpace
>
queryBSpaces
(
BSpace
bSpace
);
/**
* @param businessId
* @return
*/
@Select
(
"select count(*) from b_space where del_flag = 0 and flag = 1 and business_id = #{businessId}"
)
int
existSpace
(
String
businessId
);
/**
* 分页查询
* 分页增加
*
* */
@Select
(
"<script>select * from b_space where flag = '1' and del_flag = '0' "
+
"and business_id = #{businessId}"
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BSpace
>
querySpaceListsByName
(
BSpace
spaceList
);
/**
* 通过businessId查询
* @param spaceId
* @return
*/
@Select
(
"select * from b_space b where b.flag = '1' and b.del_flag = '0' and b.business_id=#{spaceId}"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BSpace
querySpaceListByBusinessId
(
String
spaceId
);
/**
* spaceAdd 新增
* @param spaceList
* @return
*/
@Select
(
"<script>select * from b_space where flag = '1' and del_flag = '0' "
+
"and space_id = #{spaceId} "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BSpace
>
querySpaceListsByCodeOrName
(
BSpace
spaceList
);
/**
* 分页查询 bSpaceCategory
*查询空间列表 不分页
*/
@Select
(
"<script>select * from b_space where "
+
" del_flag = 0 and flag = 1 </script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BSpace
>
queryBSpaceCategorys
(
BSpace
spaceList
);
@Select
(
"<script> SELECT "
+
"bs.space_name as spaceName, bs.space_id as spaceId, "
+
"DATE_FORMAT( bs.create_date, '%Y-%m-%d' ) AS date "
+
"FROM "
+
"b_space bs "
+
"WHERE "
+
"1 = 1 "
+
"AND bs.create_date BETWEEN '2018-7-28' "
+
"AND '2018-8-28' "
+
"GROUP BY "
+
"bs.business_id, "
+
"date "
+
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryAllSpacesByTime
(
String
beginTime
,
String
endTime
);
/**
* 查询空间数
* @param spaceList
* @return
*/
@Select
(
"select count(*) as spaceNum from b_space bs where bs.del_flag = 0 and bs.flag = 1"
)
List
<
BSpace
>
querySpaceNum
(
BSpace
spaceList
);
}
}
src/main/java/org/rcisoft/business/bspace/entity/BSpace.java
View file @
ac208ce9
...
@@ -2,36 +2,47 @@ package org.rcisoft.business.bspace.entity;
...
@@ -2,36 +2,47 @@ package org.rcisoft.business.bspace.entity;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.validator.constraints.Length
;
import
org.hibernate.validator.constraints.NotBlank
;
import
org.rcisoft.core.entity.CyIdEntity
;
import
org.rcisoft.core.entity.CyIdEntity
;
import
org.springframework.data.annotation.Transient
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* Created with on 2018-6-21 17:10:54.
* Created with cy on 2018-12-17 13:50:51.
*/
*/
@Entity
@Data
@Data
@Table
(
name
=
"b_space"
)
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"b_space"
)
public
class
BSpace
extends
CyIdEntity
<
BSpace
>
{
public
class
BSpace
extends
CyIdEntity
<
BSpace
>
{
private
static
final
long
serialVersionUID
=
-
2165299707591725301L
;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
@NotBlank
private
String
spaceName
;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
@NotBlank
/**
* @desc 空间编号
* @column space_id
* @default
*/
private
String
spaceId
;
private
String
spaceId
;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
/**
@NotBlank
* @desc 空间名
* @column space_name
* @default
*/
private
String
spaceName
;
/**
* @desc 域名
* @column realm_name
* @default
*/
private
String
realmName
;
private
String
realmName
;
@Transient
private
String
spaceNum
;
}
}
src/main/java/org/rcisoft/business/bspace/service/BSpaceService.java
View file @
ac208ce9
package
org
.
rcisoft
.
business
.
bspace
.
service
;
package
org
.
rcisoft
.
business
.
bspace
.
service
;
import
org.rcisoft.business.bspace.entity.BSpace
;
import
org.rcisoft.business.bspace.entity.BSpace
;
import
org.rcisoft.core.aop.CyPageUtil
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.aop.CyPageUtil
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Created by
on 2018-6-21 17:10:54
.
* Created by
cy on 2018-12-17 13:50:52
.
*/
*/
public
interface
BSpaceService
{
public
interface
BSpaceService
{
/**
/**
* 保存
* 保存
*
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
CyPersistModel
save
(
BSpace
bSpace
);
CyPersistModel
save
(
BSpace
bSpace
);
/**
/**
* 逻辑删除
* 删除
*
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
CyPersistModel
remove
(
BSpace
bSpace
);
CyPersistModel
remove
(
BSpace
bSpace
);
/**
* 逻辑删除
* @param bSpace
* @return
*/
CyPersistModel
removeLogical
(
BSpace
bSpace
);
/**
/**
* 修改
* 修改
*
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
...
@@ -39,7 +41,6 @@ public interface BSpaceService {
...
@@ -39,7 +41,6 @@ public interface BSpaceService {
/**
/**
* 根据id查询
* 根据id查询
*
* @param id
* @param id
* @return
* @return
*/
*/
...
@@ -47,45 +48,18 @@ public interface BSpaceService {
...
@@ -47,45 +48,18 @@ public interface BSpaceService {
/**
/**
* 分页查询
* 分页查询
*
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
List
<
BSpace
>
findAllByPagination
(
CyPageUtil
<
BSpace
>
paginationUtility
,
BSpace
bSpace
);
List
<
BSpace
>
findAllByPagination
(
CyPageUtil
<
BSpace
>
paginationUtility
,
/**
BSpace
bSpace
);
* @param bSpace
* @return java.util.List<org.rcisoft.business.bspace.entity.BSpace>
* @author ningxy
* @description 不分页查询所有空间
* @date 2018/7/20 下午1:36
*/
List
<
BSpace
>
listAllSpaces
(
BSpace
bSpace
);
/**
* 增加/修改
* @param spaceList
* @param token
* @return
*/
int
persistSpaceList
(
BSpace
spaceList
,
String
token
);
/**
/**
* 通过businessId查询
* 查询list
* @param businessId
* @param bSpace
* @return
* @return
*/
*/
BSpace
querySpaceListByBusinessId
(
String
businessId
);
List
<
BSpace
>
findAll
(
BSpace
bSpace
);
/**
* 查询 分页
* 查询所有角色,不分页
*/
List
<
BSpace
>
querySpaceListsByPagination
(
CyPageUtil
<
BSpace
>
paginationUtility
,
BSpace
spaceList
);
/**
* 查询空间数
* @param spaceList
* @return
*/
List
<
BSpace
>
querySpaceNum
(
BSpace
spaceList
);
}
}
src/main/java/org/rcisoft/business/bspace/service/impl/BSpaceServiceImpl.java
View file @
ac208ce9
package
org
.
rcisoft
.
business
.
bspace
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
bspace
.
service
.
impl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.core.aop.CyPageUtil
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.result.CyResultServiceExceptionEnums
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.aop.CyPageUtil
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.business.bspace.dao.BSpaceRepository
;
import
org.rcisoft.business.bspace.dao.BSpaceRepository
;
import
org.rcisoft.business.bspace.entity.BSpace
;
import
org.rcisoft.business.bspace.entity.BSpace
;
import
org.rcisoft.business.bspace.service.BSpaceService
;
import
org.rcisoft.business.bspace.service.BSpaceService
;
import
org.rcisoft.core.service.CyBaseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Service
;
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
java.util.*
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.List
;
import
lombok.extern.slf4j.Slf4j
;
/**
/**
* Created by
on 2018-6-21 17:10:54
.
* Created by
cy on 2018-12-17 13:50:52
.
*/
*/
@Service
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
@Slf4j
@ConfigurationProperties
(
prefix
=
"cy.model.security"
,
ignoreUnknownFields
=
true
,
ignoreInvalidFields
=
true
)
public
class
BSpaceServiceImpl
extends
CyBaseService
implements
BSpaceService
{
public
class
BSpaceServiceImpl
implements
BSpaceService
{
private
static
final
long
serialVersionUID
=
-
3485875433825192456L
;
@Autowired
@Autowired
private
BSpaceRepository
bSpaceRepository
;
private
BSpaceRepository
bSpaceRepository
;
/**
/**
* 保存 bSpace
* 保存
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
...
@@ -45,29 +42,45 @@ public class BSpaceServiceImpl implements BSpaceService {
...
@@ -45,29 +42,45 @@ public class BSpaceServiceImpl implements BSpaceService {
//增加操作
//增加操作
CyUserUtil
.
setCurrentPersistOperation
(
bSpace
);
CyUserUtil
.
setCurrentPersistOperation
(
bSpace
);
int
line
=
bSpaceRepository
.
insertSelective
(
bSpace
);
int
line
=
bSpaceRepository
.
insertSelective
(
bSpace
);
log
.
info
(
CyUserUtil
.
getUserInfoProp
(
bSpace
.
getToken
(),
CyUserUtil
.
USER_USERNAME
)+
"新增了ID为"
+
this
.
dbInfo
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
,
"新增"
);
log
.
info
(
CyUserUtil
.
getAuthenUsername
()+
"新增了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
);
bSpace
.
getBusinessId
()+
"的信息"
);
return
new
CyPersistModel
(
line
);
return
new
CyPersistModel
(
line
);
}
}
/**
/**
* 逻辑删除
* 删除
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
@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
());
this
.
dbInfo
(
CyUserUtil
.
getAuthenUsername
()+
"删除了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
,
"删除"
);
log
.
info
(
CyUserUtil
.
getAuthenUsername
()+
"删除了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 逻辑删除
* @param bSpace
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
removeLogical
(
BSpace
bSpace
){
CyUserUtil
.
setCurrentMergeOperation
(
bSpace
);
CyUserUtil
.
setCurrentMergeOperation
(
bSpace
);
bSpace
.
setDeleted
();
bSpace
.
setDeleted
();
int
line
=
bSpaceRepository
.
logicalDelete
(
bSpace
);
int
line
=
bSpaceRepository
.
logicalDelete
(
bSpace
);
log
.
info
(
CyUserUtil
.
getUserInfoProp
(
bSpace
.
getToken
(),
CyUserUtil
.
USER_USERNAME
)+
"逻辑删除了ID为"
+
this
.
dbInfo
(
CyUserUtil
.
getAuthenUsername
()+
"逻辑删除了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
,
"逻辑删除"
);
bSpace
.
getBusinessId
()+
"的信息"
);
log
.
info
(
CyUserUtil
.
getAuthenUsername
()+
"逻辑删除了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
);
return
new
CyPersistModel
(
line
);
return
new
CyPersistModel
(
line
);
}
}
/**
/**
* 修改 bSpace
* 修改
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
...
@@ -76,13 +89,13 @@ public class BSpaceServiceImpl implements BSpaceService {
...
@@ -76,13 +89,13 @@ public class BSpaceServiceImpl implements BSpaceService {
public
CyPersistModel
merge
(
BSpace
bSpace
){
public
CyPersistModel
merge
(
BSpace
bSpace
){
CyUserUtil
.
setCurrentMergeOperation
(
bSpace
);
CyUserUtil
.
setCurrentMergeOperation
(
bSpace
);
int
line
=
bSpaceRepository
.
updateByPrimaryKeySelective
(
bSpace
);
int
line
=
bSpaceRepository
.
updateByPrimaryKeySelective
(
bSpace
);
log
.
info
(
CyUserUtil
.
getUserInfoProp
(
bSpace
.
getToken
(),
CyUserUtil
.
USER_USERNAME
)+
"修改了ID为"
+
this
.
dbInfo
(
CyUserUtil
.
getAuthenUsername
()+
"修改了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
,
"修改"
);
bSpace
.
getBusinessId
()+
"的信息"
);
log
.
info
(
CyUserUtil
.
getAuthenUsername
()+
"修改了ID为"
+
bSpace
.
getBusinessId
()+
"的信息"
);
return
new
CyPersistModel
(
line
);
return
new
CyPersistModel
(
line
);
}
}
/**
/**
* 根据id查询 bSpace
* 根据id查询
* @param id
* @param id
* @return
* @return
*/
*/
...
@@ -92,101 +105,25 @@ public class BSpaceServiceImpl implements BSpaceService {
...
@@ -92,101 +105,25 @@ public class BSpaceServiceImpl implements BSpaceService {
}
}
/**
/**
* 分页查询 bSpace
* 分页查询
* @param bSpace
* @param bSpace
* @return
* @return
*/
*/
@Override
@Override
public
List
<
BSpace
>
findAllByPagination
(
CyPageUtil
<
BSpace
>
paginationUtility
,
public
List
<
BSpace
>
findAllByPagination
(
CyPageUtil
<
BSpace
>
paginationUtility
,
BSpace
bSpace
){
BSpace
bSpace
){
bSpace
.
setStart
();
bSpace
.
setNormal
();
bSpace
.
setNotDeleted
();
return
bSpaceRepository
.
queryBSpaces
(
bSpace
);
return
bSpaceRepository
.
queryBSpaces
(
bSpace
);
}
}
/**
/**
* 查询list
* @param bSpace
* @param bSpace
* @return java.util.List<org.rcisoft.business.bspace.entity.BSpace>
* @author ningxy
* @description 不分页查询所有空间
* @date 2018/7/20 下午1:36
*/
@Override
public
List
<
BSpace
>
listAllSpaces
(
BSpace
bSpace
)
{
return
bSpaceRepository
.
queryBSpaces
(
bSpace
);
}
/**
* 增加
*
* */
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
int
persistSpaceList
(
BSpace
spaceList
,
String
token
)
{
int
line
;
int
line2
=
0
;
int
result
=
0
;
if
(
StringUtils
.
isNotBlank
(
spaceList
.
getBusinessId
())){
//修改
List
<
BSpace
>
spaceLists
=
bSpaceRepository
.
querySpaceListsByName
(
spaceList
);
if
(
spaceLists
.
size
()
==
0
){
throw
new
CyServiceException
(
CyResultServiceExceptionEnums
.
USER_EXISTS
);
}
// Example example = new Example(BCategory.class);
// example.createCriteria().andEqualTo("spaceId",spaceList.getBusinessId());
// BCategory bcategory = new BCategory();
CyUserUtil
.
setCurrentMergeOperation
(
spaceList
);
// bcategory.setCategoryName(spaceList.getSpaceName());
// bcategory.setSpaceId(spaceList.getBusinessId());
line
=
bSpaceRepository
.
updateByPrimaryKeySelective
(
spaceList
);
// line2 = bCategoryRepository.updateByExampleSelective(bcategory,example);
}
else
{
//增加
List
<
BSpace
>
spaceLists
=
bSpaceRepository
.
querySpaceListsByCodeOrName
(
spaceList
);
if
(
spaceLists
.
size
()>
0
){
throw
new
CyServiceException
(
CyResultServiceExceptionEnums
.
USER_EXISTS
);
}
// BCategory bcategory = new BCategory();
// CyUserUtil.setCurrentPersistOperation(spaceList);
// CyUserUtil.setCurrentPersistOperation(bcategory);
// bcategory.setSpaceId(spaceList.getBusinessId());
// bcategory.setCategoryName(spaceList.getSpaceName());
// bcategory.setPid(0);
line
=
bSpaceRepository
.
insertSelective
(
spaceList
);
// line2 = bCategoryRepository.insertSelective(bcategory);
}
// if(line == line2){
// result = line;
// }
return
line
;
}
/**
* 通过businessId查询
* @param businessId
* @return
*/
@Override
public
BSpace
querySpaceListByBusinessId
(
String
businessId
)
{
return
bSpaceRepository
.
querySpaceListByBusinessId
(
businessId
);
}
@Override
public
List
<
BSpace
>
querySpaceListsByPagination
(
CyPageUtil
<
BSpace
>
paginationUtility
,
BSpace
spaceList
)
{
return
bSpaceRepository
.
queryBSpaceCategorys
(
spaceList
);
}
/**
* 查询空间数
* @param spaceList
* @return
* @return
*/
*/
@Override
@Override
public
List
<
BSpace
>
querySpaceNum
(
BSpace
spaceList
)
{
public
List
<
BSpace
>
findAll
(
BSpace
bSpace
){
return
bSpaceRepository
.
querySpaceNum
(
spaceList
);
bSpace
.
setNormal
();
return
bSpaceRepository
.
queryBSpaces
(
bSpace
);
}
}
}
}
src/main/resources/application-dev.yml
View file @
ac208ce9
...
@@ -16,7 +16,7 @@ server:
...
@@ -16,7 +16,7 @@ server:
# org.springframework.web: DEBUG
# org.springframework.web: DEBUG
druid
:
druid
:
url
:
jdbc:mysql://127.0.0.1:3306/mall
2
?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
url
:
jdbc:mysql://127.0.0.1:3306/mall
4
?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
username
:
root
username
:
root
password
:
123456
password
:
123456
initial-size
:
1
initial-size
:
1
...
...
src/main/resources/logback-spring.xml
View file @
ac208ce9
...
@@ -54,9 +54,9 @@
...
@@ -54,9 +54,9 @@
<connectionSource
class=
"ch.qos.logback.core.db.DataSourceConnectionSource"
>
<connectionSource
class=
"ch.qos.logback.core.db.DataSourceConnectionSource"
>
<dataSource
class=
"org.apache.tomcat.jdbc.pool.DataSource"
>
<dataSource
class=
"org.apache.tomcat.jdbc.pool.DataSource"
>
<driverClassName
class=
"com.mysql.jdbc.Driver"
/>
<driverClassName
class=
"com.mysql.jdbc.Driver"
/>
<url>
jdbc:mysql://127.0.0.1:3306/
family
?characterEncoding=UTF-8
</url>
<url>
jdbc:mysql://127.0.0.1:3306/
mall3
?characterEncoding=UTF-8
</url>
<username>
root
</username>
<username>
root
</username>
<password>
cy
</password>
<password>
123456
</password>
</dataSource>
</dataSource>
</connectionSource>
</connectionSource>
...
@@ -81,13 +81,11 @@
...
@@ -81,13 +81,11 @@
</appender>
</appender>
<!-- 用户操作日志logger -->
<!-- 用户操作日志logger -->
<
logger
name=
"DBLog"
level=
"INFO"
>
<
!--<logger name="DBLog" level="INFO" >--
>
<
appender-ref
ref=
"DBLog"
/
>
<
!--<appender-ref ref="DBLog"/>--
>
<
/logger
>
<
!--</logger>--
>
<!--
<!--指定对应包名 -->
指定对应包名
-->
<logger
name=
"com.minlia"
level=
"DEBUG"
/>
<logger
name=
"com.minlia"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.data.mybatis"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.data.mybatis"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.aop.aspectj"
level=
"ERROR"
/>
<logger
name=
"org.springframework.aop.aspectj"
level=
"ERROR"
/>
...
...
src/main/resources/mapper.biz/bspace/mapper/BSpaceMapper.xml
deleted
100644 → 0
View file @
ed60f0b6
<?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.rcisoft.business.bspace.dao.BSpaceRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.bspace.entity.BSpace"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"space_name"
jdbcType=
"VARCHAR"
property=
"spaceName"
/>
<result
column=
"space_id"
jdbcType=
"VARCHAR"
property=
"spaceId"
/>
<result
column=
"CREATE_BY"
property=
"createBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"FLAG"
property=
"flag"
jdbcType=
"VARCHAR"
/>
<result
column=
"REMARKS"
property=
"remarks"
jdbcType=
"VARCHAR"
/>
<result
column=
"UPDATE_BY"
property=
"updateBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"DEL_FLAG"
property=
"delFlag"
jdbcType=
"VARCHAR"
/>
<result
column=
"update_date"
property=
"updateDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_date"
property=
"createDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"realm_name"
property=
"realmName"
jdbcType=
"VARCHAR"
/>
</resultMap>
</mapper>
\ No newline at end of file
src/main/resources/mapper/biz/bspace/mapper/BSpaceMapper.xml
0 → 100644
View file @
ac208ce9
<?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.rcisoft.business.bspace.dao.BSpaceRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.bspace.entity.BSpace"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"space_id"
jdbcType=
"VARCHAR"
property=
"spaceId"
/>
<result
column=
"space_name"
jdbcType=
"VARCHAR"
property=
"spaceName"
/>
<result
column=
"realm_name"
jdbcType=
"VARCHAR"
property=
"realmName"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment