Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
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
李丛阳
education
Commits
43111093
Commit
43111093
authored
Apr 26, 2018
by
hanshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hanshuai stop/start
parent
29e2bb9c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
320 additions
and
0 deletions
+320
-0
BSubtaskController.java
...soft/business/bsubtask/controller/BSubtaskController.java
+88
-0
BSubtaskRepository.java
...org/rcisoft/business/bsubtask/dao/BSubtaskRepository.java
+29
-0
BSubtask.java
...n/java/org/rcisoft/business/bsubtask/entity/BSubtask.java
+31
-0
BSubtaskService.java
...rg/rcisoft/business/bsubtask/service/BSubtaskService.java
+53
-0
BSubtaskServiceImpl.java
...t/business/bsubtask/service/impl/BSubtaskServiceImpl.java
+101
-0
BSubtaskMapper.xml
...ources/mapper/business/bsubtask/mapper/BSubtaskMapper.xml
+18
-0
No files found.
src/main/java/org/rcisoft/business/bsubtask/controller/BSubtaskController.java
0 → 100644
View file @
43111093
package
org
.
rcisoft
.
business
.
bsubtask
.
controller
;
/*固定导入*/
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.common.model.GridModel
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.util.UserUtil
;
import
javax.validation.Valid
;
import
org.rcisoft.business.bsubtask.entity.BSubtask
;
import
org.rcisoft.business.bsubtask.service.BSubtaskService
;
import
java.util.List
;
/**
* Created by on 2018-4-25 10:50:35.
*/
@RestController
@RequestMapping
(
"bsubtask"
)
public
class
BSubtaskController
extends
PaginationController
<
BSubtask
>
{
@Autowired
private
BSubtaskService
bSubtaskServiceImpl
;
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
@Valid
BSubtask
bSubtask
,
BindingResult
bindingResult
)
{
bSubtask
.
setToken
(
getToken
());
PersistModel
data
=
bSubtaskServiceImpl
.
save
(
bSubtask
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bSubtask
);
}
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"逻辑删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"id"
,
required
=
false
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/delete/{id:\\w+}"
)
public
Result
delete
(
@PathVariable
String
id
)
{
BSubtask
bSubtask
=
new
BSubtask
();
bSubtask
.
setBusinessId
(
id
);
bSubtask
.
setToken
(
getToken
());
PersistModel
data
=
bSubtaskServiceImpl
.
remove
(
bSubtask
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/update/{id:\\w+}"
)
public
Result
update
(
@Valid
BSubtask
bSubtask
,
BindingResult
bindingResult
)
{
bSubtask
.
setToken
(
getToken
());
PersistModel
data
=
bSubtaskServiceImpl
.
merge
(
bSubtask
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bSubtask
);
}
@ApiOperation
(
value
=
"查看单 "
,
notes
=
"查看单 "
)
@GetMapping
(
"/detail/{id:\\w+}"
)
public
Result
detail
(
@PathVariable
String
id
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bSubtaskServiceImpl
.
findById
(
id
));
}
@ApiOperation
(
value
=
"查看 集合"
,
notes
=
"查看 集合"
)
@GetMapping
(
value
=
"/queryBSubtaskByPagination"
)
public
GridModel
listByPagination
(
BSubtask
bSubtask
)
{
bSubtask
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
bSubtaskServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
bSubtask
);
return
getGridModelResponse
();
}
}
src/main/java/org/rcisoft/business/bsubtask/dao/BSubtaskRepository.java
0 → 100644
View file @
43111093
package
org
.
rcisoft
.
business
.
bsubtask
.
dao
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.bsubtask.entity.BSubtask
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* Created with on 2018-4-25 10:50:35.
*/
@Repository
public
interface
BSubtaskRepository
extends
BaseMapper
<
BSubtask
>
{
/**
* 分页查询 bSubtask
*
*/
@Select
(
"<script>select * from b_subtask where 1=1 "
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BSubtask
>
queryBSubtasks
(
BSubtask
bSubtask
);
}
src/main/java/org/rcisoft/business/bsubtask/entity/BSubtask.java
0 → 100644
View file @
43111093
package
org
.
rcisoft
.
business
.
bsubtask
.
entity
;
import
lombok.*
;
import
org.rcisoft.core.entity.IdEntity
;
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-4-25 10:50:35.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"b_subtask"
)
public
class
BSubtask
extends
IdEntity
<
BSubtask
>
{
private
static
final
long
serialVersionUID
=
-
4657954042491427634L
;
private
String
code
;
private
String
name
;
}
src/main/java/org/rcisoft/business/bsubtask/service/BSubtaskService.java
0 → 100644
View file @
43111093
package
org
.
rcisoft
.
business
.
bsubtask
.
service
;
import
org.rcisoft.business.bsubtask.entity.BSubtask
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.aop.PageUtil
;
import
java.util.List
;
/**
* Created by on 2018-4-25 10:50:35.
*/
public
interface
BSubtaskService
{
/**
* 保存
* @param bSubtask
* @return
*/
PersistModel
save
(
BSubtask
bSubtask
);
/**
* 逻辑删除
* @param bSubtask
* @return
*/
PersistModel
remove
(
BSubtask
bSubtask
);
/**
* 修改
* @param bSubtask
* @return
*/
PersistModel
merge
(
BSubtask
bSubtask
);
/**
* 根据id查询
* @param id
* @return
*/
BSubtask
findById
(
String
id
);
/**
* 分页查询
* @param bSubtask
* @return
*/
List
<
BSubtask
>
findAllByPagination
(
PageUtil
<
BSubtask
>
paginationUtility
,
BSubtask
bSubtask
);
}
src/main/java/org/rcisoft/business/bsubtask/service/impl/BSubtaskServiceImpl.java
0 → 100644
View file @
43111093
package
org
.
rcisoft
.
business
.
bsubtask
.
service
.
impl
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.business.bsubtask.dao.BSubtaskRepository
;
import
org.rcisoft.business.bsubtask.entity.BSubtask
;
import
org.rcisoft.business.bsubtask.service.BSubtaskService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
lombok.extern.slf4j.Slf4j
;
/**
* Created by on 2018-4-25 10:50:35.
*/
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
BSubtaskServiceImpl
implements
BSubtaskService
{
@Autowired
private
BSubtaskRepository
bSubtaskRepository
;
/**
* 保存 bSubtask
* @param bSubtask
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
save
(
BSubtask
bSubtask
){
//增加操作
UserUtil
.
setCurrentPersistOperation
(
bSubtask
);
int
line
=
bSubtaskRepository
.
insertSelective
(
bSubtask
);
log
.
info
(
UserUtil
.
getUserInfoProp
(
bSubtask
.
getToken
(),
UserUtil
.
USER_USERNAME
)+
"新增了ID为"
+
bSubtask
.
getBusinessId
()+
"的信息"
);
return
new
PersistModel
(
line
);
}
/**
* 逻辑删除
* @param bSubtask
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
remove
(
BSubtask
bSubtask
){
UserUtil
.
setCurrentMergeOperation
(
bSubtask
);
bSubtask
.
setDeleted
();
int
line
=
bSubtaskRepository
.
logicalDelete
(
bSubtask
);
log
.
info
(
UserUtil
.
getUserInfoProp
(
bSubtask
.
getToken
(),
UserUtil
.
USER_USERNAME
)+
"逻辑删除了ID为"
+
bSubtask
.
getBusinessId
()+
"的信息"
);
return
new
PersistModel
(
line
);
}
/**
* 修改 bSubtask
* @param bSubtask
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
merge
(
BSubtask
bSubtask
){
UserUtil
.
setCurrentMergeOperation
(
bSubtask
);
int
line
=
bSubtaskRepository
.
updateByPrimaryKeySelective
(
bSubtask
);
log
.
info
(
UserUtil
.
getUserInfoProp
(
bSubtask
.
getToken
(),
UserUtil
.
USER_USERNAME
)+
"修改了ID为"
+
bSubtask
.
getBusinessId
()+
"的信息"
);
return
new
PersistModel
(
line
);
}
/**
* 根据id查询 bSubtask
* @param id
* @return
*/
public
BSubtask
findById
(
String
id
){
return
bSubtaskRepository
.
selectByPrimaryKey
(
id
);
}
/**
* 分页查询 bSubtask
* @param bSubtask
* @return
*/
public
List
<
BSubtask
>
findAllByPagination
(
PageUtil
<
BSubtask
>
paginationUtility
,
BSubtask
bSubtask
){
bSubtask
.
setStart
();
bSubtask
.
setNotDeleted
();
return
bSubtaskRepository
.
queryBSubtasks
(
bSubtask
);
}
}
src/main/resources/mapper/business/bsubtask/mapper/BSubtaskMapper.xml
0 → 100644
View file @
43111093
<?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.bsubtask.dao.BSubtaskRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.bsubtask.entity.BSubtask"
>
<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=
"code"
jdbcType=
"VARCHAR"
property=
"code"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
</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