Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhny
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
王夏晖
zhny
Commits
0ca50697
Commit
0ca50697
authored
May 16, 2018
by
王夏晖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
厂家后台维护
parent
ac9fb226
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
252 additions
and
0 deletions
+252
-0
BusFactoryController.java
...soft/business/manage/controller/BusFactoryController.java
+66
-0
BusFactoryRepository.java
...org/rcisoft/business/manage/dao/BusFactoryRepository.java
+25
-0
BusFactory.java
...n/java/org/rcisoft/business/manage/entity/BusFactory.java
+31
-0
BusFactoryService.java
...rg/rcisoft/business/manage/service/BusFactoryService.java
+44
-0
BusFactoryServiceImpl.java
...t/business/manage/service/impl/BusFactoryServiceImpl.java
+86
-0
No files found.
src/main/java/org/rcisoft/business/manage/controller/BusFactoryController.java
0 → 100644
View file @
0ca50697
package
org
.
rcisoft
.
business
.
manage
.
controller
;
/*固定导入*/
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.manage.entity.BusFactory
;
import
org.rcisoft.business.manage.service.BusFactoryService
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.controller.PaginationController
;
import
org.rcisoft.core.model.GridModel
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by on 2018-5-16 14:34:55.
*/
@RestController
@RequestMapping
(
"manage/busfactory"
)
public
class
BusFactoryController
extends
PaginationController
<
BusFactory
>
{
@Autowired
private
BusFactoryService
busFactoryServiceImpl
;
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
@Valid
BusFactory
busFactory
)
{
PersistModel
data
=
busFactoryServiceImpl
.
save
(
busFactory
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
busFactory
);
}
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@PutMapping
(
"/update"
)
public
Result
update
(
@Valid
BusFactory
busFactory
)
{
PersistModel
data
=
busFactoryServiceImpl
.
merge
(
busFactory
);
return
Result
.
builder
(
data
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@DeleteMapping
(
"/delete"
)
public
Result
delete
(
@RequestParam
String
id
)
{
PersistModel
data
=
busFactoryServiceImpl
.
delete
(
id
);
return
Result
.
builder
(
data
);
}
@ApiOperation
(
value
=
"查看列表"
,
notes
=
"查看列表"
)
@GetMapping
(
value
=
"/queryBusFactoryList"
)
public
List
<
Map
<
String
,
Object
>>
queryBusFactoryList
()
{
return
busFactoryServiceImpl
.
queryBusFactoryList
();
}
}
src/main/java/org/rcisoft/business/manage/dao/BusFactoryRepository.java
0 → 100644
View file @
0ca50697
package
org
.
rcisoft
.
business
.
manage
.
dao
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.business.manage.entity.BusFactory
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created with on 2018-5-16 14:34:55.
*/
@Repository
public
interface
BusFactoryRepository
extends
BaseMapper
<
BusFactory
>
{
/**
* 查询列表
*
*/
@Select
(
"<script>select * from bus_factory where 1=1 "
+
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryBusFactorys
();
}
src/main/java/org/rcisoft/business/manage/entity/BusFactory.java
0 → 100644
View file @
0ca50697
package
org
.
rcisoft
.
business
.
manage
.
entity
;
import
lombok.*
;
import
org.rcisoft.core.entity.IdNotDataEntity
;
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-5-16 14:34:55.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"bus_factory"
)
public
class
BusFactory
{
private
String
facId
;
private
String
facNm
;
}
src/main/java/org/rcisoft/business/manage/service/BusFactoryService.java
0 → 100644
View file @
0ca50697
package
org
.
rcisoft
.
business
.
manage
.
service
;
import
org.rcisoft.business.manage.entity.BusFactory
;
import
org.rcisoft.core.model.PersistModel
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by on 2018-5-16 14:34:55.
*/
public
interface
BusFactoryService
{
/**
* 保存
* @param busFactory
* @return
*/
PersistModel
save
(
BusFactory
busFactory
);
/**
* 修改
* @param busFactory
* @return
*/
PersistModel
merge
(
BusFactory
busFactory
);
/**
* 删除
* @return
*/
PersistModel
delete
(
String
id
);
/**
* 列表
* @return
*/
List
<
Map
<
String
,
Object
>>
queryBusFactoryList
();
}
src/main/java/org/rcisoft/business/manage/service/impl/BusFactoryServiceImpl.java
0 → 100644
View file @
0ca50697
package
org
.
rcisoft
.
business
.
manage
.
service
.
impl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.manage.dao.BusFactoryRepository
;
import
org.rcisoft.business.manage.entity.BusFactory
;
import
org.rcisoft.business.manage.service.BusFactoryService
;
import
org.rcisoft.core.model.PersistModel
;
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
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
/**
* Created by on 2018-5-16 14:34:55.
*/
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
BusFactoryServiceImpl
implements
BusFactoryService
{
@Autowired
private
BusFactoryRepository
busFactoryRepository
;
/**
* 保存 busFactory
* @param busFactory
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
save
(
BusFactory
busFactory
){
//增加操作
busFactory
.
setFacId
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
int
line
=
busFactoryRepository
.
insertSelective
(
busFactory
);
return
new
PersistModel
(
line
);
}
/**
* 修改 busFactory
* @param busFactory
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
merge
(
BusFactory
busFactory
){
Integer
line
=
0
;
String
message
=
""
;
Example
example
=
new
Example
(
BusFactory
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"facId"
,
busFactory
.
getFacId
());
if
(
busFactory
.
getFacId
()!=
null
&&
!
busFactory
.
getFacId
().
equals
(
""
)){
line
=
busFactoryRepository
.
updateByExampleSelective
(
busFactory
,
example
);
}
else
{
message
=
"ID为空,更新失败"
;
}
return
new
PersistModel
(
line
,
message
);
}
@Override
public
PersistModel
delete
(
String
id
)
{
Integer
line
=
0
;
String
message
=
""
;
Example
example
=
new
Example
(
BusFactory
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"facId"
,
id
);
if
(
id
!=
null
&&
!
id
.
equals
(
""
)){
line
=
busFactoryRepository
.
deleteByExample
(
example
);
}
else
{
message
=
"ID为空,删除失败"
;
}
return
new
PersistModel
(
line
,
message
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryBusFactoryList
()
{
return
busFactoryRepository
.
queryBusFactorys
();
}
}
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