kangwei:工作进度模块
3、日报填写增加及时率统计(及时率判断报表填写时间在24小时内,比如17日的数据,需要在18日23:59分之前填写完成)(及时率不影响面板的红色状态) 6、如果是查询当月,应填报表数应该是当月当天的日期减1
正在显示
3 个修改的文件
包含
31 行增加
和
14 行删除
... | @@ -81,9 +81,9 @@ public class ReportViewUtil { | ... | @@ -81,9 +81,9 @@ public class ReportViewUtil { |
81 | if(!StringUtils.isEmpty(itemIds)) { | 81 | if(!StringUtils.isEmpty(itemIds)) { |
82 | itemIds = itemIds.substring(1); | 82 | itemIds = itemIds.substring(1); |
83 | } | 83 | } |
84 | sb.append(" `a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( "); | 84 | sb.append(" `a`.`create_time` , `a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( "); |
85 | 85 | ||
86 | sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 "); | 86 | sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id,create_time FROM f_report_itemv v WHERE 1=1 "); |
87 | if(StringUtils.isNotEmpty(departIds)){ | 87 | if(StringUtils.isNotEmpty(departIds)){ |
88 | sb.append(" and depart_id in ("+inSqlPart+") "); | 88 | sb.append(" and depart_id in ("+inSqlPart+") "); |
89 | } | 89 | } | ... | ... |
... | @@ -105,8 +105,9 @@ public class WorkAnalysisController { | ... | @@ -105,8 +105,9 @@ public class WorkAnalysisController { |
105 | if(currentDate.toString().equals(endTime)){ | 105 | if(currentDate.toString().equals(endTime)){ |
106 | index = 0 ; | 106 | index = 0 ; |
107 | } | 107 | } |
108 | String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +1) 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+"+index+" ) month_num,"; | 108 | String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +"+index+") 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+1 ) month_num,"; |
109 | sql += " ifnull(sum(aaa.count),0) 'nh_num' ,ifnull(sum(bbb.count),0) 'szsl_num' ,ifnull(sum(ccc.count),0) 'hy_num' ,ifnull(sum(ddd.count),0) 'yy_month_num',ifnull(sum(fff.count),0) 'df_month_num' ,ifnull(sum(ggg.count),0) 'year_target_num' "; | 109 | sql += " ifnull(sum(aaa.count),0) 'nh_num' ,ifnull(sum(bbb.count),0) 'szsl_num' ,ifnull(sum(ccc.count),0) 'hy_num' ,ifnull(sum(ddd.count),0) 'yy_month_num',ifnull(sum(fff.count),0) 'df_month_num' ,ifnull(sum(ggg.count),0) 'year_target_num' ,"; |
110 | sql += " ifnull(sum(aaaHH.count),0) 'nhJsNum',ifnull(sum(bbbHH.count),0) 'szslJsNum',ifnull(sum(cccHH.count),0) 'hyJsNum' "; | ||
110 | sql += " from sys_depart d "; | 111 | sql += " from sys_depart d "; |
111 | sql += getWorkProgressSql(departIds, startTime, endTime, month); | 112 | sql += getWorkProgressSql(departIds, startTime, endTime, month); |
112 | sql += " where d.depart_type =1 "; | 113 | sql += " where d.depart_type =1 "; |
... | @@ -213,21 +214,29 @@ public class WorkAnalysisController { | ... | @@ -213,21 +214,29 @@ public class WorkAnalysisController { |
213 | //能耗日报: 污泥量、电量合计,用水量 | 214 | //能耗日报: 污泥量、电量合计,用水量 |
214 | String view3a24Sql = ReportViewUtil.buildView(ReportConstant.view3a24,"WNL,DLHJ,YSL",departIds,startTime,endTime); | 215 | String view3a24Sql = ReportViewUtil.buildView(ReportConstant.view3a24,"WNL,DLHJ,YSL",departIds,startTime,endTime); |
215 | sql += " left join (select aa.depart_id ,count(1) 'count' from "+view3a24Sql+ " aa where aa.WNL is not null and aa.WNL <> '' and aa.DLHJ is not null and aa.DLHJ <> '' and aa.YSL is not null and aa.YSL <> '' group by aa.depart_id )aaa on aaa.depart_id = d.id "; | 216 | sql += " left join (select aa.depart_id ,count(1) 'count' from "+view3a24Sql+ " aa where aa.WNL is not null and aa.WNL <> '' and aa.DLHJ is not null and aa.DLHJ <> '' and aa.YSL is not null and aa.YSL <> '' group by aa.depart_id )aaa on aaa.depart_id = d.id "; |
217 | // 能耗日报 及时天数 | ||
218 | sql += " left join (select aa.depart_id ,count(1) 'count' from "+view3a24Sql+ " aa where aa.WNL is not null and aa.WNL <> '' and aa.DLHJ is not null and aa.DLHJ <> '' and aa.YSL is not null and aa.YSL <> '' and DATEDIFF(aa.create_time , aa.time) < 2 group by aa.depart_id )aaaHH on aaaHH.depart_id = d.id "; | ||
219 | |||
216 | //水质水量日报表:进水量、出水量、PH进水、PH出水、COD进水、COD出水,TP进水、TP出水、NH4-N进水、出水; TN进水、出水 | 220 | //水质水量日报表:进水量、出水量、PH进水、PH出水、COD进水、COD出水,TP进水、TP出水、NH4-N进水、出水; TN进水、出水 |
217 | String view2119Sql = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL,JSCOD,CSCOD,JSPH,CSPH",departIds,startTime,endTime); | 221 | String view2119Sql = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL,JSCOD,CSCOD,JSPH,CSPH",departIds,startTime,endTime); |
218 | sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb "; | 222 | |
219 | sql += " where bb.JSL is not null and bb.JSL <> '' and bb.CSL is not null and bb.CSL <> '' and bb.JSAD is not null and bb.JSAD <> '' and bb.CSAD is not null and bb.CSAD <> '' "; | 223 | String view2119Sql_where = " where bb.JSL is not null and bb.JSL <> '' and bb.CSL is not null and bb.CSL <> '' and bb.JSAD is not null and bb.JSAD <> '' and bb.CSAD is not null and bb.CSAD <> '' "; |
220 | sql += " and bb.JSZD is not null and bb.JSZD <> '' and bb.CSTN is not null and bb.CSTN <> '' and bb.JSZL is not null and bb.JSZL <> '' and bb.CSZL is not null and bb.CSZL <> '' "; | 224 | view2119Sql_where += " and bb.JSZD is not null and bb.JSZD <> '' and bb.CSTN is not null and bb.CSTN <> '' and bb.JSZL is not null and bb.JSZL <> '' and bb.CSZL is not null and bb.CSZL <> '' "; |
221 | sql += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.JSPH is not null and bb.JSPH <> '' and bb.CSPH is not null and bb.CSPH <> '' "; | 225 | view2119Sql_where += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.JSPH is not null and bb.JSPH <> '' and bb.CSPH is not null and bb.CSPH <> '' "; |
222 | sql += " group by bb.depart_id )bbb on bbb.depart_id = d.id "; | 226 | |
227 | sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " group by bb.depart_id )bbb on bbb.depart_id = d.id"; | ||
228 | //水质水量日报 及时天数 | ||
229 | sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " and DATEDIFF(bb.create_time , bb.time) < 2 group by bb.depart_id )bbbHH on bbbHH.depart_id = d.id"; | ||
223 | 230 | ||
224 | //化验日报 ==化验数据:PH进水、PH出水、COD进水、COD出水、TP进水、TP出水、NH4-N进水、出水; TN进水、出水 | 231 | //化验日报 ==化验数据:PH进水、PH出水、COD进水、COD出水、TP进水、TP出水、NH4-N进水、出水; TN进水、出水 |
225 | String viewbffaSql = ReportViewUtil.buildView(ReportConstant.view9bff,"JSPHHY,CSPHHY,JSCODHY,CSCODHY,JSZLHY,CSZLHY,CSTNHY,JSZDHY,JSADHY,CSADHY",departIds,startTime,endTime); | 232 | String viewbffaSql = ReportViewUtil.buildView(ReportConstant.view9bff,"JSPHHY,CSPHHY,JSCODHY,CSCODHY,JSZLHY,CSZLHY,CSTNHY,JSZDHY,JSADHY,CSADHY",departIds,startTime,endTime); |
226 | sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "; | 233 | String viewbffaSql_where = " where cc.JSPHHY is not null and cc.JSPHHY <> '' and cc.CSPHHY is not null and cc.CSPHHY <> '' and cc.JSCODHY is not null and cc.JSCODHY <> '' and cc.CSCODHY is not null and cc.CSCODHY <> '' "; |
227 | sql += " where cc.JSPHHY is not null and cc.JSPHHY <> '' and cc.CSPHHY is not null and cc.CSPHHY <> '' and cc.JSCODHY is not null and cc.JSCODHY <> '' and cc.CSCODHY is not null and cc.CSCODHY <> '' "; | 234 | viewbffaSql_where += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' "; |
228 | sql += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' "; | 235 | viewbffaSql_where += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' "; |
229 | sql += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' "; | 236 | |
230 | sql += " group by cc.depart_id )ccc on ccc.depart_id = d.id "; | 237 | sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" group by cc.depart_id )ccc on ccc.depart_id = d.id "; |
238 | sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" and DATEDIFF(cc.create_time , cc.time) < 2 group by cc.depart_id )cccHH on cccHH.depart_id = d.id "; | ||
239 | |||
231 | //电费月报 | 240 | //电费月报 |
232 | sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id "; | 241 | sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id "; |
233 | 242 | ... | ... |
... | @@ -34,6 +34,14 @@ public class WorkProgressVO { | ... | @@ -34,6 +34,14 @@ public class WorkProgressVO { |
34 | private Integer szslNum; | 34 | private Integer szslNum; |
35 | @ApiModelProperty(value = "化验报表-填报天数") | 35 | @ApiModelProperty(value = "化验报表-填报天数") |
36 | private Integer hyNum; | 36 | private Integer hyNum; |
37 | |||
38 | @ApiModelProperty(value = "能耗-及时天数") | ||
39 | private Integer nhJsNum; | ||
40 | @ApiModelProperty(value = "水质水量-及时天数") | ||
41 | private Integer szslJsNum; | ||
42 | @ApiModelProperty(value = "化验报表-及时天数") | ||
43 | private Integer hyJsNum; | ||
44 | |||
37 | @ApiModelProperty(value = "运营月报-填报月数") | 45 | @ApiModelProperty(value = "运营月报-填报月数") |
38 | private Integer yyMonthNum; | 46 | private Integer yyMonthNum; |
39 | @ApiModelProperty(value = "电费月报-填报月数") | 47 | @ApiModelProperty(value = "电费月报-填报月数") | ... | ... |
-
请 注册 或 登录 后发表评论