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
321b806f
Commit
321b806f
authored
Oct 17, 2024
by
位宇华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
范各庄电--代码提交
parent
d63a5e1e
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
212 additions
and
18 deletions
+212
-18
ruoyi-wages/src/main/java/com/ruoyi/system/controller/ConfigSaveController.java
...ava/com/ruoyi/system/controller/ConfigSaveController.java
+16
-0
ruoyi-wages/src/main/java/com/ruoyi/system/controller/ImportExpenseSourceController.java
...uoyi/system/controller/ImportExpenseSourceController.java
+1
-0
ruoyi-wages/src/main/java/com/ruoyi/system/mapper/PowerDisplayMapper.java
...main/java/com/ruoyi/system/mapper/PowerDisplayMapper.java
+5
-0
ruoyi-wages/src/main/java/com/ruoyi/system/mapper/SalaryMapper.java
...s/src/main/java/com/ruoyi/system/mapper/SalaryMapper.java
+2
-0
ruoyi-wages/src/main/java/com/ruoyi/system/model/power/PowerConvertSourceModel.java
...com/ruoyi/system/model/power/PowerConvertSourceModel.java
+36
-0
ruoyi-wages/src/main/java/com/ruoyi/system/model/power/SourceIndfoModel.java
...n/java/com/ruoyi/system/model/power/SourceIndfoModel.java
+47
-0
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
...om/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
+88
-18
ruoyi-wages/src/main/resources/mapper/system/PowerDisplayMapper.xml
...s/src/main/resources/mapper/system/PowerDisplayMapper.xml
+13
-0
ruoyi-wages/src/main/resources/mapper/system/SalaryMapper.xml
...i-wages/src/main/resources/mapper/system/SalaryMapper.xml
+4
-0
No files found.
ruoyi-wages/src/main/java/com/ruoyi/system/controller/ConfigSaveController.java
View file @
321b806f
...
@@ -64,4 +64,20 @@ public class ConfigSaveController {
...
@@ -64,4 +64,20 @@ public class ConfigSaveController {
map
.
forEach
((
k
,
v
)->
salaryMapper
.
insertMap
(
k
,
v
));
map
.
forEach
((
k
,
v
)->
salaryMapper
.
insertMap
(
k
,
v
));
}
}
@PostMapping
(
"/test/source"
)
public
void
source
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"其他应收款-内部往来(销)"
,
"其他应收款"
);
map
.
put
(
"其他应收款-内部往来(供)"
,
"其他应收款"
);
map
.
put
(
"其他业务支出-转供电"
,
"其他业务成本"
);
map
.
put
(
"应付职工薪酬-福利(宿舍)"
,
"制造费用-原煤"
);
map
.
put
(
"应付职工薪酬-福利(食堂)"
,
"福利费"
);
map
.
put
(
"销售费用-电力-电力"
,
"销售费用"
);
map
.
put
(
"管理费用--电费"
,
"管理费用"
);
map
.
put
(
"生产成本-洗煤-电力"
,
"基本生产-洗煤"
);
map
.
put
(
"制造费用-原煤-电力"
,
"制造费用-原煤"
);
map
.
put
(
"生产成本-原煤-电力"
,
"基本生产-原煤"
);
map
.
forEach
((
k
,
v
)->
salaryMapper
.
insertSourceMap
(
k
,
v
));
}
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/controller/ImportExpenseSourceController.java
View file @
321b806f
...
@@ -26,4 +26,5 @@ public class ImportExpenseSourceController {
...
@@ -26,4 +26,5 @@ public class ImportExpenseSourceController {
public
AjaxResult
powerSource
(
@RequestParam
(
"multipartFile"
)
MultipartFile
multipartFile
)
{
public
AjaxResult
powerSource
(
@RequestParam
(
"multipartFile"
)
MultipartFile
multipartFile
)
{
return
importExpenseSourceService
.
save
(
multipartFile
);
return
importExpenseSourceService
.
save
(
multipartFile
);
}
}
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/mapper/PowerDisplayMapper.java
View file @
321b806f
package
com.ruoyi.system.mapper
;
package
com.ruoyi.system.mapper
;
import
com.ruoyi.system.model.power.PowerConvertSourceModel
;
import
com.ruoyi.system.model.power.PowerSourceModel
;
import
com.ruoyi.system.model.power.PowerSourceModel
;
import
com.ruoyi.system.model.power.dao.PowerClassificationQueryDao
;
import
com.ruoyi.system.model.power.dao.PowerClassificationQueryDao
;
import
com.ruoyi.system.model.power.dao.PowerControlDao
;
import
com.ruoyi.system.model.power.dao.PowerControlDao
;
...
@@ -30,4 +31,8 @@ public interface PowerDisplayMapper {
...
@@ -30,4 +31,8 @@ public interface PowerDisplayMapper {
List
<
ConfigModel
>
seletPowerConfig
();
List
<
ConfigModel
>
seletPowerConfig
();
List
<
PowerSourceModel
>
selectSource
(
@Param
(
"number"
)
String
number
);
List
<
PowerSourceModel
>
selectSource
(
@Param
(
"number"
)
String
number
);
void
deleteRepeat
(
@Param
(
"month"
)
String
month
,
@Param
(
"minId"
)
String
minId
);
List
<
PowerConvertSourceModel
>
selectConvertSource
(
@Param
(
"number"
)
String
number
);
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/mapper/SalaryMapper.java
View file @
321b806f
...
@@ -38,4 +38,6 @@ public interface SalaryMapper {
...
@@ -38,4 +38,6 @@ public interface SalaryMapper {
void
insertMap
(
@Param
(
"k"
)
String
k
,
@Param
(
"v"
)
Object
v
);
void
insertMap
(
@Param
(
"k"
)
String
k
,
@Param
(
"v"
)
Object
v
);
List
<
ConfigModel
>
getConfig
();
List
<
ConfigModel
>
getConfig
();
void
insertSourceMap
(
@Param
(
"k"
)
String
k
,
@Param
(
"v"
)
Object
v
);
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/model/power/PowerConvertSourceModel.java
0 → 100644
View file @
321b806f
package
com.ruoyi.system.model.power
;
import
java.io.Serializable
;
public
class
PowerConvertSourceModel
implements
Serializable
{
private
String
needConvertSource
;
private
String
convertSourceName
;
private
String
orgCode
;
public
String
getNeedConvertSource
()
{
return
needConvertSource
;
}
public
void
setNeedConvertSource
(
String
needConvertSource
)
{
this
.
needConvertSource
=
needConvertSource
;
}
public
String
getConvertSourceName
()
{
return
convertSourceName
;
}
public
void
setConvertSourceName
(
String
convertSourceName
)
{
this
.
convertSourceName
=
convertSourceName
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/model/power/SourceIndfoModel.java
0 → 100644
View file @
321b806f
package
com.ruoyi.system.model.power
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
public
class
SourceIndfoModel
implements
Serializable
{
private
String
sourceName
;
private
String
keyName
;
private
String
valueName
;
private
BigDecimal
unitPrice
;
public
String
getKeyName
()
{
return
keyName
;
}
public
void
setKeyName
(
String
keyName
)
{
this
.
keyName
=
keyName
;
}
public
String
getValueName
()
{
return
valueName
;
}
public
void
setValueName
(
String
valueName
)
{
this
.
valueName
=
valueName
;
}
public
String
getSourceName
()
{
return
sourceName
;
}
public
void
setSourceName
(
String
sourceName
)
{
this
.
sourceName
=
sourceName
;
}
public
BigDecimal
getUnitPrice
()
{
return
unitPrice
;
}
public
void
setUnitPrice
(
BigDecimal
unitPrice
)
{
this
.
unitPrice
=
unitPrice
;
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
View file @
321b806f
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
;
import
com.ruoyi.system.mapper.PowerDisplayMapper
;
import
com.ruoyi.system.mapper.PowerDisplayMapper
;
import
com.ruoyi.system.model.newrule.NewRuleRequestModel
;
import
com.ruoyi.system.model.newrule.NewRuleRequestModel
;
import
com.ruoyi.system.model.power.PowerConvertSourceModel
;
import
com.ruoyi.system.model.power.PowerSourceModel
;
import
com.ruoyi.system.model.power.PowerSourceModel
;
import
com.ruoyi.system.model.power.SourceIndfoModel
;
import
com.ruoyi.system.model.power.dao.PowerClassificationQueryDao
;
import
com.ruoyi.system.model.power.dao.PowerClassificationQueryDao
;
import
com.ruoyi.system.model.power.dao.PowerControlDao
;
import
com.ruoyi.system.model.power.dao.PowerControlDao
;
import
com.ruoyi.system.model.power.dto.PowerDisplayDto
;
import
com.ruoyi.system.model.power.dto.PowerDisplayDto
;
...
@@ -22,6 +25,8 @@ import redis.clients.jedis.Jedis;
...
@@ -22,6 +25,8 @@ import redis.clients.jedis.Jedis;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -37,6 +42,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -37,6 +42,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
this
.
powerDisplayMapper
=
powerDisplayMapper
;
this
.
powerDisplayMapper
=
powerDisplayMapper
;
}
}
@Override
@Override
public
void
peek
(
List
<
NewRuleRequestModel
>
electricityIntoTheParameterDtoDtoList
)
{
public
void
peek
(
List
<
NewRuleRequestModel
>
electricityIntoTheParameterDtoDtoList
)
{
Jedis
redis
=
new
Jedis
(
"192.168.111.226"
,
6379
);
Jedis
redis
=
new
Jedis
(
"192.168.111.226"
,
6379
);
...
@@ -129,10 +135,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -129,10 +135,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
}
else
if
(
dongHuanTuo
.
contains
(
mindId
))
{
}
else
if
(
dongHuanTuo
.
contains
(
mindId
))
{
saveOnTheLargeScreen
=
new
SaveOnTheLargeScreenImpl
(
new
DongHuanTuo
());
saveOnTheLargeScreen
=
new
SaveOnTheLargeScreenImpl
(
new
DongHuanTuo
());
}
else
if
(
qianJiaYing
.
contains
(
mindId
))
{
}
else
if
(
qianJiaYing
.
contains
(
mindId
))
{
List
<
NewRuleRequestModel
>
collect
=
electricityIntoTheParameterDtoDtoList
List
<
NewRuleRequestModel
>
collect
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
v
.
getRow
().
contains
(
"(尖)"
)
||
v
.
getRow
().
contains
(
"(峰)"
)
||
v
.
getRow
().
contains
(
"(平)"
)
||
v
.
getRow
().
contains
(
"(谷)"
)).
collect
(
Collectors
.
toList
());
.
parallelStream
()
.
filter
(
v
->
v
.
getRow
().
contains
(
"(尖)"
)
||
v
.
getRow
().
contains
(
"(峰)"
)
||
v
.
getRow
().
contains
(
"(平)"
)
||
v
.
getRow
().
contains
(
"(谷)"
))
.
collect
(
Collectors
.
toList
());
if
(!
collect
.
isEmpty
())
{
if
(!
collect
.
isEmpty
())
{
PowerDisplayDto
displayDto
;
PowerDisplayDto
displayDto
;
for
(
NewRuleRequestModel
dto
:
collect
)
{
for
(
NewRuleRequestModel
dto
:
collect
)
{
...
@@ -222,10 +225,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -222,10 +225,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
String
electricityPricesForLighting
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
v
.
getColoumn
().
equals
(
"照明电价"
)).
findFirst
().
get
().
getValue
();
String
electricityPricesForLighting
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
v
.
getColoumn
().
equals
(
"照明电价"
)).
findFirst
().
get
().
getValue
();
String
powerTariff
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
v
.
getColoumn
().
equals
(
"动力电价"
)).
findFirst
().
get
().
getValue
();
String
powerTariff
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
v
.
getColoumn
().
equals
(
"动力电价"
)).
findFirst
().
get
().
getValue
();
list
.
parallelStream
().
forEach
(
v
->
{
list
.
parallelStream
().
forEach
(
v
->
{
if
((
v
.
getElectricityPriceFlat
()
!=
null
&&
!
v
.
getElectricityPriceFlat
().
isEmpty
())
||
if
((
v
.
getElectricityPriceFlat
()
!=
null
&&
!
v
.
getElectricityPriceFlat
().
isEmpty
())
||
(
v
.
getElectricityPricePeak
()
!=
null
&&
!
v
.
getElectricityPricePeak
().
isEmpty
())
||
(
v
.
getElectricityPriceTip
()
!=
null
&&
!
v
.
getElectricityPriceTip
().
isEmpty
())
||
(
v
.
getElectricityPriceValley
()
!=
null
&&
!
v
.
getElectricityPriceValley
().
isEmpty
()))
(
v
.
getElectricityPricePeak
()
!=
null
&&
!
v
.
getElectricityPricePeak
().
isEmpty
())
||
return
;
(
v
.
getElectricityPriceTip
()
!=
null
&&
!
v
.
getElectricityPriceTip
().
isEmpty
())
||
(
v
.
getElectricityPriceValley
()
!=
null
&&
!
v
.
getElectricityPriceValley
().
isEmpty
()))
return
;
if
(
v
.
getLevelThreeClassification
().
equals
(
"动力用电"
))
{
if
(
v
.
getLevelThreeClassification
().
equals
(
"动力用电"
))
{
v
.
setElectricityPriceValley
(
powerTariff
);
v
.
setElectricityPriceValley
(
powerTariff
);
v
.
setElectricityPriceFlat
(
powerTariff
);
v
.
setElectricityPriceFlat
(
powerTariff
);
...
@@ -249,8 +250,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -249,8 +250,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
*/
*/
private
void
method
(
List
<
PowerDisplayDto
>
list
,
List
<
NewRuleRequestModel
>
electricityIntoTheParameterDtoDtoList
)
{
private
void
method
(
List
<
PowerDisplayDto
>
list
,
List
<
NewRuleRequestModel
>
electricityIntoTheParameterDtoDtoList
)
{
for
(
PowerDisplayDto
dto
:
list
)
{
for
(
PowerDisplayDto
dto
:
list
)
{
if
((
dto
.
getElectricityPriceFlat
()
==
null
||
dto
.
getElectricityPriceFlat
().
isEmpty
())
&&
(
dto
.
getElectricityPricePeak
()
==
null
||
dto
.
getElectricityPricePeak
().
isEmpty
())
&&
if
((
dto
.
getElectricityPriceFlat
()
==
null
||
dto
.
getElectricityPriceFlat
().
isEmpty
())
&&
(
dto
.
getElectricityPricePeak
()
==
null
||
dto
.
getElectricityPricePeak
().
isEmpty
())
&&
(
dto
.
getElectricityPriceTip
()
==
null
||
dto
.
getElectricityPriceTip
().
isEmpty
())
&&
(
dto
.
getElectricityPriceValley
()
==
null
||
dto
.
getElectricityPriceValley
().
isEmpty
()))
{
(
dto
.
getElectricityPriceTip
()
==
null
||
dto
.
getElectricityPriceTip
().
isEmpty
())
&&
(
dto
.
getElectricityPriceValley
()
==
null
||
dto
.
getElectricityPriceValley
().
isEmpty
()))
{
Optional
<
NewRuleRequestModel
>
first
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
(
v
.
getRow
().
equals
(
dto
.
getLevelOneClassification
())
||
v
.
getRow
().
equals
(
dto
.
getLevelTwoClassification
()))
&&
v
.
getColoumn
().
equals
(
"单价"
)).
findFirst
();
Optional
<
NewRuleRequestModel
>
first
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
(
v
.
getRow
().
equals
(
dto
.
getLevelOneClassification
())
||
v
.
getRow
().
equals
(
dto
.
getLevelTwoClassification
()))
&&
v
.
getColoumn
().
equals
(
"单价"
)).
findFirst
();
if
(
first
.
isPresent
())
{
if
(
first
.
isPresent
())
{
NewRuleRequestModel
model
=
first
.
get
();
NewRuleRequestModel
model
=
first
.
get
();
...
@@ -285,9 +285,13 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -285,9 +285,13 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
* @param powerDisplayDtoList
* @param powerDisplayDtoList
*/
*/
private
void
saveFGZPowerData
(
List
<
NewRuleRequestModel
>
powerDisplayDtoList
)
{
private
void
saveFGZPowerData
(
List
<
NewRuleRequestModel
>
powerDisplayDtoList
)
{
ReplaceBlank
(
powerDisplayDtoList
);
ReplaceBlank
(
powerDisplayDtoList
);
List
<
PowerDisplayDto
>
displayDtoList
=
getPowerDisplayDtoList
(
powerDisplayDtoList
);
List
<
PowerConvertSourceModel
>
sourceModelList
=
powerDisplayMapper
.
selectConvertSource
(
"011701"
);
List
<
NewRuleRequestModel
>
sourceDataList
=
powerDisplayDtoList
.
stream
().
filter
(
v
->
sourceModelList
.
stream
().
anyMatch
(
source
->
StringUtils
.
equals
(
v
.
getRow
(),
source
.
getNeedConvertSource
()))).
collect
(
Collectors
.
toList
());
List
<
NewRuleRequestModel
>
dataList
=
powerDisplayDtoList
.
stream
().
filter
(
v
->
sourceModelList
.
stream
().
noneMatch
(
source
->
StringUtils
.
equals
(
v
.
getRow
(),
source
.
getNeedConvertSource
()))).
collect
(
Collectors
.
toList
());
List
<
PowerDisplayDto
>
displayDtoList
=
getPowerDisplayDtoList
(
dataList
);
//计算部门电费
calculateEleFeeByDept
(
sourceDataList
,
displayDtoList
,
sourceModelList
);
}
}
...
@@ -297,29 +301,91 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -297,29 +301,91 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
* @param powerDisplayDtoList
* @param powerDisplayDtoList
*/
*/
private
void
saveLJTPowerData
(
List
<
NewRuleRequestModel
>
powerDisplayDtoList
)
{
private
void
saveLJTPowerData
(
List
<
NewRuleRequestModel
>
powerDisplayDtoList
)
{
String
month
=
powerDisplayDtoList
.
get
(
0
).
getWageMonth
();
String
minId
=
powerDisplayDtoList
.
get
(
0
).
getMineid
();
ReplaceBlank
(
powerDisplayDtoList
);
ReplaceBlank
(
powerDisplayDtoList
);
List
<
PowerDisplayDto
>
displayDtoList
=
getPowerDisplayDtoList
(
powerDisplayDtoList
);
List
<
PowerDisplayDto
>
displayDtoList
=
getPowerDisplayDtoList
(
powerDisplayDtoList
);
disposeParamter
(
displayDtoList
);
disposeParamter
(
displayDtoList
);
Map
<
String
,
List
<
PowerDisplayDto
>>
map
=
displayDtoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
PowerDisplayDto:
:
getClassificationName
));
Map
<
String
,
List
<
PowerDisplayDto
>>
map
=
displayDtoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
PowerDisplayDto:
:
getClassificationName
));
List
<
PowerDisplayDto
>
finalList
=
new
ArrayList
<>();
List
<
PowerDisplayDto
>
finalList
=
new
ArrayList
<>();
map
.
forEach
((
k
,
v
)
->
{
map
.
forEach
((
k
,
v
)
->
{
PowerDisplayDto
pd
=
megreData
(
v
);
PowerDisplayDto
pd
=
me
a
greData
(
v
);
finalList
.
add
(
pd
);
finalList
.
add
(
pd
);
});
});
List
<
PowerDisplayDto
>
collect
=
finalList
.
stream
().
filter
(
v
->
!
StringUtils
.
contains
(
v
.
getClassificationName
(),
"合计"
)).
collect
(
Collectors
.
toList
());
List
<
PowerDisplayDto
>
collect
=
finalList
.
stream
().
filter
(
v
->
!
StringUtils
.
contains
(
v
.
getClassificationName
(),
"合计"
)).
collect
(
Collectors
.
toList
());
List
<
PowerSourceModel
>
powerSourceModelList
=
powerDisplayMapper
.
selectSource
(
"011702"
);
List
<
PowerSourceModel
>
powerSourceModelList
=
powerDisplayMapper
.
selectSource
(
"011702"
);
collect
=
collect
.
stream
().
filter
(
v
->
powerSourceModelList
.
stream
().
noneMatch
(
powerSourceModel
->
StringUtils
.
equals
(
v
.
getClassificationName
(),
powerSourceModel
.
getLevelOneClassification
()))).
collect
(
Collectors
.
toList
());
collect
=
collect
.
stream
().
filter
(
v
->
powerSourceModelList
.
stream
().
noneMatch
(
powerSourceModel
->
StringUtils
.
equals
(
v
.
getClassificationName
(),
powerSourceModel
.
getLevelOneClassification
()))).
collect
(
Collectors
.
toList
());
collect
.
forEach
(
v
->
{
collect
.
forEach
(
v
->
{
for
(
PowerSourceModel
powerSourceModel
:
powerSourceModelList
)
{
for
(
PowerSourceModel
powerSourceModel
:
powerSourceModelList
)
{
if
(
StringUtils
.
equals
(
v
.
getClassificationName
(),
powerSourceModel
.
getClassificationName
()))
{
if
(
StringUtils
.
equals
(
v
.
getClassificationName
(),
powerSourceModel
.
getClassificationName
()))
{
v
.
setLevelOneClassification
(
powerSourceModel
.
getLevelOneClassification
());
v
.
setLevelOneClassification
(
powerSourceModel
.
getLevelOneClassification
());
}
}
}
}
});
});
powerDisplayMapper
.
deleteRepeat
(
month
,
minId
);
powerDisplayMapper
.
insert
(
collect
);
powerDisplayMapper
.
insert
(
collect
);
}
}
private
PowerDisplayDto
megreData
(
List
<
PowerDisplayDto
>
powerDisplayDtoList
)
{
private
void
calculateEleFeeByDept
(
List
<
NewRuleRequestModel
>
sourceDataList
,
List
<
PowerDisplayDto
>
displayDtoList
,
List
<
PowerConvertSourceModel
>
sourceModelList
)
{
String
month
=
sourceDataList
.
get
(
0
).
getWageMonth
();
String
mindId
=
sourceDataList
.
get
(
0
).
getMineid
();
sourceDataList
.
forEach
(
v
->
sourceModelList
.
forEach
(
s
->
{
if
(
StringUtils
.
equals
(
v
.
getRow
(),
s
.
getNeedConvertSource
()))
{
v
.
setRow
(
s
.
getConvertSourceName
());
}
}));
Map
<
String
,
List
<
NewRuleRequestModel
>>
map
=
sourceDataList
.
stream
().
collect
(
Collectors
.
groupingBy
(
NewRuleRequestModel:
:
getRow
));
List
<
SourceIndfoModel
>
sourceIndfoModelList
=
new
ArrayList
<>();
map
.
forEach
((
k
,
v
)
->
v
.
forEach
(
a
->
{
SourceIndfoModel
sourceIndfoModel
=
new
SourceIndfoModel
();
if
(
v
.
size
()
>
2
)
{
if
(
StringUtils
.
equals
(
"电费总额"
,
a
.
getColoumn
()))
{
sourceIndfoModel
.
setValueName
(
a
.
getValue
());
sourceIndfoModel
.
setKeyName
(
a
.
getColoumn
());
sourceIndfoModel
.
setSourceName
(
k
);
sourceIndfoModelList
.
add
(
sourceIndfoModel
);
}
if
(
StringUtils
.
equals
(
"电量总额"
,
a
.
getColoumn
()))
{
sourceIndfoModel
.
setValueName
(
a
.
getValue
());
sourceIndfoModel
.
setKeyName
(
a
.
getColoumn
());
sourceIndfoModel
.
setSourceName
(
k
);
sourceIndfoModelList
.
add
(
sourceIndfoModel
);
}
}
else
{
sourceIndfoModel
.
setValueName
(
a
.
getValue
());
sourceIndfoModel
.
setKeyName
(
a
.
getColoumn
());
sourceIndfoModel
.
setSourceName
(
k
);
sourceIndfoModelList
.
add
(
sourceIndfoModel
);
}
}));
Map
<
String
,
List
<
SourceIndfoModel
>>
stringListMap
=
sourceIndfoModelList
.
stream
().
collect
(
Collectors
.
groupingBy
(
SourceIndfoModel:
:
getSourceName
));
List
<
SourceIndfoModel
>
sourceIndfoModels
=
new
ArrayList
<>();
stringListMap
.
forEach
((
k
,
v
)
->
{
SourceIndfoModel
sourceIndfoModel
=
new
SourceIndfoModel
();
List
<
BigDecimal
>
capacityList
=
v
.
stream
().
filter
(
a
->
StringUtils
.
equals
(
"电量总额"
,
a
.
getKeyName
())).
map
(
a
->
new
BigDecimal
(
a
.
getValueName
())).
collect
(
Collectors
.
toList
());
List
<
BigDecimal
>
feeList
=
v
.
stream
().
filter
(
a
->
StringUtils
.
equals
(
"电费总额"
,
a
.
getKeyName
())).
map
(
a
->
new
BigDecimal
(
a
.
getValueName
())).
collect
(
Collectors
.
toList
());
BigDecimal
capacityReduce
=
capacityList
.
stream
().
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
feeReduce
=
feeList
.
stream
().
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
sourceIndfoModel
.
setSourceName
(
k
);
sourceIndfoModel
.
setUnitPrice
(
feeReduce
.
divide
(
capacityReduce
,
2
,
RoundingMode
.
HALF_UP
));
sourceIndfoModels
.
add
(
sourceIndfoModel
);
});
List
<
PowerSourceModel
>
powerSourceModelList
=
powerDisplayMapper
.
selectSource
(
"011701"
);
displayDtoList
.
forEach
(
v
->
powerSourceModelList
.
forEach
(
s
->
{
if
(
StringUtils
.
equals
(
v
.
getClassificationName
(),
s
.
getClassificationName
()))
{
v
.
setLevelOneClassification
(
s
.
getLevelOneClassification
());
}
}));
displayDtoList
.
forEach
(
v
->
sourceIndfoModels
.
forEach
(
s
->
{
if
(
StringUtils
.
equals
(
v
.
getLevelOneClassification
(),
s
.
getSourceName
()))
{
v
.
setElectricityTotal
(
String
.
valueOf
(
new
BigDecimal
(
v
.
getPowerTotal
()).
multiply
(
s
.
getUnitPrice
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
)));
}
}));
powerDisplayMapper
.
deleteRepeat
(
month
,
mindId
);
powerDisplayMapper
.
insert
(
displayDtoList
);
}
private
PowerDisplayDto
meagreData
(
List
<
PowerDisplayDto
>
powerDisplayDtoList
)
{
return
powerDisplayDtoList
.
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toMap
(
data
->
data
.
getMindId
()
+
data
.
getClassificationName
()
+
data
.
getDateColumn
(),
data
->
data
,
(
existingData
,
newData
)
->
{
return
powerDisplayDtoList
.
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toMap
(
data
->
data
.
getMindId
()
+
data
.
getClassificationName
()
+
data
.
getDateColumn
(),
data
->
data
,
(
existingData
,
newData
)
->
{
existingData
.
setPowerTotal
(
StringUtils
.
isEmpty
(
existingData
.
getPowerTotal
())
?
newData
.
getPowerTotal
()
:
existingData
.
getPowerTotal
());
existingData
.
setPowerTotal
(
StringUtils
.
isEmpty
(
existingData
.
getPowerTotal
())
?
newData
.
getPowerTotal
()
:
existingData
.
getPowerTotal
());
existingData
.
setPowerTip
(
StringUtils
.
isEmpty
(
existingData
.
getPowerTip
())
?
newData
.
getPowerTip
()
:
existingData
.
getPowerTip
());
existingData
.
setPowerTip
(
StringUtils
.
isEmpty
(
existingData
.
getPowerTip
())
?
newData
.
getPowerTip
()
:
existingData
.
getPowerTip
());
...
@@ -352,7 +418,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -352,7 +418,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
PowerDisplayDto
powerDisplayDto
=
new
PowerDisplayDto
();
PowerDisplayDto
powerDisplayDto
=
new
PowerDisplayDto
();
for
(
NewRuleRequestModel
newRuleRequestModel
:
v
)
{
for
(
NewRuleRequestModel
newRuleRequestModel
:
v
)
{
for
(
ConfigModel
configModel
:
configModelList
)
{
for
(
ConfigModel
configModel
:
configModelList
)
{
if
(
StringUtils
.
contains
(
newRuleRequestModel
.
getColoumn
(),
configModel
.
getColName
()))
{
if
(
StringUtils
.
contains
(
configModel
.
getColName
(),
newRuleRequestModel
.
getColoumn
()))
{
Field
field
;
Field
field
;
try
{
try
{
field
=
PowerDisplayDto
.
class
.
getDeclaredField
(
configModel
.
getKeyName
());
field
=
PowerDisplayDto
.
class
.
getDeclaredField
(
configModel
.
getKeyName
());
...
@@ -379,12 +445,16 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
...
@@ -379,12 +445,16 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
v
.
setRow
(
v
.
getRow
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setRow
(
v
.
getRow
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setValue
(
v
.
getValue
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setValue
(
v
.
getValue
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setColoumn
(
v
.
getColoumn
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
v
.
setColoumn
(
v
.
getColoumn
().
replaceAll
(
StringUtils
.
SPACE
,
StringUtils
.
EMPTY
));
if
(
StringUtils
.
equalsAny
(
v
.
getMineid
(),
"011702"
,
"011701"
))
{
v
.
setColoumn
(
v
.
getColoumn
().
replaceAll
(
"\\(.*?\\)"
,
StringUtils
.
EMPTY
));
v
.
setColoumn
(
v
.
getColoumn
().
replaceAll
(
"(.*?)"
,
StringUtils
.
EMPTY
));
}
});
});
}
}
private
void
disposeParamter
(
List
<
PowerDisplayDto
>
displayDtoList
)
{
private
void
disposeParamter
(
List
<
PowerDisplayDto
>
displayDtoList
)
{
for
(
PowerDisplayDto
powerDisplayDto
:
displayDtoList
)
{
for
(
PowerDisplayDto
powerDisplayDto
:
displayDtoList
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
contains
(
powerDisplayDto
.
getClassificationName
(),
"其中"
))
{
if
(
StringUtils
.
contains
(
powerDisplayDto
.
getClassificationName
(),
"其中"
))
{
powerDisplayDto
.
setClassificationName
(
powerDisplayDto
.
getClassificationName
().
replaceAll
(
"其中:"
,
StringUtils
.
EMPTY
));
powerDisplayDto
.
setClassificationName
(
powerDisplayDto
.
getClassificationName
().
replaceAll
(
"其中:"
,
StringUtils
.
EMPTY
));
}
}
powerDisplayDto
.
setClassificationName
(
powerDisplayDto
.
getClassificationName
().
replaceAll
(
"[^\\u4e00-\\u9fa5]"
,
StringUtils
.
EMPTY
));
powerDisplayDto
.
setClassificationName
(
powerDisplayDto
.
getClassificationName
().
replaceAll
(
"[^\\u4e00-\\u9fa5]"
,
StringUtils
.
EMPTY
));
...
...
ruoyi-wages/src/main/resources/mapper/system/PowerDisplayMapper.xml
View file @
321b806f
...
@@ -111,4 +111,17 @@
...
@@ -111,4 +111,17 @@
from power_classification_query
from power_classification_query
where mind_id = #{number}
where mind_id = #{number}
</select>
</select>
<delete
id=
"deleteRepeat"
>
delete
from power_large_screen_display
where mind_id = #{minId}
and date_column = #{month}
</delete>
<select
id=
"selectConvertSource"
resultType=
"com.ruoyi.system.model.power.PowerConvertSourceModel"
>
select need_convert_source as needConvertSource,
convert_source as convertSourceName
from power_source_convert
where org_code = #{number}
</select>
</mapper>
</mapper>
\ No newline at end of file
ruoyi-wages/src/main/resources/mapper/system/SalaryMapper.xml
View file @
321b806f
...
@@ -203,6 +203,10 @@
...
@@ -203,6 +203,10 @@
INSERT INTO power_col_config (key_name, col_name)
INSERT INTO power_col_config (key_name, col_name)
values (#{k}, #{v})
values (#{k}, #{v})
</insert>
</insert>
<insert
id=
"insertSourceMap"
>
INSERT INTO power_source_convert (need_convert_source, convert_source,org_code)
values (#{k}, #{v},'011701')
</insert>
<select
id=
"getConfig"
resultType=
"com.ruoyi.system.model.salary.ConfigModel"
>
<select
id=
"getConfig"
resultType=
"com.ruoyi.system.model.salary.ConfigModel"
>
select key_name as keyName,
select key_name as keyName,
col_name as colName
col_name as colName
...
...
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