|
@ -307,6 +307,54 @@ public class BookingController extends WeixinBaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "CancelOrder", method = RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ApiOperation("取消挂号单")
|
|
|
|
public String CancelOrder(@ApiParam(name = "orderId", value = "订单id", defaultValue = "9")
|
|
|
|
@RequestParam(value = "orderId", required = true) Long orderId) {
|
|
|
|
try {
|
|
|
|
//获取订单信息
|
|
|
|
PatientReservation obj = patientReservationService.findById(orderId);
|
|
|
|
boolean re = false;
|
|
|
|
if (obj != null) {
|
|
|
|
String type = obj.getType();
|
|
|
|
String code = obj.getCode();
|
|
|
|
if (type.equals("0")) { //医护网接口
|
|
|
|
re = guahaoYihu.CancelOrder(code);
|
|
|
|
} else if (type.equals("1")) //厦门市民健康预约接口
|
|
|
|
{
|
|
|
|
re = guahaoXM.CancelOrder(code, obj.getSsc());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (re) {
|
|
|
|
//更新状态
|
|
|
|
patientReservationService.updateStatus(orderId, 0);
|
|
|
|
//微信消息
|
|
|
|
Patient p = patientService.findByCode(obj.getPatient());
|
|
|
|
if (StringUtils.isNotEmpty(p.getOpenid())) {
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
json.put("first", "");
|
|
|
|
json.put("toUser", p.getCode());
|
|
|
|
json.put("name", obj.getName());
|
|
|
|
json.put("date", obj.getStartTime());
|
|
|
|
json.put("doctorName", obj.getDoctorName());
|
|
|
|
json.put("orgName", obj.getOrgName());
|
|
|
|
json.put("remark", obj.getName() + ",您好!\n您已取消了" + obj.getStartTime() + "的挂号!");
|
|
|
|
PushMsgTask.getInstance().putWxMsg(getAccessToken(), 7, p.getOpenid(), obj.getName(), json);
|
|
|
|
}
|
|
|
|
|
|
|
|
return write(200, "取消挂号单成功!");
|
|
|
|
} else {
|
|
|
|
return error(-1, "取消挂号单失败!");
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
return error(-1, e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************** 内网预约 ***************************************************************/
|
|
@RequestMapping(value = "CreateOrderByDoctor", method = RequestMethod.POST)
|
|
@RequestMapping(value = "CreateOrderByDoctor", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ApiOperation("(内网)转诊预约挂号")
|
|
@ApiOperation("(内网)转诊预约挂号")
|
|
@ -390,12 +438,12 @@ public class BookingController extends WeixinBaseController {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ApiOperation("(内网)获取医生排班接口")
|
|
@ApiOperation("(内网)获取医生排班接口")
|
|
public String GetDoctorArrangeTenDay(
|
|
public String GetDoctorArrangeTenDay(
|
|
@ApiParam(name = "hospitalId", value = "医院ID", defaultValue = "350211A1001")
|
|
|
|
@RequestParam(value = "hospitalId", required = true) String hospitalId,
|
|
|
|
@ApiParam(name = "hosDeptId", value = "科室ID", defaultValue = "1011610")
|
|
|
|
@RequestParam(value = "hosDeptId", required = true) String hosDeptId,
|
|
|
|
@ApiParam(name = "doctorId", value = "医生ID", defaultValue = "50108")
|
|
|
|
@RequestParam(value = "doctorId", required = true) String doctorId) {
|
|
|
|
|
|
@ApiParam(name = "hospitalId", value = "医院ID", defaultValue = "350211A1001")
|
|
|
|
@RequestParam(value = "hospitalId", required = true) String hospitalId,
|
|
|
|
@ApiParam(name = "hosDeptId", value = "科室ID", defaultValue = "1011610")
|
|
|
|
@RequestParam(value = "hosDeptId", required = true) String hosDeptId,
|
|
|
|
@ApiParam(name = "doctorId", value = "医生ID", defaultValue = "50108")
|
|
|
|
@RequestParam(value = "doctorId", required = true) String doctorId) {
|
|
try {
|
|
try {
|
|
List<Map<String, Object>> list = guahaoXM.GetDoctorArrangeTenDay(hospitalId, hosDeptId, doctorId);
|
|
List<Map<String, Object>> list = guahaoXM.GetDoctorArrangeTenDay(hospitalId, hosDeptId, doctorId);
|
|
return write(200, "获取医生排班成功!", "data", list);
|
|
return write(200, "获取医生排班成功!", "data", list);
|
|
@ -404,54 +452,6 @@ public class BookingController extends WeixinBaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "CancelOrder", method = RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ApiOperation("取消挂号单")
|
|
|
|
public String CancelOrder(@ApiParam(name = "orderId", value = "订单id", defaultValue = "9")
|
|
|
|
@RequestParam(value = "orderId", required = true) String orderId) {
|
|
|
|
try {
|
|
|
|
//获取订单信息
|
|
|
|
PatientReservation obj = patientReservationService.findById(orderId);
|
|
|
|
boolean re = false;
|
|
|
|
if (obj != null) {
|
|
|
|
String type = obj.getType();
|
|
|
|
String code = obj.getCode();
|
|
|
|
if (type.equals("0")) { //医护网接口
|
|
|
|
re = guahaoYihu.CancelOrder(code);
|
|
|
|
} else if (type.equals("1")) //厦门市民健康预约接口
|
|
|
|
{
|
|
|
|
re = guahaoXM.CancelOrder(code, obj.getSsc());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (re) {
|
|
|
|
//更新状态
|
|
|
|
patientReservationService.updateStatus(obj.getCode(), 0);
|
|
|
|
//微信消息
|
|
|
|
Patient p = patientService.findByCode(obj.getPatient());
|
|
|
|
if (StringUtils.isNotEmpty(p.getOpenid())) {
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
json.put("first", "");
|
|
|
|
json.put("toUser", p.getCode());
|
|
|
|
json.put("name", obj.getName());
|
|
|
|
json.put("date", obj.getStartTime());
|
|
|
|
json.put("doctorName", obj.getDoctorName());
|
|
|
|
json.put("orgName", obj.getOrgName());
|
|
|
|
json.put("remark", obj.getName() + ",您好!\n您已取消了" + obj.getStartTime() + "的挂号!");
|
|
|
|
PushMsgTask.getInstance().putWxMsg(getAccessToken(), 7, p.getOpenid(), obj.getName(), json);
|
|
|
|
}
|
|
|
|
|
|
|
|
return write(200, "取消挂号单成功!");
|
|
|
|
} else {
|
|
|
|
return error(-1, "取消挂号单失败!");
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
return error(-1, e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/********************************************* 医生端查询 **************************************************************************/
|
|
/********************************************* 医生端查询 **************************************************************************/
|
|
@RequestMapping(value = "GetPatientReservationList", method = RequestMethod.POST)
|
|
@RequestMapping(value = "GetPatientReservationList", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ -460,29 +460,13 @@ public class BookingController extends WeixinBaseController {
|
|
@RequestParam(value = "pageIndex", required = false) Integer pageIndex,
|
|
@RequestParam(value = "pageIndex", required = false) Integer pageIndex,
|
|
@ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "10")
|
|
@ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "10")
|
|
@RequestParam(value = "pageSize", required = false) Integer pageSize,
|
|
@RequestParam(value = "pageSize", required = false) Integer pageSize,
|
|
@ApiParam(name = "patient", value = "患者编号", defaultValue = "10")
|
|
|
|
|
|
@ApiParam(name = "patient", value = "患者编号", defaultValue = "4afdbce6194e412fbc770eb4dfbe7b00")
|
|
@RequestParam(value = "patient", required = false) String patient,
|
|
@RequestParam(value = "patient", required = false) String patient,
|
|
@ApiParam(name = "doctor", value = "医生编号", defaultValue = "10")
|
|
|
|
|
|
@ApiParam(name = "doctor", value = "医生编号", defaultValue = "shiliuD20160926005")
|
|
@RequestParam(value = "doctor", required = false) String doctor) {
|
|
@RequestParam(value = "doctor", required = false) String doctor) {
|
|
try {
|
|
try {
|
|
List<PatientReservation> list = patientReservationService.getReservationByPatient(patient, doctor, pageIndex, pageSize);
|
|
List<PatientReservation> list = patientReservationService.getReservationByPatient(patient, doctor, pageIndex, pageSize);
|
|
//遍历更新预约状态
|
|
|
|
for (PatientReservation item : list) {
|
|
|
|
String type = item.getType();
|
|
|
|
String code = item.getCode();
|
|
|
|
if (type.equals("0")) { //医护网接口
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (type.equals("1")) //厦门市民健康预约接口
|
|
|
|
{
|
|
|
|
Integer status = guahaoXM.GetOrderStatus(item.getOrgCode(), code, item.getSsc());
|
|
|
|
//更新状态
|
|
|
|
if (status != null) {
|
|
|
|
patientReservationService.updateStatus(item.getCode(), 0);
|
|
|
|
item.setStatus(status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return write(200, "获取患者预约信息列表成功!", "data", list);
|
|
return write(200, "获取患者预约信息列表成功!", "data", list);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return error(-1, e.getMessage());
|
|
return error(-1, e.getMessage());
|
|
@ -497,39 +481,12 @@ public class BookingController extends WeixinBaseController {
|
|
@RequestParam(value = "pageIndex", required = false) Integer pageIndex,
|
|
@RequestParam(value = "pageIndex", required = false) Integer pageIndex,
|
|
@ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "10")
|
|
@ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "10")
|
|
@RequestParam(value = "pageSize", required = false) Integer pageSize,
|
|
@RequestParam(value = "pageSize", required = false) Integer pageSize,
|
|
@ApiParam(name = "doctor", value = "医生编号", defaultValue = "10")
|
|
|
|
|
|
@ApiParam(name = "doctor", value = "医生编号", defaultValue = "shiliuD20160926005")
|
|
@RequestParam(value = "doctor", required = false) String doctor) {
|
|
@RequestParam(value = "doctor", required = false) String doctor) {
|
|
try {
|
|
try {
|
|
List<PatientReservation> list = patientReservationService.getReservationByDoctor(doctor, pageIndex, pageSize);
|
|
|
|
//遍历更新预约状态
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
for (PatientReservation item : list) {
|
|
|
|
String type = item.getType();
|
|
|
|
String code = item.getCode();
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
|
Class pClass = (Class) item.getClass();
|
|
|
|
for(Field field : pClass.getDeclaredFields()){
|
|
|
|
field.setAccessible(true);
|
|
|
|
object.put(field.getName(),field.get(item));
|
|
|
|
}
|
|
|
|
Patient patient = patientService.findByCode(item.getPatient());
|
|
|
|
if(patient!=null){
|
|
|
|
object.put("photo",patient.getPhoto());
|
|
|
|
}
|
|
|
|
array.put(object);
|
|
|
|
if (type.equals("0")) { //医护网接口
|
|
|
|
|
|
List<Map<String,String>> list = patientReservationService.getReservationByDoctor(doctor, pageIndex, pageSize);
|
|
|
|
|
|
} else if (type.equals("1")) //厦门市民健康预约接口
|
|
|
|
{
|
|
|
|
Integer status = guahaoXM.GetOrderStatus(item.getOrgCode(), code, item.getSsc());
|
|
|
|
//更新状态
|
|
|
|
if (status != null) {
|
|
|
|
patientReservationService.updateStatus(item.getCode(), 0);
|
|
|
|
item.setStatus(status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return write(200, "获取患者预约信息列表成功!", "data", array);
|
|
|
|
|
|
return write(200, "获取患者预约信息列表成功!", "data", list);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return error(-1, e.getMessage());
|
|
return error(-1, e.getMessage());
|
|
}
|
|
}
|
|
@ -540,35 +497,13 @@ public class BookingController extends WeixinBaseController {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ApiOperation("获取患者预约信息单条-医生端")
|
|
@ApiOperation("获取患者预约信息单条-医生端")
|
|
public String GetPatientReservation(@ApiParam(name = "orderId", value = "订单id", defaultValue = "9")
|
|
public String GetPatientReservation(@ApiParam(name = "orderId", value = "订单id", defaultValue = "9")
|
|
@RequestParam(value = "orderId", required = true) String orderId) {
|
|
|
|
|
|
@RequestParam(value = "orderId", required = true) Long orderId) {
|
|
try {
|
|
try {
|
|
PatientReservation obj = null;
|
|
|
|
try {
|
|
|
|
obj = patientReservationService.findById(orderId);
|
|
|
|
} catch (Exception e) {
|
|
|
|
obj = patientReservationService.findByCode(orderId);
|
|
|
|
}
|
|
|
|
if (obj != null) {
|
|
|
|
String type = obj.getType();
|
|
|
|
String code = obj.getCode();
|
|
|
|
Integer status = null;
|
|
|
|
if (type.equals("0")) { //医护网接口
|
|
|
|
|
|
|
|
} else if (type.equals("1")) //厦门市民健康预约接口
|
|
|
|
{
|
|
|
|
status = guahaoXM.GetOrderStatus(obj.getOrgCode(), code, obj.getSsc());
|
|
|
|
}
|
|
|
|
//更新状态
|
|
|
|
if (status != null) {
|
|
|
|
patientReservationService.updateStatus(obj.getCode(), 0);
|
|
|
|
obj.setStatus(status);
|
|
|
|
}
|
|
|
|
return write(200, "获取患者预约信息成功!", "data", obj);
|
|
|
|
} else {
|
|
|
|
return error(-1, "不存在该条预约信息!");
|
|
|
|
}
|
|
|
|
|
|
PatientReservation obj = patientReservationService.findById(orderId);
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
return write(200, "获取患者预约信息成功!", "data", obj);
|
|
|
|
}
|
|
|
|
catch (Exception e) {
|
|
return error(-1, e.getMessage());
|
|
return error(-1, e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|