|
@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.sign;
|
|
|
import java.net.URLDecoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@ -244,8 +245,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
}
|
|
|
Doctor cDoctor = doctorService.findDoctorByCode(getUID());
|
|
|
SignFamily sf = familyContractService.agent(getAccessToken(), name, doctor, doctorName,
|
|
|
healthDoctor, healthDoctorName,cDoctor.getHospital(), cDoctor.getHosptialName(),
|
|
|
idcard, ssc, mobile, emerMobile, images, healthLabel, customLabel, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel,adminTeamCode);
|
|
|
healthDoctor, healthDoctorName, cDoctor.getHospital(), cDoctor.getHosptialName(),
|
|
|
idcard, ssc, mobile, emerMobile, images, healthLabel, customLabel, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, adminTeamCode);
|
|
|
|
|
|
if (sf == null) {
|
|
|
return error(-1, "代理签约失败!");
|
|
@ -268,17 +269,17 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
* @param msgid 消息id
|
|
|
* @param patientIDcard 患者身份证
|
|
|
* @param type 处理类型:1同意,2拒绝
|
|
|
* @param adminTeamCode 行政团队code
|
|
|
* @param adminTeamCode 行政团队code
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "sign")
|
|
|
@ResponseBody
|
|
|
public String sign(
|
|
|
@RequestParam(required = true, defaultValue = "1") String signType,
|
|
|
@RequestParam(required = false, defaultValue = "")String healthDoctor,
|
|
|
@RequestParam(required = false, defaultValue = "")String healthDoctorName,
|
|
|
@RequestParam(required = false, defaultValue = "") String healthDoctor,
|
|
|
@RequestParam(required = false, defaultValue = "") String healthDoctorName,
|
|
|
@RequestParam(required = false, defaultValue = "") String doctor,
|
|
|
@RequestParam(required = false, defaultValue = "")String doctorName,
|
|
|
@RequestParam(required = false, defaultValue = "") String doctorName,
|
|
|
String healthLabel,
|
|
|
@RequestParam(required = false, defaultValue = "") String customLabel,
|
|
|
@RequestParam(required = false, defaultValue = "") String disease,
|
|
@ -311,7 +312,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isEmpty(doctor) && StringUtils.isEmpty(healthDoctor)){
|
|
|
if (StringUtils.isEmpty(doctor) && StringUtils.isEmpty(healthDoctor)) {
|
|
|
return error(-1, "全科医生或健管师不能为空!");
|
|
|
}
|
|
|
|
|
@ -319,7 +320,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
return error(-1, "健康情况标签不能为空!");
|
|
|
}
|
|
|
|
|
|
int res = familyContractService.handleSign(signType, getAccessToken(),doctor,doctorName, healthDoctor, healthDoctorName, msgid, patientIDcard, type, healthLabel, customLabel, disease, expenses,adminTeamCode);
|
|
|
int res = familyContractService.handleSign(signType, getAccessToken(), doctor, doctorName, healthDoctor, healthDoctorName, msgid, patientIDcard, type, healthLabel, customLabel, disease, expenses, adminTeamCode);
|
|
|
if (res == -1) {
|
|
|
return error(-1, "未知的处理类型!");
|
|
|
} else if (res == 0) {
|
|
@ -350,9 +351,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
try {
|
|
|
Map<String, Object> res = familyContractService.getSanshiSignByPatientCode(patientCode);
|
|
|
|
|
|
if(String.valueOf(res.get("hasSanshi")).equals("true") && StringUtils.isNotEmpty(signDoctor)){
|
|
|
List<AdminTeam> teams = teamService.findDoctorsTeams(signDoctor,String.valueOf(res.get("qkCode")));
|
|
|
res.put("team",teams != null ? teams : new ArrayList<AdminTeam>());
|
|
|
if (String.valueOf(res.get("hasSanshi")).equals("true") && StringUtils.isNotEmpty(signDoctor)) {
|
|
|
List<AdminTeam> teams = teamService.findDoctorsTeams(signDoctor, String.valueOf(res.get("qkCode")));
|
|
|
res.put("team", teams != null ? teams : new ArrayList<AdminTeam>());
|
|
|
}
|
|
|
|
|
|
return write(200, "获取消息列表成功!", "data", res);
|
|
@ -502,7 +503,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "patient_sanshi_signinfo")
|
|
|
@ResponseBody
|
|
|
public String getPatientSanshiSignByIdCard(String idCard,@RequestParam(required = false) String signDoctor) {
|
|
|
public String getPatientSanshiSignByIdCard(String idCard, @RequestParam(required = false) String signDoctor) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(idCard)) {
|
|
|
return error(-1, "请输入身份证号!");
|
|
@ -540,9 +541,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
|
|
|
result = familyContractService.getSanshiSingInfoByPatientIdCard(idCard);
|
|
|
|
|
|
if(result.getString("signStatus").equals("1") && StringUtils.isNotEmpty(signDoctor)){
|
|
|
List<AdminTeam> teams = teamService.findDoctorsTeams(signDoctor,result.getString("doctor"));
|
|
|
result.put("team",teams != null ? new JSONArray(teams) : new JSONArray());
|
|
|
if (result.getString("signStatus").equals("1") && StringUtils.isNotEmpty(signDoctor)) {
|
|
|
List<AdminTeam> teams = teamService.findDoctorsTeams(signDoctor, result.getString("doctor"));
|
|
|
result.put("team", teams != null ? new JSONArray(teams) : new JSONArray());
|
|
|
}
|
|
|
|
|
|
return write(200, "查询成功!", "data", result);
|
|
@ -731,18 +732,18 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
@RequestMapping(value = "/sign_info_update")
|
|
|
@ResponseBody
|
|
|
public String updateSignInfo(String patient, @RequestParam(required = false) String healthDoctor,
|
|
|
@RequestParam(required = false) String doctor,
|
|
|
@RequestParam(required = false) String expensesType) {
|
|
|
@RequestParam(required = false) String doctor,
|
|
|
@RequestParam(required = false) String expensesType) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient)) {
|
|
|
return error(-1, "患者不能为空");
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(healthDoctor) && StringUtils.isEmpty(expensesType) && StringUtils.isEmpty(doctor) ) {
|
|
|
if (StringUtils.isEmpty(healthDoctor) && StringUtils.isEmpty(expensesType) && StringUtils.isEmpty(doctor)) {
|
|
|
return error(-1, "参数不能同时为空");
|
|
|
}
|
|
|
|
|
|
JSONObject result = familyContractService.updateSignInfo(patient, healthDoctor,doctor, expensesType);
|
|
|
JSONObject result = familyContractService.updateSignInfo(patient, healthDoctor, doctor, expensesType);
|
|
|
|
|
|
if (result.getInt("status") != 1) {
|
|
|
return error(-1, result.getString("msg"));
|
|
@ -837,10 +838,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
@RequestMapping(value = "/expenses_remind")
|
|
|
@ResponseBody
|
|
|
public String remindPatientExpenses(@RequestParam(required = false) String patient
|
|
|
,@RequestParam(required = false) String isAll) {
|
|
|
, @RequestParam(required = false) String isAll) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient) && StringUtils.isEmpty(isAll)) {
|
|
|
return error(-1,"参数不能都为空");
|
|
|
return error(-1, "参数不能都为空");
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(patient)) {
|
|
@ -861,4 +862,32 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
|
return error(-1, "提醒失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 患者今天是否已提醒缴费
|
|
|
*
|
|
|
* @param patient 患者code
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/is_patient_remind_expenses")
|
|
|
@ResponseBody
|
|
|
public String isPatientExpensesRemindToday(String patient) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient)) {
|
|
|
return error(-1, "患者不能为空");
|
|
|
}
|
|
|
int result = 0;
|
|
|
String epTime = redisTemplate.opsForValue().get("expenses:remind:" + patient);
|
|
|
|
|
|
if (StringUtils.isEmpty(epTime)) {
|
|
|
result = 0;
|
|
|
} else {
|
|
|
result = new SimpleDateFormat("yyyy-MM-dd").format(new Date()).equals(epTime) ? 1 : 0;
|
|
|
}
|
|
|
return write(200, "查询成功", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
}
|