Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
e74b1760
由
张雷
编写于
2025-01-13 16:06:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
月度运营报表问题修改
1 个父辈
f44a8dd9
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
5 行删除
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/custom/handle/impl/PwxkybReportHandle.java
查看文件 @
e74b176
...
...
@@ -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
查看文件 @
e74b176
...
...
@@ -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)"
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论