|
@ -16,6 +16,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
|
|
|
import com.yihu.jw.entity.base.org.BaseOrgDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
|
|
|
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
|
|
|
import com.yihu.jw.entity.care.lifeCare.LifeCareCancelLogDO;
|
|
|
import com.yihu.jw.entity.care.lifeCare.LifeCareFeeDetailDO;
|
|
@ -475,6 +476,18 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
|
|
|
orderDO = EntityUtils.jsonToEntity(jsonObjectParam.get("order").toString(), LifeCareOrderDO.class);
|
|
|
//存在未支付的订单不能发起
|
|
|
|
|
|
boolean bool = lifeCareOrderDao.existsByPatientAndStatusIn(orderDO.getPatient(),
|
|
|
new Integer[]{
|
|
|
BaseDoorCoachOrderDO.Status.waitForPay.getType()
|
|
|
});
|
|
|
|
|
|
if(bool){
|
|
|
String failMsg = "当前服务对象存在未支付或未完成,无法再次申请!";
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.fail);
|
|
|
result.put(ResponseContant.resultMsg, failMsg);
|
|
|
logger.error(failMsg);
|
|
|
return result;
|
|
|
}
|
|
|
Integer type = orderDO.getType();
|
|
|
if (type==1||type==2){
|
|
|
//本人或家人代发起
|
|
@ -488,8 +501,14 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
|
|
|
orderDO.setProxyPatient(proxyPatient);
|
|
|
orderDO.setProxyPatientName(doctorDO.getName());
|
|
|
orderDO.setProxyPatientPhone(doctorDO.getMobile());
|
|
|
List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wxId,orderDO.getPatient());
|
|
|
if (basePatientWechatDos.size()>0){
|
|
|
JSONObject json = new JSONObject();
|
|
|
String openId = basePatientWechatDos.get(0).getOpenid();
|
|
|
messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","shzldzf",openId,null,null,"请在30分钟内完成支付",3,json,
|
|
|
DateUtil.dateToChineseDate(new Date()),"助老员已为您代预约生活照料","待支付");
|
|
|
}
|
|
|
}
|
|
|
//todo 代发起时推送待支付模板给患者
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|