|
@ -7,6 +7,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.im.ConsultDo;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
|
|
|
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
|
|
|
import com.yihu.jw.entity.base.wx.WxPayLogDO;
|
|
|
import com.yihu.jw.entity.base.wx.WxWechatDO;
|
|
@ -34,6 +35,8 @@ import com.yihu.jw.order.dao.ConsultOrderDao;
|
|
|
import com.yihu.jw.order.pay.wx.WeChatConfig;
|
|
|
import com.yihu.jw.order.pay.ylz.YlzPayService;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
|
|
|
import com.yihu.jw.sms.service.YkyySMSService;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.common.QrcodeUtil;
|
|
|
import com.yihu.jw.util.common.XMLUtil;
|
|
@ -50,6 +53,7 @@ import com.yihu.utils.network.HttpResponse;
|
|
|
import com.yihu.utils.network.HttpUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -127,6 +131,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
private WlyyHttpLogDao wlyyHttpLogDao;
|
|
|
@Autowired
|
|
|
private BaseNatAppointmentDao baseNatAppointmentDao;
|
|
|
@Autowired
|
|
|
private BaseSmsTemplateDao smsTemplateDao;
|
|
|
@Autowired
|
|
|
private YkyySMSService ykyySMSService;
|
|
|
|
|
|
|
|
|
|
|
@ -451,12 +459,14 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
public Map<String,Object> selectOrderByRelationCode(String relationCode,String tradeType,String wechatId,boolean payFlag,String appletCode) throws Exception {
|
|
|
WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.parseInt(relationCode));
|
|
|
if (baseNatAppointmentDO!=null&&"-1".equalsIgnoreCase(baseNatAppointmentDO.getIsSuccess())){
|
|
|
throw new Exception("订单已取消");
|
|
|
}
|
|
|
if (businessOrderDO!=null&&businessOrderDO.getStatus()==1){
|
|
|
throw new Exception("订单已支付");
|
|
|
if (NumberUtils.isDigits(relationCode) ){
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.valueOf(relationCode));
|
|
|
if (baseNatAppointmentDO!=null&&"-1".equalsIgnoreCase(baseNatAppointmentDO.getIsSuccess())){
|
|
|
throw new Exception("订单已取消");
|
|
|
}
|
|
|
if (businessOrderDO!=null&&businessOrderDO.getStatus()==1){
|
|
|
throw new Exception("订单已支付");
|
|
|
}
|
|
|
}
|
|
|
String body = businessOrderDO.getDescription();
|
|
|
String totalFee = businessOrderDO.getPayPrice().intValue()+"";
|
|
@ -875,6 +885,13 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
" where "+condition+" t.CFSB ='"+wlyyPrescriptionDO.getRealOrder()+"'";
|
|
|
ykyyEntranceService.updateHisStatus(updatesql);
|
|
|
logger.info("自取写入更新his");
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
|
|
|
SmsTemplateDO smsTemplateDO = smsTemplateDao.findByClientId("oneself_pick");
|
|
|
if (smsTemplateDO!=null){
|
|
|
String content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime())).replace("{{门诊号码}}",wlyyPrescriptionDO.getRealOrder());
|
|
|
ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),smsTemplateDO.getHeader()+content);
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
//向顺丰下单
|
|
|
logger.info("向顺丰快递下单");
|