use of com.bc.pmpheep.back.po.DecEduExp in project pmph by BCSquad.
the class DecEduExpServiceTest method testAddDecEduExp.
@Test
@Rollback(Const.ISROLLBACK)
public void testAddDecEduExp() {
DecEduExp decEduExp = new DecEduExp(8L, "第四军医大学", "脑科学", "博士", "博士", "2005-08", "2008-06", 10);
decEduExp = decEduExpService.addDecEduExp(decEduExp);
Assert.assertTrue("数据添加失败", decEduExp.getId() > 0);
}
use of com.bc.pmpheep.back.po.DecEduExp in project pmph by BCSquad.
the class WordHelperTest method makeFakeDecEduExpList.
//
// @Test
// public void export() throws CheckedServiceException, IllegalArgumentException, IllegalAccessException {
// /* 生成唯一临时目录名 */
// String tempDir = String.valueOf(System.currentTimeMillis()).concat(String.valueOf(RandomUtil.getRandomNum()));
// List<Material> materials = materialService.getListMaterial("四川重庆中等卫生职业教育规划教材(护理、助产专业) 第二轮修订");
// List<DeclarationEtcBO> declarationEtcBOs = declarationService.declarationEtcBO(materials.get(0).getId(),
// null, null, null, null, null, null, null, null, null);
// if (CollectionUtil.isEmpty(declarationEtcBOs)) {
// return;
// }
// StringBuilder sb = new StringBuilder();
// String src = this.getClass().getResource("/").getPath();
// src = src.substring(1);
// sb.append(src);
// if (!src.endsWith(File.separator)) {
// sb.append(File.separator);
// }
// sb.append(tempDir);
// sb.append(File.separator);
// sb.append("全国高等学校健康服务与管理专业第一轮规划教材");
// sb.append(File.separator);
// sb.append("1.人体解剖学与组织胚胎学");
// sb.append(File.separator);
// logger.info("获取到的路径地址是 {}", sb.toString());
// wordHelper.export("四川重庆中等卫生职业教育规划教材(护理、助产专业) 第二轮修订", sb.toString(), declarationEtcBOs, "111111111111111111");
// }
private ArrayList<DecEduExp> makeFakeDecEduExpList() {
ArrayList<DecEduExp> exps = new ArrayList<>(3);
DecEduExp exp = new DecEduExp();
exp.setDateBegin("1998-07-01");
exp.setDateEnd("2003-12-01");
exp.setDegree("本科");
exp.setMajor("临床医学");
exp.setSchoolName("首都医科大学");
exps.add(exp);
exp = new DecEduExp();
exp.setDateBegin("2004-07-01");
exp.setDateEnd("2007-12-01");
exp.setDegree("硕士");
exp.setMajor("临床医学");
exp.setSchoolName("首都医科大学");
exps.add(exp);
exp = new DecEduExp();
exp.setDateBegin("2008-07-01");
exp.setDateEnd("2012-12-01");
exp.setDegree("博士");
exp.setMajor("临床医学");
exp.setSchoolName("首都医科大学");
exps.add(exp);
return exps;
}
use of com.bc.pmpheep.back.po.DecEduExp in project pmph by BCSquad.
the class MigrationStageSix method decEduExp.
/**
* 作家学习经历表
*/
protected void decEduExp() {
// 要迁移的旧库表名
String tableName = "writer_learn";
// 增加new_pk字段
JdbcHelper.addColumn(tableName);
String sql = "select wl.leamid,wl.writerid,wl.schoolname,wl.speciality," + "wl.record,wl.remark,wl.startstopdate,wl.enddate,wl.createdate," + "wd.new_pk id " + "from writer_learn wl " + "left join writer_declaration wd on wd.writerid=wl.writerid ";
// 取得该表中所有数据
List<Map<String, Object>> maps = JdbcHelper.getJdbcTemplate().queryForList(sql);
// 迁移成功的条目数
int count = 0;
int declarationidCount = 0;
List<Map<String, Object>> excel = new LinkedList<>();
Map<String, Object> result = new LinkedHashMap<>();
int correctCount = 0;
int[] state = { 0 };
StringBuilder reason = new StringBuilder();
StringBuilder dealWith = new StringBuilder();
/* 开始遍历查询结果 */
for (Map<String, Object> map : maps) {
StringBuilder sb = new StringBuilder();
// 旧表主键值
String id = (String) map.get("leamid");
// 申报表id
Long declarationid = (Long) map.get("id");
// 学校名称
String schoolName = (String) map.get("schoolname");
// 所学专业
String major = (String) map.get("speciality");
// 学历
String degree = (String) map.get("record");
DecEduExp decEduExp = new DecEduExp();
if (ObjectUtil.isNull(declarationid) || declarationid.intValue() == 0) {
map.put(SQLParameters.EXCEL_EX_HEADER, sb.append("未找到申报表对应的关联结果。"));
excel.add(map);
logger.debug("未找到申报表对应的关联结果,此结果将被记录在Excel中");
declarationidCount++;
if (state[0] == 0) {
reason.append("找不到对应的申报作家。");
dealWith.append("放弃迁移。");
state[0] = 1;
}
continue;
}
decEduExp.setDeclarationId(declarationid);
decEduExp.setSchoolName(schoolName);
decEduExp.setMajor(major);
decEduExp.setDegree(degree);
// 备注
decEduExp.setNote((String) map.get("remark"));
// 起始时间
Timestamp startstopDate = (Timestamp) map.get("startstopdate");
if (null != startstopDate) {
decEduExp.setDateBegin(sdf.format(startstopDate));
} else {
decEduExp.setDateBegin("未知");
}
// 终止时间
Timestamp endDate = (Timestamp) map.get("enddate");
if (null != endDate) {
if (endDate.getTime() >= split.getTime() || endDate.getTime() == blank.getTime()) {
decEduExp.setDateEnd("至今");
} else {
decEduExp.setDateEnd(sdf.format(endDate));
}
} else {
decEduExp.setDateEnd("至今");
}
// 显示顺序
decEduExp.setSort(999);
decEduExp = decEduExpService.addDecEduExp(decEduExp);
long pk = decEduExp.getId();
JdbcHelper.updateNewPrimaryKey(tableName, pk, "leamid", id);
count++;
if (null == map.get("exception")) {
correctCount++;
}
}
if (excel.size() > 0) {
try {
excelHelper.exportFromMaps(excel, "作家学习经历表", "dec_edu_exp");
} catch (IOException ex) {
logger.error("异常数据导出到Excel失败", ex);
}
}
if (correctCount != maps.size()) {
result.put(SQLParameters.EXCEL_HEADER_TABLENAME, "dec_edu_exp");
result.put(SQLParameters.EXCEL_HEADER_DESCRIPTION, "作家学习经历表");
result.put(SQLParameters.EXCEL_HEADER_SUM_DATA, maps.size());
result.put(SQLParameters.EXCEL_HEADER_MIGRATED_DATA, count);
result.put(SQLParameters.EXCEL_HEADER_CORECT_DATA, correctCount);
result.put(SQLParameters.EXCEL_HEADER_TRANSFERED_DATA, count - correctCount);
result.put(SQLParameters.EXCEL_HEADER_NO_MIGRATED_DATA, maps.size() - count);
result.put(SQLParameters.EXCEL_HEADER_EXCEPTION_REASON, reason.toString());
result.put(SQLParameters.EXCEL_HEADER_DEAL_WITH, dealWith.toString());
SQLParameters.STATISTICS_RESULT.add(result);
}
logger.info("未找到申报表对应的关联结果数量:{}", declarationidCount);
logger.info("writer_learn表迁移完成,异常条目数量:{}", excel.size());
logger.info("原数据库中共有{}条数据,迁移了{}条数据", maps.size(), count);
// 记录信息
Map<String, Object> msg = new HashMap<String, Object>();
msg.put("result", "" + tableName + " 表迁移完成" + count + "/" + maps.size());
SQLParameters.STATISTICS.add(msg);
}
use of com.bc.pmpheep.back.po.DecEduExp in project pmph by BCSquad.
the class DeclarationServiceImpl method getDeclarationEtcBOs.
@Override
public List<DeclarationEtcBO> getDeclarationEtcBOs(Long materialId) {
List<DeclarationEtcBO> declarationEtcBOs = new ArrayList<>(20);
List<Declaration> declarations = declarationDao.getDeclarationByMaterialId(materialId);
if (CollectionUtil.isEmpty(declarations)) {
return null;
}
int count = 1;
for (Declaration declaration : declarations) {
// 学习经历
ArrayList<DecEduExp> decEduExps = (ArrayList<DecEduExp>) decEduExpDao.getListDecEduExpByDeclarationId(declaration.getId());
// 工作经历
ArrayList<DecWorkExp> decWorkExps = (ArrayList<DecWorkExp>) decWorkExpDao.getListDecWorkExpByDeclarationId(declaration.getId());
// 教学经历
ArrayList<DecTeachExp> decTeachExps = (ArrayList<DecTeachExp>) decTeachExpDao.getListDecTeachExpByDeclarationId(declaration.getId());
// 兼职学术
ArrayList<DecAcade> decAcades = (ArrayList<DecAcade>) decAcadeDao.getListDecAcadeByDeclarationId(declaration.getId());
// 上套教材
ArrayList<DecLastPosition> decLastPositions = (ArrayList<DecLastPosition>) decLastPositionDao.getListDecLastPositionByDeclarationId(declaration.getId());
// 精品课程建设情况
ArrayList<DecCourseConstruction> decCourseConstructions = (ArrayList<DecCourseConstruction>) decCourseConstructionDao.getDecCourseConstructionByDeclarationId(declaration.getId());
// 主编国家级规划
ArrayList<DecNationalPlan> decNationalPlans = (ArrayList<DecNationalPlan>) decNationalPlanDao.getListDecNationalPlanByDeclarationId(declaration.getId());
// 教材编写
ArrayList<DecTextbook> decTextbooks = (ArrayList<DecTextbook>) decTextbookDao.getListDecTextbookByDeclarationId(declaration.getId());
// 作家科研
ArrayList<DecResearch> decResearchs = (ArrayList<DecResearch>) decResearchDao.getListDecResearchByDeclarationId(declaration.getId());
/*
* ArrayList<DecAchievement> decAchievements = (ArrayList<DecAchievement>)
* decAchievementDao .getDecAchievementByDeclarationId(declaration.getId());
*/
DeclarationEtcBO declarationEtcBO = new DeclarationEtcBO();
declarationEtcBO.setRealname("欧阳望月".concat(String.valueOf(count)));
declarationEtcBO.setUsername("Smith");
// declarationEtcBO.setTextbookName("人体解剖学与组织胚胎学");
// declarationEtcBO.setPresetPosition("副主编");
declarationEtcBO.setChosenOrgName("人民卫生出版社");
declarationEtcBO.setSex("女");
declarationEtcBO.setBirthday("1975年11月22日");
declarationEtcBO.setAddress("浙江省金华市婺城区婺州街1188号");
declarationEtcBO.setExperience(23);
declarationEtcBO.setOrgName("金华职业技术学院医学院");
declarationEtcBO.setPosition("教师");
declarationEtcBO.setTitle("教授");
declarationEtcBO.setPostcode("321017");
declarationEtcBO.setHandphone("13857989881");
declarationEtcBO.setEmail("test10001test@163.com");
declarationEtcBO.setFax("01065930013");
declarationEtcBO.setTelephone("010-65930013");
declarationEtcBO.setDecEduExps(decEduExps);
declarationEtcBO.setDecWorkExps(decWorkExps);
declarationEtcBO.setDecTeachExps(decTeachExps);
declarationEtcBO.setDecAcades(decAcades);
declarationEtcBO.setDecLastPositions(decLastPositions);
declarationEtcBO.setDecCourseConstructions(decCourseConstructions);
declarationEtcBO.setDecNationalPlans(decNationalPlans);
declarationEtcBO.setDecTextbooks(decTextbooks);
declarationEtcBO.setDecResearchs(decResearchs);
// declarationEtcBO.setDecAchievement(decAchievements.get(0));
declarationEtcBOs.add(declarationEtcBO);
count++;
if (count > 21) {
break;
}
}
return declarationEtcBOs;
}
use of com.bc.pmpheep.back.po.DecEduExp in project pmph by BCSquad.
the class DeclarationServiceImpl method exportExcel.
@Override
public ApplicationVO exportExcel(Long declarationId) {
// 专家信息显示实体
ApplicationVO applicationVO = new ApplicationVO();
// 作家申报
List<DecPositionDisplayVO> decPositionList = decPositionDao.listDecPositionsOrBook(declarationId);
for (DecPositionDisplayVO decPositions : decPositionList) {
String syllabusId = decPositions.getSyllabusId();
if (StringUtil.notEmpty(syllabusId)) {
// 下载路径
String syllabusIds = RouteUtil.MONGODB_FILE + syllabusId;
decPositions.setSyllabusId(syllabusIds);
}
switch(decPositions.getPresetPosition()) {
case 1:
decPositions.setShowPosition("编委");
break;
case 2:
decPositions.setShowPosition("副主编");
break;
case 3:
decPositions.setShowPosition("副主编,编委");
break;
case 4:
decPositions.setShowPosition("主编");
break;
case 5:
decPositions.setShowPosition("主编,编委");
break;
case 6:
decPositions.setShowPosition("主编,副主编");
break;
case 7:
decPositions.setShowPosition("主编,副主编,编委");
break;
case 8:
decPositions.setShowPosition("数字编委");
break;
case 9:
decPositions.setShowPosition("编委,数字编委");
break;
case 10:
decPositions.setShowPosition("副主编,数字编委");
break;
case 11:
decPositions.setShowPosition("副主编,编委,数字编委");
break;
case 12:
decPositions.setShowPosition("主编,数字编委");
break;
case 13:
decPositions.setShowPosition("主编,编委,数字编委");
break;
case 14:
decPositions.setShowPosition("主编,副主编,数字编委");
break;
case 15:
decPositions.setShowPosition("主编,副主编,编委,数字编委");
break;
default:
break;
}
if (decPositions.getChosenPosition() != 0) {
switch(decPositions.getChosenPosition()) {
case 1:
decPositions.setShowChosenPosition("编委");
break;
case 2:
decPositions.setShowChosenPosition("副主编");
break;
case 3:
decPositions.setShowChosenPosition("副主编,编委");
break;
case 4:
decPositions.setShowChosenPosition("主编");
break;
case 5:
decPositions.setShowChosenPosition("主编,编委");
break;
case 6:
decPositions.setShowChosenPosition("主编,副主编");
break;
case 7:
decPositions.setShowChosenPosition("主编,副主编,编委");
break;
case 8:
decPositions.setShowChosenPosition("数字编委");
break;
case 9:
decPositions.setShowChosenPosition("编委,数字编委");
break;
case 10:
decPositions.setShowChosenPosition("副主编,数字编委");
break;
case 11:
decPositions.setShowChosenPosition("副主编,编委,数字编委");
break;
case 12:
decPositions.setShowChosenPosition("主编,数字编委");
break;
case 13:
decPositions.setShowChosenPosition("主编,编委,数字编委");
break;
case 14:
decPositions.setShowChosenPosition("主编,副主编,数字编委");
break;
case 15:
decPositions.setShowChosenPosition("主编,副主编,编委,数字编委");
break;
default:
break;
}
}
}
// 作家遴选
List<DecPositionPublishedVO> decPositionPublishedVOs = decPositionPublishedDao.listDecPositionDisplayOrPosition(declarationId);
for (DecPositionPublishedVO decPositionPublished : decPositionPublishedVOs) {
if (decPositionPublished.getChosenPosition() != 0) {
switch(decPositionPublished.getChosenPosition()) {
case 1:
decPositionPublished.setShowChosenPosition("编委");
break;
case 2:
decPositionPublished.setShowChosenPosition("副主编");
break;
case 3:
decPositionPublished.setShowChosenPosition("副主编,编委");
break;
case 4:
decPositionPublished.setShowChosenPosition("主编");
break;
case 5:
decPositionPublished.setShowChosenPosition("主编,编委");
break;
case 6:
decPositionPublished.setShowChosenPosition("主编,副主编");
break;
case 7:
decPositionPublished.setShowChosenPosition("主编,副主编,编委");
break;
case 8:
decPositionPublished.setShowChosenPosition("数字编委");
break;
case 9:
decPositionPublished.setShowChosenPosition("编委,数字编委");
break;
case 10:
decPositionPublished.setShowChosenPosition("副主编,数字编委");
break;
case 11:
decPositionPublished.setShowChosenPosition("副主编,编委,数字编委");
break;
case 12:
decPositionPublished.setShowChosenPosition("主编,数字编委");
break;
case 13:
decPositionPublished.setShowChosenPosition("主编,编委,数字编委");
break;
case 14:
decPositionPublished.setShowChosenPosition("主编,副主编,数字编委");
break;
case 15:
decPositionPublished.setShowChosenPosition("主编,副主编,编委,数字编委");
break;
default:
break;
}
}
}
// 作家申报表
DeclarationOrDisplayVO declaration = declarationDao.getDeclarationByIdOrOrgName(declarationId);
WriterUser user = writerUserService.get(declaration.getUserId());
if (user != null) {
declaration.setUsername(user.getUsername());
}
// 作家学习经历
List<DecEduExp> decEduExpList = decEduExpDao.getListDecEduExpByDeclarationId(declarationId);
// 作家工作经历
List<DecWorkExp> decWorkExpList = decWorkExpDao.getListDecWorkExpByDeclarationId(declarationId);
// 作家教学经历
List<DecTeachExp> decTeachExpList = decTeachExpDao.getListDecTeachExpByDeclarationId(declarationId);
// 作家个人成就
DecAchievement decAchievement = decAchievementDao.getDecAchievementByDeclarationId(declarationId);
// 作家兼职学术
List<DecAcade> decAcadeList = decAcadeDao.getListDecAcadeByDeclarationId(declarationId);
// 作家本套上版教材参编情况
List<DecLastPosition> decLastPositionList = decLastPositionDao.getListDecLastPositionByDeclarationId(declarationId);
// 作家主编国家级规划教材情况
List<DecNationalPlan> decNationalPlanList = decNationalPlanDao.getListDecNationalPlanByDeclarationId(declarationId);
// 人卫社教材编写情况表
List<DecTextbookPmph> decTextbookPmphList = decTextbookPmphDao.getListDecTextbookPmphByDeclarationId(declarationId);
// 其他社教材编写情况
List<DecTextbook> decTextbookList = decTextbookDao.getListDecTextbookByDeclarationId(declarationId);
// 参加人卫慕课、数字教材编写情况表
DecMoocDigital decMoocDigital = decMoocDigitalDao.getDecMoocDigitalByDeclarationId(declarationId);
// 作家精品课程建设情况
List<DecCourseConstruction> decCourseConstruction = decCourseConstructionDao.getDecCourseConstructionByDeclarationId(declarationId);
// 作家科研情况
List<DecResearch> decResearchList = decResearchDao.getListDecResearchByDeclarationId(declarationId);
// 主编学术专著情况
List<DecMonograph> decMonographList = decMonographDao.getListDecMonographByDeclarationId(declarationId);
// 出版行业获奖情况
List<DecPublishReward> decPublishRewardList = decPublishRewardDao.getListDecPublishRewardByDeclarationId(declarationId);
// SCI论文投稿及影响因子情况
List<DecSci> decSciList = decSciDao.getListDecSciByDeclarationId(declarationId);
// 临床医学获奖情况
List<DecClinicalReward> decClinicalRewardList = decClinicalRewardDao.getListDecClinicalRewardByDeclarationId(declarationId);
// 学术荣誉授予情况
List<DecAcadeReward> decAcadeRewardList = decAcadeRewardDao.getListDecAcadeRewardByDeclarationId(declarationId);
// 作家扩展项
List<DecExtensionVO> decExtensionList = decExtensionDao.getListDecExtensionByDeclarationId(declarationId);
// 编写内容意向表
DecIntention decIntention = decIntentionDao.getDecIntentionByDeclarationId(declarationId);
// 是否选择必填
Material material = materialService.getMaterialById(declaration.getMaterialId());
// 把查询出来的信息添加进applicationVO
applicationVO.setDecPositionList(decPositionList);
applicationVO.setDecPositionPublishedVOs(decPositionPublishedVOs);
applicationVO.setDeclaration(declaration);
applicationVO.setDecEduExpList(decEduExpList);
applicationVO.setDecWorkExpList(decWorkExpList);
applicationVO.setDecTeachExpList(decTeachExpList);
applicationVO.setDecAchievement(decAchievement);
applicationVO.setDecAcadeList(decAcadeList);
applicationVO.setDecLastPositionList(decLastPositionList);
applicationVO.setDecNationalPlanList(decNationalPlanList);
applicationVO.setDecTextbookPmphList(decTextbookPmphList);
applicationVO.setDecTextbookList(decTextbookList);
applicationVO.setDecMoocDigital(decMoocDigital);
applicationVO.setDecCourseConstruction(decCourseConstruction);
applicationVO.setDecResearchList(decResearchList);
applicationVO.setDecMonographList(decMonographList);
applicationVO.setDecPublishRewardList(decPublishRewardList);
applicationVO.setDecSciList(decSciList);
applicationVO.setDecClinicalRewardList(decClinicalRewardList);
applicationVO.setDecAcadeRewardList(decAcadeRewardList);
applicationVO.setDecExtensionList(decExtensionList);
applicationVO.setDecIntention(decIntention);
applicationVO.setMaterial(material);
return applicationVO;
}
Aggregations