Commit 8ed958a7 by jinxin

自动激活许可账号处理

parent 3f5c0614
...@@ -17,4 +17,6 @@ public interface WxEnterpriseActiveDataService { ...@@ -17,4 +17,6 @@ public interface WxEnterpriseActiveDataService {
Integer saveOrUpdate(String wxEnterpriseId); Integer saveOrUpdate(String wxEnterpriseId);
StaffActiveDataDTO getWxEnterpriseActiveDataByWxEnterpriseId(String wxEnterpriseId); StaffActiveDataDTO getWxEnterpriseActiveDataByWxEnterpriseId(String wxEnterpriseId);
void updateByStaffActiveDataDTO(StaffActiveDataDTO dto);
} }
...@@ -124,4 +124,13 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData ...@@ -124,4 +124,13 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
staffActiveDataDTO.setExpiring(expiringNum); staffActiveDataDTO.setExpiring(expiringNum);
return staffActiveDataDTO; return staffActiveDataDTO;
} }
@Override
public void updateByStaffActiveDataDTO(StaffActiveDataDTO dto) {
if (null == dto){
return;
}
TabHaobanWxEnterpriseActiveData tabHaobanWxEnterpriseActiveData = EntityUtil.changeEntityByJSON(TabHaobanWxEnterpriseActiveData.class, dto);
tabHaobanWxEnterpriseActiveDataMapper.updateActiveDataByWxEnterpriseId(tabHaobanWxEnterpriseActiveData);
}
} }
...@@ -119,6 +119,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -119,6 +119,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private DealSyncOperationApiService dealSyncOperationApiService; private DealSyncOperationApiService dealSyncOperationApiService;
@Autowired @Autowired
private ExternalClerkRelatedService externalClerkRelatedService; private ExternalClerkRelatedService externalClerkRelatedService;
@Autowired
private WxEnterpriseActiveDataService wxEnterpriseActiveDataService;
@Override @Override
public StaffDTO selectById(String staffId) { public StaffDTO selectById(String staffId) {
...@@ -1132,7 +1134,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1132,7 +1134,7 @@ public class StaffApiServiceImpl implements StaffApiService {
if (StrUtil.isBlank(params)) { if (StrUtil.isBlank(params)) {
return com.gic.api.base.commons.ServiceResponse.success(false); return com.gic.api.base.commons.ServiceResponse.success(false);
} }
//1、解析参数 2、刷新企业微信群列表 3、更新成员信息 //1、解析参数 2、刷新企业微信群列表 3、更新成员信息 4、实时统计许可总数
JSONObject object = JSONObject.parseObject(params, JSONObject.class); JSONObject object = JSONObject.parseObject(params, JSONObject.class);
String infoType = object.getString("infoType"); String infoType = object.getString("infoType");
String authCorpId = object.getString("authCorpId"); String authCorpId = object.getString("authCorpId");
...@@ -1165,6 +1167,23 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1165,6 +1167,23 @@ public class StaffApiServiceImpl implements StaffApiService {
String staffId = staff.getStaffId(); String staffId = staff.getStaffId();
groupChatService.initStaffGroupChat(staffId); groupChatService.initStaffGroupChat(staffId);
staffMapper.updateActiveStatusById(staffId,timeStampDate,expireTimeDate,activeCode); staffMapper.updateActiveStatusById(staffId,timeStampDate,expireTimeDate,activeCode);
StaffActiveDataDTO activeDataDTO = wxEnterpriseActiveDataService.getWxEnterpriseActiveDataByWxEnterpriseId(wxEnterprise.getWxEnterpriseId());
if (null == activeDataDTO){
logger.info("查询不到企业的许可账号统计信息!");
}
//已使用的加1,已激活的加1,未激活的减1
Integer used = activeDataDTO.getUsed();
Integer inactive = activeDataDTO.getInactive();
Integer activated = activeDataDTO.getActivated();
used++;
activated++;
if(null != inactive && inactive > 0){
inactive--;
}
activeDataDTO.setUsed(used);
activeDataDTO.setInactive(inactive);
activeDataDTO.setActivated(activated);
wxEnterpriseActiveDataService.updateByStaffActiveDataDTO(activeDataDTO);
} }
return com.gic.api.base.commons.ServiceResponse.success(true); return com.gic.api.base.commons.ServiceResponse.success(true);
} }
......
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