|
@ -102,7 +102,7 @@ public class FamilyContractService extends BaseService {
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
public SignFamily findSigningByPatient(String patient){
|
|
|
public SignFamily findSigningByPatient(String patient) {
|
|
|
return signFamilyDao.findSigningByPatient(patient);
|
|
|
}
|
|
|
|
|
@ -202,7 +202,7 @@ public class FamilyContractService extends BaseService {
|
|
|
json.put("doctor", d.getCode());
|
|
|
json.put("name", d.getName());
|
|
|
json.put("photo", d.getPhoto());
|
|
|
json.put("sex",d.getSex());
|
|
|
json.put("sex", d.getSex());
|
|
|
json.put("job", d.getJob());
|
|
|
json.put("jobName", d.getJobName());
|
|
|
json.put("hospital", d.getHosptialName());
|
|
@ -486,7 +486,7 @@ public class FamilyContractService extends BaseService {
|
|
|
public int surrender(String patient, String patientName, String userPhoto, String doctor, String doctorName, String openid, String reason, int sex) {
|
|
|
// 更新为待解约
|
|
|
int res = signFamilyDao.surrender(patient, doctor);
|
|
|
SignFamily signFamily= signFamilyDao.findByjiatingPatient(patient);
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatient(patient);
|
|
|
signFamily.setPatientApplyUnsignDate(new Date());
|
|
|
if (res == 0) {
|
|
|
return 0;
|
|
@ -618,7 +618,7 @@ public class FamilyContractService extends BaseService {
|
|
|
String hospital, String hospitalName,
|
|
|
String idcard, String ssc, String mobile,
|
|
|
String emerMobile, String images, String disease, String expenses, String signDoctorCode,
|
|
|
String signDoctorName, String signDoctorLevel,String customGroup) throws Exception {
|
|
|
String signDoctorName, String signDoctorLevel, String customGroup) throws Exception {
|
|
|
// 查询是否有家庭签约
|
|
|
SignFamily sc = signFamilyDao.findByIdcard(idcard);
|
|
|
if (sc != null) {
|
|
@ -626,12 +626,12 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
//判断是否有三师签约 并且判断全科医生一致
|
|
|
SignFamily sssignFamily = signFamilyDao.findSSByIdcard(idcard);
|
|
|
if (sssignFamily != null&&!doctor.equals(sssignFamily.getDoctor())) {
|
|
|
if (sssignFamily != null && !doctor.equals(sssignFamily.getDoctor())) {
|
|
|
throw new Exception("全科医生不一致!");
|
|
|
}
|
|
|
|
|
|
List<SystemDict> systemDicts= systemDictDao.findByDictName("SIGN_YEAR");
|
|
|
String signYear=systemDicts.get(0).getCode();
|
|
|
List<SystemDict> systemDicts = systemDictDao.findByDictName("SIGN_YEAR");
|
|
|
String signYear = systemDicts.get(0).getCode();
|
|
|
|
|
|
SignFamily sf = new SignFamily();
|
|
|
sf.setSignYear(signYear);//设置签约年度
|
|
@ -651,12 +651,12 @@ public class FamilyContractService extends BaseService {
|
|
|
sf.setMobile(mobile);
|
|
|
sf.setHospital(hospital);
|
|
|
sf.setHospitalName(hospitalName);
|
|
|
String sscD="";
|
|
|
if(StringUtils.isNumeric(ssc.trim())){
|
|
|
String sscD = "";
|
|
|
if (StringUtils.isNumeric(ssc.trim())) {
|
|
|
//如果是纯数字的医保号换成D开头的
|
|
|
sscD=sbInfoDao.findBySfzh18Max(idcard).getCardno();
|
|
|
}else{
|
|
|
sscD=ssc;
|
|
|
sscD = sbInfoDao.findBySfzh18Max(idcard).getCardno();
|
|
|
} else {
|
|
|
sscD = ssc;
|
|
|
}
|
|
|
sf.setSsc(sscD);
|
|
|
sf.setStatus(1);// 代理签约,直接生效
|
|
@ -771,7 +771,7 @@ public class FamilyContractService extends BaseService {
|
|
|
//判断病人分组
|
|
|
if (!StringUtils.isEmpty(disease)) {
|
|
|
List<String> diseases = Arrays.asList(disease.split(","));
|
|
|
if(diseases.contains("1") || diseases.contains("2")) {
|
|
|
if (diseases.contains("1") || diseases.contains("2")) {
|
|
|
groupCode = "2";
|
|
|
}
|
|
|
} else {
|
|
@ -816,7 +816,7 @@ public class FamilyContractService extends BaseService {
|
|
|
doctorPatientGroupInfo.setSignType("2");//家庭签约
|
|
|
doctorPatientGroupInfoDao.save(doctorPatientGroupInfo);
|
|
|
|
|
|
if(!StringUtils.isEmpty(customGroup) && !customGroup.equals("0")){
|
|
|
if (!StringUtils.isEmpty(customGroup) && !customGroup.equals("0")) {
|
|
|
DoctorPatientGroupInfo customDoctorGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
customDoctorGroup.setCzrq(new Date());
|
|
@ -831,9 +831,9 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
doctorPatientGroupInfoDao.save(customDoctorGroup);
|
|
|
|
|
|
SignFamily signFamily = signFamilyDao.findSsSignByDoctorPatient(sf.getDoctor(),sf.getPatient());
|
|
|
SignFamily signFamily = signFamilyDao.findSsSignByDoctorPatient(sf.getDoctor(), sf.getPatient());
|
|
|
|
|
|
if(signFamily != null){
|
|
|
if (signFamily != null) {
|
|
|
DoctorPatientGroupInfo ssDoctorGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ssDoctorGroup.setCzrq(new Date());
|
|
@ -854,10 +854,10 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
if (groups != null && groups.size() > 0) {
|
|
|
for (DoctorPatientGroupInfo group : groups) {
|
|
|
if(StringUtils.isNotEmpty(group.getSignType()) && group.getSignType().equals("2")) {
|
|
|
if (StringUtils.isNotEmpty(group.getSignType()) && group.getSignType().equals("2")) {
|
|
|
continue;
|
|
|
}
|
|
|
if(group.getGroup().equals(customGroup)){
|
|
|
if (group.getGroup().equals(customGroup)) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@ -877,10 +877,10 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(!StringUtils.isEmpty(disease) && !disease.equals("0")){
|
|
|
boolean flag = patientDiseaseService.updatePatientDisease(sf.getPatient(),disease);
|
|
|
if (!StringUtils.isEmpty(disease) && !disease.equals("0")) {
|
|
|
boolean flag = patientDiseaseService.updatePatientDisease(sf.getPatient(), disease);
|
|
|
|
|
|
if(!flag){
|
|
|
if (!flag) {
|
|
|
throw new Exception("疾病更新失败");
|
|
|
}
|
|
|
}
|
|
@ -890,7 +890,7 @@ public class FamilyContractService extends BaseService {
|
|
|
Doctor doc = doctorDao.findByCode(sf.getDoctor());
|
|
|
Hospital hos = hospitalDao.findByCode(doc.getHospital());
|
|
|
|
|
|
String content= "祝贺您,成功签约" + sf.getDoctorName() + "医生团队,您已可以享受家庭医生所带来的无微不至的健康保健服务。"+
|
|
|
String content = "祝贺您,成功签约" + sf.getDoctorName() + "医生团队,您已可以享受家庭医生所带来的无微不至的健康保健服务。" +
|
|
|
"为了给您提供更好的服务,请尽快到" + (hos != null ? hos.getName() : "") + "社区(地址:" +
|
|
|
(hos != null ? hos.getAddress() : "") + ")缴费。";
|
|
|
JSONObject json = new JSONObject();
|
|
@ -899,12 +899,13 @@ public class FamilyContractService extends BaseService {
|
|
|
json.put("doctorName", sf.getDoctorName());
|
|
|
json.put("date", DateUtil.dateToStrShort(sf.getBegin()));
|
|
|
json.put("content", content);
|
|
|
json.put("remark", "您好,您成功签约家庭医生");
|
|
|
json.put("remark", ""); //您好,您成功签约家庭医生
|
|
|
// 添加到发送队列
|
|
|
PushMsgTask.getInstance().putWxMsg(access_token, 1, sf.getOpenid(), sf.getName(), json);
|
|
|
}
|
|
|
return temp;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 处理签约申请
|
|
|
*
|
|
@ -921,7 +922,7 @@ public class FamilyContractService extends BaseService {
|
|
|
String healthDoctor,
|
|
|
String healthDoctorName,
|
|
|
long msgid,
|
|
|
String patientCard, int type, String disease, String majorDoctor, String majorhDoctorName,String customGroup, String expenses) throws Exception {
|
|
|
String patientCard, int type, String disease, String majorDoctor, String majorhDoctorName, String customGroup, String expenses) throws Exception {
|
|
|
if (type != 1 && type != 2) {
|
|
|
return -1;
|
|
|
}
|
|
@ -942,8 +943,8 @@ public class FamilyContractService extends BaseService {
|
|
|
return 0;
|
|
|
}
|
|
|
if (type == 1) {
|
|
|
List<SystemDict> systemDicts= systemDictDao.findByDictName("SIGN_YEAR");
|
|
|
String year=systemDicts.get(0).getCode();
|
|
|
List<SystemDict> systemDicts = systemDictDao.findByDictName("SIGN_YEAR");
|
|
|
String year = systemDicts.get(0).getCode();
|
|
|
//病人疾病更新
|
|
|
// if (!StringUtils.isEmpty(disease)) {
|
|
|
// p.setDisease(Integer.valueOf(disease));
|
|
@ -1050,7 +1051,7 @@ public class FamilyContractService extends BaseService {
|
|
|
//判断病人分组
|
|
|
if (!StringUtils.isEmpty(disease)) {
|
|
|
List<String> diseases = Arrays.asList(disease.split(","));
|
|
|
if(diseases.contains("1") || diseases.contains("2")) {
|
|
|
if (diseases.contains("1") || diseases.contains("2")) {
|
|
|
groupCode = "2";
|
|
|
}
|
|
|
} else {
|
|
@ -1097,7 +1098,7 @@ public class FamilyContractService extends BaseService {
|
|
|
doctorPatientGroupInfo.setSignType("2");//家庭签约
|
|
|
doctorPatientGroupInfoDao.save(doctorPatientGroupInfo);
|
|
|
|
|
|
if(!StringUtils.isEmpty(customGroup) && !customGroup.equals("0")){
|
|
|
if (!StringUtils.isEmpty(customGroup) && !customGroup.equals("0")) {
|
|
|
DoctorPatientGroupInfo customDoctorGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
customDoctorGroup.setCzrq(new Date());
|
|
@ -1111,9 +1112,9 @@ public class FamilyContractService extends BaseService {
|
|
|
customDoctorGroup.setSignType("2");//家庭签约
|
|
|
doctorPatientGroupInfoDao.save(customDoctorGroup);
|
|
|
|
|
|
SignFamily signFamily = signFamilyDao.findSsSignByDoctorPatient(sf.getDoctor(),sf.getPatient());
|
|
|
SignFamily signFamily = signFamilyDao.findSsSignByDoctorPatient(sf.getDoctor(), sf.getPatient());
|
|
|
|
|
|
if(signFamily != null){
|
|
|
if (signFamily != null) {
|
|
|
DoctorPatientGroupInfo ssDoctorGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ssDoctorGroup.setCzrq(new Date());
|
|
@ -1134,10 +1135,10 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
if (groups != null && groups.size() > 0) {
|
|
|
for (DoctorPatientGroupInfo group : groups) {
|
|
|
if(StringUtils.isNotEmpty(group.getSignType()) && group.getSignType().equals("2")) {
|
|
|
if (StringUtils.isNotEmpty(group.getSignType()) && group.getSignType().equals("2")) {
|
|
|
continue;
|
|
|
}
|
|
|
if(group.getGroup().equals(customGroup)){
|
|
|
if (group.getGroup().equals(customGroup)) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@ -1157,10 +1158,10 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(!StringUtils.isEmpty(disease) && !disease.equals("0")){
|
|
|
boolean flag = patientDiseaseService.updatePatientDisease(sf.getPatient(),disease);
|
|
|
if (!StringUtils.isEmpty(disease) && !disease.equals("0")) {
|
|
|
boolean flag = patientDiseaseService.updatePatientDisease(sf.getPatient(), disease);
|
|
|
|
|
|
if(!flag){
|
|
|
if (!flag) {
|
|
|
throw new Exception("疾病更新失败");
|
|
|
}
|
|
|
}
|
|
@ -1170,7 +1171,7 @@ public class FamilyContractService extends BaseService {
|
|
|
Doctor doc = doctorDao.findByCode(sf.getDoctor());
|
|
|
Hospital hos = hospitalDao.findByCode(doc.getHospital());
|
|
|
|
|
|
String content= "祝贺您,成功签约" + sf.getDoctorName() + "医生团队,您已可以享受家庭医生所带来的无微不至的健康保健服务。"+
|
|
|
String content = "祝贺您,成功签约" + sf.getDoctorName() + "医生团队,您已可以享受家庭医生所带来的无微不至的健康保健服务。" +
|
|
|
"为了给您提供更好的服务,请尽快到" + (hos != null ? hos.getName() : "") + "社区(地址:" +
|
|
|
(hos != null ? hos.getAddress() : "") + ")缴费。";
|
|
|
// 同意签约
|
|
@ -1180,7 +1181,7 @@ public class FamilyContractService extends BaseService {
|
|
|
json.put("doctorName", sf.getDoctorName());
|
|
|
json.put("date", DateUtil.dateToStrShort(sf.getBegin()));
|
|
|
json.put("content", content);
|
|
|
json.put("remark", "您好,您成功签约家庭医生");
|
|
|
json.put("remark", ""); //您好,您成功签约家庭医生
|
|
|
// 添加到发送队列
|
|
|
PushMsgTask.getInstance().putWxMsg(access_token, 1, sf.getOpenid(), sf.getName(), json);
|
|
|
} else if (type == 2) {
|
|
@ -1207,7 +1208,7 @@ public class FamilyContractService extends BaseService {
|
|
|
* @param reason 解约原因
|
|
|
* @return
|
|
|
*/
|
|
|
public int handleSurrender(String access_token, long msgid, String patient, int type, String reason) {
|
|
|
public int handleSurrender(String access_token, long msgid, String patient, int type, String reason) throws Exception {
|
|
|
if (type != 1 && type != 2) {
|
|
|
return -1;
|
|
|
}
|
|
@ -1222,6 +1223,10 @@ public class FamilyContractService extends BaseService {
|
|
|
message.setOver("0");
|
|
|
}
|
|
|
if (type == 1) {
|
|
|
// 设置家庭签约疾病无效
|
|
|
if (!patientDiseaseService.updatePatientDisease(patient, "")) {
|
|
|
throw new Exception("patient's disease update failed");
|
|
|
}
|
|
|
// 将签约状态改为已解约
|
|
|
sf.setReason(reason);
|
|
|
sf.setStatus(-3);
|
|
@ -1235,8 +1240,6 @@ public class FamilyContractService extends BaseService {
|
|
|
doctorPatientGroupInfoDao.deleteByPatient(patient);
|
|
|
//结束患者家庭签约咨询
|
|
|
consultTeamDao.updateStatusByPatient(patient);
|
|
|
// 设置家庭签约疾病无效
|
|
|
patientDiseaseService.updatePatientDisease(patient,"");
|
|
|
|
|
|
// 推送消息消息给微信端
|
|
|
JSONObject json = new JSONObject();
|
|
@ -1338,23 +1341,25 @@ public class FamilyContractService extends BaseService {
|
|
|
// 获取当前年份
|
|
|
String year = DateUtil.getStringDate(DateUtil.YY);
|
|
|
Hospital hospital1 = hospitalDao.findByCode(hospital);
|
|
|
Integer amount=0;
|
|
|
SignFamilyCode signFamilyCode = wlyySignFamilyCodeDao.findByOrgCode(hospital);
|
|
|
if(signFamilyCode !=null){
|
|
|
amount= signFamilyCode.getSequence()+1;
|
|
|
signFamilyCode.setSequence(amount);
|
|
|
signFamilyCode.setModifyTime(new Date());
|
|
|
}else{
|
|
|
Integer amount = 0;
|
|
|
SignFamilyCode wlyySignFamilyCode = wlyySignFamilyCodeDao.findByOrgCodeAndYear(hospital, year);
|
|
|
if (wlyySignFamilyCode != null) {
|
|
|
amount = wlyySignFamilyCode.getSequence() + 1;
|
|
|
wlyySignFamilyCode.setSequence(amount);
|
|
|
wlyySignFamilyCode.setModifyTime(new Date());
|
|
|
} else {
|
|
|
//创建序列
|
|
|
amount=1;
|
|
|
SignFamilyCode signFamilyCodeTemp =new SignFamilyCode();
|
|
|
signFamilyCodeTemp.setModifyTime(new Date());
|
|
|
signFamilyCodeTemp.setOrgCode(hospital1.getCode());
|
|
|
signFamilyCodeTemp.setOrgName(hospital1.getName());
|
|
|
signFamilyCodeTemp.setSequence(1);
|
|
|
wlyySignFamilyCodeDao.save(signFamilyCodeTemp);
|
|
|
}
|
|
|
return year + hospital1.getRoadCode() + hospital1.getCenterSite() + StringUtils.leftPad(String.valueOf(amount + 1), 6, "0");
|
|
|
amount = 1;
|
|
|
SignFamilyCode wlyySignFamilyCodeTemp = new SignFamilyCode();
|
|
|
wlyySignFamilyCodeTemp.setModifyTime(new Date());
|
|
|
wlyySignFamilyCodeTemp.setOrgCode(hospital1.getCode());
|
|
|
wlyySignFamilyCodeTemp.setOrgName(hospital1.getName());
|
|
|
wlyySignFamilyCodeTemp.setYear(year);
|
|
|
wlyySignFamilyCodeTemp.setSequence(1);
|
|
|
wlyySignFamilyCodeDao.save(wlyySignFamilyCodeTemp);
|
|
|
}
|
|
|
|
|
|
return year + hospital1.getRoadCode() + hospital1.getCenterSite() + "Y" + StringUtils.leftPad(String.valueOf(amount + 1), 5, "0");
|
|
|
}
|
|
|
|
|
|
public int countAmountSigned2(String uid) {
|
|
@ -1366,6 +1371,7 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
return signFamilyDao.findSanshiSignByPatient(code);
|
|
|
}
|
|
|
|
|
|
public SignFamily findByJiatingPatient(String code) {
|
|
|
|
|
|
return signFamilyDao.findFamilySignByPatient(code);
|
|
@ -1471,8 +1477,8 @@ public class FamilyContractService extends BaseService {
|
|
|
result.put("majorDoctor", member.getMemberCode());
|
|
|
result.put("majorDoctorName", member.getName());
|
|
|
} else if (member.getType() == 2) {
|
|
|
Doctor doctor=doctorDao.findByCode(member.getMemberCode());
|
|
|
result.put("hospital",doctor.getHospital());
|
|
|
Doctor doctor = doctorDao.findByCode(member.getMemberCode());
|
|
|
result.put("hospital", doctor.getHospital());
|
|
|
result.put("doctor", member.getMemberCode());
|
|
|
result.put("doctorName", member.getName());
|
|
|
} else if (member.getType() == 3) {
|
|
@ -1483,20 +1489,20 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
// 查询患者疾病
|
|
|
String diseases = redisTemplate.opsForValue().get("disease:" + p.getCode());
|
|
|
if(!StringUtils.isEmpty(diseases)){
|
|
|
if (!StringUtils.isEmpty(diseases)) {
|
|
|
JSONArray array = new JSONArray(diseases);
|
|
|
JSONArray disArray = new JSONArray();
|
|
|
|
|
|
for(int i = 0; i < array.length(); i++){
|
|
|
for (int i = 0; i < array.length(); i++) {
|
|
|
JSONObject json = array.getJSONObject(i);
|
|
|
if(json != null && json.get("signType").toString().equals("1")){
|
|
|
if (json != null && json.get("signType").toString().equals("1")) {
|
|
|
disArray.put(json);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
result.put("diseases",disArray);
|
|
|
}else{
|
|
|
result.put("diseases","");
|
|
|
result.put("diseases", disArray);
|
|
|
} else {
|
|
|
result.put("diseases", "");
|
|
|
}
|
|
|
|
|
|
|
|
@ -1506,9 +1512,9 @@ public class FamilyContractService extends BaseService {
|
|
|
result.put("signStatus", "3");
|
|
|
}
|
|
|
|
|
|
if(p != null){
|
|
|
if (p != null) {
|
|
|
JSONObject pJson = new JSONObject(p);
|
|
|
result.put("patient",pJson);
|
|
|
result.put("patient", pJson);
|
|
|
}
|
|
|
|
|
|
return result;
|
|
@ -1518,7 +1524,7 @@ public class FamilyContractService extends BaseService {
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
//找出患者的三师签约信息
|
|
|
SignFamily signFamily = signFamilyDao.findSanshiSignByPatient(patientCode);
|
|
|
Patient patient=patientDao.findByCode(patientCode);
|
|
|
Patient patient = patientDao.findByCode(patientCode);
|
|
|
if (signFamily != null) {
|
|
|
//得到三师签约的服务团队
|
|
|
List<Doctor> doctors = doctorDao.findSanshiDoctorByTeam(signFamily.getTeamCode());
|
|
@ -1534,14 +1540,14 @@ public class FamilyContractService extends BaseService {
|
|
|
jo.put("signStatus", signFamily.getStatus());//签约状态 0待签约,1已签约 2待解约
|
|
|
jo.put("jobName", doctor.getJobName());//职称
|
|
|
jo.put("disease", patient.getDisease());//0健康,1高血压,2糖尿病,3高血压+糖尿病
|
|
|
if(signFamily.getStatus()==0){
|
|
|
if (signFamily.getStatus() == 0) {
|
|
|
jo.put("sqDate", DateUtil.dateToStrShort(signFamily.getPatientApplyDate()));//申请时间
|
|
|
}else if(signFamily.getStatus()==1){
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort( signFamily.getApplyDate()));//签约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort( signFamily.getEnd()));//结束时间
|
|
|
}else if(signFamily.getStatus()==2){
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort( signFamily.getPatientApplyUnsignDate()));//申请解约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort( signFamily.getEnd()));//结束时间
|
|
|
} else if (signFamily.getStatus() == 1) {
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort(signFamily.getApplyDate()));//签约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort(signFamily.getEnd()));//结束时间
|
|
|
} else if (signFamily.getStatus() == 2) {
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort(signFamily.getPatientApplyUnsignDate()));//申请解约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort(signFamily.getEnd()));//结束时间
|
|
|
}
|
|
|
jsonArray.put(jo);
|
|
|
}
|
|
@ -1552,25 +1558,25 @@ public class FamilyContractService extends BaseService {
|
|
|
if (jtSignFamily != null) {
|
|
|
//家庭签约只找全科医生
|
|
|
Doctor doctor = doctorDao.findByCode(jtSignFamily.getDoctor());
|
|
|
if(doctor !=null){
|
|
|
JSONObject jo = new JSONObject();
|
|
|
jo.put("code", doctor.getCode());
|
|
|
jo.put("sex", doctor.getSex());
|
|
|
jo.put("name", doctor.getName());
|
|
|
jo.put("photo", doctor.getPhoto());
|
|
|
jo.put("hosptialName", doctor.getHosptialName());
|
|
|
jo.put("level", doctor.getLevel());
|
|
|
jo.put("signType", "2");//三师签约
|
|
|
jo.put("signStatus", jtSignFamily.getStatus());
|
|
|
jo.put("jobName", doctor.getJobName());
|
|
|
jo.put("disease", patient.getDisease());//0健康,1高血压,2糖尿病,3高血压+糖尿病
|
|
|
if(jtSignFamily.getStatus()==0){
|
|
|
jo.put("sqDate", DateUtil.dateToStrShort(jtSignFamily.getPatientApplyDate()));//申请时间
|
|
|
}else{
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort( jtSignFamily.getApplyDate()));//签约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort( jtSignFamily.getEnd()));//结束时间
|
|
|
}
|
|
|
jsonArray.put(jo);
|
|
|
if (doctor != null) {
|
|
|
JSONObject jo = new JSONObject();
|
|
|
jo.put("code", doctor.getCode());
|
|
|
jo.put("sex", doctor.getSex());
|
|
|
jo.put("name", doctor.getName());
|
|
|
jo.put("photo", doctor.getPhoto());
|
|
|
jo.put("hosptialName", doctor.getHosptialName());
|
|
|
jo.put("level", doctor.getLevel());
|
|
|
jo.put("signType", "2");//三师签约
|
|
|
jo.put("signStatus", jtSignFamily.getStatus());
|
|
|
jo.put("jobName", doctor.getJobName());
|
|
|
jo.put("disease", patient.getDisease());//0健康,1高血压,2糖尿病,3高血压+糖尿病
|
|
|
if (jtSignFamily.getStatus() == 0) {
|
|
|
jo.put("sqDate", DateUtil.dateToStrShort(jtSignFamily.getPatientApplyDate()));//申请时间
|
|
|
} else {
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort(jtSignFamily.getApplyDate()));//签约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort(jtSignFamily.getEnd()));//结束时间
|
|
|
}
|
|
|
jsonArray.put(jo);
|
|
|
}
|
|
|
}
|
|
|
return jsonArray;
|
|
@ -1592,10 +1598,10 @@ public class FamilyContractService extends BaseService {
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean updateExpensesType(String expensesType,String patient) {
|
|
|
public boolean updateExpensesType(String expensesType, String patient) {
|
|
|
if (signFamilyDao.updateExpensesType(expensesType, patient) > 0) {
|
|
|
return true;
|
|
|
}else{
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
}
|