Commit 902b13f3 authored by chenyuxi's avatar chenyuxi

feat: 出差缩小对比范围

parent 3f3caa4b
......@@ -19,11 +19,14 @@ public interface EkpQiweiChuchaiMapper extends BaseMapper<EkpQiwiChuchai> {
/**
* @param status 状态
* @Description: 获取全部的列表,用来: 拉取企业微信时,不覆盖数据
* 1.9.6版本优化:只查找:已被拉取的90天内的数据Map(定时任务最多拉取30天内的,手动执行是当天的。所以比对90天内的查重足够了。查全部数据对IO是浪费的)
* 用来: 拉取企E人事出差数据时,不覆盖数据
* @Author: hgw
* @Date: 2021/7/28 18:05
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.salary.TStatisticsProjectReimburse>
**/
List<EkpQiwiChuchai> getAllInfo(@Param("status") String status);
List<EkpQiwiChuchai> getAllInfo(@Param("status") String status,
@Param("queryStartTime") String queryStartTime,@Param("queryEndTime") String queryEndTime);
List<QiWeiUserVo> getQiYeWeiXinUserList();
}
......
......@@ -172,10 +172,15 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
List<EkpQiwiChuchai> cpAllList = new ArrayList<>();
List<EkpQiwiChuchai> returnCpList = new ArrayList<>();
// todo 1.9.6计划改造:只查找:已被拉取的90天内的数据Map
String queryStartDay = DateUtil.addDay(-90);
String queryStartTimes = queryStartDay + " 00:00:00";
// type 1:企业微信;2:HCM的E人事
if (type == 1) {
// 已被拉取的Map
cpMap = this.getAllMap();
// todo 1.9.6计划改造:只查找:已被拉取的90天内的数据Map(定时任务最多拉取30天内的,手动执行是当天的。所以比对90天内的查重足够了。查全部数据对IO是浪费的)
cpMap = this.getAllMap(queryStartTimes,endTimes);
// 企微姓名Map
userMap = this.getUserMap();
String qwType = "chuChai";
......@@ -198,7 +203,8 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
} else {
// type 2:HCM的E人事
// 已被拉取的Map
cpMap = this.getAllMap();
// todo 1.9.6计划改造:只查找:已被拉取的90天内的数据Map(定时任务最多拉取30天内的,手动执行是当天的。所以比对90天内的查重足够了。查全部数据对IO是浪费的)
cpMap = this.getAllMap(queryStartTimes,endTimes);
this.getChuChaiListByHcm(startTimes, endTimes, cpAllList);
log.debug("2拉取HCM的E人事出差数据cpAllList.size()=" + cpAllList.size());
if (!cpAllList.isEmpty()) {
......@@ -587,12 +593,14 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
/**
* @Description: 获取全部的列表,用来: 拉取企业微信时,不覆盖数据
* 1.9.6版本优化:只查找:已被拉取的90天内的数据Map(定时任务最多拉取30天内的,手动执行是当天的。所以比对90天内的查重足够了。查全部数据对IO是浪费的)
* 用来: 拉取企E人事出差数据时,不覆盖数据
* @Author: hgw
* @Date: 2021-7-28 18:14:59
* @return: java.util.Map<java.lang.String, java.lang.String>
**/
private Map<String, String> getAllMap() {
List<EkpQiwiChuchai> cpHistoryList = baseMapper.getAllInfo(null);
private Map<String, String> getAllMap(String queryStartTime,String queryEndTime) {
List<EkpQiwiChuchai> cpHistoryList = baseMapper.getAllInfo(null,queryStartTime,queryEndTime);
Map<String, String> cpMap = new HashMap<>();
for (EkpQiwiChuchai cpHis : cpHistoryList) {
cpMap.put(cpHis.getFdSpNo(), "0");
......
......@@ -59,6 +59,7 @@
<if test="status != null and status.trim() != ''">
AND a.FD_STATUS = #{status}
</if>
and a.FD_APPLY_DATE >= #{queryStartTime} and a.FD_APPLY_DATE <![CDATA[<=]]> #{queryEndTime}
</where>
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment