Browse Source

大屏接口修改

ftature/screen
zhangyongzhangyong 4 years ago
parent
commit
f831a71653
  1. 5
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/OrgrankdataResultDTO.java
  2. 4
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java
  3. 4
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java
  4. 12
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  5. 27
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml

5
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/OrgrankdataResultDTO.java

@ -75,13 +75,14 @@ public class OrgrankdataResultDTO implements Serializable {
*/
private Integer projectTotal;
/**
* 满意最大值100保留小数点后四位
* 结案最大值100保留小数点后四位
*/
private BigDecimal closeProjectRatio;
/**
* 结案最大值100保留小数点后四位
* 满意最大值100保留小数点后四位
*/
private BigDecimal satisfactionRatio;
/**

4
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java

@ -106,7 +106,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
@Override
public Result quantityGridMonthly(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth.replace("-", "");
// 数据统计
List<QuantityGridMonthly> data = baseDao.selectQuantityGridMonthly(yearMonth);
// 数据格式化
@ -119,7 +119,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
@Override
public Result quantityOrgMonthly(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth.replace("-", "");
// 数据统计
List<QuantityOrgMonthlyDTO> data = baseDao.selectQuantityOrgMonthly(yearMonth);
// 数据格式化

4
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java

@ -147,7 +147,7 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl<ScreenPublicDat
@Override
public Result getOrgrankdata(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth2(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth2(DateUtils.addDateMonths(new Date(),-1)) : yearMonth.replace("-", "");
List<OrgrankdataResultDTO> list = baseDao.getOrgrankdata(yearMonth);
// 将list转换为json格式
if(list != null && list.size()>0){
@ -232,7 +232,7 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl<ScreenPublicDat
@Override
public Result getUserjoin(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth2(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth2(DateUtils.addDateMonths(new Date(),-1)) : yearMonth.replace("-", "");
//获取人均议题 ,总的参与次数,
List<UserjoinResultDTO> list = baseDao.getUserjoin(yearMonth);
//获取平均参与度

12
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -230,7 +230,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
AND date_format( lin.CREATED_TIME, '%Y%m' ) = #{yearMonth}
group by lin.EVENT_ID)li
group by li.GRID_ID)it on it.GRID_ID=sd.id
left join (select al.GRID_ID,
@ -240,7 +240,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;= #{yearMonth}
AND date_format( lin.CREATED_TIME, '%Y%m' ) &lt;= #{yearMonth}
group by lin.EVENT_ID)al
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id
WHERE sd.`del_flag`= 0
@ -270,7 +270,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{yearMonth}
AND date_format( lin.CREATED_TIME, '%Y%m' ) =#{yearMonth}
group by lin.EVENT_ID)li
group by li.GRID_ID)it on it.GRID_ID=sd.id
left join (select al.GRID_ID,
@ -280,7 +280,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;=#{yearMonth}
AND date_format( lin.CREATED_TIME, '%Y%m' ) &lt;=#{yearMonth}
group by lin.EVENT_ID)al
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id
WHERE sd.`del_flag`= 0
@ -310,7 +310,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{yearMonth}
AND date_format( lin.CREATED_TIME, '%Y%m' ) =#{yearMonth}
group by lin.EVENT_ID)li
group by li.GRID_ID)it on it.GRID_ID=sd.id
left join (select al.GRID_ID,
@ -320,7 +320,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;=#{yearMonth}
AND date_format( lin.CREATED_TIME, '%Y%m' ) &lt;=#{yearMonth}
group by lin.EVENT_ID)al
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id
WHERE sd.`del_flag`= 0

27
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml

@ -1437,10 +1437,15 @@ select gr.id as orgId,
t.issueTotal,
t.projectTotal,
IFNULL(ROUND(t.itemCloseTotal/t.projectTotal,4),0) * 100 closeProjectRatio,
IFNULL(ROUND((t.itemSatisfiedTotal * 0.6 + t.itemVeryTotal)/t.projectTotal,4),0) * 100 satisfactionRatio,
IFNULL(ROUND(
((t.itemUnsatisfactoryTotal * 0.6) + t.itemVeryTotal + ((t.projectTotal - t.itemUnsatisfactoryTotal - t.itemVeryTotal) * 0.8))
/t.projectTotal,4),0) * 100 satisfactionRatio,
IFNULL(t.itemCloseTotal,0) as closeProjectRatioFz,
IFNULL(t.projectTotal,0) as closeProjectRatioFm,
IFNULL((t.itemSatisfiedTotal * 0.6 + t.itemVeryTotal),0) as satisfactionRatioFz,
IFNULL(
((t.itemUnsatisfactoryTotal * 0.6) + t.itemVeryTotal + ((t.projectTotal - t.itemUnsatisfactoryTotal - t.itemVeryTotal) * 0.8))
,0) as satisfactionRatioFz,
IFNULL(t.projectTotal,0) as satisfactionRatioFm
from (
select
@ -1494,7 +1499,7 @@ select gr.id as orgId,
)t
) projectTotal,
(select count(*) itemCloseTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.ITEM_STATE = 10 GROUP BY `EVENT_ID`) itemCloseTotal,
(select count(*) itemSatisfiedTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 GROUP BY `EVENT_ID`) itemSatisfiedTotal,
(select count(*) itemUnsatisfactoryTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 0 GROUP BY `EVENT_ID`) itemUnsatisfactoryTotal,
(select count(*) itemVeryTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 GROUP BY `EVENT_ID`) itemVeryTotal
from esua_epdc_admin.sys_dept sd
where sd.DEL_FLAG = '0'
@ -1517,7 +1522,7 @@ select gr.id as orgId,
IFNULL(issueCount.issueNum,0) issueTotal,
IFNULL(itemCount.itemNum,0) projectTotal,
IFNULL(itemCloseCount.itemNum,0) itemCloseTotal,
IFNULL(itemSatisfiedCount.itemNum,0) itemSatisfiedTotal,
IFNULL(itemUnsatisfactoryTotal.itemNum,0) itemUnsatisfactoryTotal,
IFNULL(itemVeryCount.itemNum,0) itemVeryTotal
from esua_epdc_admin.sys_dept sd
left join (
@ -1620,11 +1625,11 @@ select gr.id as orgId,
left join (
select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from
(select GRID_ID,count(itemNum)itemNum FROM( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.`EVENT_ID` ,item.GRID_ID )a GROUP BY a.GRID_ID) itemgrid
and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 0 group by item.`EVENT_ID` ,item.GRID_ID )a GROUP BY a.GRID_ID) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID
left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID
group by d2.PID
) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID
) itemUnsatisfactoryTotal on itemUnsatisfactoryTotal.DEPT_ID = sd.ID
left join (
select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from
(select GRID_ID,count(itemNum)itemNum FROM( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
@ -1652,7 +1657,7 @@ select gr.id as orgId,
IFNULL(issueCount.issueNum,0) issueTotal,
IFNULL(itemCount.itemNum,0) projectTotal,
IFNULL(itemCloseCount.itemNum,0) itemCloseTotal,
IFNULL(itemSatisfiedCount.itemNum,0) itemSatisfiedTotal,
IFNULL(itemUnsatisfactoryTotal.itemNum,0) itemUnsatisfactoryTotal,
IFNULL(itemVeryCount.itemNum,0) itemVeryTotal
from esua_epdc_admin.sys_dept sd
left join (
@ -1749,9 +1754,9 @@ select gr.id as orgId,
left join (
select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from
( SELECT GRID_ID,count(itemNum)itemNum from( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.`EVENT_ID` ,item.GRID_ID )a GROUP BY a.GRID_ID) itemgrid
and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 0 group by item.`EVENT_ID` ,item.GRID_ID )a GROUP BY a.GRID_ID) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID
) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID
) itemUnsatisfactoryTotal on itemUnsatisfactoryTotal.DEPT_ID = sd.ID
left join (
select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from
( SELECT GRID_ID,count(itemNum)itemNum from( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
@ -1780,7 +1785,7 @@ select gr.id as orgId,
IFNULL(issueCount.issueNum,0) issueTotal,
IFNULL(itemCount.itemNum,0) projectTotal,
IFNULL(itemCloseCount.itemNum,0) itemCloseTotal,
IFNULL(itemSatisfiedCount.itemNum,0) itemSatisfiedTotal,
IFNULL(itemUnsatisfactoryTotal.itemNum,0) itemUnsatisfactoryTotal,
IFNULL(itemVeryCount.itemNum,0) itemVeryTotal
from esua_epdc_admin.sys_dept sd
left join (select count(*) partyNum,uu.DEPT_ID from esua_epdc_user.epdc_user uu where uu.DEL_FLAG = '0' and uu.PARTY_FLAG = '1' group by uu.DEPT_ID) user on user.DEPT_ID = sd.ID
@ -1838,7 +1843,7 @@ select gr.id as orgId,
t.GRID_ID
) itemCount on itemCount.DEPT_ID = sd.ID
left join (select DEPT_ID, COUNT(itemNum)itemNum from((select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.ITEM_STATE = 10 group by item.`EVENT_ID` ,item.GRID_ID))a group by a.`DEPT_ID` ) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID
left join (select DEPT_ID, COUNT(itemNum)itemNum from((select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.`EVENT_ID` ,item.GRID_ID))a group by a.`DEPT_ID` ) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID
left join (select DEPT_ID, COUNT(itemNum)itemNum from((select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 0 group by item.`EVENT_ID` ,item.GRID_ID))a group by a.`DEPT_ID` ) itemUnsatisfactoryTotal on itemUnsatisfactoryTotal.DEPT_ID = sd.ID
left join (select DEPT_ID, COUNT(itemNum)itemNum from((select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 group by item.`EVENT_ID` ,item.GRID_ID))a group by a.`DEPT_ID` ) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID
where sd.DEL_FLAG = '0'
AND sd.id IS NOT NULL

Loading…
Cancel
Save