2025-03-23 08:39:16 +08:00
|
|
|
|
package com.hzs.third.job;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import com.hzs.common.core.domain.R;
|
|
|
|
|
import com.hzs.common.domain.member.ext.CuMemberExt;
|
|
|
|
|
import com.hzs.member.account.IMemberJobServiceApi;
|
|
|
|
|
import com.hzs.member.base.IMemberServiceApi;
|
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 会员模块定时任务
|
|
|
|
|
*/
|
|
|
|
|
@ConditionalOnProperty(name = "xxl-job.start", havingValue = "true")
|
|
|
|
|
@Component
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class CuMemberJob {
|
|
|
|
|
|
|
|
|
|
@DubboReference
|
2025-05-20 15:32:33 +08:00
|
|
|
|
IMemberJobServiceApi iMemberJobServiceApi;
|
2025-03-23 08:39:16 +08:00
|
|
|
|
@DubboReference
|
2025-05-20 15:32:33 +08:00
|
|
|
|
IMemberServiceApi iMemberServiceApi;
|
2025-03-23 08:39:16 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 定时插入账户详情数据
|
|
|
|
|
*/
|
|
|
|
|
@XxlJob("insertAccountDetail")
|
|
|
|
|
public void insertAccountDetail() {
|
2025-05-20 15:32:33 +08:00
|
|
|
|
iMemberJobServiceApi.insertAccountDetail();
|
2025-03-23 08:39:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-05-20 15:32:33 +08:00
|
|
|
|
* 每月月初定时删除上上个月的数据
|
2025-03-23 08:39:16 +08:00
|
|
|
|
*/
|
2025-05-20 15:32:33 +08:00
|
|
|
|
@XxlJob("deleteAccountDetailByMonth")
|
|
|
|
|
public void deleteAccountDetailByMonth() {
|
|
|
|
|
iMemberJobServiceApi.deleteAccountDetailByMonth();
|
2025-03-23 08:39:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@XxlJob("sendPlaceErrorMsg")
|
|
|
|
|
public void sendPlaceErrorMsg() {
|
2025-05-20 15:32:33 +08:00
|
|
|
|
List<CuMemberExt> cuMemberList = iMemberServiceApi.queryPlaceErrorCode().getData();
|
2025-03-23 08:39:16 +08:00
|
|
|
|
if (CollectionUtil.isNotEmpty(cuMemberList)) {
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
for (CuMemberExt cuMemberExt : cuMemberList) {
|
|
|
|
|
Long pkPlaceParent = cuMemberExt.getPkPlaceParent();
|
|
|
|
|
Integer placeDept = cuMemberExt.getPlaceDept();
|
|
|
|
|
sb.append("会员ID: ").append(pkPlaceParent).append(" ,部门: ").append(placeDept).append(" ,");
|
|
|
|
|
}
|
|
|
|
|
sb.append("结算错误,安置有问题");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提前四个月自动服务协议有效期续期一年
|
|
|
|
|
*/
|
|
|
|
|
@XxlJob("updateMemberWhiteExpireDate")
|
|
|
|
|
public void updateMemberExpireDate() {
|
2025-05-20 15:32:33 +08:00
|
|
|
|
R<?> result = iMemberServiceApi.updateMemberExpireDate();
|
2025-03-23 08:39:16 +08:00
|
|
|
|
if (!result.isSuccess()) {
|
|
|
|
|
log.error("提前四个月自动服务协议有效期续期一年,{}", result.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-24 14:00:41 +08:00
|
|
|
|
/**
|
|
|
|
|
* 清除7天前0元会员
|
|
|
|
|
*/
|
|
|
|
|
@XxlJob("clearZeroMember")
|
|
|
|
|
public void clearZeroMember() {
|
|
|
|
|
R<?> result = iMemberJobServiceApi.clearZeroMember();
|
|
|
|
|
if (!result.isSuccess()) {
|
|
|
|
|
log.error("清除7天前0元会员失败,{}", result.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-23 08:39:16 +08:00
|
|
|
|
}
|