Merge branch 'dev' of http://62.234.217.137:3000/Big-Data-Lab/CET-cmd-2.0 into dev
This commit is contained in:
commit
4266d351c4
|
@ -13,11 +13,11 @@ import lombok.experimental.Accessors;
|
|||
* @Date: 2024/09/09/20:45
|
||||
* @Description:
|
||||
*/
|
||||
@TableName("cet_4_20240907")
|
||||
@TableName("cet_6_copy1")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="cet_4数据清洗实体类", description="仅用作cet_4数据清洗")
|
||||
@ApiModel(value="cet数据清洗实体类", description="仅用作cet数据清洗")
|
||||
public class CetClean extends Cet_4 {
|
||||
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
if(college.equals("全校")){
|
||||
collect = passedList.stream().collect(Collectors.groupingBy(Cet_4::getCollege));
|
||||
}else{
|
||||
//TODO:majorname为空时存在异常
|
||||
collect = passedList.stream().collect(Collectors.groupingBy(Cet_4::getMajorname));
|
||||
}
|
||||
|
||||
|
@ -591,7 +592,9 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
if (getRateByEntryDateDtoParams.getMajor() != null && !getRateByEntryDateDtoParams.getMajor().isEmpty()) {
|
||||
cet4StudentCount.eq(Cet_4::getMajorname, getRateByEntryDateDtoParams.getMajor());
|
||||
}
|
||||
long allStudentCount = cet4Mapper.selectCount(cet4StudentCount);
|
||||
cet4StudentCount.groupBy(Cet_4::getCode);
|
||||
List<Object> allStudentList = cet4Mapper.selectObjs(cet4StudentCount);
|
||||
long allStudentCount = allStudentList.size();
|
||||
// 统计当前 entryDate 下的通过人数
|
||||
//所有参加过四级考试的学生
|
||||
Map<String, Integer> attendMap4 = new HashMap<>();
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package org.jeecg.modules.cet.clean;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.modules.entity.CetClean;
|
||||
import org.jeecg.modules.entity.Cet_4;
|
||||
import org.jeecg.modules.mapper.CetCleanMapper;
|
||||
import org.jeecg.modules.mapper.Cet_4Mapper;
|
||||
import org.jeecg.modules.service.CetCleanService;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = JeecgSystemApplication.class)
|
||||
public class CetCleanTest {
|
||||
@Autowired
|
||||
private CetCleanMapper cetCleanMapper;
|
||||
@Autowired
|
||||
private Cet_4Mapper cet4Mapper;
|
||||
|
||||
@Test
|
||||
public void cleanData() {
|
||||
LambdaQueryWrapper<Cet_4> actualQueryWrapper = Wrappers.lambdaQuery(Cet_4.class)
|
||||
.select(Cet_4::getCollege)
|
||||
.groupBy(Cet_4::getCollege);
|
||||
List<Cet_4> cet4s = cet4Mapper.selectList(actualQueryWrapper);
|
||||
List<String> collegeList = cet4s.stream()
|
||||
.map(Cet_4::getCollege)
|
||||
.collect(Collectors.toList());
|
||||
LambdaUpdateWrapper<CetClean> cleanUpdateWrapper = Wrappers.lambdaUpdate(CetClean.class)
|
||||
.notIn(CetClean::getCollege, collegeList);
|
||||
cetCleanMapper.delete(cleanUpdateWrapper);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue