Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
343f5545
由
康伟
编写于
2024-11-12 18:19:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
kangwei:厂级药耗分析总药耗趋势改为吨水药费趋势-后端
1 个父辈
f5a65866
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
13 行删除
sk-module-biz/src/main/java/com/skua/modules/erp/controller/TestMetricInfoController.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/controller/DrugConsumptionAnalysisController.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/IDrugConsumptionAnalysisService.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/impl/DrugConsumptionAnalusisServiceImpl.java
sk-module-biz/src/main/java/com/skua/modules/erp/controller/TestMetricInfoController.java
查看文件 @
343f554
...
...
@@ -118,7 +118,6 @@ public class TestMetricInfoController {
//月数据
if
(
timeType
.
equals
(
"3"
))
dataMap
.
put
(
metricInfoVO
.
getEquipmentCode
()+
"_ZT"
,
JSUtils
.
subtract
(
30
*
24
*
60
,
paramMap
.
get
(
metricInfoVO
.
getYxExpress
()),
paramMap
.
get
(
metricInfoVO
.
getGzExpress
())
)
);
//暂停
}
dataList
.
add
(
dataMap
);
}
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/controller/DrugConsumptionAnalysisController.java
查看文件 @
343f554
...
...
@@ -34,6 +34,7 @@ public class DrugConsumptionAnalysisController {
result
.
setResult
(
data
);
return
result
;
}
// 2411112:总药耗趋势 --->吨水药费
@AutoLog
(
value
=
"总药耗趋势"
)
@ApiOperation
(
value
=
"总药耗趋势"
,
notes
=
"总药耗趋势"
)
@GetMapping
(
"/data/drugConsumptionTrend"
)
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/IDrugConsumptionAnalysisService.java
查看文件 @
343f554
...
...
@@ -13,7 +13,7 @@ public interface IDrugConsumptionAnalysisService {
//数据展示
DrugConsumptionDisplayVO
dataDisplay
(
String
time
,
String
departId
);
//总药耗趋势
//总药耗趋势
--->改为吨水药费用
List
<
DrugConsumptionTrendChartVO
>
drugConsumptionTrend
(
String
time
,
String
departId
);
//吨水药耗趋势
List
<
DrugConsumptionTrendChartVO
>
consumptionTonOfWaterTrend
(
String
time
,
String
departId
);
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/impl/DrugConsumptionAnalusisServiceImpl.java
查看文件 @
343f554
package
com
.
skua
.
modules
.
equipment
.
service
.
impl
;
import
com.google.common.collect.Maps
;
import
com.skua.common.constant.ReportConstant
;
import
com.skua.common.report.ReportViewUtil
;
import
com.skua.core.context.SpringContextUtils
;
import
com.skua.core.util.ConvertUtils
;
import
com.skua.modules.common.vo.DateVO
;
import
com.skua.modules.equipment.dto.*
;
import
com.skua.modules.equipment.mapper.ComprehensiveSupervisionMapper
;
import
com.skua.modules.equipment.service.IDrugConsumptionAnalysisService
;
import
com.skua.modules.equipment.vo.CorrelationAnalysisVO
;
import
com.skua.modules.equipment.vo.DrugConsumptionDisplayVO
;
import
com.skua.modules.equipment.vo.DrugConsumptionTrendChartVO
;
import
com.skua.modules.equipment.vo.MetricVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.dao.DataAccessException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
...
...
@@ -24,7 +18,6 @@ import java.math.BigDecimal;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
...
...
@@ -81,14 +74,37 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
return
displayVO
;
}
//总药耗趋势
//总药耗趋势
--->吨水药费
public
List
<
DrugConsumptionTrendChartVO
>
drugConsumptionTrend
(
String
time
,
String
departId
){
List
<
DrugConsumptionTrendChartVO
>
chartVOList
=
new
ArrayList
<>();
//查询当前时间往前推12个月的数据
String
startTime
=
this
.
getMonthBytime
(-
25
,
time
)+
"-01"
;
String
endTime
=
this
.
getMonthBytime
(-
1
,
time
)+
"-31"
;
String
dataViewName3a24
=
ReportViewUtil
.
buildView
(
ReportConstant
.
view3a24
,
"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY"
,
departId
,
startTime
,
endTime
);
System
.
out
.
println
(
"dataViewName3a24 ="
+
dataViewName3a24
);
String
dataViewName4411
=
ReportViewUtil
.
buildView
(
ReportConstant
.
view4411
,
"YYH"
,
departId
,
startTime
,
endTime
);
String
sql
=
"select sum(aaa.yyh) yyh,aaa.time from ( "
+
dataViewName4411
+
") aaa group by aaa.time"
;
List
<
Map
<
String
,
Object
>
>
dataList
=
getJdbcTemplate
().
queryForList
(
sql
);
Map
<
String
,
String
>
dataMap
=
new
HashMap
<>();
if
(
dataList
!=
null
){
for
(
Map
<
String
,
Object
>
map
:
dataList
){
dataMap
.
put
(
map
.
get
(
"time"
)+
""
,
ConvertUtils
.
getString
(
map
.
get
(
"yyh"
),
"0"
));
}
}
//查询当前时间往前推12个月的数据
DrugConsumptionTrendChartVO
chartVO
=
null
;
List
<
String
>
months
=
this
.
getTwelve
(
time
);
for
(
String
month
:
months
)
{
String
yesmonth
=
this
.
getMonthBytime
(-
12
,
month
);
//同比
chartVO
=
new
DrugConsumptionTrendChartVO
();
chartVO
.
setTime
(
month
);
chartVO
.
setZyh
(
ConvertUtils
.
getDouble
(
dataMap
.
get
(
month
),
0
d
)
);
chartVO
.
setTbzyh
(
ConvertUtils
.
getDouble
(
dataMap
.
get
(
yesmonth
),
0
d
)
);
chartVOList
.
add
(
chartVO
)
;
}
return
chartVOList
;
/* String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime);
StringBuffer sql2 = new StringBuffer("select DATE_FORMAT(aaa.time,'%Y-%m') 'time', ");
sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'zyh' from ");
sql2.append( " "+dataViewName3a24+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m')");
...
...
@@ -120,7 +136,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
}
chartVOList1.add( chartVOTemp) ;
}
return
chartVOList1
;
return chartVOList1;
*/
}
//吨水药耗趋势
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论