|
|
@@ -7,8 +7,6 @@ import com.xintong.visualinspection.bean.FwqDeptStatistic;
|
|
|
import com.xintong.visualinspection.bean.FwqStatisticsBean;
|
|
|
import com.xintong.visualinspection.bean.Item;
|
|
|
import com.xintong.visualinspection.bean.Organ;
|
|
|
-import com.xintong.visualinspection.pojo.fwq.FwqStatisiticPojo;
|
|
|
-import com.xintong.visualinspection.pojo.fwq.ServiceAreaStatistic;
|
|
|
import com.xintong.visualinspection.service.CommonService;
|
|
|
import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqCheckDeptStatisticsDao;
|
|
|
import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqStatisticsDao;
|
|
|
@@ -85,7 +83,7 @@ public class StatisticsService_FImpl implements StatisticsService_F {
|
|
|
List<FwqStatisticsBean> onsite_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
|
|
|
|
|
|
for (FwqStatisticsBean company_bean : company_beans) {
|
|
|
- mapStationInfos.get(company_bean.getDept_id()).setCompany_check_num(15);
|
|
|
+ mapStationInfos.get(company_bean.getDept_id()).setCompany_check_num(company_bean.getChecked_num());
|
|
|
mapStationInfos.get(company_bean.getDept_id()).setCompany_total_score(company_bean.getAll_check_score());
|
|
|
}
|
|
|
for (FwqStatisticsBean third_bean : third_beans) {
|
|
|
@@ -111,9 +109,11 @@ public class StatisticsService_FImpl implements StatisticsService_F {
|
|
|
value.setOnsite_check_num(1);
|
|
|
// 设置总平均扣分
|
|
|
if (value.getCompany_check_num() > 0 || value.getThird_check_num() > 0) {
|
|
|
- avg += value.getCompany_total_score() / 15.0 * 0.3 + value.getThird_total_score() * 0.4 + value.getOnsite_total_score() * 0.3;
|
|
|
+ avg += (value.getCompany_total_score() + value.getThird_total_score()) / 2.0 / (value.getCompany_check_num() + value.getThird_check_num());
|
|
|
+ }
|
|
|
+ if (value.getOnsite_check_num() > 0) {
|
|
|
+ avg += value.getOnsite_total_score() / 2.0 / value.getOnsite_check_num();
|
|
|
}
|
|
|
-
|
|
|
value.setCheck_total_avg(df.format(avg));
|
|
|
// 设置平均得分
|
|
|
Float score_avg = (1000 - Float.valueOf(df.format(avg)));
|
|
|
@@ -589,141 +589,6 @@ public class StatisticsService_FImpl implements StatisticsService_F {
|
|
|
exportExcel("温馨服务检查情况统计表", "fwq_checked_item_info", map, resp);
|
|
|
}
|
|
|
|
|
|
- @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() + 1 * 1000 * 60 * 60 == p.getEndtime().getTime()) {
|
|
|
- obj.setStartperiod_id(p.getId());
|
|
|
- }
|
|
|
- if (obj.getEnd_date() + 1 * 1000 * 60 * 60 == p.getEndtime().getTime()) {
|
|
|
- obj.setEndperiod_id(p.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- if (obj.getStart_date() > (checkTaskPeriods.get(checkTaskPeriods.size() - 1).getEndtime().getTime() - 1 * 1000 * 60 * 60)) {
|
|
|
- return new ArrayList<>();
|
|
|
- }
|
|
|
- if (obj.getEnd_date() < (checkTaskPeriods.get(0).getEndtime().getTime() - 1 * 1000 * 60 * 60)) {
|
|
|
- return new ArrayList<>();
|
|
|
- }
|
|
|
- if (obj.getStart_date() < (checkTaskPeriods.get(0).getEndtime().getTime() - 1 * 1000 * 60 * 60)) {
|
|
|
- obj.setStartperiod_id(checkTaskPeriods.get(0).getId());
|
|
|
- }
|
|
|
- if (obj.getEnd_date() > (checkTaskPeriods.get(checkTaskPeriods.size() - 1).getEndtime().getTime() - 1 * 1000 * 60 * 60)) {
|
|
|
- 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);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for (FwqStatisiticPojo s:fwq_ids ) {
|
|
|
- String dat = "";
|
|
|
- for (ServiceAreaStatistic statistic : s.getFwqStatistics()) {
|
|
|
- dat += statistic.getP_str() + "月、";
|
|
|
- }
|
|
|
- dat = dat.substring(0, dat.length() - 1);
|
|
|
- s.setDes(dat);
|
|
|
- }
|
|
|
-
|
|
|
- return fwq_ids;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void getFwqStatistic(ServiceAreaStatistic obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
- List<FwqStatisiticPojo> list = this.getFwqStatistic(obj);
|
|
|
- SimpleDateFormat d = new SimpleDateFormat("yyyy/MM");
|
|
|
- String name = "";
|
|
|
- if ("2".equals(obj.getSctype())) {
|
|
|
- name = "综合得分";
|
|
|
- } else if ("1".equals(obj.getSctype())) {
|
|
|
- name = "温馨服务得分";
|
|
|
- }
|
|
|
- List<Integer> temp = new ArrayList<>();
|
|
|
- for (int i = 1; i <= list.size(); i++) {
|
|
|
- temp.add(i);
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("list", temp);
|
|
|
- map.put("datas", list);
|
|
|
- map.put("title", "服务区" + name + "连续月统计" + "(" + d.format(obj.getStart_date()) + "---" + d.format(obj.getEnd_date()) + ")");
|
|
|
- exportExcel("服务区连续月统计", "fwq_user_statistic", map, resp);
|
|
|
- }
|
|
|
-
|
|
|
private void exportExcel(String fileName, String excelTemplateName, Map<String, Object> map,
|
|
|
HttpServletResponse resp) {
|
|
|
String path = "./" + fileName + ".xls";
|