|
@@ -14,8 +14,10 @@ import com.fs.common.constant.FsConstants;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
+import com.fs.common.enums.ImTypeEnum;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.service.impl.SmsServiceImpl;
|
|
|
+import com.fs.common.utils.CloudHostUtils;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.SecurityUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
@@ -47,6 +49,7 @@ import com.fs.huifuPay.domain.HuiFuRefundResult;
|
|
|
import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.im.config.IMConfig;
|
|
|
+import com.fs.im.config.ImTypeConfig;
|
|
|
import com.fs.im.dto.*;
|
|
|
import com.fs.im.service.IImService;
|
|
|
import com.fs.im.service.OpenIMService;
|
|
@@ -659,6 +662,9 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(param.getDoctorId()!=null){
|
|
|
+ order.setDoctorId(param.getDoctorId());
|
|
|
+ }
|
|
|
List<FsPriceDTO> price = configDTO.getPrices().stream().filter(x -> x.getType().equals(param.getOrderType())).collect(Collectors.toList());
|
|
|
if(price!=null&&price.size()==1){
|
|
|
order.setMoney(price.get(0).getPrice());
|
|
@@ -815,6 +821,17 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
map.setPayTime(new Date());
|
|
|
map.setTradeNo(tradeNo);
|
|
|
fsInquiryOrderMapper.updateFsInquiryOrder(map);
|
|
|
+ // 木易华康特殊处理(支付成功医生自动接单)
|
|
|
+ if (CloudHostUtils.hasCloudHostName("木易华康")&&order.getDoctorId()!=null) {
|
|
|
+ Integer orderCount=fsInquiryOrderMapper.checkAcceptOrder(order.getDoctorId(),order.getUserId());
|
|
|
+ if(orderCount>0){
|
|
|
+ return R.error("此医生正在为您服务,不能下单");
|
|
|
+ }
|
|
|
+ FsInquiryOrderReceiveParam fsInquiryOrderReceiveParam = new FsInquiryOrderReceiveParam();
|
|
|
+ fsInquiryOrderReceiveParam.setOrderId(order.getOrderId());
|
|
|
+ fsInquiryOrderReceiveParam.setDoctorId(order.getDoctorId());
|
|
|
+ receiveOrder(fsInquiryOrderReceiveParam);
|
|
|
+ }
|
|
|
try {
|
|
|
FsUser fsUser = userMapper.selectFsUserByUserId(order.getUserId());
|
|
|
imService.addAccount(fsUser.getUserId(),fsUser.getAvatar(),fsUser.getNickName());
|
|
@@ -937,34 +954,37 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- //MsgDTO msgDTO=new MsgDTO();
|
|
|
+ MsgDTO msgDTO=new MsgDTO();
|
|
|
MsgCustomDTO customDTO=new MsgCustomDTO();
|
|
|
customDTO.setType("startInquiry");
|
|
|
customDTO.setOrderType(order.getOrderType());
|
|
|
customDTO.setOrderId(order.getOrderId().toString());
|
|
|
customDTO.setImType(1);
|
|
|
- /*msgDTO.setCloudCustomData(JSONUtil.toJsonStr(customDTO));
|
|
|
+ msgDTO.setCloudCustomData(JSONUtil.toJsonStr(customDTO));
|
|
|
msgDTO.setFrom_Account("D-"+param.getDoctorId());
|
|
|
- msgDTO.setTo_Account("U-"+order.getUserId());*/
|
|
|
- /*List<MsgDataDTO> msgs=new ArrayList<>();
|
|
|
+ msgDTO.setTo_Account("U-"+order.getUserId());
|
|
|
+ List<MsgDataDTO> msgs=new ArrayList<>();
|
|
|
MsgDataDTO msg=new MsgDataDTO();
|
|
|
- msg.setMsgType("TIMCustomElem");*/
|
|
|
+ msg.setMsgType("TIMCustomElem");
|
|
|
FsDoctor doctor=doctorMapper.selectFsDoctorByDoctorId(param.getDoctorId());
|
|
|
String doc="医生";
|
|
|
if (doctor.getDeptId()!=null&&doctor.getDeptId().compareTo(39L)==0){
|
|
|
doc="药师";
|
|
|
}
|
|
|
- /*InquiryOrderMsgDTO inquiryOrderMsgDTO=new InquiryOrderMsgDTO();
|
|
|
+ InquiryOrderMsgDTO inquiryOrderMsgDTO=new InquiryOrderMsgDTO();
|
|
|
inquiryOrderMsgDTO.setTitle(doctor.getDoctorName()+doc+"为您服务");
|
|
|
String ext= JSONUtil.toJsonStr(inquiryOrderMsgDTO);
|
|
|
msg.setMsgContent(new MsgDataFormatDTO("startInquiry",ext,order.getOrderId().toString()));
|
|
|
msgs.add(msg);
|
|
|
- msgDTO.setMsgBody(msgs);*/
|
|
|
- //imService.sendMsg(msgDTO);
|
|
|
+ msgDTO.setMsgBody(msgs);
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
- openIMService.sendUtil("D"+param.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","",doctor.getDoctorName()+doc+"为您服务","","","");
|
|
|
- /*OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
|
|
|
+ if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
+ String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
+ openIMService.sendUtil("D"+param.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","",doctor.getDoctorName()+doc+"为您服务","","","");
|
|
|
+ }else if (ImTypeConfig.IMTYPE== ImTypeEnum.TENCENT){
|
|
|
+ imService.sendMsg(msgDTO);
|
|
|
+ }
|
|
|
+ /*OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
|
|
|
openImMsgDTO.setSendID("D"+param.getDoctorId().toString());
|
|
|
openImMsgDTO.setRecvID("U"+order.getUserId().toString());
|
|
|
openImMsgDTO.setContentType(110);
|
|
@@ -992,11 +1012,13 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
msg1.setMsgContent(dto1);
|
|
|
msgs1.add(msg1);
|
|
|
msgDTO1.setMsgBody(msgs1);
|
|
|
- //imService.sendMsg(msgDTO1);
|
|
|
|
|
|
- ObjectMapper objectMapper1 = new ObjectMapper();
|
|
|
- String ex1 = objectMapper.writeValueAsString(customDTO1);
|
|
|
- openIMService.sendUtil("D"+param.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","","您好,我是芸医汇互联网医院执业药师,请问您有什么问题想咨询?","","",ex1);
|
|
|
+ if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
+ String ex1 = objectMapper.writeValueAsString(customDTO1);
|
|
|
+ openIMService.sendUtil("D"+param.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","","您好,我是芸医汇互联网医院执业药师,请问您有什么问题想咨询?","","",ex1);
|
|
|
+ }else if (ImTypeConfig.IMTYPE== ImTypeEnum.TENCENT){
|
|
|
+ imService.sendMsg(msgDTO1);
|
|
|
+ }
|
|
|
/*OpenImMsgDTO openImMsgDTO1 = new OpenImMsgDTO();
|
|
|
openImMsgDTO1.setSendID("D"+param.getDoctorId().toString());
|
|
|
openImMsgDTO1.setRecvID("U"+order.getUserId().toString());
|
|
@@ -1124,10 +1146,15 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
msg.setMsgContent(new MsgDataFormatDTO("startInquiry",ext,order.getOrderId().toString()));
|
|
|
msgs.add(msg);
|
|
|
msgDTO.setMsgBody(msgs);
|
|
|
- //imService.sendMsg(msgDTO);
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
- openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","",doctor.getDoctorName()+doc+"为您服务","","",ex);
|
|
|
+
|
|
|
+ if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
+ String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
+ openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","",doctor.getDoctorName()+doc+"为您服务","","",ex);
|
|
|
+ }else if (ImTypeConfig.IMTYPE== ImTypeEnum.TENCENT){
|
|
|
+ imService.sendMsg(msgDTO);
|
|
|
+ }
|
|
|
+ //imService.sendMsg(msgDTO);
|
|
|
/*OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
|
|
|
openImMsgDTO.setSendID("D"+order.getDoctorId().toString());
|
|
|
openImMsgDTO.setRecvID("U"+order.getUserId().toString());
|
|
@@ -1157,11 +1184,13 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
msgs1.add(msg1);
|
|
|
msgDTO1.setMsgBody(msgs1);
|
|
|
//imService.sendMsg(msgDTO1);
|
|
|
-
|
|
|
- ObjectMapper objectMapper1 = new ObjectMapper();
|
|
|
- String ex1 = objectMapper.writeValueAsString(customDTO1);
|
|
|
- openIMService.sendUtil("D"+param.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","","您好,我是芸医汇互联网医院执业药师,请问您有什么问题想咨询?","","",ex1);
|
|
|
- /* OpenImMsgDTO openImMsgDTO1 = new OpenImMsgDTO();
|
|
|
+ if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
+ String ex1 = objectMapper.writeValueAsString(customDTO1);
|
|
|
+ openIMService.sendUtil("D"+param.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","","您好,我是芸医汇互联网医院执业药师,请问您有什么问题想咨询?","","",ex1);
|
|
|
+ }else if (ImTypeConfig.IMTYPE== ImTypeEnum.TENCENT){
|
|
|
+ imService.sendMsg(msgDTO1);
|
|
|
+ }
|
|
|
+ /* OpenImMsgDTO openImMsgDTO1 = new OpenImMsgDTO();
|
|
|
openImMsgDTO1.setSendID("D"+order.getDoctorId().toString());
|
|
|
openImMsgDTO1.setRecvID("U"+order.getUserId().toString());
|
|
|
openImMsgDTO1.setContentType(110);
|
|
@@ -1310,9 +1339,12 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
msgDTO.setMsgBody(msgs);
|
|
|
//imService.sendMsg(msgDTO);
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
- openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"finishInquiry","","医生完成订单","","",ex);
|
|
|
-
|
|
|
+ if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
+ String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
+ openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"finishInquiry","","医生完成订单","","",ex);
|
|
|
+ }else if (ImTypeConfig.IMTYPE== ImTypeEnum.TENCENT){
|
|
|
+ imService.sendMsg(msgDTO);
|
|
|
+ }
|
|
|
//发送给医生
|
|
|
// MsgDTO msgDTO1=new MsgDTO();
|
|
|
// MsgCustomDTO customDTO1=new MsgCustomDTO();
|
|
@@ -1381,11 +1413,13 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
msg.setMsgContent(new MsgDataFormatDTO("finishInquiry",ext,order.getOrderId().toString()));
|
|
|
msgs.add(msg);
|
|
|
msgDTO.setMsgBody(msgs);
|
|
|
- //imService.sendMsg(msgDTO);
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
- openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"finishInquiry","","医生完成订单","","",ex);
|
|
|
-
|
|
|
+ if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
+ openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"finishInquiry","","医生完成订单","","",ex);
|
|
|
+ }else if (ImTypeConfig.IMTYPE== ImTypeEnum.TENCENT){
|
|
|
+ imService.sendMsg(msgDTO);
|
|
|
+ }
|
|
|
redisTemplate.delete("DrugReport:doctorId:" + order.getDoctorId() + ":userId:" + order.getUserId());
|
|
|
return R.ok();
|
|
|
}
|
|
@@ -1690,10 +1724,13 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
msgs.add(msg);
|
|
|
msgDTO.setMsgBody(msgs);
|
|
|
//imService.sendMsg(msgDTO);
|
|
|
-
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
- openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","1","为您服务","","",ex);
|
|
|
+ if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ String ex = objectMapper.writeValueAsString(customDTO);
|
|
|
+ openIMService.sendUtil("D"+order.getDoctorId(),"U"+order.getUserId(),110,"startInquiry","1","为您服务","","",ex);
|
|
|
+ }else if (ImTypeConfig.IMTYPE== ImTypeEnum.TENCENT){
|
|
|
+ imService.sendMsg(msgDTO);
|
|
|
+ }
|
|
|
|
|
|
return "OK";
|
|
|
}
|