|
@ -23,6 +23,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@ -250,7 +253,7 @@ public class BookingController extends WeixinBaseController {
|
|
|
if (StringUtils.isEmpty(patientPhone)) {
|
|
|
return error(-1, "未设置手机号码!");
|
|
|
}
|
|
|
String orderCode = getService(city).CreateOrder(hospitalId,hospitalName,hosDeptId,hosDeptName,doctorId,doctorName,arrangeDate,patient,patientName,cardNo,clinicCard,patientPhone);
|
|
|
String orderCode = getService(city).CreateOrder(hospitalId,hospitalName,hosDeptId,hosDeptName,doctorId,doctorName,arrangeDate,patient,patientName,cardNo,clinicCard,patientPhone,null,null);
|
|
|
|
|
|
//预约发送微信消息
|
|
|
PatientReservation obj = patientReservationService.findByCode(orderCode);
|
|
@ -281,6 +284,74 @@ public class BookingController extends WeixinBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 创建挂号单
|
|
|
*/
|
|
|
@RequestMapping(value = "CreateOrderByDoctor",method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("创建挂号单")
|
|
|
public String CreateOrderByDoctor(@ApiParam(name="city",value="城市编码",defaultValue = "350200")
|
|
|
@RequestParam(value="city",required = true) String city,
|
|
|
@ApiParam(name="hospitalId",value="医院ID",defaultValue = "350211A1001")
|
|
|
@RequestParam(value="hospitalId",required = true) String hospitalId,
|
|
|
@ApiParam(name="hospitalName",value="医院名称",defaultValue = "厦门大学附属第一医院")
|
|
|
@RequestParam(value="hospitalName",required = true) String hospitalName,
|
|
|
@ApiParam(name="hosDeptId",value="科室ID",defaultValue = "1040610")
|
|
|
@RequestParam(value="hosDeptId",required = true) String hosDeptId,
|
|
|
@ApiParam(name="hosDeptName",value="医院科室名称",defaultValue = "儿二科")
|
|
|
@RequestParam(value="hosDeptName",required = true) String hosDeptName,
|
|
|
@ApiParam(name="doctorId",value="医生ID",defaultValue = "07101")
|
|
|
@RequestParam(value="doctorId",required = true) String doctorId,
|
|
|
@ApiParam(name="doctorName",value="医生姓名",defaultValue = "林素莲")
|
|
|
@RequestParam(value="doctorName",required = true) String doctorName,
|
|
|
@ApiParam(name="arrangeDate",value="排班信息",defaultValue = "{\"sectionType\":\"a\",\"startTime\":\"2016-09-02 08:20:00\",\"endTime\":\"2016-09-02 08:30:00\"}")
|
|
|
@RequestParam(value="arrangeDate",required = true) String arrangeDate,
|
|
|
@ApiParam(name="patient",value="患者代码",defaultValue = "01954b2ebbb24a40a05da9d2f5c94795")
|
|
|
@RequestParam(value="patient",required = true) String patient,
|
|
|
@ApiParam(name="patientName",value="患者姓名",defaultValue = "张锦川")
|
|
|
@RequestParam(value="patientName",required = true) String patientName,
|
|
|
@ApiParam(name="cardNo",value="身份证号码",defaultValue = "35052419880511553X")
|
|
|
@RequestParam(value="cardNo",required = true) String cardNo,
|
|
|
@ApiParam(name="clinicCard",value="市民卡号",defaultValue = "D57117706")
|
|
|
@RequestParam(value="clinicCard",required = true) String clinicCard,
|
|
|
@ApiParam(name="patientPhone",value="患者手机",defaultValue = "13950116510")
|
|
|
@RequestParam(value="patientPhone",required = true) String patientPhone,
|
|
|
@ApiParam(name="dcode",value="代预约医生编号",defaultValue = "test00000000005")
|
|
|
@RequestParam(value="dcode",required = true) String dcode,
|
|
|
@ApiParam(name="dname",value="代预约医生名称",defaultValue = "组2全科医生")
|
|
|
@RequestParam(value="dname",required = true) String dname) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patientName)) {
|
|
|
return error(-1, "未设置姓名!");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(cardNo)) {
|
|
|
return error(-1, "未设置身份证号!");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(clinicCard)) {
|
|
|
return error(-1, "未设置社保卡号!");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(patientPhone)) {
|
|
|
return error(-1, "未设置手机号码!");
|
|
|
}
|
|
|
String orderCode = getService(city).CreateOrder(hospitalId,hospitalName,hosDeptId,hosDeptName,doctorId,doctorName,arrangeDate,patient,patientName,cardNo,clinicCard,patientPhone,dname,dcode);
|
|
|
//获取预约信息查询是否挂号成功
|
|
|
PatientReservation obj = patientReservationService.findByCode(orderCode);
|
|
|
if(obj!=null)
|
|
|
{
|
|
|
return write(200, "创建挂号单成功!");
|
|
|
}
|
|
|
else{
|
|
|
return error(-1,"创建挂号单失败!");
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 取消挂号单
|
|
|
*/
|
|
@ -345,7 +416,6 @@ public class BookingController extends WeixinBaseController {
|
|
|
@RequestParam(value="pageSize",required = false) Integer pageSize) {
|
|
|
try {
|
|
|
List<PatientReservation> list = patientReservationService.getReservationByPatient(getUID(),pageIndex,pageSize);
|
|
|
|
|
|
//遍历更新预约状态
|
|
|
for(PatientReservation item :list)
|
|
|
{
|
|
@ -370,6 +440,32 @@ public class BookingController extends WeixinBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取患者预约信息列表接口
|
|
|
*/
|
|
|
@RequestMapping(value = "GetRegList",method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("获取患者预约信息列表接口")
|
|
|
public String GetRegList(@ApiParam(name="strSSID",value="市民卡号",defaultValue = "1")
|
|
|
@RequestParam(value="strSSID",required = false) String strSSID) {
|
|
|
try {
|
|
|
SimpleDateFormat sm = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date nowDate = new Date();
|
|
|
Date threeMonthBefore = getMonthBefore(nowDate, 3);
|
|
|
List<PatientReservation> list = guahaoXM.GetRegList(strSSID,sm.format(threeMonthBefore),sm.format(nowDate));
|
|
|
return write(200, "获取患者预约信息列表成功!", "data", list);
|
|
|
} catch (Exception e) {
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
public static Date getMonthBefore(Date d, int month) {
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.setTime(d);
|
|
|
now.set(Calendar.MONTH, now.get(Calendar.MONTH) - month);
|
|
|
return now.getTime();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取患者预约信息单条
|
|
|
*/
|