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
824940a6
Commit
824940a6
authored
May 02, 2018
by
王夏晖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计划编制批量插入
parent
c432f24a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
9 deletions
+22
-9
BusEnergyPlanController.java
...mainte/energyplan/controller/BusEnergyPlanController.java
+9
-4
ParamLibraryRepository.java
...iness/mainte/paramlibrary/dao/ParamLibraryRepository.java
+5
-5
ParamLibraryServiceImpl.java
...te/paramlibrary/service/impl/ParamLibraryServiceImpl.java
+8
-0
No files found.
src/main/java/org/rcisoft/business/mainte/energyplan/controller/BusEnergyPlanController.java
View file @
824940a6
...
@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiImplicitParams;
...
@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiImplicitParams;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.mainte.energyplan.entity.BusEnergyPlan
;
import
org.rcisoft.business.mainte.energyplan.entity.BusEnergyPlan
;
import
org.rcisoft.business.mainte.energyplan.service.BusEnergyPlanService
;
import
org.rcisoft.business.mainte.energyplan.service.BusEnergyPlanService
;
import
org.rcisoft.business.mainte.energyplan.vo.EnergyPlanList
;
import
org.rcisoft.business.mainte.energyplan.vo.EnergyPlanVo
;
import
org.rcisoft.business.mainte.energyplan.vo.EnergyPlanVo
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.controller.PaginationController
;
import
org.rcisoft.core.controller.PaginationController
;
...
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -36,12 +38,15 @@ public class BusEnergyPlanController extends PaginationController<BusEnergyPlan>
...
@@ -36,12 +38,15 @@ public class BusEnergyPlanController extends PaginationController<BusEnergyPlan>
@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")})
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
@Valid
EnergyPlanVo
energyPlan
)
throws
Exception
{
public
Result
add
(
@Valid
EnergyPlanList
energyPlanlist
)
throws
Exception
{
PersistModel
data
=
busEnergyPlanServiceImpl
.
save
(
energyPlan
);
List
<
EnergyPlanVo
>
epList
=
energyPlanlist
.
getEnergyPlanVoList
();
return
Result
.
builder
(
data
,
for
(
EnergyPlanVo
energyPlanVo
:
epList
){
busEnergyPlanServiceImpl
.
save
(
energyPlanVo
);
}
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
energyPlan
);
null
);
}
}
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"逻辑删除"
)
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"逻辑删除"
)
...
...
src/main/java/org/rcisoft/business/mainte/paramlibrary/dao/ParamLibraryRepository.java
View file @
824940a6
...
@@ -31,23 +31,23 @@ public interface ParamLibraryRepository {
...
@@ -31,23 +31,23 @@ public interface ParamLibraryRepository {
* 根据设备编码获取第一个参数集合
* 根据设备编码获取第一个参数集合
* @return
* @return
*/
*/
@Select
(
"<script>select distinct p1_v from bus_param_library where dev_num = #{dev_num} "
@Select
(
"<script>select distinct p1_v from bus_param_library where dev_num = #{dev_num}
and year = #{year}
"
+
"</script>"
)
+
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_1
(
Map
<
String
,
Object
>
map
);
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_1
(
Map
<
String
,
Object
>
map
);
/**
/**
* 根据设备编码及第一个参数获取第二个参数集合
* 根据设备编码及第一个参数获取第二个参数集合
* @return
* @return
*/
*/
@Select
(
"<script>select distinct p
2_v
from bus_param_library where dev_num = #{dev_num}"
+
@Select
(
"<script>select distinct p
1_v,p2_v,p3_v,power,gas_speed
from bus_param_library where dev_num = #{dev_num}"
+
" and p1_v = #{p1_v} "
" and p1_v = #{p1_v}
and year = #{year}
"
+
"</script>"
)
+
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_2
(
Map
<
String
,
Object
>
map
);
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_2
(
Map
<
String
,
Object
>
map
);
/**
/**
* 根据设备编码及前两个参数获取第三个参数集合
* 根据设备编码及前两个参数获取第三个参数集合
* @return
* @return
*/
*/
@Select
(
"<script>select distinct p
3_v
from bus_param_library where dev_num = #{dev_num}"
+
@Select
(
"<script>select distinct p
1_v,p2_v,p3_v,power,gas_speed
from bus_param_library where dev_num = #{dev_num}"
+
" and p1_v = #{p1_v} and p2_v = #{p2_v} "
" and p1_v = #{p1_v} and p2_v = #{p2_v}
and year = #{year}
"
+
"</script>"
)
+
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_3
(
Map
<
String
,
Object
>
map
);
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_3
(
Map
<
String
,
Object
>
map
);
...
...
src/main/java/org/rcisoft/business/mainte/paramlibrary/service/impl/ParamLibraryServiceImpl.java
View file @
824940a6
...
@@ -8,6 +8,8 @@ import org.springframework.stereotype.Service;
...
@@ -8,6 +8,8 @@ import org.springframework.stereotype.Service;
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.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -25,16 +27,22 @@ public class ParamLibraryServiceImpl implements ParamLibraryService {
...
@@ -25,16 +27,22 @@ public class ParamLibraryServiceImpl implements ParamLibraryService {
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_1
(
Map
<
String
,
Object
>
map
)
{
public
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_1
(
Map
<
String
,
Object
>
map
)
{
SimpleDateFormat
simple
=
new
SimpleDateFormat
(
"yyyy"
);
map
.
put
(
"year"
,
simple
.
format
(
new
Date
()));
return
paramLibraryRepository
.
queryPlanParamVal_1
(
map
);
return
paramLibraryRepository
.
queryPlanParamVal_1
(
map
);
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_2
(
Map
<
String
,
Object
>
map
)
{
public
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_2
(
Map
<
String
,
Object
>
map
)
{
SimpleDateFormat
simple
=
new
SimpleDateFormat
(
"yyyy"
);
map
.
put
(
"year"
,
simple
.
format
(
new
Date
()));
return
paramLibraryRepository
.
queryPlanParamVal_2
(
map
);
return
paramLibraryRepository
.
queryPlanParamVal_2
(
map
);
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_3
(
Map
<
String
,
Object
>
map
)
{
public
List
<
Map
<
String
,
Object
>>
queryPlanParamVal_3
(
Map
<
String
,
Object
>
map
)
{
SimpleDateFormat
simple
=
new
SimpleDateFormat
(
"yyyy"
);
map
.
put
(
"year"
,
simple
.
format
(
new
Date
()));
return
paramLibraryRepository
.
queryPlanParamVal_3
(
map
);
return
paramLibraryRepository
.
queryPlanParamVal_3
(
map
);
}
}
...
...
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