efe583e9 kangwei

kangwei:运营月报统计数据修改,修改

1 个父辈 9d850624
...@@ -30,9 +30,6 @@ public class MaterialINVO extends MaterialIN { ...@@ -30,9 +30,6 @@ public class MaterialINVO extends MaterialIN {
30 @ApiModelProperty(value = "权限厂站编号集合") 30 @ApiModelProperty(value = "权限厂站编号集合")
31 private String departIds; 31 private String departIds;
32 32
33 @ApiModelProperty(value = "药剂入库编号")
34 private String materialInId;
35
36 33
37 @ApiModelProperty(value = "物料编码") 34 @ApiModelProperty(value = "物料编码")
38 private String sparepartCode; 35 private String sparepartCode;
......
1 package com.skua.modules.statistics.vo; 1 package com.skua.modules.statistics.vo;
2 2
3 import cn.jiguang.common.utils.StringUtils; 3 import cn.jiguang.common.utils.StringUtils;
4 import com.skua.core.aspect.annotation.Dict;
5 import com.skua.tool.util.JSUtils; 4 import com.skua.tool.util.JSUtils;
6 import io.swagger.annotations.ApiModel; 5 import io.swagger.annotations.ApiModel;
7 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
8 import liquibase.util.StringUtils;
9 import lombok.Data; 7 import lombok.Data;
10 8
11 import java.util.List; 9 import java.util.List;
......
...@@ -107,11 +107,25 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -107,11 +107,25 @@ public class OperationReportServiceImpl implements IOperationReportService {
107 107
108 108
109 //目标水量 109 //目标水量
110 sql = "select sum(ifnull(target_water,0)) target_water from report_target_config where 1=1 "; 110 //根据开始时间、结束时间判断;如果是同一个月,那么就获取月度目标,不在一个月那就获取年度目标
111 if(StringUtils.isNotEmpty(departId)){ 111 String target_water = null;
112 sql += " and depart_id in ("+JSUtils.quoteEach(departId,",")+")"; 112 if(startMonth.equals(endMonth )){//获取月度目标
113
114 sql = "select sum(ifnull(target_value,0)) target_water from report_target_config_sub where target_type='sl' and target_time = '"+endMonth+"' ";
115 if(StringUtils.isNotEmpty(departId)){
116 sql += " and depart_id in ("+JSUtils.quoteEach(departId,",")+")";
117 }
118 target_water = getJdbcTemplate().queryForObject(sql,String.class);
119 }else{//获取年度目标
120 sql = "select sum(ifnull(target_water,0)) target_water from report_target_config where 1=1 and target_year = '"+year+"' ";
121 if(StringUtils.isNotEmpty(departId)){
122 sql += " and depart_id in ("+JSUtils.quoteEach(departId,",")+")";
123 }
124 target_water = getJdbcTemplate().queryForObject(sql,String.class);
113 } 125 }
114 String target_water = getJdbcTemplate().queryForObject(sql,String.class); 126
127
128
115 productDataVO.setAvgDayWaterVolume( JSUtils.divide(ysfsl, dayNum) ); 129 productDataVO.setAvgDayWaterVolume( JSUtils.divide(ysfsl, dayNum) );
116 String completeRatio = JSUtils.multiply( JSUtils.divide(ysfsl,target_water),100); 130 String completeRatio = JSUtils.multiply( JSUtils.divide(ysfsl,target_water),100);
117 productDataVO.setCompleteRatio( completeRatio);//完成率 131 productDataVO.setCompleteRatio( completeRatio);//完成率
...@@ -144,11 +158,11 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -144,11 +158,11 @@ public class OperationReportServiceImpl implements IOperationReportService {
144 List<FReportWaterMonthDataVO> waterMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportWaterMonthDataVO>(FReportWaterMonthDataVO.class)); 158 List<FReportWaterMonthDataVO> waterMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportWaterMonthDataVO>(FReportWaterMonthDataVO.class));
145 productDataVO.setWaterDeptartList(waterMonthDataList); 159 productDataVO.setWaterDeptartList(waterMonthDataList);
146 160
147 //水电耗高于控制目标--水务公司列表 YYYY-MM 161 //水电耗高于控制目标--水务公司列表 YYYY-MM 月电耗
148 dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ydh,dhcmbzyy", departId, startMonth,endMonth); 162 dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ydh,dhcmbzyy", departId, startMonth,endMonth);
149 sql = "select * from ( "; 163 sql = "select * from ( ";
150 sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.ydh),2) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.dhcmbzyy SEPARATOR '') 'causeAnalysis' from "+ dataViewName4411+" aaa";; 164 sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.ydh),2) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.dhcmbzyy SEPARATOR '') 'causeAnalysis' from "+ dataViewName4411+" aaa";;
151 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; 165 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='"+year+"')";
152 sql += " left join sys_depart d on d.id = aaa.depart_id "; 166 sql += " left join sys_depart d on d.id = aaa.depart_id ";
153 sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; 167 sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume ";
154 List<FReportPowerMonthDataVO> dhMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class)); 168 List<FReportPowerMonthDataVO> dhMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class));
...@@ -159,7 +173,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -159,7 +173,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
159 dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"yyh,yhcyqyy", departId, startMonth,endMonth); 173 dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"yyh,yhcyqyy", departId, startMonth,endMonth);
160 sql = "select * from ( "; 174 sql = "select * from ( ";
161 sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.yyh),2) realConsume , IFNULL(tc.target_drug,2) 'targetConsume' ,GROUP_CONCAT(aaa.yhcyqyy SEPARATOR '') 'causeAnalysis' from "+ dataViewName4411+" aaa";; 175 sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.yyh),2) realConsume , IFNULL(tc.target_drug,2) 'targetConsume' ,GROUP_CONCAT(aaa.yhcyqyy SEPARATOR '') 'causeAnalysis' from "+ dataViewName4411+" aaa";;
162 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; 176 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='"+year+"')";
163 sql += " left join sys_depart d on d.id = aaa.depart_id "; 177 sql += " left join sys_depart d on d.id = aaa.depart_id ";
164 sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; 178 sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume ";
165 List<FReportPowerMonthDataVO> yyhMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class)); 179 List<FReportPowerMonthDataVO> yyhMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class));
......
...@@ -98,21 +98,23 @@ public class ProductDataVO { ...@@ -98,21 +98,23 @@ public class ProductDataVO {
98 98
99 99
100 public String getWaterDeptartName() { 100 public String getWaterDeptartName() {
101 return getDeptName(waterDeptartList); 101 String deptName = "";
102 } 102 if( waterDeptartList != null && !waterDeptartList.isEmpty() ){
103 103 for(FReportWaterMonthDataVO dataVO : waterDeptartList){
104 public String getPowerDeptartName() { 104 if(deptName.length() > 0 ) deptName+="、";
105 return getDeptName2(powerDeptartList); 105 if(StringUtils.isNotEmpty(dataVO.getDepartName())){
106 } 106 deptName += dataVO.getDepartName();
107 }
107 108
108 public String getDrugDeptartName() { 109 }
109 return getDeptName2(drugDeptartList); 110 }
111 return deptName;
110 } 112 }
111 113
112 private String getDeptName(List<FReportWaterMonthDataVO> deptartList){ 114 public String getPowerDeptartName() {
113 String deptName = ""; 115 String deptName = "";
114 if( deptartList != null && !deptartList.isEmpty() ){ 116 if( powerDeptartList != null && !powerDeptartList.isEmpty() ){
115 for(FReportWaterMonthDataVO dataVO : deptartList){ 117 for(FReportPowerMonthDataVO dataVO : powerDeptartList){
116 if(deptName.length() > 0 ) deptName+="、"; 118 if(deptName.length() > 0 ) deptName+="、";
117 if(StringUtils.isNotEmpty(dataVO.getDepartName())){ 119 if(StringUtils.isNotEmpty(dataVO.getDepartName())){
118 deptName += dataVO.getDepartName(); 120 deptName += dataVO.getDepartName();
...@@ -122,19 +124,20 @@ public class ProductDataVO { ...@@ -122,19 +124,20 @@ public class ProductDataVO {
122 } 124 }
123 return deptName; 125 return deptName;
124 } 126 }
125 private String getDeptName2(List<FReportPowerMonthDataVO> deptartList){ 127
128 public String getDrugDeptartName() {
126 String deptName = ""; 129 String deptName = "";
127 if( deptartList != null && !deptartList.isEmpty() ){ 130 if( drugDeptartList != null && !drugDeptartList.isEmpty() ){
128 for(FReportPowerMonthDataVO dataVO : deptartList){ 131 for(FReportPowerMonthDataVO dataVO : drugDeptartList){
129 if(deptName.length() > 0 ) deptName+="、"; 132 if(deptName.length() > 0 ) deptName+="、";
130 if(StringUtils.isNotEmpty(dataVO.getDepartName())){ 133 if(StringUtils.isNotEmpty(dataVO.getDepartName())){
131 deptName += dataVO.getDepartName(); 134 deptName += dataVO.getDepartName();
132 } 135 }
136
133 } 137 }
134 } 138 }
135 return deptName; 139 return deptName;
136 } 140 }
137
138 public ProductDataVO() { 141 public ProductDataVO() {
139 } 142 }
140 143
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!