ソースを参照

按集中器导出bug修复 PengDi@2021/1/20

pengdi@zoniot.com 4 年 前
コミット
aacd5688c5

+ 11 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/StatMeterReadRateByConcentratorServiceImpl.java

@@ -110,6 +110,16 @@ public class StatMeterReadRateByConcentratorServiceImpl implements StatMeterRead
 	public void exportRateListByConcentrator(CommonQueryCondition condition, HttpServletResponse httpServletResponse) {
 		log.info("begin StatMeterReadRateByConcentratorService exportRateListByConcentrator,condition ={} ", JSON.toJSONString(condition));
 		// 1,查询数据
+        if(condition.getPeriod().equals(MeterReadPeriod.TODAY)){
+            condition.setStatDay(Integer.parseInt(DateTimeUtil.formatNow("yyyyMMdd")));
+        }
+        else if(condition.getPeriod().equals(MeterReadPeriod.LAST_MONTH)){
+            DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMM");
+            condition.setStatDay(Integer.parseInt(LocalDateTime.now().plusMonths(-1).format(df)));
+        }
+        else{
+            condition.setStatDay(Integer.parseInt(DateTimeUtil.formatDate(DateTimeUtil.beforeNow(1), "yyyyMMdd")));
+        }
 		List<StatMeterReadRateDto> list = baseQuery(condition);
     	// 2,定义excel格式&内容
 		String title = "按集中器统计抄表率";
@@ -120,7 +130,7 @@ public class StatMeterReadRateByConcentratorServiceImpl implements StatMeterRead
 			StatMeterReadRateDto dto = list.get(i);
 			objs = new Object[rowsName.length];
 			objs[0] = i;
-			objs[1] = dto.getCollectorNo() ;
+			objs[1] = dto.getConcentratorId() ;
 			objs[2] = dto.getCustomerName();
 			objs[3] = dto.getDeviceTypeName();
 			objs[4] = dto.getDeviceCount();