Commit ac5c2a54 by 墨竹

fix:收费改为消息队列

parent 723e82ff
...@@ -23,7 +23,17 @@ public interface HaobanQywxFeeApiService { ...@@ -23,7 +23,17 @@ public interface HaobanQywxFeeApiService {
* @author mozhu * @author mozhu
* @date 2022-08-03 17:28:56 * @date 2022-08-03 17:28:56
*/ */
void insert(String param); void run(String param);
/**
* "routerName": "qywxAddFeeMq"
*
* @param wxEnterpriseId wx企业id
* @author mozhu
* @date 2022-08-11 14:38:50
*/
void addFee(String wxEnterpriseId);
/** /**
......
...@@ -11,6 +11,7 @@ import com.gic.dubbo.entity.ProviderLocalTag; ...@@ -11,6 +11,7 @@ import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.constants.Manage3Constants; import com.gic.haoban.manage.api.constants.Manage3Constants;
import com.gic.haoban.manage.api.dto.AlertMessageDTO; import com.gic.haoban.manage.api.dto.AlertMessageDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeAccountInterceptLogDTO; import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeAccountInterceptLogDTO;
import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO; import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO;
...@@ -31,6 +32,7 @@ import com.gic.wechat.api.dto.qywx.fee.*; ...@@ -31,6 +32,7 @@ import com.gic.wechat.api.dto.qywx.fee.*;
import com.gic.wechat.api.dto.qywx.fee.qdto.FeeOrderListQDTO; import com.gic.wechat.api.dto.qywx.fee.qdto.FeeOrderListQDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -64,201 +66,215 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService { ...@@ -64,201 +66,215 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
private HaobanQywxFeeAccountInterceptLogService haobanQywxFeeAccountInterceptLogService; private HaobanQywxFeeAccountInterceptLogService haobanQywxFeeAccountInterceptLogService;
@Override @Override
public void insert(String param) { public void run(String param) {
List<TabHaobanWxEnterprise> tabHaobanWxEnterprises = wxEnterpriseService.listAll(); List<TabHaobanWxEnterprise> tabHaobanWxEnterprises = wxEnterpriseService.listAll();
String serviceCorpid = config.getCorpid();
for (TabHaobanWxEnterprise wxEnterprise : tabHaobanWxEnterprises) { for (TabHaobanWxEnterprise wxEnterprise : tabHaobanWxEnterprises) {
String wxEnterpriseId = wxEnterprise.getWxEnterpriseId(); GicMQClient instance = GICMQClientUtil.getClientInstance();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); try {
String corpid = qwDTO.getThirdCorpid(); instance.sendMessage("addFeeMq", wxEnterprise.getWxEnterpriseId());
String autoActiveStatus = qywxUserApiService.getAutoActiveStatus(corpid, serviceCorpid); } catch (Exception e) {
if (!"1".equals(autoActiveStatus)) { logger.info("发送消息处理异常:{}", e.getMessage(),e);
logger.info("未开启自动激活:{}", corpid);
wxEnterpriseService.updateAutoActiveFlagById(0, wxEnterpriseId);
continue;
} }
logger.info("企微收费:{},{}", corpid, wxEnterpriseId); }
}
//更新订单 @Override
List<String> orderIds = new ArrayList<>(); public void addFee(String wxEnterpriseId) {
while (true) { if (StringUtils.isBlank(wxEnterpriseId)) {
FeeOrderListQDTO feeOrderListQDTO = new FeeOrderListQDTO(); logger.error("wx企业id为空");
feeOrderListQDTO.setCorpid(corpid); return;
feeOrderListQDTO.setLimit(Manage3Constants.QW_LIMIT); }
FeeOrderResponseList feeOrderResponseList = qywxUserApiService.listOrder(corpid, serviceCorpid, feeOrderListQDTO); String serviceCorpid = config.getCorpid();
int errcode = feeOrderResponseList.getErrcode(); WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
if (errcode != 0) { WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
logger.error("查询订单列表失败:{}", feeOrderResponseList.getErrmsg()); String corpid = qwDTO.getThirdCorpid();
break; String corpName = wxEnterpriseDTO.getCorpName();
} String autoActiveStatus = qywxUserApiService.getAutoActiveStatus(corpid, serviceCorpid);
for (FeeOrderResponseList.OrderListDTO orderListDTO : feeOrderResponseList.getOrderList()) { if (!"1".equals(autoActiveStatus)) {
orderIds.add(orderListDTO.getOrderId()); logger.info("未开启自动激活:{}", corpid);
} wxEnterpriseService.updateAutoActiveFlagById(0, wxEnterpriseId);
Integer hasMore = feeOrderResponseList.getHasMore(); return;
if (hasMore == 0) { }
logger.error("订单无更多账号"); logger.info("企微收费:{},{}", corpid, wxEnterpriseId);
break;
} //更新订单
feeOrderListQDTO.setCursor(feeOrderResponseList.getNextCursor()); List<String> orderIds = new ArrayList<>();
feeOrderResponseList = qywxUserApiService.listOrder(corpid, serviceCorpid, feeOrderListQDTO); while (true) {
for (FeeOrderResponseList.OrderListDTO orderListDTO : feeOrderResponseList.getOrderList()) { FeeOrderListQDTO feeOrderListQDTO = new FeeOrderListQDTO();
orderIds.add(orderListDTO.getOrderId()); feeOrderListQDTO.setCorpid(corpid);
} feeOrderListQDTO.setLimit(Manage3Constants.QW_LIMIT);
FeeOrderResponseList feeOrderResponseList = qywxUserApiService.listOrder(corpid, serviceCorpid, feeOrderListQDTO);
int errcode = feeOrderResponseList.getErrcode();
if (errcode != 0) {
logger.error("查询订单列表失败:{}", feeOrderResponseList.getErrmsg());
break;
}
for (FeeOrderResponseList.OrderListDTO orderListDTO : feeOrderResponseList.getOrderList()) {
orderIds.add(orderListDTO.getOrderId());
}
Integer hasMore = feeOrderResponseList.getHasMore();
if (hasMore == 0) {
logger.error("订单无更多账号");
break;
} }
feeOrderListQDTO.setCursor(feeOrderResponseList.getNextCursor());
feeOrderResponseList = qywxUserApiService.listOrder(corpid, serviceCorpid, feeOrderListQDTO);
for (FeeOrderResponseList.OrderListDTO orderListDTO : feeOrderResponseList.getOrderList()) {
orderIds.add(orderListDTO.getOrderId());
}
}
List<String> activeCodes = new ArrayList<>(); List<String> activeCodes = new ArrayList<>();
for (String orderId : orderIds) { for (String orderId : orderIds) {
FeeOrderDeatilResponseDTO order = qywxUserApiService.getOrder(corpid, serviceCorpid, orderId); FeeOrderDeatilResponseDTO order = qywxUserApiService.getOrder(corpid, serviceCorpid, orderId);
if (order.getErrcode() != 0) { if (order.getErrcode() != 0) {
logger.error("请求企微失败:{}", orderId); logger.error("请求企微失败:{}", orderId);
break; break;
} }
//插入订单 //插入订单
FeeOrderDeatilResponseDTO.OrderDTO orderDTO = order.getOrder(); FeeOrderDeatilResponseDTO.OrderDTO orderDTO = order.getOrder();
Integer orderStatus = orderDTO.getOrderStatus(); Integer orderStatus = orderDTO.getOrderStatus();
if (orderStatus != 1) { if (orderStatus != 1) {
logger.info("只处理已支付订单:{}", orderId); logger.info("只处理已支付订单:{}", orderId);
continue; continue;
} }
TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder = new TabHaobanQywxFeeOrder(); TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder = new TabHaobanQywxFeeOrder();
tabHaobanQywxFeeOrder.setFeeOrderId(UniqueIdUtils.uniqueLong()); tabHaobanQywxFeeOrder.setFeeOrderId(UniqueIdUtils.uniqueLong());
tabHaobanQywxFeeOrder.setOrderId(orderId); tabHaobanQywxFeeOrder.setOrderId(orderId);
tabHaobanQywxFeeOrder.setCorpId(corpid); tabHaobanQywxFeeOrder.setCorpId(corpid);
tabHaobanQywxFeeOrder.setWxEnterpriseId(wxEnterpriseId); tabHaobanQywxFeeOrder.setWxEnterpriseId(wxEnterpriseId);
tabHaobanQywxFeeOrder.setOrderType(orderDTO.getOrderType()); tabHaobanQywxFeeOrder.setOrderType(orderDTO.getOrderType());
tabHaobanQywxFeeOrder.setOrderStatus(orderStatus); tabHaobanQywxFeeOrder.setOrderStatus(orderStatus);
tabHaobanQywxFeeOrder.setPrice(new BigDecimal(orderDTO.getPrice())); tabHaobanQywxFeeOrder.setPrice(new BigDecimal(orderDTO.getPrice()));
tabHaobanQywxFeeOrder.setBaseCount(orderDTO.getAccountCount().getBaseCount()); tabHaobanQywxFeeOrder.setBaseCount(orderDTO.getAccountCount().getBaseCount());
tabHaobanQywxFeeOrder.setExternalContactCount(orderDTO.getAccountCount().getExternalContactCount()); tabHaobanQywxFeeOrder.setExternalContactCount(orderDTO.getAccountCount().getExternalContactCount());
tabHaobanQywxFeeOrder.setMonths(orderDTO.getAccountDuration().getMonths()); tabHaobanQywxFeeOrder.setMonths(orderDTO.getAccountDuration().getMonths());
tabHaobanQywxFeeOrder.setCreateTime(DateUtil.date(orderDTO.getCreateTime())); tabHaobanQywxFeeOrder.setCreateTime(DateUtil.date(orderDTO.getCreateTime()));
tabHaobanQywxFeeOrder.setPayTime(DateUtil.date(orderDTO.getPayTime())); tabHaobanQywxFeeOrder.setPayTime(DateUtil.date(orderDTO.getPayTime()));
haobanQywxFeeOrderService.insert(tabHaobanQywxFeeOrder); haobanQywxFeeOrderService.insert(tabHaobanQywxFeeOrder);
} }
//更新账号 //更新账号
while (true) { while (true) {
FeeOrderListQDTO feeOrderListQDTO = new FeeOrderListQDTO(); FeeOrderListQDTO feeOrderListQDTO = new FeeOrderListQDTO();
feeOrderListQDTO.setCorpid(corpid); feeOrderListQDTO.setCorpid(corpid);
feeOrderListQDTO.setLimit(Manage3Constants.QW_LIMIT); feeOrderListQDTO.setLimit(Manage3Constants.QW_LIMIT);
AccountListResponseDTO accountListResponseDTO = qywxUserApiService.listActivedAccount(corpid, serviceCorpid, feeOrderListQDTO); AccountListResponseDTO accountListResponseDTO = qywxUserApiService.listActivedAccount(corpid, serviceCorpid, feeOrderListQDTO);
if (accountListResponseDTO.getErrcode() != 0) { if (accountListResponseDTO.getErrcode() != 0) {
logger.info("订单账号列表报错:{}", accountListResponseDTO.getErrmsg()); logger.info("订单账号列表报错:{}", accountListResponseDTO.getErrmsg());
break; break;
} }
List<AccountListDTO> accountList = accountListResponseDTO.getAccountList(); List<AccountListDTO> accountList = accountListResponseDTO.getAccountList();
for (AccountListDTO accountListDTO : accountList) { for (AccountListDTO accountListDTO : accountList) {
activeCodes.add(accountListDTO.getActiveCode()); activeCodes.add(accountListDTO.getActiveCode());
} }
Integer hasMore = accountListResponseDTO.getHasMore(); Integer hasMore = accountListResponseDTO.getHasMore();
if (hasMore == 0) { if (hasMore == 0) {
logger.error("无更多账号"); logger.error("无更多账号");
break; break;
} }
feeOrderListQDTO.setCursor(feeOrderListQDTO.getCursor()); feeOrderListQDTO.setCursor(feeOrderListQDTO.getCursor());
accountListResponseDTO = qywxUserApiService.listActivedAccount(corpid, serviceCorpid, feeOrderListQDTO); accountListResponseDTO = qywxUserApiService.listActivedAccount(corpid, serviceCorpid, feeOrderListQDTO);
for (AccountListDTO accountListDTO : accountListResponseDTO.getAccountList()) { for (AccountListDTO accountListDTO : accountListResponseDTO.getAccountList()) {
activeCodes.add(accountListDTO.getActiveCode()); activeCodes.add(accountListDTO.getActiveCode());
}
} }
}
for (String activeCode : activeCodes) { for (String activeCode : activeCodes) {
ActiveInfoCodeResponseDTO activeInfoCodeResponseDTO = qywxUserApiService.getActiveInfoByCode(corpid, serviceCorpid, activeCode); ActiveInfoCodeResponseDTO activeInfoCodeResponseDTO = qywxUserApiService.getActiveInfoByCode(corpid, serviceCorpid, activeCode);
if (activeInfoCodeResponseDTO.getErrcode() != 0) { if (activeInfoCodeResponseDTO.getErrcode() != 0) {
logger.error("激活码详情报错:{}", activeInfoCodeResponseDTO.getErrmsg()); logger.error("激活码详情报错:{}", activeInfoCodeResponseDTO.getErrmsg());
continue; continue;
} }
String userid = activeInfoCodeResponseDTO.getUserid(); String userid = activeInfoCodeResponseDTO.getUserid();
TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount = new TabHaobanQywxFeeOrderAccount(); TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount = new TabHaobanQywxFeeOrderAccount();
tabHaobanQywxFeeOrderAccount.setFeeAccountId(UniqueIdUtils.uniqueLong()); tabHaobanQywxFeeOrderAccount.setFeeAccountId(UniqueIdUtils.uniqueLong());
//tabHaobanQywxFeeOrderAccount.setOrderId(); //tabHaobanQywxFeeOrderAccount.setOrderId();
tabHaobanQywxFeeOrderAccount.setCorpId(corpid); tabHaobanQywxFeeOrderAccount.setCorpId(corpid);
tabHaobanQywxFeeOrderAccount.setWxEnterpriseId(wxEnterpriseId); tabHaobanQywxFeeOrderAccount.setWxEnterpriseId(wxEnterpriseId);
tabHaobanQywxFeeOrderAccount.setWxUserId(userid); tabHaobanQywxFeeOrderAccount.setWxUserId(userid);
tabHaobanQywxFeeOrderAccount.setActiveCode(activeInfoCodeResponseDTO.getActiveCode()); tabHaobanQywxFeeOrderAccount.setActiveCode(activeInfoCodeResponseDTO.getActiveCode());
tabHaobanQywxFeeOrderAccount.setAccountType(activeInfoCodeResponseDTO.getType()); tabHaobanQywxFeeOrderAccount.setAccountType(activeInfoCodeResponseDTO.getType());
tabHaobanQywxFeeOrderAccount.setStatus(activeInfoCodeResponseDTO.getStatus()); tabHaobanQywxFeeOrderAccount.setStatus(activeInfoCodeResponseDTO.getStatus());
tabHaobanQywxFeeOrderAccount.setExpireTime(DateUtil.date(activeInfoCodeResponseDTO.getExpireTime())); tabHaobanQywxFeeOrderAccount.setExpireTime(DateUtil.date(activeInfoCodeResponseDTO.getExpireTime()));
tabHaobanQywxFeeOrderAccount.setActiveTime(DateUtil.date(activeInfoCodeResponseDTO.getActiveTime())); tabHaobanQywxFeeOrderAccount.setActiveTime(DateUtil.date(activeInfoCodeResponseDTO.getActiveTime()));
haobanQywxFeeOrderAccountService.insert(tabHaobanQywxFeeOrderAccount); haobanQywxFeeOrderAccountService.insert(tabHaobanQywxFeeOrderAccount);
//更新成员 //更新成员
ActiveInfoUserResponseDTO activeInfoUserResponseDTO = qywxUserApiService.getActiveInfoByUser(corpid, serviceCorpid, userid); ActiveInfoUserResponseDTO activeInfoUserResponseDTO = qywxUserApiService.getActiveInfoByUser(corpid, serviceCorpid, userid);
if (activeInfoUserResponseDTO.getErrcode() != 0) { if (activeInfoUserResponseDTO.getErrcode() != 0) {
logger.info("成员激活详情报错:{}", activeInfoUserResponseDTO.getErrmsg()); logger.info("成员激活详情报错:{}", activeInfoUserResponseDTO.getErrmsg());
break; break;
} }
List<AccountListDTO> activeInfoList = activeInfoUserResponseDTO.getActiveInfoList(); List<AccountListDTO> activeInfoList = activeInfoUserResponseDTO.getActiveInfoList();
Integer activeStatus = activeInfoUserResponseDTO.getActiveStatus(); Integer activeStatus = activeInfoUserResponseDTO.getActiveStatus();
TabHaobanStaff tabHaobanStaff = staffService.selectByUserIdAndEnterpriseId(userid, wxEnterpriseId); TabHaobanStaff tabHaobanStaff = staffService.selectByUserIdAndEnterpriseId(userid, wxEnterpriseId);
for (AccountListDTO accountListDTO : activeInfoList) { for (AccountListDTO accountListDTO : activeInfoList) {
TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff = new TabHaobanQywxFeeAccountStaff(); TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff = new TabHaobanQywxFeeAccountStaff();
tabHaobanQywxFeeAccountStaff.setFeeAccountStaffId(UniqueIdUtils.uniqueLong()); tabHaobanQywxFeeAccountStaff.setFeeAccountStaffId(UniqueIdUtils.uniqueLong());
//tabHaobanQywxFeeAccountStaff.setOrderId(); //tabHaobanQywxFeeAccountStaff.setOrderId();
tabHaobanQywxFeeAccountStaff.setCorpId(corpid); tabHaobanQywxFeeAccountStaff.setCorpId(corpid);
tabHaobanQywxFeeAccountStaff.setWxEnterpriseId(wxEnterpriseId); tabHaobanQywxFeeAccountStaff.setWxEnterpriseId(wxEnterpriseId);
tabHaobanQywxFeeAccountStaff.setWxUserId(userid); tabHaobanQywxFeeAccountStaff.setWxUserId(userid);
if (tabHaobanStaff != null) {
String staffId = tabHaobanStaff.getStaffId();
tabHaobanQywxFeeAccountStaff.setStaffId(staffId);
}
tabHaobanQywxFeeAccountStaff.setActiveCode(accountListDTO.getActiveCode());
tabHaobanQywxFeeAccountStaff.setAccountType(accountListDTO.getType());
tabHaobanQywxFeeAccountStaff.setExpireTime(DateUtil.date(accountListDTO.getExpireTime()));
tabHaobanQywxFeeAccountStaff.setActiveTime(DateUtil.date(accountListDTO.getActiveTime()));
haobanQywxFeeAccountStaffService.insert(tabHaobanQywxFeeAccountStaff);
}
if (tabHaobanStaff != null) { if (tabHaobanStaff != null) {
String staffId = tabHaobanStaff.getStaffId(); String staffId = tabHaobanStaff.getStaffId();
staffService.updateActiveStatusById(activeStatus, staffId); tabHaobanQywxFeeAccountStaff.setStaffId(staffId);
} }
tabHaobanQywxFeeAccountStaff.setActiveCode(accountListDTO.getActiveCode());
tabHaobanQywxFeeAccountStaff.setAccountType(accountListDTO.getType());
tabHaobanQywxFeeAccountStaff.setExpireTime(DateUtil.date(accountListDTO.getExpireTime()));
tabHaobanQywxFeeAccountStaff.setActiveTime(DateUtil.date(accountListDTO.getActiveTime()));
haobanQywxFeeAccountStaffService.insert(tabHaobanQywxFeeAccountStaff);
}
if (tabHaobanStaff != null) {
String staffId = tabHaobanStaff.getStaffId();
staffService.updateActiveStatusById(activeStatus, staffId);
} }
}
//更新企微状态 //更新企微状态
wxEnterpriseService.updateAutoActiveFlagById(1, wxEnterpriseId); wxEnterpriseService.updateAutoActiveFlagById(1, wxEnterpriseId);
//更新收费 //更新收费
HaobanQywxFeeDetailDTO haobanQywxFeeDetailDTO = haobanQywxFeeAccountStaffService.feeIntercept(wxEnterpriseId); HaobanQywxFeeDetailDTO haobanQywxFeeDetailDTO = haobanQywxFeeAccountStaffService.feeIntercept(wxEnterpriseId);
if (haobanQywxFeeDetailDTO != null) { if (haobanQywxFeeDetailDTO != null) {
TabHaobanQywxFee tabHaobanQywxFee = new TabHaobanQywxFee(); TabHaobanQywxFee tabHaobanQywxFee = new TabHaobanQywxFee();
tabHaobanQywxFee.setQwFeeId(UniqueIdUtils.uniqueLong()); tabHaobanQywxFee.setQwFeeId(UniqueIdUtils.uniqueLong());
tabHaobanQywxFee.setCorpName(wxEnterprise.getCorpName()); tabHaobanQywxFee.setCorpName(corpName);
tabHaobanQywxFee.setCorpId(corpid); tabHaobanQywxFee.setCorpId(corpid);
tabHaobanQywxFee.setWxEnterpriseId(wxEnterpriseId); tabHaobanQywxFee.setWxEnterpriseId(wxEnterpriseId);
tabHaobanQywxFee.setInterceptTime(haobanQywxFeeDetailDTO.getInterceptTime()); tabHaobanQywxFee.setInterceptTime(haobanQywxFeeDetailDTO.getInterceptTime());
tabHaobanQywxFee.setInterceptUserNum(haobanQywxFeeDetailDTO.getInterceptUserNum()); tabHaobanQywxFee.setInterceptUserNum(haobanQywxFeeDetailDTO.getInterceptUserNum());
tabHaobanQywxFee.setPermissionUserNum(haobanQywxFeeOrderAccountService.countOrderAccountStatus(1, wxEnterpriseId)); tabHaobanQywxFee.setPermissionUserNum(haobanQywxFeeOrderAccountService.countOrderAccountStatus(1, wxEnterpriseId));
tabHaobanQywxFee.setBuyPermissionUserNum(haobanQywxFeeOrderService.countExternalContactCount(wxEnterpriseId)); tabHaobanQywxFee.setBuyPermissionUserNum(haobanQywxFeeOrderService.countExternalContactCount(wxEnterpriseId));
tabHaobanQywxFee.setInterceptFlag(0); tabHaobanQywxFee.setInterceptFlag(0);
haobanQywxFeeService.insert(tabHaobanQywxFee); haobanQywxFeeService.insert(tabHaobanQywxFee);
//告警 //告警
messageAlert(wxEnterpriseId, wxEnterprise.getCorpName(), corpid, AlertTypeEnum.FEE_ALARM.getName()); messageAlert(wxEnterpriseId, corpName, corpid, AlertTypeEnum.FEE_ALARM.getName());
} }
List<TabHaobanQywxFeeAccountInterceptLog> tabHaobanQywxFeeAccountInterceptLogs = haobanQywxFeeAccountInterceptLogService.queryByWxEnterpriseId(wxEnterpriseId); List<TabHaobanQywxFeeAccountInterceptLog> tabHaobanQywxFeeAccountInterceptLogs = haobanQywxFeeAccountInterceptLogService.queryByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isNotEmpty(tabHaobanQywxFeeAccountInterceptLogs)) { if (CollectionUtils.isNotEmpty(tabHaobanQywxFeeAccountInterceptLogs)) {
TabHaobanQywxFee tabHaobanQywxFee = new TabHaobanQywxFee(); TabHaobanQywxFee tabHaobanQywxFee = new TabHaobanQywxFee();
tabHaobanQywxFee.setQwFeeId(UniqueIdUtils.uniqueLong()); tabHaobanQywxFee.setQwFeeId(UniqueIdUtils.uniqueLong());
tabHaobanQywxFee.setCorpName(wxEnterprise.getCorpName()); tabHaobanQywxFee.setCorpName(corpName);
tabHaobanQywxFee.setCorpId(corpid); tabHaobanQywxFee.setCorpId(corpid);
tabHaobanQywxFee.setWxEnterpriseId(wxEnterpriseId); tabHaobanQywxFee.setWxEnterpriseId(wxEnterpriseId);
tabHaobanQywxFee.setInterceptTime(DateUtil.offsetDay(new Date(), -1)); tabHaobanQywxFee.setInterceptTime(DateUtil.offsetDay(new Date(), -1));
tabHaobanQywxFee.setInterceptUserNum(tabHaobanQywxFeeAccountInterceptLogs.size()); tabHaobanQywxFee.setInterceptUserNum(tabHaobanQywxFeeAccountInterceptLogs.size());
tabHaobanQywxFee.setPermissionUserNum(haobanQywxFeeOrderAccountService.countOrderAccountStatus(1, wxEnterpriseId)); tabHaobanQywxFee.setPermissionUserNum(haobanQywxFeeOrderAccountService.countOrderAccountStatus(1, wxEnterpriseId));
tabHaobanQywxFee.setBuyPermissionUserNum(haobanQywxFeeOrderService.countExternalContactCount(wxEnterpriseId)); tabHaobanQywxFee.setBuyPermissionUserNum(haobanQywxFeeOrderService.countExternalContactCount(wxEnterpriseId));
tabHaobanQywxFee.setInterceptFlag(1); tabHaobanQywxFee.setInterceptFlag(1);
haobanQywxFeeService.insert(tabHaobanQywxFee); haobanQywxFeeService.insert(tabHaobanQywxFee);
}
} }
} }
@Override @Override
public Page<HaobanQywxFeeDTO> listPage(QywxFeeListQDTO qywxFeeListQDTO) { public Page<HaobanQywxFeeDTO> listPage(QywxFeeListQDTO qywxFeeListQDTO) {
Page<HaobanQywxFeeBO> haobanQywxFeeBOS = haobanQywxFeeService.listPage(qywxFeeListQDTO); Page<HaobanQywxFeeBO> haobanQywxFeeBOS = haobanQywxFeeService.listPage(qywxFeeListQDTO);
......
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