Commit 267e75f3 by zhaopanyu

Merge branch 'master' of 49.232.152.146:qangqi/dd_school

parents c7972b4c b613b7a5
......@@ -80,6 +80,7 @@ public class SchoolTeacherBasiclnformationController extends BaseController {
//1.验证身份证信息是否重复
String idCard = information.getIdCard();
LambdaQueryWrapper<SchoolTeacherBasicInformation> wrapper = Wrappers.lambdaQuery();
wrapper.eq(SchoolTeacherBasicInformation::getDelFlag,"0");
LambdaQueryWrapper<SchoolTeacherBasicInformation> eq = wrapper.eq(SchoolTeacherBasicInformation::getIdCard, idCard);
List<SchoolTeacherBasicInformation> list = basichlnformationService.list(eq);
if (!list.isEmpty()){
......@@ -157,7 +158,10 @@ public class SchoolTeacherBasiclnformationController extends BaseController {
*/
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception {
List<SchoolTeacherBasicInformation> schoolTeacherBasicInformations = basichlnformationService.importExcel(file);
ExcelUtil<SchoolTeacherBasicInformation> util = new ExcelUtil<SchoolTeacherBasicInformation>(SchoolTeacherBasicInformation.class);
List<SchoolTeacherBasicInformation> schoolTeacherBasicInformations = util.importExceltoRow(file.getInputStream(),1);
// List<SchoolTeacherBasicInformation> schoolTeacherBasicInformations = basichlnformationService.importExcel(file);
for (SchoolTeacherBasicInformation date : schoolTeacherBasicInformations){
//1.处理出生日期
String birthDayFromIdCard = IdCardNumberUtils.getBirthDayFromIdCard(date.getIdCard());
......@@ -174,14 +178,8 @@ public class SchoolTeacherBasiclnformationController extends BaseController {
date.setSex("1");
}
}
//处理身份证重复问题
// 根据指定属性分组,并统计数量(key:指定属性,value:数量)
Map<Object, Long> mapGroup = schoolTeacherBasicInformations.stream().collect(Collectors.groupingBy(person -> person.getIdCard(), Collectors.counting()));
Stream<Object> stringStream = mapGroup.entrySet().stream().filter(entry -> entry.getValue() > 1).map(entry -> entry.getKey());
if (stringStream != null){
return AjaxResult.error("身份证信息有重复"+mapGroup.toString());
}
boolean b = basichlnformationService.saveBatch(schoolTeacherBasicInformations);
boolean b = basichlnformationService.saveOrUpdateList(schoolTeacherBasicInformations);
return AjaxResult.success(b);
}
......
package yangtz.cs.liu.campus.domain.schoolNewTeacherDzdn;
import lombok.Data;
/**
* 身份证查询存储对象
*/
@Data
public class SchoolIdCardQuerReq {
/**
* 身份证
*/
private String idCard;
/**
* id
*/
private Long id;
}
......@@ -24,11 +24,13 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
/**
* 姓名
*/
@Excel(name = "姓名",required = true)
private String name;
/**
* 身份证号
*/
@Excel(name = "身份证号",required = true)
private String idCard;
/**
......@@ -45,6 +47,7 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
/**
* 档案出生日期 (年月)
*/
@Excel(name = "档案出生日期")
@JsonFormat(pattern = "yyyy-MM")
private Date fileBirthDate;
......@@ -63,91 +66,108 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
/**
* 籍贯
*/
@Excel(name = "籍贯")
private String hometown;
/**
* 民族
*/
@Excel(name = "民族")
private String nation;
/**
* 政治面貌(1中共党员、2共青团员、3群众、4民主党派成员、5无党派人士)
*/
@Excel(name = "政治面貌",dictType = "politics_tatusls")
private String politicalLandscape;
/**
* 入党时间(年月)
*/
@Excel(name = "入党时间")
@JsonFormat(pattern = "yyyy-MM")
private Date partyMembershipTime;
/**
* 任教学科(1语文、2数学、3英语、4物理、5化学、6生物、7政治、8历史、9地理、10音乐、11体育、12美术、13技术、14心理、15书法)
*/
@Excel(name = "任教学科",dictType = "teaching_subjects",required = true)
private String teachingSubject;
/**
* 现职称(1无、2初级、3中级、4副高、5正高)
*/
@Excel(name = "现职称",dictType = "current_professional")
private String currentProfessionalTitle;
/**
* 现职称取得资格时间
*/
@Excel(name = "现职称取得资格时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date currentProfessionalTitleTime;
/**
* 现聘职称(1无、2初级、3中级、4副高、5正高)
*/
@Excel(name = "现聘职称",dictType = "current_professional")
private String currentHiringProfessionalTitle;
/**
* 现职称聘任时间
*/
@Excel(name = "现职称聘任时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date currentHiringProfessionalTitleTime;
/**
* 现聘岗位(1专业技术岗、2管理岗、3工勤岗)
*/
@Excel(name = "现聘岗位",dictType = "current_position")
private String currentPosition;
/**
* 现岗位等级(见习(三个现聘岗位都有见习这个等级 下拉框联动)、专业技术三级-专业技术十三级、
* 管理五级-管理九级、技术工二级-技术工五级)
*/
@Excel(name = "现岗位等级",dictType = "current_joblevel")
private String currentJobLevel;
/**
* 现岗位等级聘任时间
*/
@Excel(name = "现岗位等级聘任时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date currentJobLevelAppointmentTime;
/**
* 职务
*/
@Excel(name = "职务")
private String duties;
/**
* 教师资格种类
*/
@Excel(name = "教师资格种类")
private String teacherQualificationType;
/**
* 教师资格证号码
*/
@Excel(name = "教师资格证号码")
private String teacherQualificationCertificateNum;
/**
* 参加工作时间
*/
@Excel(name = "参加工作时间")
private String workingHours;
/**
* 到二中工作时间
*/
@Excel(name = "到二中工作时间",required = true)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date toSecondMiddleSchoolTime;
......@@ -176,64 +196,76 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
/**
* 在岗情况(1教学岗位、2教辅岗、3后勤岗、4管理岗、5其他岗、6退休、7行政、8内退岗、9待退岗)
*/
@Excel(name = "在岗情况",dictType ="duty_situation")
private String onDutySituation;
/**
* 在编情况 1在编 2合同制
*/
@Excel(name = "在编情况",dictType ="current_situation")
private String currentSituation;
/**
* 毕业院校1
*/
@Excel(name = "毕业院校1")
private String graduationInstitution1;
/**
* 专业1
*/
@Excel(name = "专业1")
private String major1;
/**
* 毕业时间1 年月
*/
@Excel(name = "毕业时间1")
@JsonFormat(pattern = "yyyy-MM")
private Date graduationTime1;
/**
* 毕业院校2
*/
@Excel(name = "毕业院校2")
private String graduationInstitution2;
/**
* 专业2
*/
@Excel(name = "专业2")
private String major2;
/**
* 毕业时间2年月
*/
@Excel(name = "毕业时间2")
@JsonFormat(pattern = "yyyy-MM")
private Date graduationTime2;
/**
* 毕业院校3
*/
@Excel(name = "毕业院校3")
private String graduationInstitution3;
/**
* 专业3
*/
@Excel(name = "专业3")
private String major3;
/**
* 毕业时间3 年月
*/
@Excel(name = "毕业时间3")
@JsonFormat(pattern = "yyyy-MM")
private Date graduationTime3;
/**
* 第一学历
*/
@Excel(name = "第一学历")
private String firstDegree;
/**
......@@ -244,11 +276,13 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
/**
* 学位
*/
@Excel(name = "学位")
private String degree;
/**
* 工作经历
*/
@Excel(name = "工作经历")
private String workExperience;
/**
......@@ -264,11 +298,13 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
/**
* 钉钉手机号
*/
@Excel(name = "钉钉手机号")
private String ddPhone;
/**
* 备注
*/
@Excel(name = "备注")
private String remark;
//
// /**
......
package yangtz.cs.liu.campus.mapper.schoolNewTeacherDzdn;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.schoolNewTeacherDzdn.SchoolIdCardQuerReq;
import yangtz.cs.liu.campus.domain.schoolNewTeacherDzdn.SchoolTeacherBasicInformation;
import yangtz.cs.liu.campus.domain.schoolNewTeacherDzdn.SchoolTeacherBasicInformationVo;
import java.util.List;
import java.util.Map;
public interface SchoolTeacherBasichlnformationMapper extends BaseMapper<SchoolTeacherBasicInformation> {
......@@ -14,4 +16,6 @@ public interface SchoolTeacherBasichlnformationMapper extends BaseMapper<SchoolT
int updateInformationById(SchoolTeacherBasicInformation information);
List<SchoolIdCardQuerReq> selectByIdCardMap();
}
......@@ -89,6 +89,38 @@ public class SchoolTeacherBasichlnformationServicelmpl extends ServiceImpl<Schoo
}
/**
* 重新更新 新增方法
* @param schoolTeacherBasicInformations
* @return
*/
@Override
public Boolean saveOrUpdateList(List<SchoolTeacherBasicInformation> schoolTeacherBasicInformations) {
//1查询所有老师信息 //与统计 几百条
Map<String,Long> mapList = new HashMap<>();
List<SchoolIdCardQuerReq> schoolIdCardQuerReqs = teacherBasichlnformationMapper.selectByIdCardMap();
for(SchoolIdCardQuerReq req :schoolIdCardQuerReqs){
mapList.put(req.getIdCard(),req.getId());
}
//2.讲数据存储到map中
try {
for (SchoolTeacherBasicInformation date :schoolTeacherBasicInformations){
if ( null != (Long)mapList.get(date.getIdCard())){
//当前身份证号在数据库中存在 已更新的方式进行
date.setId(mapList.get(date.getIdCard()));
teacherBasichlnformationMapper.updateById(date);
}else {
//新增
teacherBasichlnformationMapper.insert(date);
}
}
return true;
}catch (Exception e){
throw new RuntimeException("新导用户信息失败:"+e.getMessage());
}
}
@Override
public SchoolTeacherBasicInformationVo getByIds(Long id) throws ParseException {
......
......@@ -20,6 +20,8 @@ public interface SchoolTeacherBasichlnformationService extends IService<SchoolT
int updateInformationById(SchoolTeacherBasicInformation information);
Boolean saveOrUpdateList( List<SchoolTeacherBasicInformation> schoolTeacherBasicInformations);
/**
* 综合信息查询
* @param
......
......@@ -44,6 +44,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id =#{id} and del_flag = 0
</select>
<select id="selectByIdCardMap" resultType="yangtz.cs.liu.campus.domain.schoolNewTeacherDzdn.SchoolIdCardQuerReq">
select id_card,id from school_teacher_basic_information where del_flag = 0
</select>
<update id="updateInformationById" parameterType="SchoolTeacherBasicInformation">
update school_teacher_basic_information
......
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