|
|
@@ -11,6 +11,8 @@ import com.xintong.visualinspection.bean.FwqStatisticsBo;
|
|
|
import com.xintong.visualinspection.bean.Item;
|
|
|
import com.xintong.visualinspection.bean.Organ;
|
|
|
import com.xintong.visualinspection.pojo.fwq.FwqRankingData;
|
|
|
+import com.xintong.visualinspection.pojo.fwq.FwqStatisiticPojo;
|
|
|
+import com.xintong.visualinspection.pojo.fwq.ServiceAreaStatistic;
|
|
|
import com.xintong.visualinspection.service.CommonService;
|
|
|
import com.xintong.visualinspection.service.StatisticsService_F;
|
|
|
import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqCheckDeptStatisticsDao;
|
|
|
@@ -787,9 +789,9 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
|
|
|
}
|
|
|
|
|
|
- if(obj.getStart_date()!=null && obj.getEnd_date()!=null){
|
|
|
+ if (obj.getStart_date() != null && obj.getEnd_date() != null) {
|
|
|
CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime(), obj.getEnd_date().getTime());
|
|
|
- if(p!=null){
|
|
|
+ if (p != null) {
|
|
|
obj.setPeriod_id(p.getId());
|
|
|
}
|
|
|
}
|
|
|
@@ -910,7 +912,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
centerManageList.get(1).setChecked_num(centerManageList.get(1).getChecked_num()
|
|
|
+ centerManageMap.get(sta.getDept_id()).getChecked_num());
|
|
|
centerManageList.get(1).setFeeStationName("盐城");
|
|
|
- } else if (sta.getParent_dept_id() == 32){
|
|
|
+ } else if (sta.getParent_dept_id() == 32) {
|
|
|
centerManageList.get(2).setAll_check_score(centerManageList.get(2).getAll_check_score()
|
|
|
+ centerManageMap.get(sta.getDept_id()).getAll_check_score());
|
|
|
centerManageList.get(2).setChecked_num(centerManageList.get(2).getChecked_num()
|
|
|
@@ -1017,6 +1019,110 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<FwqStatisiticPojo> getFwqStatistic(ServiceAreaStatistic obj) {
|
|
|
+
|
|
|
+ List<CheckTaskPeriod> checkTaskPeriods = commonService.getAllCheckTaskPeriod();
|
|
|
+ Map<Long, Organ> deptMap = commonService.getDeptMap();
|
|
|
+
|
|
|
+ for (CheckTaskPeriod p : checkTaskPeriods) {
|
|
|
+ if (obj.getStart_date() == p.getEndtime().getTime()) {
|
|
|
+ obj.setStartperiod_id(p.getId());
|
|
|
+ }
|
|
|
+ if (obj.getEnd_date() == p.getEndtime().getTime()) {
|
|
|
+ obj.setEndperiod_id(p.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (obj.getStart_date() > (checkTaskPeriods.get(checkTaskPeriods.size() - 1).getEndtime().getTime())) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ if (obj.getEnd_date() < (checkTaskPeriods.get(0).getEndtime().getTime())) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ if (obj.getStart_date() < (checkTaskPeriods.get(0).getEndtime().getTime())) {
|
|
|
+ obj.setStartperiod_id(checkTaskPeriods.get(0).getId());
|
|
|
+ }
|
|
|
+ if (obj.getEnd_date() > (checkTaskPeriods.get(checkTaskPeriods.size() - 1).getEndtime().getTime())) {
|
|
|
+ obj.setEndperiod_id(checkTaskPeriods.get(checkTaskPeriods.size() - 1).getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<CheckTaskPeriod> temp_p = new ArrayList<>();
|
|
|
+ for (CheckTaskPeriod p : checkTaskPeriods) {
|
|
|
+ if (p.getId() >= obj.getStartperiod_id() && p.getId() <= obj.getEndperiod_id()) {
|
|
|
+ temp_p.add(p);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM");
|
|
|
+ //获取满足条件的服务区
|
|
|
+ List<ServiceAreaStatistic> fwqStatistics = fwqStatisticsDao.selectlimituser(obj);
|
|
|
+
|
|
|
+ HashMap<Integer, List<ServiceAreaStatistic>> usm = new HashMap<>();
|
|
|
+
|
|
|
+ for (ServiceAreaStatistic c : fwqStatistics
|
|
|
+ ) {
|
|
|
+ List<ServiceAreaStatistic> s = usm.get(c.getDept_id());
|
|
|
+ if (s == null) {
|
|
|
+ s = new ArrayList<>();
|
|
|
+ }
|
|
|
+ s.add(c);
|
|
|
+ usm.put(c.getDept_id(), s);
|
|
|
+ for (CheckTaskPeriod p : checkTaskPeriods) {
|
|
|
+ if (c.getPeriod_id().equals(p.getId())) {
|
|
|
+ c.setP_str(simpleDateFormat.format(p.getEndtime()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FwqStatisiticPojo> fwq_ids = new ArrayList<>();
|
|
|
+
|
|
|
+ //判断是否连续
|
|
|
+ for (Integer k : usm.keySet()) {
|
|
|
+ List<ServiceAreaStatistic> user_temp = new ArrayList<>();
|
|
|
+ boolean isM = false;
|
|
|
+
|
|
|
+ List<ServiceAreaStatistic> pp = new ArrayList<>();
|
|
|
+ //获取得分
|
|
|
+ List<ServiceAreaStatistic> ll = usm.get(k);
|
|
|
+ int count = 0;
|
|
|
+ for (CheckTaskPeriod p : temp_p) {
|
|
|
+ boolean isfond = false;
|
|
|
+ for (ServiceAreaStatistic s : ll) {
|
|
|
+ if (s.getPeriod_id().equals(p.getId())) {
|
|
|
+ isfond = true;
|
|
|
+ pp.add(s);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isfond) {
|
|
|
+ count++;
|
|
|
+ if (count >= obj.getLimitnumber()) {
|
|
|
+ isM = true;
|
|
|
+ user_temp.addAll(pp);
|
|
|
+ pp.clear();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (count >= obj.getLimitnumber()) {
|
|
|
+ isM = true;
|
|
|
+ user_temp.addAll(pp);
|
|
|
+ }
|
|
|
+ count = 0;
|
|
|
+ pp.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isM) {
|
|
|
+ FwqStatisiticPojo p = new FwqStatisiticPojo();
|
|
|
+ p.setDept_id(k.longValue());
|
|
|
+ p.setDept(deptMap.get(k.longValue()).getOrganname());
|
|
|
+ p.setFwqStatistics(user_temp);
|
|
|
+ fwq_ids.add(p);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return fwq_ids;
|
|
|
+ }
|
|
|
+
|
|
|
private List<FwqStatisticsBean> reFeeStationScoreInfo(FwqStatisticsBean obj) {
|
|
|
List<FwqStatisticsBean> scoreList = fwqStatisticsDao.selectFeeStationScoreInfo(obj);
|
|
|
Map<Long, FwqStatisticsBean> feeStationMap = new HashMap<>();
|