Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

yeshijie 3 anos atrás
pai
commit
87a0abf590

+ 20 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doorCoach/PatientDoorCoachOrderController.java

@ -206,6 +206,26 @@ public class PatientDoorCoachOrderController extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = "dispatcherIntoTopic")
    @ApiOperation(value = "调度员进入会话")
    public ObjEnvelop dispatcherIntoTopic(
            @ApiParam(name = "orderId", value = "工单id", required = true) @RequestParam String orderId,
            @ApiParam(name = "hospitalName", value = "机构名称", required = true) @RequestParam String hospitalName,
            @ApiParam(name = "dispatcher", value = "调度员code", required = true) @RequestParam String dispatcher,
            @ApiParam(name = "dispatcherName", value = "调度员姓名", required = true) @RequestParam  String dispatcherName
    ) {
        try{
            JSONObject result = patientDoorCoachOrderService.dispatcherIntoTopic(orderId,hospitalName,dispatcher,dispatcherName);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return ObjEnvelop.getSuccess("转接成功",result.get(ResponseContant.resultMsg));
        }catch (Exception e){
            e.printStackTrace();
        }
        return ObjEnvelop.getError("转接失败");
    }
    /**
     * 获取服务项目
     *

+ 4 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultTeamService.java

@ -279,7 +279,7 @@ public class ConsultTeamService {
        //咨询详细信息
        ConsultTeamDo consultTeam = new ConsultTeamDo();
        consultTeam.setType(21);  //上门服务咨询
        consultTeam.setType(21);  //上门辅导咨询
        consultTeam.setRelationCode(doorServiceOrderDO.getId()); //关联业务code
        consultTeam.setSymptoms(doorServiceOrderDO.getServeDesc());
        consultTeam.setPatient(patient);
@ -336,6 +336,9 @@ public class ConsultTeamService {
     */
    public boolean finishDoorCoachConsult(BaseDoorCoachOrderDO assistanceDO, String endOperator, int endType){
        ConsultTeamDo consultTeam = consultTeamDao.queryByRelationCode(assistanceDO.getId());
        if (consultTeam==null){
            return true;
        }
        ConsultDo consult = consultDao.findOne(consultTeam.getConsult());
        String sessionId = assistanceDO.getPatient() + "_" + consultTeam.getConsult() + "_" + consultTeam.getType();

+ 8 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java

@ -652,9 +652,10 @@ public class DoctorDoorCoachOrderService {
        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"))){
@ -662,10 +663,10 @@ public class DoctorDoorCoachOrderService {
                   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()) ;
@ -674,7 +675,7 @@ public class DoctorDoorCoachOrderService {
                   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()) ;
@ -685,6 +686,7 @@ public class DoctorDoorCoachOrderService {
           }
       }
       map.put("all",all);
       map.put("waitForAccept",waitForAccept);
       map.put("waitForServe",waitForServe);
       map.put("served",served);
       map.put("cancel",cancel);

+ 42 - 13
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java

@ -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);

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/PatientMessageService.java

@ -44,7 +44,7 @@ public class PatientMessageService {
            sqlCondition += " and t.notice_time <= '"+endTime+"' ";
        }
        String time = DateUtil.getTime();
        String time = DateUtil.getStringDate();
        sqlCondition += " and t.notice_time <= '"+time+"' ";
        Long count = jdbcTemplate.queryForObject(sqlCount+sqlCondition,Long.class);