Commit cce92e96 by fudahua

gic 企业过期停用

parent d0a1b9b9
......@@ -2,7 +2,9 @@ package com.gic.haoban.manage.service.service.out.impl;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -39,12 +41,38 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
private StaffService staffService;
@Autowired
private StaffMapper staffMapper;
@Autowired
private EnterpriseService enterpriseService;
//获取门店详情
public boolean isEnterpriseOver(String eid) {
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(eid);
if(enterprise == null || enterprise.getExpireTime() == null){
return false;
}
if(enterprise.getExpireTime().getTime() > System.currentTimeMillis()){
return false;
}
return true;
}
@Override
public List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId(
String wxEnterpriseId) {
List<TabHaobanWxEnterpriseRelated> relatedList = wxEnterpriseRelatedMapper.listByWxenterpriseId(wxEnterpriseId);
List<EnterpriseDetailDTO> result = EntityUtil.changeEntityListByJSON(EnterpriseDetailDTO.class, relatedList);
if (CollectionUtils.isEmpty(result)){
return result;
}
return result.stream().filter(dto->{
boolean over = isEnterpriseOver(dto.getEnterpriseId());
return !over;
}).collect(Collectors.toList());
// for (EnterpriseDetailDTO enterpriseDetailDTO : result) {
// String enterpriseId = enterpriseDetailDTO.getEnterpriseId();
// int gicAllCount = storeGroupService.gicDepartmentCount(enterpriseId);
......@@ -53,7 +81,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
// int nodeCount = gicAllCount - syncCount;
// enterpriseDetailDTO.setNodeCount(nodeCount);
// }
return result;
// return result;
}
// public int getNodeCount(String enterpriseId,String parentId,int type) {
......
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