|
@ -12,8 +12,6 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
|
|
|
import com.yihu.jw.entity.care.doorCoach.*;
|
|
|
import com.yihu.jw.entity.door.WlyyDoorFeeDetailDO;
|
|
|
import com.yihu.jw.entity.door.WlyyDoorOrderItemDO;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
|
|
|
import com.yihu.jw.im.dao.ConsultDao;
|
|
@ -961,6 +959,40 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 调度员进入聊天室
|
|
|
* @param dispatcher
|
|
|
* @param orderId
|
|
|
*/
|
|
|
public JSONObject dispatcherIntoTopic(String orderId, String hospitalName, String dispatcher, String dispatcherName) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
BaseDoorCoachOrderDO orderDO = baseDoorCoachOrderDao.findOne(orderId);
|
|
|
if (null == orderDO) {
|
|
|
String failMsg = "调度员进入聊天室时,找不到对应工单,工单id=" + orderId;
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.fail);
|
|
|
result.put(ResponseContant.resultMsg, failMsg);
|
|
|
logger.error(failMsg);
|
|
|
return result;
|
|
|
}
|
|
|
ConsultDo consult = consultDao.queryByRelationCode(orderId);
|
|
|
String sessionId = orderDO.getPatient() + "_" + consult.getId() + "_" + orderDO.getNumber() + "_" + consult.getType();
|
|
|
// 把调度员拉入会话,作为其中一个成员,第一个进入会话的调度员,系统发送欢迎语和居民的预约卡片信息
|
|
|
if (org.apache.commons.lang3.StringUtils.isEmpty(orderDO.getDispatcher())) {
|
|
|
orderDO.setDispatcher(dispatcher);
|
|
|
orderDO.setDispatcherName(dispatcherName);
|
|
|
this.save(orderDO);
|
|
|
// 先进入会话,再聊天
|
|
|
imUtill.updateParticipantNew(sessionId,dispatcher,null);
|
|
|
String noticeContent = hospitalName + dispatcherName + "为您服务";
|
|
|
this.qucikSendIM(orderId, dispatcher, "智能助手", "1", noticeContent);
|
|
|
}
|
|
|
// 把调度员拉入会话,作为其中一个成员
|
|
|
imUtill.updateParticipantNew(sessionId,dispatcher,null);
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.success);
|
|
|
result.put(ResponseContant.resultMsg, "调度员["+dispatcherName+"]进入会话成功");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 工单与服务项费用关联关系
|
|
|
*
|
|
@ -1002,11 +1034,6 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
|
|
|
JSONObject oneJson = (JSONObject)one;
|
|
|
try {
|
|
|
feeDetailDO = EntityUtils.jsonToEntity(one.toString(), BaseDoorCoachFeeDetailDO.class);
|
|
|
WlyyDoorOrderItemDO orderItemDO = new WlyyDoorOrderItemDO();
|
|
|
orderItemDO.setDoctor(order.getDoctor());
|
|
|
orderItemDO.setCode(feeDetailDO.getCode());
|
|
|
orderItemDO.setCreateTime(new Date());
|
|
|
orderItemDO.setPatient(order.getPatient());
|
|
|
} catch (Exception e) {
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.fail);
|
|
|
String failMsg = "工单与服务费用关联关系时," + e.getMessage();
|
|
@ -1112,9 +1139,10 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
Map<String, Integer> map = new HashMap<>();
|
|
|
Integer all = list.size();
|
|
|
Integer waitForServe = 0;
|
|
|
Integer served = 0;
|
|
|
Integer cancel = 0;
|
|
|
Integer waitForAccept = 0;//待接单
|
|
|
Integer waitForServe = 0;//待服务
|
|
|
Integer served = 0;//已完成
|
|
|
Integer cancel = 0;//已取消
|
|
|
// -1已取消 [1,4]待服务 [5,6]已服务
|
|
|
for (Map<String, Object> tmp:list){
|
|
|
switch (String.valueOf(tmp.get("status"))){
|
|
@ -1122,10 +1150,10 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
|
|
|
cancel += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
break;
|
|
|
case "1":
|
|
|
waitForServe += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
waitForAccept += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
break;
|
|
|
case "2":
|
|
|
waitForServe += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
waitForAccept += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
break;
|
|
|
case "3":
|
|
|
waitForServe += Integer.valueOf(tmp.get("num").toString()) ;
|
|
@ -1134,7 +1162,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
|
|
|
waitForServe += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
break;
|
|
|
case "5":
|
|
|
served += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
waitForServe += Integer.valueOf(tmp.get("num").toString()) ;
|
|
|
break;
|
|
|
case "6":
|
|
|
served += Integer.valueOf(tmp.get("num").toString()) ;
|
|
@ -1145,6 +1173,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
|
|
|
}
|
|
|
}
|
|
|
map.put("all",all);
|
|
|
map.put("waitForAccept",waitForAccept);
|
|
|
map.put("waitForServe",waitForServe);
|
|
|
map.put("served",served);
|
|
|
map.put("cancel",cancel);
|