|
@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.jw.care.aop.ObserverRequired;
|
|
|
import com.yihu.jw.care.endpoint.BaseController;
|
|
|
|
|
|
import com.yihu.jw.care.service.common.PermissionService;
|
|
|
import com.yihu.jw.care.service.consult.ConsultTeamService;
|
|
|
import com.yihu.jw.care.service.doorCoach.DoctorDoorCoachOrderService;
|
|
|
import com.yihu.jw.care.service.doorCoach.PatientDoorCoachOrderService;
|
|
@ -47,6 +48,9 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
private ImService imService;
|
|
|
@Autowired
|
|
|
private ConsultTeamService consultTeamService;
|
|
|
@Autowired
|
|
|
private PermissionService permissionService;
|
|
|
|
|
|
private BaseController baseController = new BaseController();
|
|
|
|
|
|
@PostMapping(value = "proxyCreate")
|
|
@ -54,7 +58,8 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
@ObserverRequired
|
|
|
public String create(@ApiParam(name = "jsonData", value = "Json数据", required = true) @RequestParam String jsonData) {
|
|
|
try{
|
|
|
JSONObject result = patientDoorCoachOrderService.proxyCreate(jsonData,getUID());
|
|
|
String uid = permissionService.getUID();
|
|
|
JSONObject result = patientDoorCoachOrderService.proxyCreate(jsonData,uid);
|
|
|
if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
|
|
|
return baseController.error(-1, result.getString(ResponseContant.resultMsg));
|
|
|
}
|
|
@ -70,6 +75,11 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
@ApiParam(name = "doctor", value = "医生codedoctor")
|
|
|
@RequestParam(value = "doctor", required = true) String doctor) {
|
|
|
try {
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("doctorId",doctor);
|
|
|
if(permissionService.noPermission(1,param)){
|
|
|
return baseController.error(-1,"该操作没有权限");
|
|
|
}
|
|
|
return baseController.write(200, "获取成功", "data",doctorDoorCoachOrderService.getDoorOrderNum(doctor));
|
|
|
} catch (Exception e) {
|
|
|
return baseController.errorResult(e);
|
|
@ -171,7 +181,8 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
@ApiParam(value = "拒绝原因", name = "reason", required = false)
|
|
|
@RequestParam(value = "reason", required = false) String reason) {
|
|
|
try {
|
|
|
doctorDoorCoachOrderService.refuseOrder(getUID(),orderId, reason);
|
|
|
String uid = permissionService.getUID();
|
|
|
doctorDoorCoachOrderService.refuseOrder(uid,orderId, reason);
|
|
|
return baseController.write(200, "操作成功");
|
|
|
} catch (Exception e) {
|
|
|
return baseController.errorResult(e);
|
|
@ -216,7 +227,8 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
@ApiParam(value = "二维码内容", name = "twoDimensionalCode")
|
|
|
@RequestParam(value = "twoDimensionalCode", required = false) String twoDimensionalCode) {
|
|
|
try {
|
|
|
BaseDoorCoachOrderDO baseDoorCoachOrderDO = doctorDoorCoachOrderService.signIn(orderId, signTime, signWay, signLocation, signImg,twoDimensionalCode,getUID());
|
|
|
String uid = permissionService.getUID();
|
|
|
BaseDoorCoachOrderDO baseDoorCoachOrderDO = doctorDoorCoachOrderService.signIn(orderId, signTime, signWay, signLocation, signImg,twoDimensionalCode,uid);
|
|
|
if (baseDoorCoachOrderDO != null){
|
|
|
return baseController.write(200, "操作成功", "data", baseDoorCoachOrderDO);
|
|
|
}else {
|
|
@ -310,6 +322,11 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
@ApiParam(name = "doctor", value = "医生code")
|
|
|
@RequestParam(value = "doctor", required = true) String doctor) {
|
|
|
try {
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("doctorId",doctor);
|
|
|
if(permissionService.noPermission(1,param)){
|
|
|
return baseController.error(-1,"该操作没有权限");
|
|
|
}
|
|
|
Map<String, Integer> map = doctorDoorCoachOrderService.getNumGroupByStatus(doctor);
|
|
|
return baseController.write(200, "获取成功", "data", map);
|
|
|
} catch (Exception e) {
|
|
@ -328,6 +345,7 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
@RequestParam(value="page",required = true) String page,
|
|
|
@ApiParam(name="pageSize",value="",defaultValue = "10")
|
|
|
@RequestParam(value="pageSize",required = true) String pageSize){
|
|
|
String uid = permissionService.getUID();
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(pageSize)) {
|
|
|
pageSize = "10";
|
|
|
}
|
|
@ -343,7 +361,7 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
|
|
|
message1.setOver(object.getString("over"));
|
|
|
message1.setIsRead(object.get("read")+"");
|
|
|
message1.setReceiver(getUID());
|
|
|
message1.setReceiver(uid);
|
|
|
try {
|
|
|
org.json.JSONObject waitingMessages = doctorDoorCoachOrderService.getWaitingMessages(message1, types, Integer.valueOf(page), Integer.valueOf(pageSize));
|
|
|
return baseController.write(200, "查询成功","data",waitingMessages);
|
|
@ -387,7 +405,7 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
if("0".equals(isManage)){
|
|
|
if(StringUtils.isEmpty(doctorCode)){
|
|
|
doctorCode=getUID();
|
|
|
doctorCode = permissionService.getUID();
|
|
|
}
|
|
|
}else if ("1".equals(isManage) && StringUtils.isBlank(hospitalCode)){
|
|
|
//如果是管理员并且未筛选机构,就默认展示其管理下所有机构
|
|
@ -584,6 +602,11 @@ public class DoctorDoorCoachOrderController extends EnvelopRestEndpoint {
|
|
|
@ApiParam(value = "开关值,5关闭 1开启", name = "value")
|
|
|
@RequestParam(value = "value", required = true) Integer value) {
|
|
|
try {
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("doctorId",doctor);
|
|
|
if(permissionService.noPermission(1,param)){
|
|
|
return baseController.error(-1,"该操作没有权限");
|
|
|
}
|
|
|
doctorDoorCoachOrderService.updateDispatchStatusByDoctor(doctor, value);
|
|
|
return baseController.write(200, "修改成功");
|
|
|
} catch (Exception e) {
|