Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
9910378a
由
张雷
编写于
2025-01-23 15:16:02 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
数据接口修改
1 个父辈
e59cc5b1
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
83 行增加
和
11 行删除
sk-module-biz/src/main/java/com/skua/modules/dataAnalysis/controller/SysCommandCentreController.java
sk-module-datafill/src/main/java/com/skua/modules/custom/service/impl/FCustomReportDatasetServiceImpl.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/PowerAnalysisNewServiceImpl.java
sk-module-datafill/src/main/java/com/skua/modules/report/mapper/xml/FReportItemvMapper.xml
sk-module-system/src/main/java/com/skua/modules/system/controller/SysDepartController.java
sk-module-system/src/main/java/com/skua/modules/system/service/ISysDepartService.java
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysDepartServiceImpl.java
sk-module-biz/src/main/java/com/skua/modules/dataAnalysis/controller/SysCommandCentreController.java
查看文件 @
9910378
...
...
@@ -289,7 +289,7 @@ public class SysCommandCentreController {
List
<
String
>
yaXisList
=
new
ArrayList
<
String
>();
yaXisList
.
addAll
(
fyList
)
;
//费用
yaXisList
.
addAll
(
waterList
)
;
//水
yaXisList
.
addAll
(
waterList
)
;
//水
stackedAreaChartDataVO
.
setYAxis
(
yaXisList
);
Result
<
StackedAreaChartDataVO
>
result
=
new
Result
<>();
...
...
sk-module-datafill/src/main/java/com/skua/modules/custom/service/impl/FCustomReportDatasetServiceImpl.java
查看文件 @
9910378
...
...
@@ -110,7 +110,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" round(ifnull(v5.dlhj/tb.clsl_tb,0)/10000,2) qntqdh, "
+
" round(100*(v4.dlhj-ifnull(v5.dlhj,0))/ifnull(v5.dlhj,v4.dlhj),2) as dhdbbhl, "
+
" v6.dhgyqntqyy, "
+
" round(v
4.yjhl
/sum(v1.CSL),2) as yyh, "
+
" round(v
6.yyf
/sum(v1.CSL),2) as yyh, "
+
" v6.yyf,"
+
" round(ifnull(v5.yjhl/tb.clsl_tb/10000,0),2) qntqyh, "
+
" round(100*(v4.yjhl-ifnull(v5.yjhl,0))/ifnull(v5.yjhl,v4.yjhl),2) as yhdbbhl, "
+
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/PowerAnalysisNewServiceImpl.java
查看文件 @
9910378
...
...
@@ -6,6 +6,7 @@ import com.skua.common.constant.ReportConstant;
import
com.skua.common.report.ReportViewUtil
;
import
com.skua.core.context.BaseContextHandler
;
import
com.skua.core.context.SpringContextUtils
;
import
com.skua.core.util.ConvertUtils
;
import
com.skua.core.util.DateUtils
;
import
com.skua.modules.custom.service.IFCustomReportDatasetService
;
import
com.skua.modules.dataAnalysis.mapper.PowerAnalysisNewMapper
;
...
...
@@ -30,10 +31,10 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
private
PowerAnalysisNewMapper
powerAnalysisNewMapper
;
@Autowired
private
WaterCountAnalysisNewMapper
waterCountAnalysisNewMapper
;
@Autowired
private
IFCustomReportDatasetService
fCustomReportDatasetService
;
//时间格式
public
static
final
SimpleDateFormat
yyyyMM
=
new
SimpleDateFormat
(
"yyyy-MM"
);
//格式化小数
private
static
DecimalFormat
df
=
new
DecimalFormat
(
"#.##"
);
/**
* 功能描述: <br>电耗分析统计
...
...
@@ -53,6 +54,12 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
//本月总的电耗,处理水量,吨水电耗
Map
result
=
powerAnalysisNewMapper
.
totalPowerConsumptionAnalysis
(
thisDataViewName3a24
,
thisDataViewName2119
,
lastDataViewName3a24
,
lastDataViewName2119
,
thisMonth
,
lastMonth
,
departIds
);
List
<
Map
<
String
,
Object
>>
thisList
=
powerAnalysisNewMapper
.
powerConsumptionDistribution
(
thisDataViewName3a24
,
thisDataViewName2119
,
thisMonth
,
departIds
);
List
<
Map
<
String
,
Object
>>
lastList
=
powerAnalysisNewMapper
.
powerConsumptionDistribution
(
lastDataViewName3a24
,
lastDataViewName2119
,
lastMonth
,
departIds
);
result
=
updateDSDH
(
result
,
thisList
,
lastList
);
//向前6个月的电耗,处理水量分布
String
precedingTime
=
getSixMonth
(
thisMonth
);
String
start
=
precedingTime
+
"-01"
;
...
...
@@ -60,14 +67,47 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
String
dataViewName3a24
=
ReportViewUtil
.
buildView
(
ReportConstant
.
view3a24
,
"DLHJ"
,
departIds
,
start
,
end
);
String
dataViewName2119
=
ReportViewUtil
.
buildView
(
ReportConstant
.
view2119
,
"CSL"
,
departIds
,
start
,
end
);
List
<
Map
>
SixMonthPowerConsumption
=
powerAnalysisNewMapper
.
querySixMonthPowerConsumption
(
dataViewName3a24
,
dataViewName2119
,
start
,
end
,
departIds
);
resultMap
.
put
(
"totalResult"
,
result
);
resultMap
.
put
(
"dataList"
,
SixMonthPowerConsumption
);
return
resultMap
;
}
//更新吨水电耗计算逻辑
private
Map
updateDSDH
(
Map
result
,
List
<
Map
<
String
,
Object
>>
thisList
,
List
<
Map
<
String
,
Object
>>
lastList
)
{
int
thisnNum
=
0
;
int
lastNum
=
0
;
//平均值计数
double
thisDsdh
=
0.00
;
double
lastDsdh
=
0.00
;
//吨水电耗
String
bydsdh
=
"0.00"
;
String
sydsdh
=
"0.00"
;
for
(
Map
<
String
,
Object
>
map
:
thisList
)
{
if
(
ConvertUtils
.
isNotEmpty
(
map
.
get
(
"ydl"
))&&
ConvertUtils
.
isNotEmpty
(
map
.
get
(
"clsl"
))){
if
(!
"0.0"
.
equals
(
String
.
valueOf
(
map
.
get
(
"ydl"
)))&&!
"0.0"
.
equals
(
String
.
valueOf
(
map
.
get
(
"clsl"
)))){
thisDsdh
=
thisDsdh
+
Double
.
parseDouble
(
map
.
get
(
"dsdh"
).
toString
());
thisnNum
=
thisnNum
+
1
;
}
}
}
if
(
thisnNum
>
0
){
bydsdh
=
df
.
format
(
thisDsdh
/
thisnNum
);
result
.
put
(
"BYDSHDL"
,
bydsdh
);
}
for
(
Map
<
String
,
Object
>
map
:
lastList
)
{
if
(
ConvertUtils
.
isNotEmpty
(
map
.
get
(
"ydl"
))&&
ConvertUtils
.
isNotEmpty
(
map
.
get
(
"clsl"
))){
if
(!
"0.0"
.
equals
(
String
.
valueOf
(
map
.
get
(
"ydl"
)))&&!
"0.0"
.
equals
(
String
.
valueOf
(
map
.
get
(
"clsl"
)))){
lastDsdh
=
lastDsdh
+
Double
.
parseDouble
(
map
.
get
(
"dsdh"
).
toString
());
lastNum
=
lastNum
+
1
;
}
}
}
if
(
lastNum
>
0
){
sydsdh
=
df
.
format
(
lastDsdh
/
lastNum
);
result
.
put
(
"SYDSHDL"
,
sydsdh
);
}
bydsdh
=
result
.
get
(
"BYDSHDL"
).
toString
();
sydsdh
=
result
.
get
(
"SYDSHDL"
).
toString
();
result
.
put
(
"DSHDLCZ"
,
df
.
format
(
Double
.
parseDouble
(
bydsdh
)-
Double
.
parseDouble
(
sydsdh
)));
return
result
;
}
public
static
String
getSixMonth
(
String
month
)
{
try
{
Date
currdate
=
yyyyMM
.
parse
(
month
);
...
...
@@ -87,7 +127,7 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
String
dataViewName3a24
=
ReportViewUtil
.
buildViewLike
(
ReportConstant
.
view3a24
,
"DLHJ"
,
departIds
,
time
);
String
dataViewName2119
=
ReportViewUtil
.
buildViewLike
(
ReportConstant
.
view2119
,
"CSL"
,
departIds
,
time
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
distribution
Map
=
powerAnalysisNewMapper
.
powerConsumptionDistribution
(
dataViewName3a24
,
dataViewName2119
,
time
,
departIds
);
List
<
Map
<
String
,
Object
>>
distribution
List
=
powerAnalysisNewMapper
.
powerConsumptionDistribution
(
dataViewName3a24
,
dataViewName2119
,
time
,
departIds
);
List
<
Map
<
String
,
Object
>>
keys
=
Lists
.
newArrayList
();
Integer
count1
=
0
,
count2
=
0
,
count3
=
0
,
count4
=
0
;
Map
<
String
,
Object
>
tmp1
=
Maps
.
newTreeMap
();
...
...
@@ -107,7 +147,7 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
tmp4
.
put
(
"name"
,
"高电耗"
);
tmp4
.
put
(
"id"
,
"4"
);
for
(
Map
<
String
,
Object
>
v
:
distribution
Map
)
{
for
(
Map
<
String
,
Object
>
v
:
distribution
List
)
{
Double
dsdh
=
(
Double
)
v
.
get
(
"dsdh"
);
if
(
dsdh
>
0.7
)
{
count4
++;
...
...
@@ -128,7 +168,7 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
keys
.
add
(
tmp3
);
keys
.
add
(
tmp4
);
result
.
put
(
"distributionMap"
,
keys
);
result
.
put
(
"factoryDistributionList"
,
distribution
Map
);
result
.
put
(
"factoryDistributionList"
,
distribution
List
);
return
result
;
}
...
...
sk-module-datafill/src/main/java/com/skua/modules/report/mapper/xml/FReportItemvMapper.xml
查看文件 @
9910378
...
...
@@ -54,7 +54,7 @@
<select
id=
"getFyData"
resultType=
"com.skua.modules.report.vo.ReportDateTrendVO"
>
SELECT
t.month AS time,
ROUND( SUM( IFNULL(t.cost,0) ), 2 ) AS value
ROUND( SUM( IFNULL(t.cost,0) )
/10000
, 2 ) AS value
FROM
report_electric_cost t
WHERE
...
...
sk-module-system/src/main/java/com/skua/modules/system/controller/SysDepartController.java
查看文件 @
9910378
...
...
@@ -76,6 +76,24 @@ public class SysDepartController {
return
result
;
}
/**
* 查询数据 查出所有厂区
* @return
*/
@RequestMapping
(
value
=
"/getDepartList"
,
method
=
RequestMethod
.
GET
)
public
Result
<
List
<
SysDepart
>>
getDepartList
()
{
Result
<
List
<
SysDepart
>>
result
=
new
Result
<>();
try
{
String
departIds
=
BaseContextHandler
.
getDeparts
();
List
<
SysDepart
>
list
=
sysDepartService
.
getDepartList
(
departIds
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
return
result
;
}
@ApiOperation
(
value
=
"无token获取全部机构"
,
notes
=
"无token获取全部机构"
)
@RequestMapping
(
value
=
"/getTreeList"
,
method
=
RequestMethod
.
GET
)
public
Result
<
List
<
SysDepartTreeModel
>>
getTreeList
()
{
...
...
sk-module-system/src/main/java/com/skua/modules/system/service/ISysDepartService.java
查看文件 @
9910378
...
...
@@ -183,4 +183,6 @@ public interface ISysDepartService extends IService<SysDepart>{
List
<
SysDepart
>
queryUserDepartList
(
String
userId
);
List
<
SysDepartTreeModel
>
getTreeList
();
List
<
SysDepart
>
getDepartList
(
String
departIds
);
}
...
...
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysDepartServiceImpl.java
查看文件 @
9910378
...
...
@@ -24,6 +24,7 @@ import com.skua.modules.system.util.FindsDepartsChildrenUtil;
import
com.skua.modules.system.vo.DepartTree
;
import
com.skua.modules.system.vo.SysDeptUserVO
;
import
com.skua.tool.dfs.MapDFS
;
import
com.skua.tool.util.JSUtils
;
import
io.netty.util.internal.StringUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -590,4 +591,15 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
return
listResult
;
}
@Override
public
List
<
SysDepart
>
getDepartList
(
String
departIds
)
{
List
<
SysDepart
>
list
=
new
ArrayList
<>();
QueryWrapper
<
SysDepart
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"id"
,
departIds
.
split
(
","
));
queryWrapper
.
eq
(
"depart_type"
,
"1"
);
queryWrapper
.
orderByAsc
(
"depart_order"
);
list
=
sysDepartMapper
.
selectList
(
queryWrapper
);
return
list
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论