Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
e730e4f0
由
张雷
编写于
2024-10-28 10:10:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
水质分析BUG修改
1 个父辈
cf18e8d5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
26 行增加
和
30 行删除
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/WaterAnalysisNewService.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/WaterAnalysisNewServiceImpl.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/WaterCountAnalysisNewServiceImpl.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/WaterAnalysisNewService.java
查看文件 @
e730e4f
package
com
.
skua
.
modules
.
dataAnalysis
.
service
.
impl
;
package
com
.
skua
.
modules
.
dataAnalysis
.
service
;
import
java.util.List
;
import
java.util.Map
;
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/WaterAnalysisNewServiceImpl.java
查看文件 @
e730e4f
...
...
@@ -7,7 +7,7 @@ import com.skua.core.api.vo.DictModel;
import
com.skua.core.context.BaseContextHandler
;
import
com.skua.core.util.DateUtils
;
import
com.skua.modules.dataAnalysis.mapper.WaterAnalysisNewMapper
;
import
com.skua.modules.dataAnalysis.service.
impl.
WaterAnalysisNewService
;
import
com.skua.modules.dataAnalysis.service.WaterAnalysisNewService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/WaterCountAnalysisNewServiceImpl.java
查看文件 @
e730e4f
...
...
@@ -20,25 +20,21 @@ import java.util.Map;
@Service
public
class
WaterCountAnalysisNewServiceImpl
implements
WaterCountAnalysisNewService
{
private
static
String
REPOART_ID_SL
=
"2119ecbf53a1d2d0708258ff67cfd9e1"
;
private
static
String
FACTORYIDS
=
"1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864,"
+
" 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392,"
+
" 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152,"
+
" 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344"
;
@Autowired
private
WaterCountAnalysisNewMapper
waterCountAnalysisNewMapper
;
@Autowired
private
ISysMonitorMetricInfoService
sysMonitorMetricInfoService
;
@Override
public
Map
<
String
,
Object
>
querySLDeatailList
(
String
startTime
,
String
endTime
)
{
// String factory
Ids = BaseContextHandler.getDeparts();
String
depart
Ids
=
BaseContextHandler
.
getDeparts
();
DecimalFormat
df
=
new
DecimalFormat
(
"#.##"
);
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
tmp
=
Maps
.
newTreeMap
();
List
<
String
>
list
=
DateUtils
.
sliceUpDateRange
(
startTime
,
endTime
,
"year"
);
String
dataViewName
=
ReportViewUtil
.
buildView
(
REPOART_ID_SL
,
"CSL"
,
FACTORYIDS
,
startTime
,
endTime
);
String
dataViewName
=
ReportViewUtil
.
buildView
(
REPOART_ID_SL
,
"CSL"
,
departIds
,
startTime
,
endTime
);
//查询年度水量数据
List
<
Map
<
String
,
Object
>>
facLists
=
waterCountAnalysisNewMapper
.
queryFacLists
(
""
,
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
data
=
waterCountAnalysisNewMapper
.
queryTimesSLDataByFac
(
dataViewName
,
startTime
,
endTime
,
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
facLists
=
waterCountAnalysisNewMapper
.
queryFacLists
(
""
,
departIds
);
List
<
Map
<
String
,
Object
>>
data
=
waterCountAnalysisNewMapper
.
queryTimesSLDataByFac
(
dataViewName
,
startTime
,
endTime
,
departIds
);
if
(
data
!=
null
&&
data
.
size
()
>
0
)
{
data
.
forEach
(
v
->
{
String
ti
=
(
String
)
v
.
get
(
"time"
);
...
...
@@ -87,19 +83,19 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public
List
<
Map
<
String
,
Object
>>
queryZLSAnalysis
(
String
time
)
{
// String factory
Ids = BaseContextHandler.getDeparts();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"JSL,CSL"
,
FACTORYIDS
,
time
);
String
depart
Ids
=
BaseContextHandler
.
getDeparts
();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"JSL,CSL"
,
departIds
,
time
);
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
=
waterCountAnalysisNewMapper
.
queryZLSAnalysis
(
dataViewName
,
time
,
FACTORYIDS
);
list
=
waterCountAnalysisNewMapper
.
queryZLSAnalysis
(
dataViewName
,
time
,
departIds
);
return
list
;
}
@Override
public
Map
<
String
,
Object
>
querySLFHLAnalysis
(
String
time
)
{
// String factory
Ids = BaseContextHandler.getDeparts();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
FACTORYIDS
,
time
);
String
depart
Ids
=
BaseContextHandler
.
getDeparts
();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
departIds
,
time
);
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
List
<
Map
<
String
,
Object
>>
mets
=
waterCountAnalysisNewMapper
.
queryWaterListAllByMonth
(
dataViewName
,
time
,
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
mets
=
waterCountAnalysisNewMapper
.
queryWaterListAllByMonth
(
dataViewName
,
time
,
departIds
);
List
<
Map
<
String
,
Object
>>
upList
=
Lists
.
newArrayList
();
List
<
Map
<
String
,
Object
>>
lowList
=
Lists
.
newArrayList
();
List
<
Map
<
String
,
Object
>>
list
=
Lists
.
newArrayList
();
...
...
@@ -157,22 +153,22 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
}
@Override
public
Map
<
String
,
Object
>
querySLAnalysis
(
String
time
)
{
// String factory
Ids = BaseContextHandler.getDeparts();
String
thisDataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
FACTORYIDS
,
time
);
String
lastDataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
FACTORYIDS
,
DateUtils
.
getLastMonthOfMonth
(
time
));
String
depart
Ids
=
BaseContextHandler
.
getDeparts
();
String
thisDataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
departIds
,
time
);
String
lastDataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
departIds
,
DateUtils
.
getLastMonthOfMonth
(
time
));
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
//增长率
List
<
Map
<
String
,
Object
>>
upData
=
waterCountAnalysisNewMapper
.
queryUpFacList
(
thisDataViewName
,
lastDataViewName
,
time
,
DateUtils
.
getLastMonthOfMonth
(
time
),
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
upData
=
waterCountAnalysisNewMapper
.
queryUpFacList
(
thisDataViewName
,
lastDataViewName
,
time
,
DateUtils
.
getLastMonthOfMonth
(
time
),
departIds
);
//下降率
List
<
Map
<
String
,
Object
>>
lowData
=
waterCountAnalysisNewMapper
.
queryLowFacList
(
thisDataViewName
,
lastDataViewName
,
time
,
DateUtils
.
getLastMonthOfMonth
(
time
),
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
lowData
=
waterCountAnalysisNewMapper
.
queryLowFacList
(
thisDataViewName
,
lastDataViewName
,
time
,
DateUtils
.
getLastMonthOfMonth
(
time
),
departIds
);
result
.
put
(
"upData"
,
upData
);
result
.
put
(
"lowData"
,
lowData
);
return
result
;
}
@Override
public
Map
<
String
,
Object
>
queryTotalSLList
(
String
time
)
{
// String factory
Ids = BaseContextHandler.getDeparts();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
FACTORYIDS
,
time
);
String
depart
Ids
=
BaseContextHandler
.
getDeparts
();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
departIds
,
time
);
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
tmp
=
Maps
.
newTreeMap
();
String
nowYear
=
DateUtils
.
getDate
(
"yyyy"
);
...
...
@@ -183,8 +179,8 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
list
=
DateUtils
.
sliceUpDateRange
(
time
+
"-01"
,
time
+
"-12"
,
"year"
);
}
//查询年度水量数据
List
<
Map
<
String
,
Object
>>
facLists
=
waterCountAnalysisNewMapper
.
queryFacLists
(
""
,
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
data
=
waterCountAnalysisNewMapper
.
queryTotalSLDataByFac
(
dataViewName
,
time
,
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
facLists
=
waterCountAnalysisNewMapper
.
queryFacLists
(
""
,
departIds
);
List
<
Map
<
String
,
Object
>>
data
=
waterCountAnalysisNewMapper
.
queryTotalSLDataByFac
(
dataViewName
,
time
,
departIds
);
if
(
data
!=
null
&&
data
.
size
()
>
0
)
{
data
.
forEach
(
v
->
{
String
ti
=
(
String
)
v
.
get
(
"time"
);
...
...
@@ -219,16 +215,16 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
}
@Override
public
Map
<
String
,
Object
>
queryTotalSLData
(
String
time
)
{
// String factory
Ids = BaseContextHandler.getDeparts();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
FACTORYIDS
,
time
);
String
depart
Ids
=
BaseContextHandler
.
getDeparts
();
String
dataViewName
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
departIds
,
time
);
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
StringBuilder
stringBuilder
=
new
StringBuilder
();
List
<
Map
<
String
,
Object
>>
data
=
waterCountAnalysisNewMapper
.
queryTotalSLData
(
dataViewName
,
time
,
FACTORYIDS
);
List
<
Map
<
String
,
Object
>>
data
=
waterCountAnalysisNewMapper
.
queryTotalSLData
(
dataViewName
,
time
,
departIds
);
String
time2
=
String
.
valueOf
(
Integer
.
parseInt
(
time
)
-
1
);
String
dataViewName2
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
FACTORYIDS
,
time2
);
List
<
Map
<
String
,
Object
>>
lastData
=
waterCountAnalysisNewMapper
.
queryTotalSLData
(
dataViewName2
,
time2
,
FACTORYIDS
);
String
dataViewName2
=
ReportViewUtil
.
buildViewLike
(
REPOART_ID_SL
,
"CSL"
,
departIds
,
time2
);
List
<
Map
<
String
,
Object
>>
lastData
=
waterCountAnalysisNewMapper
.
queryTotalSLData
(
dataViewName2
,
time2
,
departIds
);
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++){
Map
<
String
,
Object
>
map
=
data
.
get
(
i
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论