2023年6月27日 修复定时任务删除数据报错的问题

This commit is contained in:
bai 2023-06-27 20:57:27 +08:00
parent 283943cce7
commit 40123b2375
3 changed files with 30 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.kc.grab.SynchronizationService;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -55,7 +56,6 @@ public class SyncTJwXsxkb extends BaseSync {
boolean isAll = false;
boolean isScope = false;
boolean isToday = false;
if(param != null){
if(param.containsKey("isAll")){
String isAllStr = (String)param.get("isAll");
@ -96,7 +96,7 @@ public class SyncTJwXsxkb extends BaseSync {
// dqw.apply("TIMESTAMPS < str_to_date('"+endDate+"','yyyy-MM-dd')");
}else{
//按天
String nowStr = DateTime.now().toDateStr();
String nowStr = now.toDateStr();
// eqw.between("timestamps","to_date('"+nowStr+" 00:00:00', 'yyyy-MM-dd HH24:MI:SS')","to_date('"+nowStr+" 00:00:00', 'yyyy-MM-dd HH24:MI:SS')");
// dqw.between("timestamps","str_to_date('"+nowStr+"', '%Y-%m-%d')","str_to_date('"+nowStr+"', '%Y-%m-%d')");
eqw.apply("timestamps between to_date('"+nowStr+" 00:00:00', 'yyyy-MM-dd HH24:MI:SS') and to_date('"+nowStr+" 23:59:59', 'yyyy-MM-dd HH24:MI:SS')");
@ -136,7 +136,12 @@ public class SyncTJwXsxkb extends BaseSync {
List<Xxhbxsxkb> outDataList = Lists.newArrayList();
//清洗数据
inDataList.forEach(x -> outDataList.add(BeanUtil.toBean(x, Xxhbxsxkb.class)));
inDataList.forEach(x -> {
Xxhbxsxkb outData = BeanUtil.toBean(x, Xxhbxsxkb.class);
outData.setTimestamps(DateUtil.format(x.getTimestamps(), DatePattern.NORM_DATETIME_PATTERN));
outDataList.add(outData);
});
//保存到胃
int syncnum=0;

View File

@ -65,4 +65,10 @@ public class Xxhbldxx implements Serializable {
@TableField(exist = false)
private Integer mysqlnum;
/**
* 听课要求次数
*/
@TableField(exist = false)
private String tkyq;
}

View File

@ -5,4 +5,20 @@
<select id="getSumnum" resultType="org.jeecg.modules.kc.grab.imports.entity.Xxhbldxx">
select count(*) as mysqlnum from xxhbldxx
</select>
<select id="selectList" resultType="org.jeecg.modules.kc.grab.imports.entity.Xxhbldxx">
select
xxhbldxx.*, b.tkyq
from xxhbldxx
left join kc_tksfyq b on b.zwmc = xxhbldxx.zwmc
${ew.customSqlSegment}
</select>
<select id="selectPage" resultType="org.jeecg.modules.kc.grab.imports.entity.Xxhbldxx">
select
xxhbldxx.*, b.tkyq
from xxhbldxx
left join kc_tksfyq b on b.zwmc = xxhbldxx.zwmc
${ew.customSqlSegment}
</select>
</mapper>