|
@ -3,6 +3,7 @@ package com.yihu.jw.base.service.doctor.excelImport;
|
|
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
|
|
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
|
|
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
|
|
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
|
|
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
|
|
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
|
|
|
|
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
|
|
import com.yihu.jw.base.dao.org.BaseOrgDao;
|
|
import com.yihu.jw.base.dao.org.BaseOrgDao;
|
|
import com.yihu.jw.base.endpoint.common.excel.AExcelReader;
|
|
import com.yihu.jw.base.endpoint.common.excel.AExcelReader;
|
|
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
|
|
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
|
|
@ -11,6 +12,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.context.annotation.Scope;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@ -18,6 +21,7 @@ import java.util.*;
|
|
* 医生信息列表-excel解析类
|
|
* 医生信息列表-excel解析类
|
|
* Created by 刘文彬 on 2018/10/24.
|
|
* Created by 刘文彬 on 2018/10/24.
|
|
*/
|
|
*/
|
|
|
|
@Component
|
|
public class BaseDoctorExcelDOReader extends AExcelReader {
|
|
public class BaseDoctorExcelDOReader extends AExcelReader {
|
|
@Autowired
|
|
@Autowired
|
|
private BaseOrgDao baseOrgDao;
|
|
private BaseOrgDao baseOrgDao;
|
|
@ -27,6 +31,8 @@ public class BaseDoctorExcelDOReader extends AExcelReader {
|
|
private DictDoctorDutyDao dutyDao;
|
|
private DictDoctorDutyDao dutyDao;
|
|
@Autowired
|
|
@Autowired
|
|
private DictJobTitleDao jobTitleDao;
|
|
private DictJobTitleDao jobTitleDao;
|
|
|
|
@Autowired
|
|
|
|
private BaseDoctorRoleInfoDao roleInfoDao;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void read(Workbook rwb) throws Exception {
|
|
public void read(Workbook rwb) throws Exception {
|
|
@ -91,19 +97,19 @@ public class BaseDoctorExcelDOReader extends AExcelReader {
|
|
String[] element = hospital.split("/");
|
|
String[] element = hospital.split("/");
|
|
String[] org = element[0].split(",");//机构
|
|
String[] org = element[0].split(",");//机构
|
|
String[] dept = element[1].split(",");//部门
|
|
String[] dept = element[1].split(",");//部门
|
|
String[] duty = element[1].split(",");//职务
|
|
|
|
|
|
String[] duty = element[2].split(",");//职务
|
|
String orgCode = org[0];
|
|
String orgCode = org[0];
|
|
String deptCode = dept[0];
|
|
String deptCode = dept[0];
|
|
String dutyCode = duty[0];
|
|
String dutyCode = duty[0];
|
|
// if(!baseOrgDao.existsByCode(orgCode)){
|
|
|
|
// return 0;
|
|
|
|
// }
|
|
|
|
// if(!deptDao.existsByCodeAndOrgCode(deptCode,orgCode)){
|
|
|
|
// return 0;
|
|
|
|
// }
|
|
|
|
// if(!dutyDao.existsByCode(dutyCode)){
|
|
|
|
// return 0;
|
|
|
|
// }
|
|
|
|
|
|
if(!baseOrgDao.existsByCode(orgCode)){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if(!deptDao.existsByCodeAndOrgCode(deptCode,orgCode)){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if(!dutyDao.existsByCode(dutyCode)){
|
|
|
|
return 0;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(StringUtils.isNotEmpty(baseDoctorExcelDO.getRoleInfo())){
|
|
if(StringUtils.isNotEmpty(baseDoctorExcelDO.getRoleInfo())){
|
|
@ -111,11 +117,17 @@ public class BaseDoctorExcelDOReader extends AExcelReader {
|
|
for(String role:roles){
|
|
for(String role:roles){
|
|
String[] element = role.split(",");
|
|
String[] element = role.split(",");
|
|
String roleCode = element[0];
|
|
String roleCode = element[0];
|
|
// if(jobTitleDao.existsByCode(roleCode)){
|
|
|
|
// return 0;
|
|
|
|
// }
|
|
|
|
|
|
if(!roleInfoDao.existsByCode(roleCode)){
|
|
|
|
return 0;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if(StringUtils.isEmpty(baseDoctorExcelDO.getIdcard())){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if(StringUtils.isEmpty(baseDoctorExcelDO.getMobile())){
|
|
|
|
return 0;
|
|
|
|
}
|
|
return rs;
|
|
return rs;
|
|
}
|
|
}
|
|
}
|
|
}
|