2023年7月18日 修改批量修改听课要求
This commit is contained in:
parent
333ae01d15
commit
ceed5f5c2d
|
@ -1,6 +1,7 @@
|
||||||
package org.jeecg.modules.kc.tksf.kctksfyq.service.impl;
|
package org.jeecg.modules.kc.tksf.kctksfyq.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.modules.kc.tksf.kctksfyq.entity.KcTksfyq;
|
import org.jeecg.modules.kc.tksf.kctksfyq.entity.KcTksfyq;
|
||||||
import org.jeecg.modules.kc.tksf.kctksfyq.mapper.KcTksfyqMapper;
|
import org.jeecg.modules.kc.tksf.kctksfyq.mapper.KcTksfyqMapper;
|
||||||
import org.jeecg.modules.kc.tksf.kctksfyq.service.IKcTksfyqService;
|
import org.jeecg.modules.kc.tksf.kctksfyq.service.IKcTksfyqService;
|
||||||
|
@ -8,6 +9,10 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 听课身份要求
|
* @Description: 听课身份要求
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
|
@ -19,9 +24,20 @@ public class KcTksfyqServiceImpl extends ServiceImpl<KcTksfyqMapper, KcTksfyq> i
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveOrEdit(KcTksfyq kcTksfyq) {
|
public void saveOrEdit(KcTksfyq kcTksfyq) {
|
||||||
QueryWrapper<KcTksfyq> qw = new QueryWrapper<>();
|
//结构名称
|
||||||
qw.eq("zwmc",kcTksfyq.getZwmc());
|
if(StringUtils.isNotBlank(kcTksfyq.getZwmc())){
|
||||||
remove(qw);
|
List<String> zwmcs = Arrays.asList(kcTksfyq.getZwmc().split(","));
|
||||||
save(kcTksfyq);
|
QueryWrapper<KcTksfyq> qw = new QueryWrapper<>();
|
||||||
|
qw.in("zwmc",zwmcs);
|
||||||
|
remove(qw);
|
||||||
|
zwmcs.forEach(x -> {
|
||||||
|
kcTksfyq.setZwmc(x);
|
||||||
|
kcTksfyq.setId(null);
|
||||||
|
save(kcTksfyq);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue