|
|
@@ -33,6 +33,9 @@ import com.startup.minpay.frame.target.MINComponent;
|
|
|
@MINComponent
|
|
|
public class ReportServiceImpl implements IReportService {
|
|
|
static Map<String, String> totalMap = new HashMap<String, String>();
|
|
|
+
|
|
|
+ //各区客户数
|
|
|
+ static Map<String, String> customerMap = new HashMap<String, String>();
|
|
|
// 台区停电停电时长
|
|
|
static List<Map<String, String>> fenduanList = new ArrayList<Map<String, String>>();
|
|
|
static {
|
|
|
@@ -46,6 +49,17 @@ public class ReportServiceImpl implements IReportService {
|
|
|
totalMap.put("gaoxin", "1945");
|
|
|
totalMap.put("heji", "38824");
|
|
|
|
|
|
+ //客户数
|
|
|
+ customerMap.put("xintai", "593100");
|
|
|
+ customerMap.put("daiyue", "323455");
|
|
|
+ customerMap.put("ningyang", "301682");
|
|
|
+ customerMap.put("taishan", "376298");
|
|
|
+ customerMap.put("dongping", "298683");
|
|
|
+ customerMap.put("feicheng", "375994");
|
|
|
+ customerMap.put("jingqu", "120623");
|
|
|
+ customerMap.put("gaoxin", "162627");
|
|
|
+ customerMap.put("heji", "2552462");
|
|
|
+
|
|
|
// 0-1小时
|
|
|
Map<String, String> map0To60 = new HashMap<String, String>();
|
|
|
map0To60.put("start", "0");
|
|
|
@@ -88,6 +102,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
String secondFileId = param.get("secondFileId");
|
|
|
String FADateRange = param.get("FADateRange");
|
|
|
String yearChoose = param.get("yearChoose");
|
|
|
+ String DdyDateRange = param.get("DdyDateRange");
|
|
|
|
|
|
Map<String, Object> resMap = new HashMap<String, Object>();
|
|
|
// 台区停电日报
|
|
|
@@ -112,10 +127,14 @@ public class ReportServiceImpl implements IReportService {
|
|
|
} else if (Constant.REPORT_TYPE_04.equals(reportTypeId)) {
|
|
|
List<List<String>> resList = reportTypeFADZBB(FADateRange, yearChoose);
|
|
|
resMap.put("resList", resList);
|
|
|
- //低电压
|
|
|
+ //低电压分析表
|
|
|
}else if(Constant.REPORT_TYPE_05.equals(reportTypeId)){
|
|
|
List<List<String>> resList = reportTypeDDYZLFXB(range, reportTypeId);
|
|
|
resMap.put("resList", resList);
|
|
|
+ //低电压日报
|
|
|
+ }else if(Constant.REPORT_TYPE_06.equals(reportTypeId)){
|
|
|
+ List<List<String>> resList = reportTypeDDYRB(DdyDateRange,yearChoose,range, reportTypeId);
|
|
|
+ resMap.put("resList", resList);
|
|
|
}
|
|
|
return resMap;
|
|
|
}
|
|
|
@@ -1374,4 +1393,156 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
return resList;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 低电压日报
|
|
|
+ * @param range
|
|
|
+ * @param reportTypeId
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ public List<List<String>> reportTypeDDYRB(String DdyDateRange, String yearChoose,String range, String reportTypeId) throws MINBusinessException, ParseException{
|
|
|
+ IMINDataBaseService db = Service.lookup(IMINDataBaseService.class);
|
|
|
+ List<List<String>> resList = new ArrayList<List<String>>();
|
|
|
+ List<String> titleList = new ArrayList<String>();
|
|
|
+ Date beginTimeDate = DateUtil.parseDate(yearChoose + DdyDateRange.substring(0, 4), "yyyyMMdd");
|
|
|
+ String beginTime = DateUtil.format(beginTimeDate, "yyyyMMdd");
|
|
|
+ String endTime = yearChoose + DdyDateRange.substring(4, 8);
|
|
|
+ // 开始月份是12,年份取下一年
|
|
|
+ if ("12".equals(beginTime.substring(0, 2))) {
|
|
|
+ endTime = CommonUtil.add(yearChoose, "1") + DdyDateRange.substring(4, 8);
|
|
|
+ }
|
|
|
+ Map<String, String> countMap = new HashMap<String, String>();
|
|
|
+ countMap.put("xintai", "0");
|
|
|
+ countMap.put("daiyue", "0");
|
|
|
+ countMap.put("ningyang", "0");
|
|
|
+ countMap.put("taishan", "0");
|
|
|
+ countMap.put("dongping", "0");
|
|
|
+ countMap.put("feicheng", "0");
|
|
|
+ countMap.put("taishanjingqu", "0");
|
|
|
+ countMap.put("gaoxin", "0");
|
|
|
+ countMap.put("heji", "0");
|
|
|
+
|
|
|
+ List<String> title = new ArrayList<String>();
|
|
|
+
|
|
|
+ //标题
|
|
|
+ List<String> childList0 = new ArrayList<String>();
|
|
|
+ childList0.add("分类\\单位");
|
|
|
+ childList0.add("岱岳");
|
|
|
+ childList0.add("新泰");
|
|
|
+ childList0.add("高新");
|
|
|
+ childList0.add("泰山");
|
|
|
+ childList0.add("宁阳");
|
|
|
+ childList0.add("景区");
|
|
|
+ childList0.add("东平");
|
|
|
+ childList0.add("肥城");
|
|
|
+ childList0.add("合计");
|
|
|
+// resList.add(childList0);
|
|
|
+ //客户总数
|
|
|
+ List<String> childList1 = new ArrayList<String>();
|
|
|
+ childList1.add("客户总数");
|
|
|
+ childList1.add(customerMap.get("daiyue"));
|
|
|
+ childList1.add(customerMap.get("xintai"));
|
|
|
+ childList1.add(customerMap.get("gaoxin"));
|
|
|
+ childList1.add(customerMap.get("taishan"));
|
|
|
+ childList1.add(customerMap.get("ningyang"));
|
|
|
+ childList1.add(customerMap.get("jingqu"));
|
|
|
+ childList1.add(customerMap.get("dongping"));
|
|
|
+ childList1.add(customerMap.get("feicheng"));
|
|
|
+ childList1.add(customerMap.get("heji"));
|
|
|
+// resList.add(childList1);
|
|
|
+ //低电压客户数
|
|
|
+ List<String> childList2 = new ArrayList<String>();
|
|
|
+ childList2.add("低电压客户数");
|
|
|
+ for(String name:childList0){
|
|
|
+ if("分类\\单位".equals(name)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ DwFileDetail03Example example03 = new DwFileDetail03Example();
|
|
|
+
|
|
|
+ if("合计".equals(name)){
|
|
|
+ example03.createCriteria().andSjrqBetween(beginTime, endTime);
|
|
|
+ }else{
|
|
|
+ example03.createCriteria().andSjrqBetween(beginTime, endTime).andXgsmcLike(name+"%");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<DwFileDetail03> DateList = db.selectByExample(DwFileDetail03Mapper.class, example03);
|
|
|
+ childList2.add(DateList.size()+"");
|
|
|
+ }
|
|
|
+// resList.add(childList2);
|
|
|
+ //低电压客户占比
|
|
|
+ List<String> childList3 = new ArrayList<String>();
|
|
|
+ childList3.add("低电压客户占比");
|
|
|
+ for(int i=1;i<childList1.size();i++){
|
|
|
+ //客户总数
|
|
|
+ String count = childList1.get(i);
|
|
|
+ //昨日客户数
|
|
|
+ String dayCount = childList2.get(i);
|
|
|
+ childList3.add(CommonUtil.multiply(CommonUtil.divide(dayCount, count, 4), "100", 2) + "%");
|
|
|
+ }
|
|
|
+// resList.add(childList3);
|
|
|
+ //昨日新增考核数
|
|
|
+ List<String> childList4 = new ArrayList<String>();
|
|
|
+ childList4.add("昨日新增考核户数");
|
|
|
+ for(int i=1;i<childList0.size();i++){
|
|
|
+ String endTimes = DateUtil.dateAddDay(range,-1);
|
|
|
+ Map<String, String> map = new HashMap<String, String>();
|
|
|
+ if(!"合计".equals(childList0.get(i))){
|
|
|
+ map.put("area", childList0.get(i));
|
|
|
+ }
|
|
|
+ map.put("beginTime", beginTime);
|
|
|
+ map.put("endTime", endTimes);
|
|
|
+ List<Map<String, String>> fileList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail03ByDDYRB(map);
|
|
|
+ map.put("endTime", endTime);
|
|
|
+ List<Map<String, String>> fileList1 = db.getMybatisMapper(ReportServiceMapper.class).selectDetail03ByDDYRB(map);
|
|
|
+ childList4.add((fileList1.size()-fileList.size())+"");
|
|
|
+ }
|
|
|
+// resList.add(childList4);
|
|
|
+ //截至目前未治理完成户数
|
|
|
+ List<String> childList5 = new ArrayList<String>();
|
|
|
+ childList5.add("截至目前未治理完成户数");
|
|
|
+ //用户id
|
|
|
+ List<String> childList6 = new ArrayList<String>();
|
|
|
+ for(int i=1;i<childList0.size();i++){
|
|
|
+ int dayCount = DateUtil.diffDate(range,beginTime);
|
|
|
+ String beginTimes = DateUtil.dateAddDay(range,-6);
|
|
|
+ DwFileDetail03Example example = new DwFileDetail03Example();
|
|
|
+ Map<String, String> map = new HashMap<String, String>();
|
|
|
+ if(!"合计".equals(childList0.get(i))){
|
|
|
+ map.put("area", childList0.get(i));
|
|
|
+ }
|
|
|
+ map.put("beginTime", beginTime);
|
|
|
+ map.put("endTime", range);
|
|
|
+ List<Map<String, String>> fileList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail03ByDDYRB(map);
|
|
|
+ if(dayCount<6){
|
|
|
+ childList5.add(fileList.size()+"");
|
|
|
+ }else{
|
|
|
+ for(Map<String, String> maps:fileList){
|
|
|
+ childList6.add(maps.get("yhid"));
|
|
|
+ }
|
|
|
+ example.createCriteria().andSjrqBetween(beginTimes, range).andYhidIn(childList6);
|
|
|
+ List<DwFileDetail03> DateList = db.selectByExample(DwFileDetail03Mapper.class, example);
|
|
|
+ childList5.add(DateList.size()+"");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ String content = "昨日新增受考核低电压客户"+childList4.get(childList4.size()-1)+"户,按单位分:";
|
|
|
+ for(int i=1;i<childList0.size()-1;i++){
|
|
|
+ content=content+childList0.get(i)+childList4.get(i)+"户,";
|
|
|
+ if(childList0.size()-1==i){
|
|
|
+ content=content+childList0.get(i)+childList4.get(i)+"户。";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ content = content+"昨日新增未治理完成客户_户,截至目前未治理完成"+childList5.get(childList5.size()-1)+"户,_户正在治理;_户治理后再次出现,其中_各_户;"
|
|
|
+ + "_户未开始治理,其中__户。其中全年累计受考核30天及以上且未治理完成的_户:为_户(户号:_)。";
|
|
|
+ title.add(content);
|
|
|
+ resList.add(title);
|
|
|
+ resList.add(childList0);
|
|
|
+ resList.add(childList1);
|
|
|
+ resList.add(childList2);
|
|
|
+ resList.add(childList3);
|
|
|
+ resList.add(childList4);
|
|
|
+ resList.add(childList5);
|
|
|
+ return resList;
|
|
|
+ }
|
|
|
}
|