体验预约人员导入功能
This commit is contained in:
parent
ed63971fa5
commit
06f8a441c9
|
|
@ -50,6 +50,7 @@ public class importExcelController {
|
|||
ar.setFailMsg(code);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ar.setFailMsg(e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ar;
|
||||
|
|
@ -91,6 +92,7 @@ public class importExcelController {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ar.setFailMsg(e.getMessage());
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,11 @@ public interface PersonnelLibraryDao {
|
|||
|
||||
PersonnelReservationBean getMealName(@Param("setMeal")String setMeal);
|
||||
|
||||
PersonnelReservationBean getInfoById(@Param("personName")String personName,@Param("idNumber") String idNumber, @Param("phone")String phone);
|
||||
PersonnelReservationBean getInfoById(@Param("personName")String personName,@Param("idNumber") String idNumber, @Param("phone")String phone,@Param("ifHighee")String ifHighee);
|
||||
|
||||
int updateReservation(PersonnelReservationBean bean);
|
||||
|
||||
int getPersonNameBy(@Param("personName")String personName);
|
||||
|
||||
int getPhoneBy(@Param("personName")String personName,@Param("phone")String phone);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,4 +122,9 @@ public class PersonnelReservationBean extends HospitalBean{
|
|||
*/
|
||||
private String checkType;
|
||||
|
||||
/**
|
||||
* 是否高职1是0不是 3 是展示空
|
||||
*/
|
||||
private String ifHighee;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ import java.util.List;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-16-19 13:57:46
|
||||
*/
|
||||
|
|
@ -44,9 +42,9 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
|
||||
@Override
|
||||
public String saveExcelInfo(List<JSONObject> lstObj) {
|
||||
PersonnelLibraryBean bean=new PersonnelLibraryBean();
|
||||
PersonnelLibraryBean bean = new PersonnelLibraryBean();
|
||||
String res = "";
|
||||
int team =1;
|
||||
int team = 1;
|
||||
int i = 1;
|
||||
String personName = "";
|
||||
String phone = "";
|
||||
|
|
@ -65,21 +63,21 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
department = obj.getString("department").trim();
|
||||
// specJob = obj.getString("specJob").trim();
|
||||
//通过部门名称寻找部门id
|
||||
if (StringHelper.isEmpty(idNumber) || "0.0".equals(idNumber.trim())) {
|
||||
if (StringHelper.isEmpty(idNumber) || "0.0".equals(idNumber.trim())) {
|
||||
res += "第" + i + "行" + personName + "行身份证为空;";
|
||||
team = 2;
|
||||
} else if (idNumber.length() != 18) {
|
||||
res += "第" + i + "行" + personName + "行身份证格式错误;";
|
||||
team = 2;
|
||||
}else {
|
||||
sex=getSexByIdcard(idNumber);
|
||||
} else {
|
||||
sex = getSexByIdcard(idNumber);
|
||||
bean.setSex(sex);
|
||||
int age = countAge(idNumber);
|
||||
bean.setAge(age);
|
||||
}
|
||||
if(!department.isEmpty()) {
|
||||
if (!department.isEmpty()) {
|
||||
String departmentName = dao.getdepartmentName(department);
|
||||
if (StringHelper.isEmpty(departmentName) || "0.0".equals(departmentName.trim())) {
|
||||
if (StringHelper.isEmpty(departmentName) || "0.0".equals(departmentName.trim())) {
|
||||
team = 2;
|
||||
res += "第" + i + "行" + personName + "部门名称有误,请检查";
|
||||
System.out.println(res);
|
||||
|
|
@ -99,12 +97,12 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
// }
|
||||
// }
|
||||
personType = obj.getString("personType");
|
||||
String peronid= ChangepersonType(personType);
|
||||
if(!peronid.equals("0")){
|
||||
String peronid = ChangepersonType(personType);
|
||||
if (!peronid.equals("0")) {
|
||||
bean.setPersonType(peronid);
|
||||
}else{
|
||||
} else {
|
||||
System.out.println(res);
|
||||
res += "第" + i + "行" + personName+"用工形式有误,请检查" ;
|
||||
res += "第" + i + "行" + personName + "用工形式有误,请检查";
|
||||
System.out.println(res);
|
||||
}
|
||||
|
||||
|
|
@ -114,15 +112,15 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
bean.setPhone(phone);
|
||||
bean.setIdNumber(idNumber);
|
||||
bean.setPassword(passwordEncoder.encode("YNsbd@123456"));
|
||||
if(bean.getSpecialPost()=="" ||bean.getSpecialPost()==null){
|
||||
bean.setSpecialPost(0+"");
|
||||
if (bean.getSpecialPost() == "" || bean.getSpecialPost() == null) {
|
||||
bean.setSpecialPost(0 + "");
|
||||
}
|
||||
if(team!=2){
|
||||
// 查询通过身份证去查询
|
||||
if (team != 2) {
|
||||
// 查询通过身份证去查询
|
||||
int sum = dao.getinfoByidcard(phone);
|
||||
if(sum>0){
|
||||
if (sum > 0) {
|
||||
dao.updatephyInfo(bean);
|
||||
} else{
|
||||
} else {
|
||||
dao.updatePersonExport(bean);
|
||||
}
|
||||
res = "导入成功";
|
||||
|
|
@ -146,7 +144,7 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
try {
|
||||
if (lstObj != null && lstObj.size() > 0) {
|
||||
for (JSONObject obj : lstObj) {
|
||||
NegativeResultBean bean = new NegativeResultBean();
|
||||
NegativeResultBean bean = new NegativeResultBean();
|
||||
bean.setPhyNumber(obj.getString("phyNumber"));
|
||||
bean.setPhyName(obj.getString("phyName"));
|
||||
bean.setProfilePosition(obj.getString("profilePosition"));
|
||||
|
|
@ -163,23 +161,23 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
bean.setGenerRecom(obj.getString("generRecom"));
|
||||
bean.setDataYear(DateTimeHelper.getYear(new Date()));
|
||||
bean.setHospitalId(UserUtil.getLoginUser().getHospitalId());
|
||||
bean.setId(UUID.randomUUID().toString().replace("-",""));
|
||||
if(StringHelper.isEmpty(obj.getString("phyNumber"))
|
||||
||StringHelper.isEmpty(obj.getString("phyName"))
|
||||
||StringHelper.isEmpty(obj.getString("profilePosition"))
|
||||
||StringHelper.isEmpty(obj.getString("phySex"))
|
||||
||StringHelper.isEmpty(obj.getString("phyOle"))
|
||||
||StringHelper.isEmpty(obj.getString("phyUnit"))
|
||||
||StringHelper.isEmpty(obj.getString("teamId"))
|
||||
||StringHelper.isEmpty(obj.getString("teamName"))
|
||||
||StringHelper.isEmpty(obj.getString("teamDepart"))
|
||||
||StringHelper.isEmpty(obj.getString("signDate"))
|
||||
||containsChineseCharacters(obj.getString("signDate"))
|
||||
||StringHelper.isEmpty(obj.getString("masResult"))
|
||||
||StringHelper.isEmpty(obj.getString("concWord"))
|
||||
||StringHelper.isEmpty(obj.getString("generRecom"))
|
||||
||((obj.getString("signDate")+"").indexOf("1900")!=-1) || ((obj.getString("signDate")+"").indexOf("1899")!=-1)){
|
||||
res.append("行号:"+obj.getString("id")+"数据,"+obj.getString("phyName")+"数据异常或为空,导入失败!<br>");
|
||||
bean.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
if (StringHelper.isEmpty(obj.getString("phyNumber"))
|
||||
|| StringHelper.isEmpty(obj.getString("phyName"))
|
||||
|| StringHelper.isEmpty(obj.getString("profilePosition"))
|
||||
|| StringHelper.isEmpty(obj.getString("phySex"))
|
||||
|| StringHelper.isEmpty(obj.getString("phyOle"))
|
||||
|| StringHelper.isEmpty(obj.getString("phyUnit"))
|
||||
|| StringHelper.isEmpty(obj.getString("teamId"))
|
||||
|| StringHelper.isEmpty(obj.getString("teamName"))
|
||||
|| StringHelper.isEmpty(obj.getString("teamDepart"))
|
||||
|| StringHelper.isEmpty(obj.getString("signDate"))
|
||||
|| containsChineseCharacters(obj.getString("signDate"))
|
||||
|| StringHelper.isEmpty(obj.getString("masResult"))
|
||||
|| StringHelper.isEmpty(obj.getString("concWord"))
|
||||
|| StringHelper.isEmpty(obj.getString("generRecom"))
|
||||
|| ((obj.getString("signDate") + "").indexOf("1900") != -1) || ((obj.getString("signDate") + "").indexOf("1899") != -1)) {
|
||||
res.append("行号:" + obj.getString("id") + "数据," + obj.getString("phyName") + "数据异常或为空,导入失败!<br>");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -192,20 +190,20 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
b.setTeamId(obj.getString("teamId"));
|
||||
b.setDataYear(dataYear);
|
||||
b.setHospitalId(UserUtil.getLoginUser().getHospitalId());
|
||||
b.setId(UUID.randomUUID().toString().replace("-",""));
|
||||
b.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
for (SysType bb : getIllnessType) {
|
||||
String[] arrays = bb.getIllnessKeyword().split(";");
|
||||
String illId = bb.getId()+"";
|
||||
String illId = bb.getId() + "";
|
||||
String illType = bb.getIllnessType();
|
||||
b.setIllnessType(illId);
|
||||
b.setIllnessName(illType);
|
||||
System.err.println("illId="+illId);
|
||||
System.err.println("illType="+illType);
|
||||
for (String aa : arrays){
|
||||
System.err.println("illId=" + illId);
|
||||
System.err.println("illType=" + illType);
|
||||
for (String aa : arrays) {
|
||||
boolean result = concWord.contains(aa);
|
||||
System.err.println("aa="+aa);
|
||||
System.err.println("result="+result);
|
||||
if(result){
|
||||
System.err.println("aa=" + aa);
|
||||
System.err.println("result=" + result);
|
||||
if (result) {
|
||||
negativeResultDao.addCountResultMessage(b);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -225,22 +223,22 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
// }
|
||||
// }
|
||||
int num = negativeResultDao.addDataInfo(bean);
|
||||
if(num <=0){
|
||||
res.append("第"+obj.getString("id")+"数据,"+obj.getString("phyName")+"新增失败!'\\n");
|
||||
if (num <= 0) {
|
||||
res.append("第" + obj.getString("id") + "数据," + obj.getString("phyName") + "新增失败!'\\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res.toString().length()<=0?"导入成功":res.toString();
|
||||
return res.toString().length() <= 0 ? "导入成功" : res.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String reservation(List<JSONObject> lstObj) {
|
||||
PersonnelReservationBean bean=new PersonnelReservationBean();
|
||||
List<PersonnelReservationBean> validBeans = new ArrayList<>(); // 用于存储通过验证的数据
|
||||
String res = "";
|
||||
int team =1;
|
||||
int team = 1;
|
||||
int i = 0;
|
||||
String personName = "";
|
||||
String phone = "";
|
||||
|
|
@ -249,147 +247,207 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
String hospital = "";
|
||||
String sex = "";
|
||||
String setMeal = "";
|
||||
boolean hasError = false; // 标志位,用于记录是否有错误
|
||||
|
||||
try {
|
||||
if (lstObj != null && lstObj.size() > 0) {
|
||||
for (JSONObject obj : lstObj) {
|
||||
i++;
|
||||
PersonnelReservationBean bean = new PersonnelReservationBean(); // 每个对象创建一个新的Bean
|
||||
personName = obj.getString("personName").trim();
|
||||
idNumber = obj.getString("idNumber").trim();
|
||||
sex = obj.getString("sex").trim();
|
||||
|
||||
department = obj.getString("department").trim();
|
||||
hospital = obj.getString("hospital").trim();
|
||||
setMeal = obj.getString("setMeal").trim();
|
||||
phone = obj.getString("phone").trim();
|
||||
|
||||
|
||||
//判断姓名为空
|
||||
if(StringHelper.isEmpty(personName)){
|
||||
// 判断姓名为空
|
||||
if (StringHelper.isEmpty(personName)) {
|
||||
res += "第" + i + "行姓名为空;";
|
||||
hasError = true;
|
||||
}
|
||||
bean.setPersonName(personName);
|
||||
|
||||
//判断身份证为空
|
||||
if (StringHelper.isEmpty(idNumber) || "0.0".equals(idNumber.trim())) {
|
||||
// 判断身份证为空
|
||||
if (StringHelper.isEmpty(idNumber) || "0.0".equals(idNumber.trim())) {
|
||||
res += "第" + i + "行" + personName + "行身份证为空;";
|
||||
team = 2;
|
||||
hasError = true;
|
||||
} else if (idNumber.length() != 18) {
|
||||
res += "第" + i + "行" + personName + "行身份证格式错误;";
|
||||
team = 2;
|
||||
hasError = true;
|
||||
}
|
||||
bean.setIdNumber(idNumber);
|
||||
|
||||
//判断性别为空
|
||||
if (StringHelper.isEmpty(sex) ) {
|
||||
// 判断性别为空
|
||||
if (StringHelper.isEmpty(sex)) {
|
||||
res += "第" + i + "行" + personName + "行性别为空;";
|
||||
team = 2;
|
||||
}else {
|
||||
String a=getSexByIdcard(idNumber);
|
||||
String b= "";
|
||||
if(sex.equals("男")){
|
||||
b="0";
|
||||
}else{
|
||||
b="1";
|
||||
hasError = true;
|
||||
} else {
|
||||
String a = getSexByIdcard(idNumber);
|
||||
String b = "";
|
||||
if (sex.equals("男")) {
|
||||
b = "0";
|
||||
} else {
|
||||
b = "1";
|
||||
}
|
||||
if(!a.equals(b)){
|
||||
if (!a.equals(b)) {
|
||||
res += "第" + i + "行" + personName + "行身份证与性别不匹配;";
|
||||
}else {
|
||||
hasError = true;
|
||||
} else {
|
||||
bean.setSex(b);
|
||||
}
|
||||
}
|
||||
|
||||
//判断部门名称为空
|
||||
if(!department.isEmpty()) {
|
||||
// 判断部门名称为空
|
||||
if (!department.isEmpty()) {
|
||||
String departmentName = dao.getdepartmentName(department);
|
||||
if (StringHelper.isEmpty(departmentName) || "0.0".equals(departmentName.trim())) {
|
||||
if (StringHelper.isEmpty(departmentName) || "0.0".equals(departmentName.trim())) {
|
||||
team = 2;
|
||||
res += "第" + i + "行" + personName + "部门名称有误,请检查";
|
||||
System.out.println(res);
|
||||
hasError = true;
|
||||
} else {
|
||||
bean.setDepartment(departmentName + "");
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
team = 2;
|
||||
res += "第" + i + "行" + personName + "部门名称为空";
|
||||
hasError = true;
|
||||
}
|
||||
|
||||
//判断医院名称为空
|
||||
if (StringHelper.isEmpty(hospital) ) {
|
||||
// 判断医院名称为空
|
||||
if (StringHelper.isEmpty(hospital)) {
|
||||
res += "第" + i + "行" + personName + "行医院名称为空;";
|
||||
team = 2;
|
||||
}else{
|
||||
if(hospital.equals("A")){
|
||||
hasError = true;
|
||||
} else {
|
||||
if (hospital.equals("A")) {
|
||||
bean.setHospital("33");
|
||||
}else if(hospital.equals("B")) {
|
||||
} else if (hospital.equals("B")) {
|
||||
bean.setHospital("34");
|
||||
}else if(hospital.equals("C")) {
|
||||
} else if (hospital.equals("C")) {
|
||||
bean.setHospital("35");
|
||||
}else {
|
||||
} else {
|
||||
res += "第" + i + "行" + personName + "行医院名称有误,请检查";
|
||||
hasError = true;
|
||||
}
|
||||
}
|
||||
|
||||
//判断体检套餐为空
|
||||
if (StringHelper.isEmpty(setMeal) ) {
|
||||
String ifHighee = null; // 判断是否为高职
|
||||
// 判断体检套餐为空
|
||||
if (StringHelper.isEmpty(setMeal)) {
|
||||
res += "第" + i + "行" + personName + "行体检套餐为空;";
|
||||
team = 2;
|
||||
}else if(!setMeal.contains(sex)){
|
||||
hasError = true;
|
||||
} else if (!setMeal.contains(sex)) {
|
||||
res += "第" + i + "行" + personName + "行体检套餐内容与性别不符合;";
|
||||
team = 2;
|
||||
hasError = true;
|
||||
} else {
|
||||
PersonnelReservationBean bean1 = dao.getMealName(setMeal);
|
||||
String setMealName = bean1.getSetMealId();
|
||||
if (StringHelper.isEmpty(setMealName) || "0.0".equals(setMealName.trim())) {
|
||||
if(bean1!=null){
|
||||
String setMealName = bean1.getSetMealId();
|
||||
ifHighee = bean1.getIfHighee();
|
||||
if (StringHelper.isEmpty(setMealName) || "0.0".equals(setMealName.trim())) {
|
||||
team = 2;
|
||||
res += "第" + i + "行" + personName + "体检套餐有误,请检查";
|
||||
hasError = true;
|
||||
} else {
|
||||
bean.setSetMeal(setMealName + "");
|
||||
bean.setCheckType(bean1.getCheckType());
|
||||
bean.setCombName(setMeal);
|
||||
}
|
||||
}else{
|
||||
team = 2;
|
||||
res += "第" + i + "行" + personName + "体检套餐有误,请检查";
|
||||
System.out.println(res);
|
||||
} else {
|
||||
bean.setSetMeal(setMealName + "");
|
||||
bean.setCheckType(bean1.getCheckType());
|
||||
bean.setCombName(setMeal);
|
||||
hasError = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//判断手机号码为空
|
||||
if (StringHelper.isEmpty(phone) || "0.0".equals(phone.trim())) {
|
||||
// 判断手机号码为空
|
||||
if (StringHelper.isEmpty(phone) || "0.0".equals(phone.trim())) {
|
||||
res += "第" + i + "行" + personName + "行手机号码为空;";
|
||||
team = 2;
|
||||
hasError = true;
|
||||
} else if (!isLegalMobileNumber(phone)) {
|
||||
res += "第" + i + "行" + personName + "行手机号码格式错误;";
|
||||
team = 2;
|
||||
hasError = true;
|
||||
}
|
||||
bean.setPhone(phone);
|
||||
|
||||
if(team!=2){
|
||||
// 查询通过身份证、姓名、电话去查询
|
||||
PersonnelReservationBean beans = dao.getInfoById(personName,idNumber,phone);
|
||||
if(beans!=null){
|
||||
//获取预约人的id
|
||||
bean.setId(beans.getId());
|
||||
int k = dao.updateReservation(bean);
|
||||
res = "导入成功";
|
||||
}else{
|
||||
res += "第" + i + "行" + personName + "行数据有误,在职人员信息未找到。请检查";
|
||||
// 查询通过身份证、姓名、电话去查询
|
||||
int personNameNum = dao.getPersonNameBy(personName);
|
||||
if (personNameNum > 0) {
|
||||
|
||||
} else {
|
||||
res += "第" + i + "行" + personName + "行姓名有误,在职人员信息未找到。请检查";
|
||||
team = 2;
|
||||
hasError = true;
|
||||
}
|
||||
|
||||
int phoneNum = dao.getPhoneBy(personName,phone);
|
||||
if (phoneNum > 0) {
|
||||
|
||||
}else{
|
||||
res += "第" + i + "行" + personName + "行手机号有误,在职人员信息未找到。请检查";
|
||||
team = 2;
|
||||
hasError = true;
|
||||
}
|
||||
|
||||
if (team != 2) {
|
||||
PersonnelReservationBean beans = dao.getInfoById(personName, idNumber, phone,"");
|
||||
if (beans != null) {
|
||||
// 获取预约人的id
|
||||
// bean.setId(beans.getId());
|
||||
} else {
|
||||
res += "第" + i + "行" + personName + "行身份证有误,在职人员信息未找到。请检查";
|
||||
hasError = true;
|
||||
}
|
||||
|
||||
PersonnelReservationBean beans1 = dao.getInfoById(personName, idNumber, phone,ifHighee);
|
||||
if (beans1 != null) {
|
||||
// 获取预约人的id
|
||||
bean.setId(beans1.getId());
|
||||
} else {
|
||||
res += "第" + i + "行" + personName + "行高职与非高职有误,在职人员信息未找到。请检查";
|
||||
hasError = true;
|
||||
}
|
||||
}
|
||||
// 只有在没有错误的情况下才执行新增操作
|
||||
if (!hasError) {
|
||||
validBeans.add(bean);
|
||||
}
|
||||
}
|
||||
// 只有在没有错误的情况下才执行批量导入操作
|
||||
if (!hasError) {
|
||||
for (PersonnelReservationBean bean : validBeans) {
|
||||
int k = dao.updateReservation(bean);
|
||||
}
|
||||
res = "导入成功";
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
private String ChangepersonType(String personType) {
|
||||
String team;
|
||||
if(personType.equals("在职")){
|
||||
team="1";
|
||||
}else if(personType.equals("离退休")){
|
||||
team="2";
|
||||
}else if(personType.equals("劳务派遣")){
|
||||
team="3";
|
||||
}else{
|
||||
team="0";
|
||||
if (personType.equals("在职")) {
|
||||
team = "1";
|
||||
} else if (personType.equals("离退休")) {
|
||||
team = "2";
|
||||
} else if (personType.equals("劳务派遣")) {
|
||||
team = "3";
|
||||
} else {
|
||||
team = "0";
|
||||
}
|
||||
return team;
|
||||
}
|
||||
|
|
@ -403,10 +461,10 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
}
|
||||
|
||||
|
||||
private String changeView(String srt){
|
||||
if(StringHelper.isEmpty(srt)){
|
||||
private String changeView(String srt) {
|
||||
if (StringHelper.isEmpty(srt)) {
|
||||
return "";
|
||||
}else{
|
||||
} else {
|
||||
return srt;
|
||||
}
|
||||
}
|
||||
|
|
@ -417,14 +475,17 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
}
|
||||
return mobile.matches(MOBILE_RULE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证身份证真假
|
||||
* @param carNumber 身份证号
|
||||
* @return boolean*/
|
||||
*
|
||||
* @param carNumber 身份证号
|
||||
* @return boolean
|
||||
*/
|
||||
public static boolean isCard(String carNumber) {
|
||||
//判断输入身份证号长度是否合法
|
||||
if (carNumber.length() != 18) {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
//校验身份证真假
|
||||
int sum = 0;
|
||||
|
|
@ -460,6 +521,7 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
|
||||
/**
|
||||
* 根据身份证号计算持有者年龄
|
||||
*
|
||||
* @param idCard
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -470,8 +532,8 @@ public class ImportExcelServiceImpl implements ImportExcelService {
|
|||
String year;
|
||||
String monthDay;
|
||||
if (idCard.length() == 18) {
|
||||
year = idCard.substring(6,10);
|
||||
monthDay = idCard.substring(10,14);
|
||||
year = idCard.substring(6, 10);
|
||||
monthDay = idCard.substring(10, 14);
|
||||
} else {
|
||||
year = "19" + idCard.substring(6, 8);
|
||||
monthDay = idCard.substring(8, 12);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -169,13 +169,29 @@
|
|||
from pm_base_physical
|
||||
where is_active = '1' and if_job = '1' and phy_name = #{personName} and idcard = #{idNumber}
|
||||
and telep_number = #{phone}
|
||||
<if test="ifHighee!=null and ifHighee !='' and ifHighee !='null' ">
|
||||
and if_higher = #{ifHighee}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPersonNameBy" resultType="java.lang.Integer">
|
||||
SELECT count(1)
|
||||
from pm_base_physical
|
||||
where is_active = '1' and if_job = '1' and phy_name = #{personName}
|
||||
</select>
|
||||
|
||||
<select id="getMealName" resultType="com.bonus.boot.manager.basic.entity.PersonnelReservationBean">
|
||||
select id as setMealId,check_id as checkType
|
||||
select id as setMealId,check_id as checkType,if_highee as ifHighee
|
||||
from pm_base_combination
|
||||
where `comb_name` = #{setMeal}
|
||||
and is_active = '1' LIMIT 1
|
||||
</select>
|
||||
<select id="getPhoneBy" resultType="java.lang.Integer">
|
||||
SELECT count(1)
|
||||
from pm_base_physical
|
||||
where is_active = '1' and if_job = '1' and telep_number = #{phone} and phy_name = #{personName}
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateReservation">
|
||||
update pm_base_physical
|
||||
|
|
|
|||
|
|
@ -115,9 +115,6 @@ layui.use(['table', 'layer', 'laydate', 'jquery', 'form'], function () {
|
|||
case "exportBtn":
|
||||
//导出
|
||||
break;
|
||||
case "exportBtnYu":
|
||||
download()
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -189,7 +186,7 @@ function importExcel() {
|
|||
contentType: false,
|
||||
success: function (data) {
|
||||
if (data.resMsg == '导入成功') {
|
||||
showMessage('导入成功!', true);
|
||||
showMessages('导入成功!', true);
|
||||
} else {
|
||||
showMessage(data.resMsg, false);
|
||||
}
|
||||
|
|
@ -208,9 +205,13 @@ function showMessage(message, isSuccess) {
|
|||
layer.msg(message, { time: 10000, icon: isSuccess ? 1 : 2 });
|
||||
}
|
||||
|
||||
function showMessages(message, isSuccess) {
|
||||
layer.msg(message, { time: 3000, icon: isSuccess ? 1 : 2 });
|
||||
}
|
||||
|
||||
function download(){
|
||||
window.location.href = ctxPath + "/download/download?filename=体检人员名单导入.xlsx"
|
||||
|
||||
function fetchExcelYu(){
|
||||
window.location.href = ctxPath + "/download/download?filename=预约体检模版.xlsx"
|
||||
}
|
||||
|
||||
function importExcelYu() {
|
||||
|
|
@ -244,10 +245,10 @@ function importExcelYu() {
|
|||
contentType: false,
|
||||
success: function (data) {
|
||||
if (data.resMsg == '导入成功') {
|
||||
showMessage('导入成功!', true);
|
||||
showMessages('导入成功!', true);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 10001)
|
||||
}, 30001)
|
||||
} else {
|
||||
showMessage(data.resMsg, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
</div>
|
||||
|
||||
<div class="layui-inline" style="width: 6%;margin-top: 4px">
|
||||
<button id="exportBtnYu" class="layui-btn layui-btn-sm" onclick="fetchExcel()"><i class="layui-icon"></i>导出预约模板</button>
|
||||
<button id="exportBtnYu" class="layui-btn layui-btn-sm" onclick="fetchExcelYu()" ><i class="layui-icon"></i>导出预约模板</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" >
|
||||
|
|
|
|||
Loading…
Reference in New Issue