Commit f182ee34 authored by suhuiguang's avatar suhuiguang

1.增加日志打印及自动任务调整为没1分钟执行一次

parent beb45ea3
......@@ -235,18 +235,27 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return model;
}
@Scheduled(cron = "* 0/1 * * * ?")
@Scheduled(cron = "${async.set.qr-code.cron:0 0/1 * * * ?}")
public void asyncSetQrCode(){
//给所有新注册的企业创建二维码,每次处理100个,不排序
if(log.isDebugEnabled()){
log.debug("新注册企业二维码生成开始");
}
LambdaQueryWrapper<TzBaseEnterpriseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.notLike(TzBaseEnterpriseInfo::getQrCode,"upload");
wrapper.last("limit 100");
List<TzBaseEnterpriseInfo> noQrCodeList = tzBaseEnterpriseInfoMapper.selectList(wrapper);
if(noQrCodeList.isEmpty()){
if(log.isDebugEnabled()){
log.debug("暂无待生成二维码的企业");
}
return;
}
noQrCodeList.forEach(e-> e.setQrCode(createQRCode(e.getUseCode())));
tzBaseEnterpriseInfoService.saveOrUpdateBatch(noQrCodeList);
if(log.isDebugEnabled()){
log.debug("新注册企业二维码生成结束");
}
}
private FutureTask<ResponseModel<Boolean>> getResponseModelFutureTask(RegUnitInfoDto model) {
......
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