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
2b2e87a1
Commit
2b2e87a1
authored
May 22, 2018
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评估--节能改造--认定 更改接口
parent
caffdb36
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
63 deletions
+86
-63
BusSavingController.java
...isoft/business/manage/controller/BusSavingController.java
+46
-16
BusSaving.java
...in/java/org/rcisoft/business/manage/entity/BusSaving.java
+2
-2
BusSavingService.java
...org/rcisoft/business/manage/service/BusSavingService.java
+12
-5
BusSavingServiceImpl.java
...ft/business/manage/service/impl/BusSavingServiceImpl.java
+24
-38
BusSavingMapper.xml
...in/resources/mapper/sys/manage.mapper/BusSavingMapper.xml
+2
-2
No files found.
src/main/java/org/rcisoft/business/manage/controller/BusSavingController.java
View file @
2b2e87a1
...
@@ -7,15 +7,16 @@ import io.swagger.annotations.ApiOperation;
...
@@ -7,15 +7,16 @@ import io.swagger.annotations.ApiOperation;
import
org.rcisoft.business.manage.entity.BusSaving
;
import
org.rcisoft.business.manage.entity.BusSaving
;
import
org.rcisoft.business.manage.service.BusSavingService
;
import
org.rcisoft.business.manage.service.BusSavingService
;
import
org.rcisoft.core.constant.MessageConstant
;
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.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.result.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java
.util.List
;
import
java
x.validation.Valid
;
/**
/**
* Created by JiChao on 2018/5/17.
* Created by JiChao on 2018/5/17.
...
@@ -23,32 +24,61 @@ import java.util.List;
...
@@ -23,32 +24,61 @@ import java.util.List;
@Api
(
tags
=
"评估--节能改造--认定"
)
@Api
(
tags
=
"评估--节能改造--认定"
)
@RestController
@RestController
@RequestMapping
(
"bussaving"
)
@RequestMapping
(
"bussaving"
)
public
class
BusSavingController
{
public
class
BusSavingController
extends
PaginationController
<
BusSaving
>
{
@Autowired
@Autowired
private
BusSavingService
busSavingServiceImpl
;
private
BusSavingService
busSavingServiceImpl
;
@ApiOperation
(
value
=
"修改"
,
notes
=
"传list对象"
)
@ApiOperation
(
value
=
"增加"
,
notes
=
"增加"
)
/* @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "字符串"),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"examiner"
,
value
=
"检定员"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"qualification"
,
value
=
"执业资质"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"tm"
,
value
=
"从业时间"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"performance"
,
value
=
"项目业绩"
,
dataType
=
"字符串"
)
})
@RequestMapping
(
"/save"
)
public
Result
save
(
@Valid
BusSaving
busSaving
)
{
Integer
result
=
busSavingServiceImpl
.
save
(
busSaving
);
return
Result
.
builder
(
new
PersistModel
(
result
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
result
);
}
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"examiner"
,
value
=
"检定员"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"examiner"
,
value
=
"检定员"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"qualification"
,
value
=
"执业资质"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"qualification"
,
value
=
"执业资质"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"tm"
,
value
=
"从业时间"
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"tm"
,
value
=
"从业时间"
,
dataType
=
"字符串"
),
@ApiImplicitParam(name = "performance", value = "项目业绩", dataType = "字符串"),
@ApiImplicitParam
(
name
=
"performance"
,
value
=
"项目业绩"
,
dataType
=
"字符串"
)
@ApiImplicitParam(name = "type", value = "1:工程造价认定,2:节能认定", dataType = "字符串"),
})
@ApiImplicitParam(name = "proId", value = "项目表主键", dataType = "字符串,可以不传")
})*/
@RequestMapping
(
"/update"
)
@RequestMapping
(
"/update"
)
public
Result
update
(
@RequestBody
List
<
BusSaving
>
busSavingList
)
{
public
Result
update
(
@Valid
BusSaving
busSaving
)
{
return
Result
.
builder
(
busSavingServiceImpl
.
update
(
busSavingList
));
Integer
result
=
busSavingServiceImpl
.
update
(
busSaving
);
return
Result
.
builder
(
new
PersistModel
(
result
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
result
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
dataType
=
"字符串"
)
})
@RequestMapping
(
"/delete/{id:\\w+}"
)
public
Result
delete
(
@PathVariable
String
id
)
{
Integer
result
=
busSavingServiceImpl
.
delete
(
id
);
return
Result
.
builder
(
new
PersistModel
(
result
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
result
);
}
@ApiOperation
(
value
=
"分页查询"
,
notes
=
"分页查询"
)
@RequestMapping
(
"/findAllByPagination"
)
public
GridModel
findAllByPagination
()
{
busSavingServiceImpl
.
findAllByPagination
(
getPaginationUtility
());
return
getGridModelResponse
();
}
}
@ApiOperation
(
value
=
"
查询"
,
notes
=
"2条记录,工程造价认定、节能认定
"
)
@ApiOperation
(
value
=
"
根据id查找"
,
notes
=
"根据id查找
"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"proId"
,
value
=
"项目表
主键"
,
required
=
true
,
dataType
=
"字符串"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"
主键"
,
required
=
true
,
dataType
=
"字符串"
)
})
})
@RequestMapping
(
"/
queryBusSaving/{proI
d:\\w+}"
)
@RequestMapping
(
"/
findBusSaving/{i
d:\\w+}"
)
public
Result
queryBusSaving
(
@PathVariable
String
proI
d
)
{
public
Result
findBusSaving
(
@PathVariable
String
i
d
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
busSavingServiceImpl
.
queryBusSaving
(
proI
d
));
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
busSavingServiceImpl
.
findBusSaving
(
i
d
));
}
}
}
}
src/main/java/org/rcisoft/business/manage/entity/BusSaving.java
View file @
2b2e87a1
...
@@ -25,7 +25,7 @@ public class BusSaving {
...
@@ -25,7 +25,7 @@ public class BusSaving {
private
String
qualification
;
private
String
qualification
;
private
String
tm
;
private
String
tm
;
private
String
performance
;
private
String
performance
;
private
String
type
;
//
private String type;
private
String
proId
;
//
private String proId;
}
}
src/main/java/org/rcisoft/business/manage/service/BusSavingService.java
View file @
2b2e87a1
package
org
.
rcisoft
.
business
.
manage
.
service
;
package
org
.
rcisoft
.
business
.
manage
.
service
;
import
org.rcisoft.business.manage.entity.BusSaving
;
import
org.rcisoft.business.manage.entity.BusSaving
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
import
java.util.List
;
import
java.util.List
;
...
@@ -14,24 +15,30 @@ public interface BusSavingService {
...
@@ -14,24 +15,30 @@ public interface BusSavingService {
* 保存
* 保存
* @return
* @return
*/
*/
PersistModel
save
(
List
<
BusSaving
>
busSavingList
);
Integer
save
(
BusSaving
busSaving
);
/**
/**
* 修改
* 修改
* @return
* @return
*/
*/
PersistModel
update
(
List
<
BusSaving
>
busSavingList
);
Integer
update
(
BusSaving
busSaving
);
/**
/**
* 删除
* 删除
* @return
* @return
*/
*/
PersistModel
delete
(
String
proI
d
);
Integer
delete
(
String
i
d
);
/**
* 分页查询
* @return
*/
List
<
BusSaving
>
findAllByPagination
(
PageUtil
<
BusSaving
>
paginationUtility
);
/**
/**
* 根据proId查询
* 查询单条
* @param id
* @return
* @return
*/
*/
List
<
BusSaving
>
queryBusSaving
(
String
proI
d
);
BusSaving
findBusSaving
(
String
i
d
);
}
}
src/main/java/org/rcisoft/business/manage/service/impl/BusSavingServiceImpl.java
View file @
2b2e87a1
...
@@ -5,6 +5,7 @@ import org.rcisoft.business.manage.dao.BusSavingRepository;
...
@@ -5,6 +5,7 @@ import org.rcisoft.business.manage.dao.BusSavingRepository;
import
org.rcisoft.business.manage.entity.BusSaving
;
import
org.rcisoft.business.manage.entity.BusSaving
;
import
org.rcisoft.business.manage.service.BusSavingService
;
import
org.rcisoft.business.manage.service.BusSavingService
;
import
org.rcisoft.business.overview.entity.BusProjectArea
;
import
org.rcisoft.business.overview.entity.BusProjectArea
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -12,6 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -12,6 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
/**
/**
* Created by JiChao on 2018/5/17.
* Created by JiChao on 2018/5/17.
...
@@ -24,56 +26,40 @@ public class BusSavingServiceImpl implements BusSavingService {
...
@@ -24,56 +26,40 @@ public class BusSavingServiceImpl implements BusSavingService {
@Transactional
@Transactional
@Override
@Override
public
PersistModel
save
(
List
<
BusSaving
>
busSavingList
)
{
public
Integer
save
(
BusSaving
busSaving
)
{
int
result
=
0
;
String
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
for
(
BusSaving
busSaving
:
busSavingList
)
{
busSaving
.
setId
(
id
);
result
+=
busSavingRepository
.
insertSelective
(
busSaving
);
return
busSavingRepository
.
insertSelective
(
busSaving
);
}
return
new
PersistModel
(
result
);
}
}
@Transactional
@Transactional
@Override
@Override
public
PersistModel
update
(
List
<
BusSaving
>
busSavingList
)
{
public
Integer
update
(
BusSaving
busSaving
)
{
int
result
=
0
;
Example
example
=
new
Example
(
BusSaving
.
class
);
String
message
=
""
;
Example
.
Criteria
criteria
=
example
.
createCriteria
();
for
(
BusSaving
busSaving
:
busSavingList
)
{
criteria
.
andEqualTo
(
"id"
,
busSaving
.
getId
());
String
id
=
busSaving
.
getId
();
return
busSavingRepository
.
updateByExampleSelective
(
busSaving
,
example
);
if
(
StringUtils
.
isNotEmpty
(
id
))
{
Example
example
=
new
Example
(
BusSaving
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"id"
,
id
);
result
+=
busSavingRepository
.
updateByExampleSelective
(
busSaving
,
example
);
message
=
"更新成功"
;
}
else
{
message
=
"ID为空,更新失败"
;
}
}
return
new
PersistModel
(
result
,
message
);
}
}
@Transactional
@Transactional
@Override
@Override
public
PersistModel
delete
(
String
proId
)
{
public
Integer
delete
(
String
id
)
{
int
result
=
0
;
String
message
=
""
;
Example
example
=
new
Example
(
BusSaving
.
class
);
Example
example
=
new
Example
(
BusSaving
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
StringUtils
.
isNotEmpty
(
proId
))
{
criteria
.
andEqualTo
(
"id"
,
id
);
criteria
.
andEqualTo
(
"proId"
,
proId
);
return
busSavingRepository
.
deleteByExample
(
example
);
result
+=
busSavingRepository
.
deleteByExample
(
example
);
message
=
"删除成功"
;
}
else
{
message
=
"项目ID为空,删除失败"
;
}
return
new
PersistModel
(
result
,
message
);
}
}
@Override
@Override
public
List
<
BusSaving
>
queryBusSaving
(
String
proId
)
{
public
List
<
BusSaving
>
findAllByPagination
(
PageUtil
<
BusSaving
>
paginationUtility
)
{
Example
example
=
new
Example
(
BusSaving
.
class
);
return
busSavingRepository
.
selectAll
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"proId"
,
proId
);
return
busSavingRepository
.
selectByExample
(
example
);
}
}
@Override
public
BusSaving
findBusSaving
(
String
id
)
{
BusSaving
busSaving
=
new
BusSaving
();
busSaving
.
setId
(
id
);
return
busSavingRepository
.
selectOne
(
busSaving
);
}
}
}
src/main/resources/mapper/sys/manage.mapper/BusSavingMapper.xml
View file @
2b2e87a1
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
<result
column=
"QUALIFICATION"
jdbcType=
"VARCHAR"
property=
"qualification"
/>
<result
column=
"QUALIFICATION"
jdbcType=
"VARCHAR"
property=
"qualification"
/>
<result
column=
"TM"
jdbcType=
"VARCHAR"
property=
"tm"
/>
<result
column=
"TM"
jdbcType=
"VARCHAR"
property=
"tm"
/>
<result
column=
"PERFORMANCE"
jdbcType=
"VARCHAR"
property=
"performance"
/>
<result
column=
"PERFORMANCE"
jdbcType=
"VARCHAR"
property=
"performance"
/>
<
result
column=
"TYPE"
jdbcType=
"VARCHAR"
property=
"type"
/
>
<
!--<result column="TYPE" jdbcType="VARCHAR" property="type"/>--
>
<
result
column=
"PRO_ID"
jdbcType=
"VARCHAR"
property=
"proId"
/
>
<
!--<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>--
>
</resultMap>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
...
...
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