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;
|
||||
|
||||
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.mapper.KcTksfyqMapper;
|
||||
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 java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 听课身份要求
|
||||
* @Author: jeecg-boot
|
||||
|
@ -19,9 +24,20 @@ public class KcTksfyqServiceImpl extends ServiceImpl<KcTksfyqMapper, KcTksfyq> i
|
|||
|
||||
@Override
|
||||
public void saveOrEdit(KcTksfyq kcTksfyq) {
|
||||
QueryWrapper<KcTksfyq> qw = new QueryWrapper<>();
|
||||
qw.eq("zwmc",kcTksfyq.getZwmc());
|
||||
remove(qw);
|
||||
save(kcTksfyq);
|
||||
//结构名称
|
||||
if(StringUtils.isNotBlank(kcTksfyq.getZwmc())){
|
||||
List<String> zwmcs = Arrays.asList(kcTksfyq.getZwmc().split(","));
|
||||
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