Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
47f0ab9b
Commit
47f0ab9b
authored
Oct 30, 2024
by
位宇华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
唐山矿电力--代码提交
parent
deff2ec5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/ImportExpenseSourceServiceImpl.java
...i/system/service/impl/ImportExpenseSourceServiceImpl.java
+1
-1
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
...om/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
+21
-2
No files found.
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/ImportExpenseSourceServiceImpl.java
View file @
47f0ab9b
...
@@ -36,7 +36,7 @@ public class ImportExpenseSourceServiceImpl implements ImportExpenseSourceServic
...
@@ -36,7 +36,7 @@ public class ImportExpenseSourceServiceImpl implements ImportExpenseSourceServic
@Override
@Override
@SneakyThrows
@SneakyThrows
public
AjaxResult
save
(
MultipartFile
multipartFile
)
{
public
AjaxResult
save
(
MultipartFile
multipartFile
)
{
List
<
PowerImportSourceModel
>
powerImportSourceModelList
=
EasyExcelFactory
.
read
(
multipartFile
.
getInputStream
(),
PowerImportSourceModel
.
class
,
new
ExcelListener
<>()).
sheet
(
"Sheet
6
"
).
headRowNumber
(
1
).
doReadSync
();
List
<
PowerImportSourceModel
>
powerImportSourceModelList
=
EasyExcelFactory
.
read
(
multipartFile
.
getInputStream
(),
PowerImportSourceModel
.
class
,
new
ExcelListener
<>()).
sheet
(
"Sheet
8
"
).
headRowNumber
(
1
).
doReadSync
();
powerImportSourceModelList
.
forEach
(
v
->{
powerImportSourceModelList
.
forEach
(
v
->{
v
.
setClassificationName
(
v
.
getClassificationName
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setClassificationName
(
v
.
getClassificationName
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setLevelOneClassification
(
v
.
getLevelOneClassification
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setLevelOneClassification
(
v
.
getLevelOneClassification
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
...
...
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
View file @
47f0ab9b
package
com.ruoyi.system.service.impl
;
package
com.ruoyi.system.service.impl
;
import
com.alibaba.fastjson.JSON
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
...
@@ -469,8 +470,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -469,8 +470,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
String
minId
=
newRuleRequestModelList
.
get
(
0
).
getMineid
();
String
minId
=
newRuleRequestModelList
.
get
(
0
).
getMineid
();
ReplaceBlank
(
newRuleRequestModelList
);
ReplaceBlank
(
newRuleRequestModelList
);
List
<
PowerDisplayDto
>
displayDtoList
=
this
.
getPowerDisplayDtoList
(
newRuleRequestModelList
);
List
<
PowerDisplayDto
>
displayDtoList
=
this
.
getPowerDisplayDtoList
(
newRuleRequestModelList
);
List
<
PowerDisplayDto
>
powerDisplayDtoList
=
groupData
(
displayDtoList
);
getTotalValue
(
displayDtoList
);
getPowerSource
(
month
,
minId
,
powerD
isplayDtoList
);
getPowerSource
(
month
,
minId
,
d
isplayDtoList
);
}
}
...
@@ -517,6 +518,17 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -517,6 +518,17 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
powerDisplayMapper
.
insert
(
collect
);
powerDisplayMapper
.
insert
(
collect
);
}
}
private
void
getTotalValue
(
List
<
PowerDisplayDto
>
displayDtoList
)
{
displayDtoList
.
forEach
(
v
->
{
if
(
StringUtils
.
isBlank
(
v
.
getPowerTotal
()))
{
v
.
setPowerTotal
(
getAddValue
(
v
));
}
if
(
StringUtils
.
isBlank
(
v
.
getElectricityTotal
()))
{
v
.
setElectricityTotal
(
getFeeTotal
(
v
));
}
});
}
private
void
disposeData
(
List
<
PowerDisplayDto
>
collect
)
{
private
void
disposeData
(
List
<
PowerDisplayDto
>
collect
)
{
//煤管科
//煤管科
List
<
PowerDisplayDto
>
coalAdminCollect
=
collect
.
stream
().
filter
(
v
->
StringUtils
.
equalsAny
(
v
.
getClassificationName
(),
"煤管科"
,
"货车队"
)).
collect
(
Collectors
.
toList
());
List
<
PowerDisplayDto
>
coalAdminCollect
=
collect
.
stream
().
filter
(
v
->
StringUtils
.
equalsAny
(
v
.
getClassificationName
(),
"煤管科"
,
"货车队"
)).
collect
(
Collectors
.
toList
());
...
@@ -589,6 +601,13 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -589,6 +601,13 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
return
String
.
valueOf
(
Stream
.
of
(
motivation
,
lighting
,
powerTip
,
powerPeak
,
powerFlat
,
powerValley
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
return
String
.
valueOf
(
Stream
.
of
(
motivation
,
lighting
,
powerTip
,
powerPeak
,
powerFlat
,
powerValley
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
private
String
getFeeTotal
(
PowerDisplayDto
powerDisplayDto
)
{
BigDecimal
electricityTip
=
StringUtils
.
isBlank
(
powerDisplayDto
.
getElectricityTip
())
?
new
BigDecimal
(
0
)
:
new
BigDecimal
(
powerDisplayDto
.
getElectricityTip
());
BigDecimal
electricityPeak
=
StringUtils
.
isBlank
(
powerDisplayDto
.
getElectricityPeak
())
?
new
BigDecimal
(
0
)
:
new
BigDecimal
(
powerDisplayDto
.
getElectricityPeak
());
BigDecimal
electricityFlat
=
StringUtils
.
isBlank
(
powerDisplayDto
.
getElectricityFlat
())
?
new
BigDecimal
(
0
)
:
new
BigDecimal
(
powerDisplayDto
.
getElectricityFlat
());
BigDecimal
electricityValley
=
StringUtils
.
isBlank
(
powerDisplayDto
.
getElectricityValley
())
?
new
BigDecimal
(
0
)
:
new
BigDecimal
(
powerDisplayDto
.
getElectricityValley
());
return
String
.
valueOf
(
Stream
.
of
(
electricityTip
,
electricityPeak
,
electricityFlat
,
electricityValley
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
private
void
getPowerSource
(
String
month
,
String
minId
,
List
<
PowerDisplayDto
>
powerDisplayDtoList
)
{
private
void
getPowerSource
(
String
month
,
String
minId
,
List
<
PowerDisplayDto
>
powerDisplayDtoList
)
{
List
<
PowerSourceModel
>
powerSourceModelList
=
powerDisplayMapper
.
selectSource
(
minId
);
List
<
PowerSourceModel
>
powerSourceModelList
=
powerDisplayMapper
.
selectSource
(
minId
);
...
...
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