Browse Source

大屏导出修改

feature/dangjian
zhaoqifeng 3 years ago
parent
commit
4fccc05e9c
  1. 14
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventStatServiceImpl.java
  2. 8
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventEfficiencyDao.xml
  3. 2
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventStatDao.xml

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

@ -20,12 +20,9 @@ package com.elink.esua.epdc.modules.screen.service.impl;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.screen.form.DataStatisticsFormDTO;
import com.elink.esua.epdc.dto.screen.form.EventStatisticsFormDTO;
import com.elink.esua.epdc.dto.screen.result.*;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import com.elink.esua.epdc.modules.screen.dao.ScreenDeptEventStatDao;
import com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventStatEntity;
import com.elink.esua.epdc.modules.screen.service.ScreenDeptEventStatService;
@ -33,7 +30,6 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -62,12 +58,12 @@ public class ScreenDeptEventStatServiceImpl extends BaseServiceImpl<ScreenDeptEv
String statYear;
if (StringUtils.isBlank(formDTO.getStatDate())) {
statDate = DateUtils.format(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN);
statMonth = statDate.substring(0,7);
statYear = statDate.substring(0,4);
statMonth = statDate.substring(0, 7);
statYear = statDate.substring(0, 4);
} else {
statDate = formDTO.getStatDate();
statMonth = formDTO.getStatDate().substring(0,7);
statYear = formDTO.getStatDate().substring(0,4);
statMonth = formDTO.getStatDate().substring(0, 7);
statYear = formDTO.getStatDate().substring(0, 4);
}
//统计总数
List<ScreenDeptEventStatEntity> list = baseDao.getEventStat("all", statDate);
@ -226,9 +222,11 @@ public class ScreenDeptEventStatServiceImpl extends BaseServiceImpl<ScreenDeptEv
} else if (NumConstant.TWO_STR.equals(formDTO.getStatType())) {
//日期为本月
formDTO.setStatDate(DateUtils.format(new Date(), DateUtils.DATE_PATTERN).substring(0, 7));
formDTO.setStartDate(DateUtils.format(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN));
} else if (NumConstant.THREE_STR.equals(formDTO.getStatType())) {
//日期为本年
formDTO.setStatDate(DateUtils.format(new Date(), DateUtils.DATE_PATTERN).substring(0, 4));
formDTO.setStartDate(DateUtils.format(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN));
}
return baseDao.getScreenExportData(formDTO);
}

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

@ -104,6 +104,8 @@
AND DATE_FORMAT(CREATED_TIME, '%Y-%m-%d') &lt;= #{statDate}) a
STRAIGHT_JOIN epdc_item_handle_process b
ON b.ITEM_ID = a.ID AND b.DEL_FLAG = '0' AND b.STATE = '60'
GROUP BY
b.ITEM_ID
) c ON a.ID = c.ITEM_ID
WHERE DEL_FLAG = '0'
AND PEOPLE_FLAG is not null
@ -226,6 +228,8 @@
AND ISSUE_ID is null
AND DATE_FORMAT(CREATED_TIME, '%Y-%m') = #{statDate}) a
STRAIGHT_JOIN epdc_item_handle_process b ON b.ITEM_ID = a.ID AND b.DEL_FLAG = '0' AND b.STATE = '60'
GROUP BY
b.ITEM_ID
) c ON a.ID = c.ITEM_ID
WHERE DEL_FLAG = '0'
AND DATE_FORMAT(a.CREATED_TIME, '%Y-%m') = #{statDate}
@ -348,6 +352,8 @@
AND ISSUE_ID is null
AND DATE_FORMAT(CREATED_TIME, '%Y') = #{statDate}) a
STRAIGHT_JOIN epdc_item_handle_process b ON b.ITEM_ID = a.ID AND b.DEL_FLAG = '0' AND b.STATE = '60'
GROUP BY
b.ITEM_ID
) c ON a.ID = c.ITEM_ID
WHERE DEL_FLAG = '0'
AND DATE_FORMAT(a.CREATED_TIME, '%Y') = #{statDate}
@ -605,6 +611,8 @@
AND DATE_FORMAT(CREATED_TIME, '%Y-%m-%d') &gt;= #{startDate}
AND DATE_FORMAT(CREATED_TIME, '%Y-%m-%d') &lt;= #{endDate}) a
STRAIGHT_JOIN epdc_item_handle_process b ON b.ITEM_ID = a.ID AND b.DEL_FLAG = '0' AND b.STATE = '60'
GROUP BY
b.ITEM_ID
) c ON a.ID = c.ITEM_ID
WHERE DEL_FLAG = '0'
AND DATE_FORMAT(a.CREATED_TIME, '%Y-%m-%d') &gt;= #{startDate}

2
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventStatDao.xml

@ -295,9 +295,11 @@
</if>
<if test='"2" == statType'>
AND DATE_FORMAT(a.CREATED_TIME, '%Y-%m') = #{statDate}
AND DATE_FORMAT(a.CREATED_TIME, '%Y-%m-%d') &lt;= #{startDate}
</if>
<if test='"3" == statType'>
AND DATE_FORMAT(a.CREATED_TIME, '%Y') = #{statDate}
AND DATE_FORMAT(a.CREATED_TIME, '%Y-%m-%d') &lt;= #{startDate}
</if>
<if test='"4" == statType'>
AND DATE_FORMAT(a.CREATED_TIME, '%Y-%m-%d') &gt;= #{startDate}

Loading…
Cancel
Save