Browse Source

满意率统计修改

feature/dangjian
zhaoqifeng 3 years ago
parent
commit
4ca2b55a90
  1. 20
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventEfficiencyServiceImpl.java
  2. 25
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventEfficiencyDao.xml

20
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventEfficiencyServiceImpl.java

@ -79,7 +79,9 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
item.setClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getClosedCount() != NumConstant.ZERO) {
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
});
baseDao.deleteData(statDate);
@ -116,7 +118,9 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
item.setClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getClosedCount() != NumConstant.ZERO) {
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
});
baseDao.deleteData(statDate);
@ -153,7 +157,9 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
item.setClosedRatio(closedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setResponseRatio(responseCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(eventCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
if (item.getClosedCount() != NumConstant.ZERO) {
item.setSatisfiedRatio(satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.SIX, RoundingMode.HALF_UP).stripTrailingZeros());
}
}
});
baseDao.deleteData(statDate);
@ -196,10 +202,14 @@ public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<Screen
BigDecimal satisfiedCount = new BigDecimal(item.getSatisfiedCount());
String closedRatio = closedCount.multiply(hundred).divide(eventCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
String responseRatio = responseCount.multiply(hundred).divide(eventCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
String satisfiedRatio = satisfiedCount.multiply(hundred).divide(eventCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
item.setClosedRatio(closedRatio.concat("%"));
item.setResponseRatio(responseRatio.concat("%"));
item.setSatisfiedRatio(satisfiedRatio.concat("%"));
if (item.getClosedCount() != NumConstant.ZERO) {
String satisfiedRatio = satisfiedCount.multiply(hundred).divide(closedCount, NumConstant.ONE, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
item.setSatisfiedRatio(satisfiedRatio.concat("%"));
} else {
item.setSatisfiedRatio("0%");
}
} else {
item.setClosedRatio("0%");
item.setResponseRatio("0%");

25
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventEfficiencyDao.xml

@ -26,7 +26,7 @@
COUNT(ID) AS eventCount,
COUNT(CASE ITEM_STATE WHEN '10' THEN ID END) AS closedCount,
COUNT(CASE WHEN processCount > 1 THEN ID END) AS responseCount,
COUNT(CASE WHEN EVALUATION_SCORE > 0 THEN ID END) AS satisfiedCount
COUNT(CASE WHEN ITEM_STATE = '10' AND (EVALUATION_SCORE != 0 OR EVALUATION_SCORE > 0) THEN ID END) AS satisfiedCount
FROM epdc_item a
LEFT JOIN (
SELECT ITEM_ID, count(ID) AS 'processCount'
@ -67,7 +67,11 @@
THEN ID END) AS closedCount,
COUNT(CASE WHEN DATE_FORMAT(b.CREATED_TIME, '%Y-%m') = #{statDate} THEN ID END) AS responseCount,
COUNT(CASE
WHEN DATE_FORMAT(EVALUATION_TIME, '%Y-%m') = #{statDate} AND EVALUATION_SCORE > 0
WHEN ITEM_STATE = '10' AND
DATE_FORMAT(c.CREATED_TIME, '%Y-%m') = #{statDate} AND
(EVALUATION_SCORE != 0 OR
(DATE_FORMAT(EVALUATION_TIME, '%Y-%m') = #{statDate} AND
EVALUATION_SCORE > 0))
THEN ID END) AS satisfiedCount
FROM epdc_item a
LEFT JOIN (
@ -141,7 +145,11 @@
THEN ID END) AS closedCount,
COUNT(CASE WHEN DATE_FORMAT(b.CREATED_TIME, '%Y') = #{statDate} THEN ID END) AS responseCount,
COUNT(CASE
WHEN DATE_FORMAT(EVALUATION_TIME, '%Y') = #{statDate} AND EVALUATION_SCORE > 0
WHEN ITEM_STATE = '10' AND
DATE_FORMAT(c.CREATED_TIME, '%Y') = #{statDate} AND
(EVALUATION_SCORE != 0 OR
(DATE_FORMAT(EVALUATION_TIME, '%Y') = #{statDate} AND
EVALUATION_SCORE > 0))
THEN ID END) AS satisfiedCount
FROM epdc_item a
LEFT JOIN (
@ -256,9 +264,14 @@
'%Y-%m-%d') &lt;= #{endDate}
THEN ID END) AS responseCount,
COUNT(CASE
WHEN DATE_FORMAT(EVALUATION_TIME, '%Y-%m-%d') &gt;= #{startDate} AND
DATE_FORMAT(EVALUATION_TIME,
'%Y-%m-%d') &lt;= #{endDate} AND EVALUATION_SCORE > 0
WHEN
ITEM_STATE = '10' AND
DATE_FORMAT(c.CREATED_TIME, '%Y-%m-%d') &gt;= #{startDate} AND
DATE_FORMAT(c.CREATED_TIME, '%Y-%m-%d') &lt;= #{endDate} AND
(EVALUATION_SCORE != 0 OR
(DATE_FORMAT(EVALUATION_TIME, '%Y-%m-%d') &gt;= #{startDate} AND
DATE_FORMAT(EVALUATION_TIME, '%Y-%m-%d') &lt;= #{endDate} AND
EVALUATION_SCORE > 0))
THEN ID END) AS satisfiedCount
FROM epdc_item a
LEFT JOIN (

Loading…
Cancel
Save