|
@ -28,6 +28,7 @@ import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
|
|
|
import com.yihu.wlyy.repository.statistics.WlyySignFamilyCodeDao;
|
|
|
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
|
|
|
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
|
|
|
import com.yihu.wlyy.service.app.message.MessageService;
|
|
|
import com.yihu.wlyy.task.SignUploadTask;
|
|
|
import com.yihu.wlyy.util.MD5;
|
|
|
import org.apache.commons.beanutils.converters.IntegerConverter;
|
|
@ -103,6 +104,8 @@ public class FamilyContractService extends BaseService {
|
|
|
private SignPatientLabelInfoService labelInfoService;
|
|
|
@Autowired
|
|
|
private DoctorAdminTeamDao doctorAdminTeamDao;
|
|
|
@Autowired
|
|
|
MessageService messageService;
|
|
|
|
|
|
public SignFamily findSignFamilyByCode(String code) {
|
|
|
return signFamilyDao.findByCodeAndType(code, 2);
|
|
@ -932,7 +935,7 @@ public class FamilyContractService extends BaseService {
|
|
|
* @return
|
|
|
*/
|
|
|
|
|
|
public int handleSign(String signType,
|
|
|
public JSONObject handleSign(String signType,
|
|
|
String access_token,
|
|
|
String doctor,
|
|
|
String doctorName,
|
|
@ -942,8 +945,10 @@ public class FamilyContractService extends BaseService {
|
|
|
String patientCard, int type,
|
|
|
String healthLabel, String customLabel, String disease,
|
|
|
String expenses, long adminTeamCode) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
if (type != 1 && type != 2) {
|
|
|
return -1;
|
|
|
result.put("status",-1);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
// 查询患者信息
|
|
@ -959,7 +964,8 @@ public class FamilyContractService extends BaseService {
|
|
|
// 判断患者有没有家庭签约
|
|
|
SignFamily sf = signFamilyDao.findByPatientStatus(patientCard, 0);
|
|
|
if (sf == null) {
|
|
|
return 0;
|
|
|
result.put("status",0);
|
|
|
return result;
|
|
|
}
|
|
|
if (type == 1) {
|
|
|
List<SystemDict> systemDicts = systemDictDao.findByDictName("SIGN_YEAR");
|
|
@ -984,6 +990,23 @@ public class FamilyContractService extends BaseService {
|
|
|
sf.setDoctorHealthName(healthDoctorName);
|
|
|
}
|
|
|
|
|
|
//判断是否有三师签约 并且判断全科医生一致
|
|
|
SignFamily sssignFamily = signFamilyDao.findSSByIdcard(p.getIdcard());
|
|
|
|
|
|
if (sssignFamily != null && StringUtils.isNotEmpty(doctor) && !doctor.equals(sssignFamily.getDoctor())) {
|
|
|
result.put("status",-2);
|
|
|
result.put("msg","居民已签约三师,故全科医生只可为" + sssignFamily.getDoctorName() + "医生,请重新选择全科医生");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
if (sssignFamily != null && StringUtils.isNotEmpty(healthDoctor) && !sf.getDoctor().equals(sssignFamily.getDoctor())) {
|
|
|
result.put("status",-3);
|
|
|
result.put("msg","对不起,居民已签约三师,故只可与" + sssignFamily.getDoctorName() + "医生签约,该签约申请已失效");
|
|
|
messageService.readHealth(msgid);
|
|
|
updateSignStatus(p.getIdcard());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
AdminTeam team = doctorAdminTeamDao.findOne(adminTeamCode);
|
|
|
Doctor docLeader = doctorDao.findByCode(team.getLeaderCode());
|
|
|
|
|
@ -1058,7 +1081,8 @@ public class FamilyContractService extends BaseService {
|
|
|
json.put("remark", "您好,签约家庭医生失败通知");
|
|
|
// 添加到发送队列
|
|
|
PushMsgTask.getInstance().putWxMsg(access_token, 2, sf.getOpenid(), sf.getName(), json);
|
|
|
return 2;
|
|
|
result.put("status",2);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
// 患者标签设置
|
|
@ -1088,7 +1112,8 @@ public class FamilyContractService extends BaseService {
|
|
|
PushMsgTask.getInstance().putWxMsg(access_token, 1, sf.getOpenid(), sf.getName(), json);
|
|
|
new Thread(new SignUploadTask(sf.getCode())).start();
|
|
|
}
|
|
|
return 1;
|
|
|
result.put("status",1);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|