|
@ -227,7 +227,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
if (StringUtils.isEmpty(mobile)) {
|
|
|
return error(-1, "手机号不允许为空!");
|
|
|
}
|
|
|
if(StringUtils.isEmpty(healthLabel)){
|
|
|
if (StringUtils.isEmpty(healthLabel)) {
|
|
|
return error(-1, "健康情况标签不能为空!");
|
|
|
}
|
|
|
int amount = familyContractService.hasSingStatus(idcard);
|
|
@ -244,7 +244,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
Doctor cDoctor = doctorService.findDoctorByCode(getUID());
|
|
|
SignFamily sf = familyContractService.agent(getAccessToken(), name, doctor, doctorName,
|
|
|
healthDoctor, healthDoctorName, majorDoctor, majorDoctorName, cDoctor.getHospital(), cDoctor.getHosptialName(),
|
|
|
idcard, ssc, mobile, emerMobile, images, healthLabel,customLabel,disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, group);
|
|
|
idcard, ssc, mobile, emerMobile, images, healthLabel, customLabel, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, group);
|
|
|
|
|
|
if (sf == null) {
|
|
|
return error(-1, "代理签约失败!");
|
|
@ -287,32 +287,34 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
int type, String group,
|
|
|
@RequestParam(required = false, defaultValue = "0") String expenses) {
|
|
|
try {
|
|
|
try {
|
|
|
String checkUrl = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload");
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + patientIDcard, "");
|
|
|
|
|
|
if (!StringUtils.isEmpty(jsonString)) {
|
|
|
JSONObject checkJson = new JSONObject(jsonString);
|
|
|
|
|
|
if (checkJson.getInt("status") == 200) {
|
|
|
JSONObject jsonData = checkJson.getJSONObject("data");
|
|
|
|
|
|
if (jsonData.getString("status").equals("1")) {
|
|
|
messageService.readHealth(msgid);
|
|
|
familyContractService.updateSignStatus(patientIDcard);
|
|
|
return error(-1, "该居民已在基卫平台签约,无需重复在移动端申请");
|
|
|
if (type != 2) {
|
|
|
try {
|
|
|
String checkUrl = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload");
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + patientIDcard, "");
|
|
|
|
|
|
if (!StringUtils.isEmpty(jsonString)) {
|
|
|
JSONObject checkJson = new JSONObject(jsonString);
|
|
|
|
|
|
if (checkJson.getInt("status") == 200) {
|
|
|
JSONObject jsonData = checkJson.getJSONObject("data");
|
|
|
|
|
|
if (jsonData.getString("status").equals("1")) {
|
|
|
messageService.readHealth(msgid);
|
|
|
familyContractService.updateSignStatus(patientIDcard);
|
|
|
return error(-1, "该居民已在基卫平台签约,无需重复在移动端申请");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isEmpty(healthLabel)){
|
|
|
if (StringUtils.isEmpty(healthLabel) && type != 2) {
|
|
|
return error(-1, "健康情况标签不能为空!");
|
|
|
}
|
|
|
|
|
|
int res = familyContractService.handleSign(signType, getAccessToken(), healthDoctor, healthDoctorName, msgid, patientIDcard, type,healthLabel,customLabel, disease, majorDoctor, majorDoctorName, group, expenses);
|
|
|
int res = familyContractService.handleSign(signType, getAccessToken(), healthDoctor, healthDoctorName, msgid, patientIDcard, type, healthLabel, customLabel, disease, majorDoctor, majorDoctorName, group, expenses);
|
|
|
if (res == -1) {
|
|
|
return error(-1, "未知的处理类型!");
|
|
|
} else if (res == 0) {
|
|
@ -731,6 +733,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
|
|
|
/**
|
|
|
* 获取没有健康管理师的签约数据数目
|
|
|
*
|
|
|
* @param doctor 医生code
|
|
|
* @return
|
|
|
*/
|
|
@ -739,12 +742,12 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
public String findNoHealthSignFamilyNum(String doctor) {
|
|
|
try {
|
|
|
List<SignFamily> signFamily = familyContractService.findNoHealthSignFamilyNum(doctor);
|
|
|
JSONObject jo= new JSONObject();
|
|
|
if(signFamily!=null&&signFamily.size()>0){
|
|
|
jo.put("date",DateUtil.dateToStr(signFamily.get(0).getCzrq(),"yyyy-MM-dd"));
|
|
|
jo.put("num",signFamily.size());
|
|
|
}else{
|
|
|
jo.put("num",0);
|
|
|
JSONObject jo = new JSONObject();
|
|
|
if (signFamily != null && signFamily.size() > 0) {
|
|
|
jo.put("date", DateUtil.dateToStr(signFamily.get(0).getCzrq(), "yyyy-MM-dd"));
|
|
|
jo.put("num", signFamily.size());
|
|
|
} else {
|
|
|
jo.put("num", 0);
|
|
|
}
|
|
|
return write(200, "查询成功", "data", jo);
|
|
|
} catch (Exception e) {
|
|
@ -755,14 +758,15 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
|
|
|
/**
|
|
|
* 获取没有健康管理师的患者列表
|
|
|
* @param doctor 医生code
|
|
|
* @param page 当前页
|
|
|
*
|
|
|
* @param doctor 医生code
|
|
|
* @param page 当前页
|
|
|
* @param pageSize 每页显示条数
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/findNoHealthSignFamilyHealth")
|
|
|
@ResponseBody
|
|
|
public String findNoHealthSignFamilyHealth(String doctor,Integer page,Integer pageSize) {
|
|
|
public String findNoHealthSignFamilyHealth(String doctor, Integer page, Integer pageSize) {
|
|
|
try {
|
|
|
JSONArray array = new JSONArray();
|
|
|
Page<SignFamily> list = familyContractService.findNoHealthSignFamilyHealth(doctor, page, pageSize);
|
|
@ -779,15 +783,15 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
if (StringUtils.isNotBlank(idcard) && (idcard.length() == 15 || idcard.length() == 18)) {
|
|
|
json.put("age", IdCardUtil.getAgeForIdcard(idcard));//患者年龄
|
|
|
json.put("sex", IdCardUtil.getSexForIdcard(idcard));//患者性别
|
|
|
} else{
|
|
|
} else {
|
|
|
json.put("age", "");//患者年龄
|
|
|
json.put("sex","");//患者性别
|
|
|
json.put("sex", "");//患者性别
|
|
|
}
|
|
|
array.put(json);
|
|
|
}
|
|
|
}
|
|
|
return write(200, "签约数据加载成功!", "list", array); }
|
|
|
catch (Exception e) {
|
|
|
return write(200, "签约数据加载成功!", "list", array);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|