|
@ -1295,12 +1295,43 @@ public class DoctorInfoService extends BaseService {
|
|
|
// doctor.setCheckPassword(Encodes.encodeHex(hashPassword));
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取CA证书过期时间
|
|
|
* 获取线上CA是否认证过
|
|
|
*/
|
|
|
public JSONObject getCAPastDue(String strUserIdcardNum) throws Exception{
|
|
|
|
|
|
public JSONObject isAuthentication(String doctorCode) throws Exception{
|
|
|
Doctor doctor = findDoctorByCode(doctorCode);
|
|
|
String strUserIdcardNum = doctor.getIdcard();
|
|
|
Boolean isSuccess = true;
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
if(doctor.getIscertified()==1){
|
|
|
if(doctor.getCertifiedOvertime().getTime()>System.currentTimeMillis()){
|
|
|
jsonObject.put("type",4);
|
|
|
String data = simpleDateFormat.format(doctor.getCertifiedOvertime());
|
|
|
jsonObject.put("time",data);
|
|
|
}else{
|
|
|
jsonObject = getCAPastDue(doctorCode,jsonObject);
|
|
|
}
|
|
|
}else{
|
|
|
|
|
|
jsonObject = getCAPastDue(doctorCode,jsonObject);
|
|
|
|
|
|
}
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取CA证书过期时间
|
|
|
*/
|
|
|
public JSONObject getCAPastDue(String doctorCode,JSONObject jsonObject) throws Exception{
|
|
|
Doctor doctor = findDoctorByCode(doctorCode);
|
|
|
String strUserIdcardNum = doctor.getIdcard();
|
|
|
String data ="";
|
|
|
// JSONObject jsonObject = new JSONObject();
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String url = jwUrl+"/third/prescription/GetRealNameSoftCertExpiredDatetime";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strUserIdcardNum",strUserIdcardNum));
|
|
@ -1311,18 +1342,16 @@ public class DoctorInfoService extends BaseService {
|
|
|
int status = responseObject.getInt("status");
|
|
|
String msg = responseObject.getString("msg");
|
|
|
if (status == 200) {
|
|
|
String data = responseObject.getString("data");
|
|
|
data = responseObject.getString("data");
|
|
|
if (!StringUtils.isEmpty(data) && data.startsWith("error")) {
|
|
|
throw new Exception(data);
|
|
|
} else {
|
|
|
// JSONObject jsonData = new JSONObject(data);
|
|
|
// JSONArray jsonArray = jsonData.getJSONArray("EventList");
|
|
|
// re = jsonArray.toString();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
//1、有证书,并有效,2、有证书,已过期,3、无证书
|
|
|
//1、线上未认证,有证书,并有效,2、线上未认证,有证书,已过期,3、线上未认证,无证书,4、线上已认证,并有效
|
|
|
if(StringUtils.isNotEmpty(data)){
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
long times = simpleDateFormat.parse(data).getTime();
|
|
|
Date CertifiedOvertime = simpleDateFormat.parse(data);
|
|
|
doctor.setCertifiedOvertime(CertifiedOvertime);
|
|
|
doctorDao.save(doctor);
|
|
|
long times = CertifiedOvertime.getTime();
|
|
|
if(System.currentTimeMillis()<=times){
|
|
|
jsonObject.put("type",1);
|
|
|
}else{
|
|
@ -1331,9 +1360,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
}else{
|
|
|
jsonObject.put("type",3);
|
|
|
}
|
|
|
jsonObject.put("time",data);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception(responseObject.getString("msg"));
|
|
@ -1341,12 +1368,14 @@ public class DoctorInfoService extends BaseService {
|
|
|
}else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
jsonObject.put("time",data);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改实名软证书调用保护口令
|
|
|
*/
|
|
|
public boolean updateAuthenticationPassword(String strUserIdcardNum,String strOldCalledPasswd,String strNewCalledPasswd) throws Exception{
|
|
|
public boolean updateAuthenticationPassword(String strUserIdcardNum,String strOldCalledPasswd,String strNewCalledPasswd,String doctorCode) throws Exception{
|
|
|
|
|
|
String url = jwUrl+"/third/prescription/ModifyRealNameSoftCertCalledPasswd";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
@ -1364,6 +1393,9 @@ public class DoctorInfoService extends BaseService {
|
|
|
throw new Exception(data);
|
|
|
}else{
|
|
|
if("0".equals(data)){
|
|
|
Doctor doctor = findDoctorByCode(doctorCode);
|
|
|
doctor.setIscertified(1);
|
|
|
doctorDao.save(doctor);
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@ -1441,4 +1473,9 @@ public class DoctorInfoService extends BaseService {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// //判断线上是否已经认证过(即是否设置过密码)
|
|
|
// public boolean iscertifiedAuthentication(S){
|
|
|
//
|
|
|
// }
|
|
|
}
|