Эх сурвалжийг харах

修改第三方暗访的得分除以0.6

huangchengzdm 7 жил өмнө
parent
commit
5935cd5fed

+ 2 - 2
VisualInspection/fwq/js/statistics/operation_management_integration.js

@@ -65,7 +65,7 @@ function gethtml(data, i, avg, lists) {
     strTbody += "<tr><td width='8%'>" + data.company_ranking2 + "</td>";
     strTbody += "<td width='8%'>" + data.name + "</td><td width='6%'>" + data.company_check_num +
         "</td><td width='6%'>" + data.company_total_score + "</td><td width='6%'>" + data.third_check_num +
-        "</td><td width='6%'>" + data.third_total_score + "</td><td width='6%'>" + data.onsite_check_num +
+        "</td><td width='6%'>" + data.third_total_score_handle + "</td><td width='6%'>" + data.onsite_check_num +
         "</td><td width='6%'>" + data.onsite_total_score + "</td><td width='8%'>" +
         data.check_total_avg + "</td>" +
         "<td width='8%'>" + data.score_avg + "</td>";
@@ -75,7 +75,7 @@ function gethtml(data, i, avg, lists) {
 
 function getTotalHtml(data) {
     var html = "<tr><td>合计</td><td></td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyScore + "</td><td>" +
-        data.totalThirdNum + "</td><td>" + data.totalThirdScore + "</td><td>" + data.totalOnsiteNum + "</td><td>" + data.totalOnsiteScore +
+        data.totalThirdNum + "</td><td>" + data.totalThirdScoreHandle + "</td><td>" + data.totalOnsiteNum + "</td><td>" + data.totalOnsiteScore +
          "</td><td>-</td><td>-</td></tr>";
     return html;
 }

+ 4 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/StatisticsController_F.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -62,12 +63,14 @@ public class StatisticsController_F extends BaseController {
                 totalThirdScore = 0,
                 totalOnsiteNum = 0,
                 totalOnsiteScore = 0;
+        BigDecimal totalThirdScoreHandle = new BigDecimal("0.00");
 
         for (FwqStatisticsBean bean : lists) {
             totalCompanyNum += bean.getCompany_check_num();
             totalCompanyScore += bean.getCompany_total_score();
             totalThirdNum += bean.getThird_check_num();
             totalThirdScore += bean.getThird_total_score();
+            totalThirdScoreHandle = totalThirdScoreHandle.add(bean.getThird_total_score_handle());
             totalOnsiteNum += bean.getOnsite_check_num();
             totalOnsiteScore += bean.getOnsite_total_score();
         }
@@ -77,6 +80,7 @@ public class StatisticsController_F extends BaseController {
         resultMap.put("totalCompanyScore", totalCompanyScore);
         resultMap.put("totalThirdNum", totalThirdNum);
         resultMap.put("totalThirdScore", totalThirdScore);
+        resultMap.put("totalThirdScoreHandle", totalThirdScoreHandle);
         resultMap.put("totalOnsiteNum", totalOnsiteNum);
         resultMap.put("totalOnsiteScore", totalOnsiteScore);
         return super.returnSuccessResult(resultMap);

+ 40 - 16
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/mapper/master/StatisticsMapper.xml

@@ -462,22 +462,46 @@
         oc.check_time_name
         ) other_check_num_t
         LEFT JOIN (
-        SELECT
-        oc.check_time_name  AS mth,
-        sum(oc.check_score) AS checkd_all_score,
-        dept_id
-        FROM other_check oc
-        WHERE 1 = 1
-        <if test="start_date !=null">
-            AND oc.check_time >= #{start_date}
-        </if>
-        <if test="end_date !=null">
-            AND oc.check_time &lt; #{end_date}
-        </if>
-        <if test="mth!=null and mth!=''">
-            AND oc.check_time_name =#{mth}
-        </if>
-        GROUP BY mth, oc.dept_id
+                SELECT
+                oc.mth,
+                sum(oc.checkd_all_score) AS checkd_all_score,
+                oc.dept_id
+                FROM (
+                SELECT
+                oc.check_time_name  AS mth,
+                sum(oc.check_score) AS checkd_all_score,
+                dept_id
+                FROM other_check oc
+                WHERE check_type = 9
+                <if test="start_date !=null">
+                    AND oc.check_time >= #{start_date}
+                </if>
+                <if test="end_date !=null">
+                    AND oc.check_time &lt; #{end_date}
+                </if>
+                <if test="mth!=null and mth!=''">
+                    AND oc.check_time_name =#{mth}
+                </if>
+                GROUP BY mth, oc.dept_id
+                UNION ALL
+                SELECT
+                oc.check_time_name  AS mth,
+                truncate(sum(oc.check_score)/0.9,2) AS checkd_all_score,
+                dept_id
+                FROM other_check oc
+                WHERE check_type = 8
+                <if test="start_date !=null">
+                    AND oc.check_time >= #{start_date}
+                </if>
+                <if test="end_date !=null">
+                    AND oc.check_time &lt; #{end_date}
+                </if>
+                <if test="mth!=null and mth!=''">
+                    AND oc.check_time_name =#{mth}
+                </if>
+                GROUP BY mth, oc.dept_id
+                ) oc
+            GROUP BY mth,oc.dept_id
         ) other_checked_score_t ON other_checked_score_t.dept_id = other_check_num_t.dept_id
         AND other_check_num_t.mth = other_checked_score_t.mth
     </sql>

+ 11 - 6
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/StatisticsServiceImpl.java

@@ -21,6 +21,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -75,7 +77,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         }
 
         // 获取公司检查的某个收费站的受检次数和扣分合计
-        List<FwqStatisticsBean> company_beans =  getFeeStationCheckItemScore(obj);
+        List<FwqStatisticsBean> company_beans = getFeeStationCheckItemScore(obj);
         // 获取第三方暗访稽查的某个服务区的受检次数和扣分合计
         obj.setCheck_type(8);
         List<FwqStatisticsBean> third_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
@@ -92,6 +94,9 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         for (FwqStatisticsBean third_bean : third_beans) {
             mapStationInfos.get(third_bean.getDept_id()).setThird_check_num(third_bean.getChecked_num() > 1 ? 1 : third_bean.getChecked_num());
             mapStationInfos.get(third_bean.getDept_id()).setThird_total_score(third_bean.getCheck_total_score());
+            // 2018年09月11日 处理第三方暗访的得分除以0.9
+            third_bean.setThird_total_score_handle(BigDecimal.valueOf(third_bean.getCheck_total_score()).divide(BigDecimal.valueOf(0.9), 2, RoundingMode.HALF_UP));
+            mapStationInfos.get(third_bean.getDept_id()).setThird_total_score_handle(third_bean.getThird_total_score_handle());
         }
 
         for (FwqStatisticsBean onsite_bean : onsite_beans) {
@@ -119,7 +124,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             value.setCheck_total_avg(df.format(avg));
             // 设置平均得分
             Float score_avg = (1000 - Float.valueOf(df.format(avg)));
-            Float score_wxfw_avg = (1000-Float.valueOf(df.format(avgWxfw)));
+            Float score_wxfw_avg = (1000 - Float.valueOf(df.format(avgWxfw)));
             value.setScore_avg(score_avg.toString());
             value.setScore_wxfw_avg(score_wxfw_avg.toString());
         }
@@ -159,7 +164,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             }
         }
 
-        CheckTaskPeriod period = commonService.getCheckTaskPeriod(obj.getStart_date().getTime()+1 * 1000 * 60 * 60, obj.getEnd_date().getTime()+1 * 1000 * 60 * 60);
+        CheckTaskPeriod period = commonService.getCheckTaskPeriod(obj.getStart_date().getTime() + 1 * 1000 * 60 * 60, obj.getEnd_date().getTime() + 1 * 1000 * 60 * 60);
 
         if (period != null) {
             for (FwqStatisticsBean s : sortList) {
@@ -395,7 +400,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         }
 
         if (obj.getStart_date() != null && obj.getEnd_date() != null) {
-            CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime()+1 * 1000 * 60 * 60, obj.getEnd_date().getTime()+1 * 1000 * 60 * 60);
+            CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime() + 1 * 1000 * 60 * 60, obj.getEnd_date().getTime() + 1 * 1000 * 60 * 60);
             if (p != null) {
                 obj.setPeriod_id(p.getId());
             }
@@ -494,7 +499,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         Calendar cal2 = Calendar.getInstance();
         cal2.setTime(obj.getEnd_date());
         cal2.add(Calendar.MONTH, -1);
-        CheckTaskPeriod lastTaskPeriod = commonService.getCheckTaskPeriod(cal.getTime().getTime()+1 * 1000 * 60 * 60, cal2.getTime().getTime()+1 * 1000 * 60 * 60);
+        CheckTaskPeriod lastTaskPeriod = commonService.getCheckTaskPeriod(cal.getTime().getTime() + 1 * 1000 * 60 * 60, cal2.getTime().getTime() + 1 * 1000 * 60 * 60);
         if (lastTaskPeriod != null) {
             FwqStatisticsBean temp = new FwqStatisticsBean();
             temp.setStart_date(new Date(lastTaskPeriod.getStarttime().getTime() - 1 * 1000 * 60 * 60));
@@ -803,7 +808,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         }
 
         if (obj.getStart_date() != null && obj.getEnd_date() != null) {
-            CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime()+1 * 1000 * 60 * 60, obj.getEnd_date().getTime()+1 * 1000 * 60 * 60);
+            CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime() + 1 * 1000 * 60 * 60, obj.getEnd_date().getTime() + 1 * 1000 * 60 * 60);
             if (p != null) {
                 obj.setPeriod_id(p.getId());
             }

+ 5 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/StatisticsService_FImpl.java

@@ -29,6 +29,8 @@ import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -89,6 +91,9 @@ public class StatisticsService_FImpl implements StatisticsService_F {
         for (FwqStatisticsBean third_bean : third_beans) {
             mapStationInfos.get(third_bean.getDept_id()).setThird_check_num(third_bean.getChecked_num() > 1 ? 1 : third_bean.getChecked_num());
             mapStationInfos.get(third_bean.getDept_id()).setThird_total_score(third_bean.getCheck_total_score());
+            // 2018年09月11日 处理第三方暗访的得分除以0.9
+            third_bean.setThird_total_score_handle(BigDecimal.valueOf(third_bean.getCheck_total_score()).divide(BigDecimal.valueOf(0.9), 2, RoundingMode.HALF_UP));
+            mapStationInfos.get(third_bean.getDept_id()).setThird_total_score_handle(third_bean.getThird_total_score_handle());
         }
 
         for (FwqStatisticsBean onsite_bean : onsite_beans) {

+ 3 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqStatisticsBean.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -145,6 +146,8 @@ public class FwqStatisticsBean implements Serializable {
     private Integer third_check_num = 0;
     // 第三方暗访扣分合计
     private Integer third_total_score = 0;
+    // 第三方暗访扣分合计(除以0.9)
+    private BigDecimal third_total_score_handle = new BigDecimal("0.00");
     // 现场受检次数
     private Integer onsite_check_num = 0;
     // 现场扣分合计