|
@@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
@@ -110,11 +111,39 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
|
|
|
queryWrapper.eq("a.practice_office",projectReportData.getPracticeOffice());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getMobilePhone())) {
|
|
|
- queryWrapper.eq("a.mobile_phone",projectReportData.getMobilePhone());
|
|
|
+ queryWrapper.like("a.mobile_phone",projectReportData.getMobilePhone());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getName())) {
|
|
|
queryWrapper.like("a.name",projectReportData.getName());
|
|
|
}
|
|
|
+ //性别
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getSex())) {
|
|
|
+ queryWrapper.eq("a.sex",projectReportData.getSex());
|
|
|
+ }
|
|
|
+ //身份证号码
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getIdCard())) {
|
|
|
+ queryWrapper.like("a.id_card",projectReportData.getIdCard());
|
|
|
+ }
|
|
|
+ //毕业院校
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getGraduatedFrom())) {
|
|
|
+ queryWrapper.like("a.graduated_from",projectReportData.getGraduatedFrom());
|
|
|
+ }
|
|
|
+ //专业
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getSpeciality())) {
|
|
|
+ queryWrapper.like("a.speciality",projectReportData.getSpeciality());
|
|
|
+ }
|
|
|
+ //qq/微信
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getQqNum())) {
|
|
|
+ queryWrapper.like("a.qq_num",projectReportData.getQqNum());
|
|
|
+ }
|
|
|
+ //实习单位名称
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getPracticeUnitName())) {
|
|
|
+ queryWrapper.like("a.practice_unit_name",projectReportData.getPracticeUnitName());
|
|
|
+ }
|
|
|
+ //项目经理
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getProjectManager())) {
|
|
|
+ queryWrapper.eq("a.project_manager",projectReportData.getProjectManager());
|
|
|
+ }
|
|
|
IPage<RegistrationDto> list = mapper.findList(page, queryWrapper);
|
|
|
return list;
|
|
|
|
|
@@ -473,6 +502,23 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
|
|
|
return registrations;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存实习人员登记信息
|
|
|
+ * @param registration
|
|
|
+ */
|
|
|
+ public void saveForm(Registration registration) throws Exception {
|
|
|
+ if (StringUtils.isNotEmpty(registration.getId())){
|
|
|
+ updateRegistration(registration);
|
|
|
+ }else {
|
|
|
+ addRegistration(registration);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改实习人员信息
|
|
|
+ * @param reportData
|
|
|
+ */
|
|
|
public void updateRegistration(Registration reportData) {
|
|
|
|
|
|
//获取当前登录人信息
|
|
@@ -521,4 +567,280 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
|
|
|
}
|
|
|
mapper.updateById(report);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增实习人员信息
|
|
|
+ * @param reportData
|
|
|
+ */
|
|
|
+ public void addRegistration(Registration reportData) {
|
|
|
+
|
|
|
+ //获取当前登录人信息
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+
|
|
|
+ Registration report = new Registration();
|
|
|
+ BeanUtils.copyProperties(reportData, report);
|
|
|
+ report.setUpdateById(userDTO.getId());
|
|
|
+ report.setUpdateTime(new Date());
|
|
|
+ report.setCreateById(userDTO.getId());
|
|
|
+ report.setCreateTime(new Date());
|
|
|
+ report.setType("5");
|
|
|
+ String reportId = SnowFlake.getId();
|
|
|
+ report.setId(reportId);
|
|
|
+ //家庭成员信息添加
|
|
|
+ List<RegistrationFamilyMembers> familyMembers = reportData.getFamilyMembers();
|
|
|
+ if (CollectionUtils.isNotEmpty(familyMembers)){
|
|
|
+ familyMembers.forEach(fa->{
|
|
|
+ // 生成id
|
|
|
+ String amountId = SnowFlake.getId();
|
|
|
+ fa.setId(amountId);
|
|
|
+ fa.setCreateById(userDTO.getId());
|
|
|
+ fa.setCreateTime(new Date());
|
|
|
+ fa.setUpdateById(userDTO.getId());
|
|
|
+ fa.setUpdateTime(new Date());
|
|
|
+ fa.setDelFlag(0);
|
|
|
+ fa.setRegistrationId(report.getId());
|
|
|
+
|
|
|
+ familyMembersMapper.insert(fa);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //实习经历信息
|
|
|
+ List<RegistrationExperience> experiences = reportData.getExperiences();
|
|
|
+ if (CollectionUtils.isNotEmpty(experiences)){
|
|
|
+ experiences.forEach(fa->{
|
|
|
+ // 生成id
|
|
|
+ String amountId = SnowFlake.getId();
|
|
|
+ fa.setId(amountId);
|
|
|
+ fa.setCreateById(userDTO.getId());
|
|
|
+ fa.setCreateTime(new Date());
|
|
|
+ fa.setUpdateById(userDTO.getId());
|
|
|
+ fa.setUpdateTime(new Date());
|
|
|
+ fa.setDelFlag(0);
|
|
|
+ fa.setRegistrationId(report.getId());
|
|
|
+
|
|
|
+ experienceMapper.insert(fa);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ mapper.insert(report);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下载实习登记信息
|
|
|
+ * @param response
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map getInfoMap(HttpServletResponse response, String id) {
|
|
|
+ Map data = new HashMap<>();
|
|
|
+
|
|
|
+ Registration registration = mapper.getById(id);
|
|
|
+ if (registration != null){
|
|
|
+ //基本信息
|
|
|
+ if (StringUtils.isNotBlank(registration.getName())){
|
|
|
+ data.put("name",registration.getName());
|
|
|
+ }else {
|
|
|
+ data.put("name","");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(registration.getSex())){
|
|
|
+ if (registration.getSex().equals("1")){
|
|
|
+ data.put("sex","男");
|
|
|
+ }else {
|
|
|
+ data.put("sex","女");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ data.put("sex","");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(registration.getIdCard())) {
|
|
|
+ data.put("idCard", registration.getIdCard());
|
|
|
+ } else {
|
|
|
+ data.put("idCard", "");
|
|
|
+ }
|
|
|
+ //出生地
|
|
|
+ if (StringUtils.isNotBlank(registration.getNativePlace())) {
|
|
|
+ data.put("nativePlace", registration.getNativePlace());
|
|
|
+ } else {
|
|
|
+ data.put("nativePlace", "");
|
|
|
+ }
|
|
|
+ //民族
|
|
|
+ if (StringUtils.isNotBlank(registration.getNation())) {
|
|
|
+ data.put("nation", registration.getNation());
|
|
|
+ } else {
|
|
|
+ data.put("nation", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getPoliticalOutlook())) {
|
|
|
+ String dictLabel = SpringUtil.getBean(IDictApi.class).getDictLabel(registration.getPoliticalOutlook(), "political_outlook", "");
|
|
|
+ data.put("politicalOutlook", dictLabel);
|
|
|
+ } else {
|
|
|
+ data.put("politicalOutlook", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getGraduatedFrom())) {
|
|
|
+ data.put("graduatedFrom", registration.getGraduatedFrom());
|
|
|
+ } else {
|
|
|
+ data.put("graduatedFrom", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getSpeciality())) {
|
|
|
+ data.put("speciality", registration.getSpeciality());
|
|
|
+ } else {
|
|
|
+ data.put("speciality", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getMobilePhone())) {
|
|
|
+ data.put("mobilePhone", registration.getMobilePhone());
|
|
|
+ } else {
|
|
|
+ data.put("mobilePhone", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getQqNum())) {
|
|
|
+ data.put("qqNum", registration.getQqNum());
|
|
|
+ } else {
|
|
|
+ data.put("qqNum", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getPracticeStartDay())) {
|
|
|
+ data.put("practiceStartDay", registration.getPracticeStartDay());
|
|
|
+ } else {
|
|
|
+ data.put("practiceStartDay", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getPracticeOffice())) {
|
|
|
+ OfficeDTO officeDTO = SpringUtil.getBean(IOfficeApi.class).getOfficeById(registration.getPracticeOffice());
|
|
|
+ data.put("practiceOffice", officeDTO.getName());
|
|
|
+ } else {
|
|
|
+ data.put("practiceOffice", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getPracticeUnitName())) {
|
|
|
+ data.put("practiceUnitName", registration.getPracticeUnitName());
|
|
|
+ } else {
|
|
|
+ data.put("practiceUnitName", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getProjectManager())) {
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(registration.getProjectManager());
|
|
|
+ data.put("projectManager", userDTO.getName());
|
|
|
+ } else {
|
|
|
+ data.put("projectManager", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getRemarks())) {
|
|
|
+ int maxLineLength = 42; // 您可以根据需要调整这个值
|
|
|
+ StringBuilder formattedRemarks = new StringBuilder();
|
|
|
+
|
|
|
+ // 遍历每个字符并在需要时添加换行符
|
|
|
+ for (int i = 0; i < registration.getRemarks().length(); i++) {
|
|
|
+ formattedRemarks.append(registration.getRemarks().charAt(i));
|
|
|
+ // 在每maxLineLength个字符后添加换行符
|
|
|
+ if ((i + 1) % maxLineLength == 0) {
|
|
|
+ formattedRemarks.append("\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ data.put("remarks", formattedRemarks.toString());
|
|
|
+ } else {
|
|
|
+ data.put("remarks", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(registration.getPracticeCompleteDay())) {
|
|
|
+ data.put("practiceCompleteDay", registration.getPracticeCompleteDay());
|
|
|
+ } else {
|
|
|
+ data.put("practiceCompleteDay", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 实习经历
|
|
|
+ List<RegistrationExperience> experiences = experienceMapper.getByRegisterId(id);
|
|
|
+ if (CollectionUtils.isNotEmpty(experiences)) {
|
|
|
+ if (experiences.size()<2){
|
|
|
+ for (int i = 0; i < 2; i++) {
|
|
|
+ RegistrationExperience registrationExperience = new RegistrationExperience();
|
|
|
+ registrationExperience.setStartTime("");
|
|
|
+ registrationExperience.setEndTime("");
|
|
|
+ registrationExperience.setPracticeUnit("");
|
|
|
+ registrationExperience.setPost("");
|
|
|
+ experiences.add(registrationExperience);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data.put("experiences", experiences);
|
|
|
+ } else {
|
|
|
+ ArrayList<RegistrationExperience> list = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 2; i++) {
|
|
|
+ RegistrationExperience registrationExperience = new RegistrationExperience();
|
|
|
+ registrationExperience.setStartTime("");
|
|
|
+ registrationExperience.setEndTime("");
|
|
|
+ registrationExperience.setPracticeUnit("");
|
|
|
+ registrationExperience.setPost("");
|
|
|
+ list.add(registrationExperience);
|
|
|
+ }
|
|
|
+ data.put("experiences",list);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 家庭成员
|
|
|
+ List<RegistrationFamilyMembers> familyMembers = familyMembersMapper.getByRegisterId(id);
|
|
|
+ if (CollectionUtils.isNotEmpty(familyMembers)) {
|
|
|
+ if (familyMembers.size()<2){
|
|
|
+ RegistrationFamilyMembers members = new RegistrationFamilyMembers();
|
|
|
+ members.setCallName("");
|
|
|
+ members.setName("");
|
|
|
+ members.setPhone("");
|
|
|
+ members.setWorkUnit("");
|
|
|
+ familyMembers.add(members);
|
|
|
+ }
|
|
|
+ data.put("familyMembers", familyMembers);
|
|
|
+ } else {
|
|
|
+ ArrayList<RegistrationFamilyMembers> list = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 2; i++) {
|
|
|
+ RegistrationFamilyMembers members = new RegistrationFamilyMembers();
|
|
|
+ members.setCallName("");
|
|
|
+ members.setName("");
|
|
|
+ members.setPhone("");
|
|
|
+ members.setWorkUnit("");
|
|
|
+ list.add(members);
|
|
|
+ }
|
|
|
+ data.put("familyMembers",list );
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+ data.put("name","");
|
|
|
+ data.put("sex","");
|
|
|
+ data.put("idCard", "");
|
|
|
+ data.put("nativePlace", "");
|
|
|
+ data.put("nation", "");
|
|
|
+ data.put("politicalOutlook", "");
|
|
|
+ data.put("graduatedFrom", "");
|
|
|
+ data.put("speciality", "");
|
|
|
+ data.put("mobilePhone", "");
|
|
|
+ data.put("qqNum", "");
|
|
|
+ data.put("practiceStartDay", "");
|
|
|
+ data.put("practiceOffice", "");
|
|
|
+ data.put("practiceUnitName", "");
|
|
|
+ data.put("remarks", "");
|
|
|
+ data.put("projectManager", "");
|
|
|
+ data.put("practiceCompleteDay", "");
|
|
|
+ ArrayList<RegistrationExperience> list = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 2; i++) {
|
|
|
+ RegistrationExperience registrationExperience = new RegistrationExperience();
|
|
|
+ registrationExperience.setStartTime("");
|
|
|
+ registrationExperience.setEndTime("");
|
|
|
+ registrationExperience.setPracticeUnit("");
|
|
|
+ registrationExperience.setPost("");
|
|
|
+ list.add(registrationExperience);
|
|
|
+ }
|
|
|
+ data.put("experiences",list);
|
|
|
+
|
|
|
+ ArrayList<RegistrationFamilyMembers> list1 = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 2; i++) {
|
|
|
+ RegistrationFamilyMembers members = new RegistrationFamilyMembers();
|
|
|
+ members.setCallName("");
|
|
|
+ members.setName("");
|
|
|
+ members.setPhone("");
|
|
|
+ members.setWorkUnit("");
|
|
|
+ list1.add(members);
|
|
|
+ }
|
|
|
+ data.put("familyMembers",list1 );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|