|
@ -2,6 +2,7 @@ package com.yihu.jw.hospital.endpoint.hospital;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.entity.base.patient.BaseNatPatientFamilyMemberDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
|
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
@ -10,15 +11,21 @@ import com.yihu.jw.hospital.family.dao.WlyyPatientFamilyMemberDao;
|
|
|
import com.yihu.jw.hospital.family.service.PatientMemberDictService;
|
|
|
import com.yihu.jw.hospital.family.service.WlyyFamilyMemberService;
|
|
|
import com.yihu.jw.hospital.prescription.service.DsyyPrescriptionService;
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.*;
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
|
|
|
import com.yihu.jw.sms.service.YkyyINSMSService;
|
|
|
import com.yihu.jw.sms.service.ZBSmsService;
|
|
|
import com.yihu.jw.sms.service.ZhongShanSMSService;
|
|
|
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@ -75,7 +82,8 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
private String wxId;
|
|
|
@Autowired
|
|
|
private DsyyPrescriptionService dsyyPrescriptionService;
|
|
|
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
|
|
|
@ApiOperation("获取家人关系")
|
|
|
@PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findRelationDict)
|
|
@ -389,6 +397,9 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
|
|
|
//验证验证码
|
|
|
public boolean verification(String client_id, String username, String code) {
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
return false;
|
|
|
}
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("isNeedSMS").orElse(null);
|
|
|
if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
|
|
|
if (code.equalsIgnoreCase(wlyyHospitalSysDictDO.getDictValue())){
|
|
@ -397,8 +408,12 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
return false;
|
|
|
//新增白名单判断-白名单验证码默认123456
|
|
|
if("123456".equals(code)){
|
|
|
WlyyHospitalSysDictDO dictDO = wlyyHospitalSysDictDao.findOneByDictNameAndDictCode("sms_captcha_white",username);
|
|
|
if(dictDO!=null){
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
String key = client_id + ":" + username + KEY_SUFFIX;
|
|
|
String _code = (String) redisTemplate.opsForValue().get(key);
|
|
@ -411,6 +426,32 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "buildAccount")
|
|
|
@ApiOperation(value = "账户建档接口")
|
|
|
public ObjEnvelop buildAccount(@ApiParam(name = "userName", value = "姓名", required = false)
|
|
|
@RequestParam(value = "userName",required = false)String userName,
|
|
|
@ApiParam(name = "idNo", value = "身份证", required = false)
|
|
|
@RequestParam(value = "idNo",required = false)String idNo,
|
|
|
@ApiParam(name = "gend", value = "性别 1男 2女", required = false)
|
|
|
@RequestParam(value = "gend",required = false)String gend,
|
|
|
@ApiParam(name = "phone", value = "电话号码", required = false)
|
|
|
@RequestParam(value = "phone",required = false)String phone,
|
|
|
@ApiParam(name = "cardNo", value = "卡号", required = false)
|
|
|
@RequestParam(value = "cardNo",required = false)String cardNo) throws Exception {
|
|
|
try {
|
|
|
BasePatientDO patientDO = patientDao.findById(getUID()).orElse(null);
|
|
|
String operatorName = "";
|
|
|
if(patientDO!=null){
|
|
|
operatorName = patientDO.getName();
|
|
|
}
|
|
|
JSONObject obj = dsyyPrescriptionService.buildAccountToHospital(operatorName,userName,idNo,gend,phone,cardNo);
|
|
|
return ObjEnvelop.getSuccess("ok",obj);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return ObjEnvelop.getError("创建失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("保存家人关系")
|
|
|
@PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.saveFamilyRelation)
|
|
|
public MixEnvelop saveFamilyRelation(@ApiParam(name = "jsonData", value = "jsonData", required = false)
|
|
@ -424,12 +465,18 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
String medicareType = jsonObject.getString("medicareType");
|
|
|
String medicare = jsonObject.getString("medicare");
|
|
|
String clinicId = jsonObject.getString("clinicId");
|
|
|
String buildAccount = jsonObject.getString("buildAccount");
|
|
|
boolean checkCode =false;
|
|
|
if(!StringUtils.isEmpty(code)){
|
|
|
checkCode = this.verification(client_id, username, code);
|
|
|
}else if(StringUtils.isEmpty(code)&&StringUtils.isEmpty(client_id)) {
|
|
|
if(!"1".equals(buildAccount)){
|
|
|
if(!StringUtils.isEmpty(code)){
|
|
|
checkCode = this.verification(client_id, username, code);
|
|
|
}else if(StringUtils.isEmpty(code)&&StringUtils.isEmpty(client_id)) {
|
|
|
checkCode = true;
|
|
|
}
|
|
|
}else {
|
|
|
checkCode = true;
|
|
|
}
|
|
|
|
|
|
if (checkCode) {
|
|
|
String patientId = jsonObject.getString("patientId");
|
|
|
String familyName = jsonObject.getString("familyName");
|
|
@ -449,6 +496,27 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
if (null != jsonObject.get("id")) {
|
|
|
id = jsonObject.get("id").toString();
|
|
|
}
|
|
|
|
|
|
if ("1".equals(buildAccount)&&"xm_dsyy_wx".equalsIgnoreCase(wxId)){
|
|
|
if (medicare==null||medicare==""){
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("社保卡号为空无法建档!请核对社保卡号!");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
//三院自费建档
|
|
|
BasePatientDO patientDO = patientDao.findById(getUID()).orElse(null);
|
|
|
String operatorName = "";
|
|
|
if(patientDO!=null){
|
|
|
operatorName = patientDO.getName();
|
|
|
}
|
|
|
JSONObject object = dsyyPrescriptionService.buildAccountToHospital(operatorName,familyName,idCard, IdCardUtil.getSexForIdcard_new(idCard),username,medicare);
|
|
|
if(!"00".equals(object.getString("retCode"))){
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage(object.getString("retMsg"));
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取建档信息
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
|
|
|
|