Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
eddb0df0
由
康伟
编写于
2025-01-16 17:41:50 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/master'
2 个父辈
3cc2d625
5a450e0f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
57 行增加
和
35 行删除
sk-module-datafill/src/main/java/com/skua/modules/custom/handle/impl/PwxkybReportHandle.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/FactoryCenterServiceImpl.java
sk-module-system/src/main/java/com/skua/modules/system/controller/SysFactoryInfoController.java
sk-module-datafill/src/main/java/com/skua/modules/custom/handle/impl/PwxkybReportHandle.java
查看文件 @
eddb0df
...
...
@@ -12,6 +12,8 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.math.MathContext
;
import
java.util.*
;
/**
...
...
@@ -98,7 +100,11 @@ public class PwxkybReportHandle implements ICustomHandle{
for
(
String
key
:
keySet
)
{
if
(!
StringUtils
.
isEmpty
(
dataFieldDict
.
get
(
key
)))
{
ValueEntity
valueEntity
=
new
ValueEntity
();
valueEntity
.
setValue
(
ConvertUtils
.
getString
(
valueMap
.
get
(
key
)));
if
(
"time"
.
equals
(
key
)){
valueEntity
.
setValue
(
ConvertUtils
.
getString
(
valueMap
.
get
(
key
)));
}
else
{
valueEntity
.
setValue
(
handleDoubleValue
(
ConvertUtils
.
getString
(
valueMap
.
get
(
key
))));
}
handleMap
.
put
(
dataFieldDict
.
get
(
key
),
valueEntity
);
}
}
...
...
@@ -107,6 +113,17 @@ public class PwxkybReportHandle implements ICustomHandle{
return
list
;
}
public
static
String
handleDoubleValue
(
String
doubleValue
)
{
if
(
doubleValue
.
contains
(
"E"
))
{
MathContext
mc
=
new
MathContext
(
32
);
BigDecimal
bigNumber
=
new
BigDecimal
(
doubleValue
,
mc
);
BigDecimal
setScale
=
bigNumber
.
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
);
return
setScale
.
toString
();
}
else
{
return
ConvertUtils
.
getString
(
ConvertUtils
.
getDouble
(
doubleValue
,
0.0
,
4
));
}
}
@Override
public
String
buildWaterQualityAlarmValue
(
String
reportId
,
String
departId
,
String
json
)
{
return
json
;
...
...
sk-module-datafill/src/main/java/com/skua/modules/custom/service/impl/FCustomReportDatasetServiceImpl.java
查看文件 @
eddb0df
...
...
@@ -93,7 +93,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String
field4411
=
"yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy,df,sbwhf"
;
String
dataViewName4411
=
ReportViewUtil
.
buildViewLike
(
ReportConstant
.
view4411
,
field4411
,
departId
,
dataTime
);
String
dataViewName4411tb
=
ReportViewUtil
.
buildViewLike
(
ReportConstant
.
view4411
,
"
qntq
sfsl"
,
departId
,
tbYear
);
String
dataViewName4411tb
=
ReportViewUtil
.
buildViewLike
(
ReportConstant
.
view4411
,
"
y
sfsl"
,
departId
,
tbYear
);
//主库数据源
JdbcTemplate
masterDB
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"master"
);
String
sql
=
"select "
+
...
...
@@ -102,7 +102,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" round(ifnull(tb.clsl_tb,0),4) tqysjsl, "
+
" round(100*(sum(v1.CSL)/10000-ifnull(tb.clsl_tb,0))/ifnull(tb.clsl_tb,sum(v1.CSL)/10000),2) as sjsldbbhl, "
+
" v6.ysjsldyqntqyy, "
+
" ifnull(v7.
qntq
sfsl,0) as qntqsfsl, "
+
" ifnull(v7.
y
sfsl,0) as qntqsfsl, "
+
" v6.ysfsl,v6.sfsldbbhl, "
+
" rtc.target_water as ndslmb, "
+
" round(100*(sum(v1.CSL)/10000)/rtc.target_water,2) yslwcbl, "
+
...
...
@@ -120,7 +120,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" round(y.dlhj_year/sum(v1.CSL),2) as bnsjdh, "
+
" v6.dhcmbzyy,v6.df,v6.sbwhf, "
+
" rtc.target_drug as bnyhmb, "
+
" round(y.yjhl_year/sum(v1.CSL),2) as bnsjyh, "
+
// " round(y.yjhl_year/sum(v1.CSL),2) as bnsjyh, " +
" round(v4.yjhl/sum(v1.CSL),2) as bnsjyh, "
+
" v6.yhcyqyy "
+
" from "
+
dataViewName2119
+
" v1 "
+
" left join ( "
+
...
...
@@ -166,7 +167,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" where v3a24.depart_id = '"
+
departId
+
"' and v3a24.time like CONCAT('"
+
dataTime
+
"','%') GROUP BY LEFT(v3a24.time,7)"
+
" ) y on y.time = LEFT ( v1.time, 7 ) "
+
" left join ( "
+
" select right(left(v4411.time,7),2) time,v4411.
qntq
sfsl "
+
" select right(left(v4411.time,7),2) time,v4411.
y
sfsl "
+
" from "
+
dataViewName4411tb
+
" v4411 "
+
" where v4411.depart_id = '"
+
departId
+
"' and v4411.time like CONCAT('"
+
tbYear
+
"','%')) v7 on right(left(v7.time,7),2) = right(left(v1.time,7),2) "
+
" where v1.time like CONCAT('"
+
dataTime
+
"','%') and v1.depart_id = '"
+
departId
+
"' GROUP BY v1.depart_id,left(v1.time,7)"
;
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/FactoryCenterServiceImpl.java
查看文件 @
eddb0df
...
...
@@ -87,42 +87,46 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
if
(!
StringUtils
.
isEmpty
(
fields
))
{
fields
=
fields
.
substring
(
1
);
}
//获取实时数据
List
<
Map
<
String
,
Object
>>
pgDataList
=
pgQueryService
.
queryFactoryMonitorFromRealTimeData
(
departId
,
fields
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<
String
,
Object
>();
if
(
pgDataList
!=
null
&&
pgDataList
.
size
()>
0
)
{
dataMap
=
pgDataList
.
get
(
0
);
}
String
[]
departArray
=
departId
.
split
(
","
);
//根据厂区分别查询实时数据
int
sort
=
0
;
//序号
for
(
String
depart
:
departArray
)
{
Map
<
String
,
Object
>
limitMap
=
new
HashMap
<>();
if
(
levelMap
.
get
(
depart
)!=
null
){
List
<
Map
<
String
,
String
>>
limitList
=
(
List
<
Map
<
String
,
String
>>)
levelMap
.
get
(
depart
);
for
(
Map
<
String
,
String
>
lMap
:
limitList
)
{
limitMap
.
put
(
lMap
.
get
(
"code"
),
lMap
);
String
[]
departIdArr
=
departId
.
split
(
","
);
for
(
String
depart
:
departIdArr
)
{
List
<
WaterQualityMonitoringDetailVO
>
realTimelist
=
new
ArrayList
<>();
//获取实时数据
List
<
Map
<
String
,
Object
>>
pgDataList
=
pgQueryService
.
queryFactoryMonitorFromRealTimeData
(
depart
,
fields
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<
String
,
Object
>();
if
(
pgDataList
!=
null
&&
pgDataList
.
size
()>
0
)
{
dataMap
=
pgDataList
.
get
(
0
);
Map
<
String
,
Object
>
limitMap
=
new
HashMap
<>();
if
(
levelMap
.
get
(
depart
)!=
null
){
List
<
Map
<
String
,
String
>>
limitList
=
(
List
<
Map
<
String
,
String
>>)
levelMap
.
get
(
depart
);
for
(
Map
<
String
,
String
>
lMap
:
limitList
)
{
limitMap
.
put
(
lMap
.
get
(
"code"
),
lMap
);
}
}
}
if
(
parmType
!=
null
){
if
(
"in"
.
equals
(
parmType
)){
sort
++;
list
=
putInWaterDataInList
(
sort
,
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
}
else
if
(
"out"
.
equals
(
parmType
)){
sort
++;
list
=
putOutWaterDataInList
(
sort
,
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
if
(
parmType
!=
null
){
if
(
"in"
.
equals
(
parmType
)){
sort
++;
realTimelist
=
putInWaterDataInList
(
sort
,
realTimelist
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
}
else
if
(
"out"
.
equals
(
parmType
)){
sort
++;
realTimelist
=
putOutWaterDataInList
(
sort
,
realTimelist
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
}
else
{
sort
++;
realTimelist
=
putInWaterDataInList
(
sort
,
realTimelist
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
sort
++;
realTimelist
=
putOutWaterDataInList
(
sort
,
realTimelist
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
}
}
else
{
sort
++;
list
=
putInWaterDataInList
(
sort
,
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
realTimelist
=
putInWaterDataInList
(
sort
,
realTime
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
sort
++;
list
=
putOutWaterDataInList
(
sort
,
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
realTimelist
=
putOutWaterDataInList
(
sort
,
realTime
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
}
}
else
{
sort
++;
list
=
putInWaterDataInList
(
sort
,
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
sort
++;
list
=
putOutWaterDataInList
(
sort
,
list
,
dataMap
,
monitorTagMap
,
depart
,
departMap
,
departParentMap
,
limitMap
);
list
.
addAll
(
realTimelist
);
}
}
return
list
;
}
...
...
sk-module-system/src/main/java/com/skua/modules/system/controller/SysFactoryInfoController.java
查看文件 @
eddb0df
...
...
@@ -483,12 +483,12 @@ public class SysFactoryInfoController {
public
Result
queryByDepartId
(
@RequestParam
(
name
=
"departId"
,
required
=
true
)
String
departId
)
{
Result
result
=
new
Result
();
SysFactoryInfoVO
sysFactoryInfo
=
sysFactoryInfoService
.
getByDepartId
(
departId
);
JSONObject
jsonObject
=
sysDictService
.
translateTDictValue
(
sysFactoryInfo
);
JSONObject
jsonObject
=
new
JSONObject
(
);
if
(
sysFactoryInfo
==
null
)
{
departId
=
getDepart
(
BaseContextHandler
.
getRealDepartId
());
sysFactoryInfo
=
sysFactoryInfoService
.
getByDepartId
(
departId
);
jsonObject
=
sysDictService
.
translateTDictValue
(
sysFactoryInfo
);
}
jsonObject
=
sysDictService
.
translateTDictValue
(
sysFactoryInfo
);
result
.
setResult
(
jsonObject
);
result
.
setSuccess
(
true
);
return
result
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论