添加xxljob日志打印,排除用户名为空的数据

This commit is contained in:
xiaodong.hu
2023-07-14 18:10:35 +08:00
parent aab46306de
commit 7156ff6455
3 changed files with 11 additions and 10 deletions

View File

@@ -55,13 +55,13 @@
SELECT a.id as id, a.username as customername,a.mobile as customermobile,d.`name` as followname,d.mobile as followmobile ,c.channel_id as channelId FROM hy_partner_user_info a LEFT join hy_partner_line_info b on
a.partner_id=b.partner_id LEFT join hy_partner_user_channel c on b.user_channel_id=c.channel_id left join enterprise_user d on b.investment_manager=d.user_id
WHERE ( a.create_time BETWEEN #{selectTime} and #{now} or
a.update_time BETWEEN #{selectTime} and #{now} ) order by a.id Limit #{limit1},#{limit2}
a.update_time BETWEEN #{selectTime} and #{now} ) and a.username is not null order by a.id Limit #{limit1},#{limit2}
</select>
<select id="selectByHourDateCount" resultType="java.lang.Integer">
SELECT count(*) FROM hy_partner_user_info a LEFT join hy_partner_line_info b on
a.partner_id=b.partner_id LEFT join hy_partner_user_channel c on b.user_channel_id=c.channel_id left join enterprise_user d on b.investment_manager=d.user_id
WHERE (a.create_time BETWEEN #{selectTime} and #{now} or
a.update_time BETWEEN #{selectTime} and #{now} )
a.update_time BETWEEN #{selectTime} and #{now} ) and a.username is not null
</select>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">

View File

@@ -59,8 +59,10 @@ public class EcSyncDataJob {
//定时同步小程序数据到ec
private void syncAppletToEcExecute() {
String startTime = getHourDayDate(-5, 0);
String endTime = DateUtil.now();
//获取总数
int size = hyPartnerUserInfoMapper.selectByHourDateCount(getHourDayDate(-5, 0), DateUtil.now());
int size = hyPartnerUserInfoMapper.selectByHourDateCount(startTime, endTime);
//执行数
int counts = size / count;
//取余如果大于1就再加一
@@ -68,8 +70,10 @@ public class EcSyncDataJob {
if (yu > 0) {
counts += 1;
}
XxlJobHelper.log("开始时间为:" + startTime+",结束时间为:"+endTime);
for (int i = 1; i <= counts; i++) {
List<SyncEcCustomerDO> list = hyPartnerUserInfoMapper.selectByHourDate(getHourDayDate(-5, 0), DateUtil.now(),count * (i - 1),count);
XxlJobHelper.log("执行limit1" + count * (i - 1)+"执行limit2"+count);
List<SyncEcCustomerDO> list = hyPartnerUserInfoMapper.selectByHourDate(startTime, endTime,count * (i - 1),count);
SyncEcCustomerRequest syncEcCustomerRequest = new SyncEcCustomerRequest();
syncEcCustomerRequest.setParameter(list);
EcClient ecClient = new EcClient();

View File

@@ -114,14 +114,11 @@ public class EcSyncServiceImpl implements EcSyncService {
HyPartnerUserChannelDO hyPartnerUserChannelDO = hyPartnerUserChannelMapper.selectByChannelName(channel);
Long channelId =null;
if (StringUtil.isNotEmpty(channel)) {
if (ObjectUtil.isNull(hyPartnerUserChannelDO)||ObjectUtil.isNull(hyPartnerUserChannelDO.getId())) {
if (ObjectUtil.isNull(hyPartnerUserChannelDO)||ObjectUtil.isNull(hyPartnerUserChannelDO.getChannelId())) {
getChannelSource();
HyPartnerUserChannelDO channelDO = hyPartnerUserChannelMapper.selectByChannelName(channel);
channelId=channelDO.getChannelId();
}else {
HyPartnerUserChannelDO channelDO = hyPartnerUserChannelMapper.selectByChannelName(channel);
channelId=channelDO.getChannelId();
}
HyPartnerUserChannelDO channelDO = hyPartnerUserChannelMapper.selectByChannelName(channel);
channelId=channelDO.getChannelId();
}
String newPartnerId = UUIDUtils.get32UUID();
HyPartnerUserInfoDO resultUser = new HyPartnerUserInfoDO();