소스 검색

Merge branch 'master' into prod

buzhanyi 2 년 전
부모
커밋
7ac8fb2d02

+ 8 - 4
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -631,7 +631,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         } else if (reqType == 4) { //合同信息列表
             lw.apply("(project_status >=19 )");
         } else if (reqType == 5) { //项目建设列表
-            lw.apply("(project_status = 20 or project_status = 21 )");
+            lw.apply("(project_status >=20 )");
         }
 
         lw.last(" order by project_status, plan_demand_sub_time");
@@ -2801,13 +2801,14 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             int year = calendar.get(Calendar.YEAR);
             // 获取统计数据
             List<Map<String, Integer>> listMap = pmDemandMapper.selectPurchaseTaskFinishYear(pmDemandReqVo);
-            mapReturn.addAll(listMap);
+            //mapReturn.addAll(listMap);
             for (int i = minYear; i <= year; i++) {
                 boolean isYear = false;
                 for (Map<String, Integer> map : listMap) {
                     if (i == Integer.parseInt(String.valueOf(map.get("yy")))) {
                         isYear = true;
                         map.put("yy", i);
+                        mapReturn.add(map);
                     }
                 }
                 if (!isYear) {
@@ -2823,12 +2824,14 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             // 当前年份季度统计
             // 获取统计数据
             List<Map<String, Integer>> listMap = pmDemandMapper.selectPurchaseTaskFinishQuarter(pmDemandReqVo);
-            mapReturn.addAll(listMap);
+            //mapReturn.addAll(listMap);
             for (int i = 1; i <= 4; i++) {
                 boolean isYear = false;
                 for (Map<String, Integer> map : listMap) {
                     if (i == Integer.parseInt(String.valueOf(map.get("yy")))) {
                         isYear = true;
+                        map.put("yy", i);
+                        mapReturn.add(map);
                     }
                 }
                 if (!isYear) {
@@ -2844,7 +2847,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             // 当前年份月份统计
             // 获取统计数据
             List<Map<String, Integer>> listMap = pmDemandMapper.selectPurchaseTaskFinishMonth(pmDemandReqVo);
-            mapReturn.addAll(listMap);
+            //mapReturn.addAll(listMap);
             for (int i = 1; i <= 12; i++) {
                 boolean isYear = false;
                 for (Map<String, Integer> map : listMap) {
@@ -2852,6 +2855,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                         isYear = true;
                         map.put("yy", i);
                         map.put("countNum", 0);
+                        mapReturn.add(map);
                     }
                 }
                 if (!isYear) {

+ 25 - 18
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -148,7 +148,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
-        now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
         and YEAR(plan_demand_sub_time) = YEAR(NOW())
     </select>
 
@@ -157,7 +158,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
-        now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
         and quarter(plan_demand_sub_time) = quarter(NOW())
     </select>
 
@@ -166,7 +168,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
-        now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
         and MONTH(plan_demand_sub_time) = MONTH(NOW())
     </select>
 
@@ -175,7 +178,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
-        now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
     </select>
 
     <select id="countProjectExceedTZ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
@@ -309,19 +313,19 @@
     <select id="majorProjectByStatusThisMonthFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         <include refid="majorProjectByStatus"/>
-        AND MONTH(plan_purchase_finish_time ) = MONTH(now())
+        AND MONTH(up_acceptance_time ) = MONTH(now())
         AND project_status &gt;= #{vo.projectStatus}
     </select>
     <select id="majorProjectByStatusThisQuaFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         <include refid="majorProjectByStatus"/>
-        AND QUARTER(plan_purchase_finish_time ) = QUARTER(now())
+        AND QUARTER(up_acceptance_time ) = QUARTER(now())
         AND project_status &gt;= #{vo.projectStatus}
     </select>
     <select id="majorProjectByStatusThisYearFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         <include refid="majorProjectByStatus"/>
-        AND YEAR(plan_purchase_finish_time ) = YEAR(now())
+        AND YEAR(up_acceptance_time ) = YEAR(now())
         AND project_status &gt;= #{vo.projectStatus}
     </select>
     <select id="majorProjectByStatusThisMonthFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
@@ -583,57 +587,60 @@
             resultType="java.util.Map">
         select count(a.demand_id) countNum,
         ifnull(sum(a.evaluation), 0) evaluation,
-        year(a.create_time) yy,
+        year(a.up_acceptance_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, create_time, demand_id
+        select evaluation, up_acceptance_time, demand_id
         from pm_demand
         <include refid="deptListOrDemandIdAll"/>
         project_status in (15, 16, 17)
+        and up_acceptance_time!=null
         ) a
         left join (
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by year(a.create_time)
+        group by year(a.up_acceptance_time)
     </select>
 
     <select id="selectPurchaseTaskFinishQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        quarter(a.create_time) yy,
+        quarter(a.up_acceptance_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, create_time, demand_id
+        select evaluation, up_acceptance_time, demand_id
         from pm_demand
         <include refid="deptListOrDemandIdAll"/>
         project_status in (15, 16, 17)
-        and year(create_time) = year(NOW())
+        and up_acceptance_time!=null
+        and year(up_acceptance_time) = year(NOW())
         ) a
         left join (
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by concat(Year(a.create_time), quarter(a.create_time))
+        group by concat(Year(a.up_acceptance_time), quarter(a.up_acceptance_time))
     </select>
 
     <select id="selectPurchaseTaskFinishMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        date_format(create_time, '%m') yy,
+        date_format(up_acceptance_time, '%m') yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, create_time, demand_id
+        select evaluation, up_acceptance_time, demand_id
         from pm_demand
         <include refid="deptListOrDemandIdAll"/>
         project_status in (15, 16, 17)
-        and year(create_time) = year(NOW())
+        and up_acceptance_time!=null
+        and year(up_acceptance_time) = year(NOW())
         ) a
         left join (
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by date_format(a.create_time, '%y%m')
+        group by date_format(a.up_acceptance_time, '%y%m')
     </select>
 
     <select id="countProjectExceedAndMajor" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"