Browse Source

充值订单查询接口新增

wangjun 4 years ago
parent
commit
1dc3213e06

+ 9 - 21
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1,18 +1,6 @@
package com.yihu.jw.hospital.prescription.service;
import cn.jiguang.common.ClientConfig;
import cn.jiguang.common.resp.APIConnectionException;
import cn.jiguang.common.resp.APIRequestException;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.PushResult;
import cn.jpush.api.push.model.Message;
import cn.jpush.api.push.model.Platform;
import cn.jpush.api.push.model.PushPayload;
import cn.jpush.api.push.model.audience.Audience;
import cn.jpush.api.push.model.audience.AudienceTarget;
import cn.jpush.api.push.model.notification.AndroidNotification;
import cn.jpush.api.push.model.notification.IosNotification;
import cn.jpush.api.push.model.notification.Notification;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.*;
@ -4417,7 +4405,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 医生拒诊开始");
                logger.info("极光消息推送 医生拒诊开始");
                //wxTempalteJPush("cancel_remind",outpatientDO,null,"","","","");
                wxTempalteJPush("cancel_remind",outpatientDO,null,"","","","");
                /*String res = wxTempalteJPush(outpatientDO.getConsumer(),newConfig.getFirst(),"医生拒绝了你的问诊",type,outpatientDO.getId());
                logger.info("JPUSH res==="+res);*/
            }else if("outPatientTimeOutRemind".equals(titelType)){
@ -4454,7 +4442,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 就诊支付提醒开始");
                logger.info("极光消息推送 就诊支付提醒开始");
                //wxTempalteJPush("outpatient_pay",outpatientDO,null,"","","","");
                wxTempalteJPush("outpatient_pay",outpatientDO,null,"","","","");
            } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
                //处方开具支付提醒
                scene = "cfzfts";
@ -4468,7 +4456,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 处方支付提醒开始");
                logger.info("极光消息推送 医生拒诊开始");
                //wxTempalteJPush("prescription_pay",outpatientDO,null,"","","","");
                wxTempalteJPush("prescription_pay",outpatientDO,null,"","","","");
            }else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
                //视频问诊预约提醒
                scene = "spwzyytx";
@ -4499,7 +4487,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                logger.info("极光消息推送 医生拒诊开始");
                //wxTempalteJPush("give_score",outpatientDO,consultTeam,"","","","");
                wxTempalteJPush("give_score",outpatientDO,consultTeam,"","","","");
                logger.info("眼科微信消息模板推送 服务评价提醒开始");
            } else if ("systemCancelRemind".equalsIgnoreCase(titelType)) {
                //系统24小时取消复诊提醒
@ -4696,7 +4684,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                wxPushLogDao.save(wxPushLogDO);
            }
            //发送极光消息推送
           // wxTempalteJPush("logistics_remind",wlyyOutpatientDO,null,drugName,mailNo,remindMsg,prescriptionId);
           wxTempalteJPush("logistics_remind",wlyyOutpatientDO,null,drugName,mailNo,remindMsg,prescriptionId);
        }else {
            first = "您好,您的处方订单物流"+remindMsg;
            contentMsg = "患者"+patienName+"的处方药品订单,"+drugName+"等,当前"+remindMsg+"。物流方:「顺丰快递」,物流单号:"+mailNo+"。";
@ -8523,7 +8511,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                List<WlyyPrescriptionInfoDO> list = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                if (list!=null&&list.size()>0){
                    wlyyPrescriptionDO.setStatus(10);
                }else {
                    if(inspectionDOS!=null&&inspectionDOS.size()>0){
                        wlyyPrescriptionDO.setStatus(20);
                    }
@ -11481,7 +11469,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @return
     */
    public String jPushMessage(String userId, String alert, String title, com.alibaba.fastjson.JSONObject extras){
        List<WlyyHospitalSysDictDO> hospitalSysDictDOList = hospitalSysDictDao.findByDictName("JPUSH");
       /* List<WlyyHospitalSysDictDO> hospitalSysDictDOList = hospitalSysDictDao.findByDictName("JPUSH");
        String appKey = null;
        String masterSecret =null;
        for (WlyyHospitalSysDictDO hospitalSysDictDO:hospitalSysDictDOList){
@ -11529,7 +11517,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("HTTP Status: " + e.getStatus());
            logger.info("Error Code: " + e.getErrorCode());
            logger.info("Error Message: " + e.getErrorMessage());
        }
        }*/
        /*logger.info("极光推送返回日志==="+response);*/
       /* WlyyHttpLogDO httpLogDO = new WlyyHttpLogDO();
        httpLogDO.setCode("JPUSH");

+ 77 - 3
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -34,6 +34,7 @@ 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.restmodel.web.MixEnvelop;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.QrcodeUtil;
@ -43,6 +44,7 @@ import com.yihu.jw.util.wechat.WeiXinPayUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.ByteToInputStream;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
@ -136,6 +138,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private YkyySMSService ykyySMSService;
    @Autowired
    private WlyyInspectionDao inspectionDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
@ -879,14 +883,14 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
                        wlyyOutpatientDO.setPayStatus(1);
                        outpatientDao.save(wlyyOutpatientDO);
                        //prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                        prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                    }
                }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
                    wlyyOutpatientDO.setPayStatus(1);
                    outpatientDao.save(wlyyOutpatientDO);
                    //prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                    prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                    if (StringUtils.isNoneBlank(wlyyOutpatientDO.getDoctor())){
                        BaseDoctorDO baseDoctorDO= doctorDao.findById(wlyyOutpatientDO.getDoctor());
                        if (baseDoctorDO!=null){
@ -1767,7 +1771,77 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        }
    }
    public MixEnvelop findYktCardCharge(String startTime, String endTime, String orderNo, String yktOrderNo, String patientName
                                                    , String idCard, String medicard , Integer status, Integer page, Integer pageSize){
        String sql = " select t.id as \"id\"," +
                " t.patient as \"patient\","+
                " t.patient_name as \"patientName\","+
                " t.order_no as \"orderNo\","+
                " t.order_type as \"orderType\","+
                " t.relation_code as \"relationCode\","+
                " t.relation_name as \"relationName\","+
                " t.description as \"description\","+
                " t.pay_type as \"payType\","+
                " t.pay_price as \"payPrice\","+
                " t.status as \"status\","+
                " t.pay_time as \"payTime\","+
                " t.upload_status as \"uploadStatus\","+
                " t.create_time as \"createTime\","+
                " t.remark as \"remark\","+
                " t.yk_order_no as \"ykOrderNo\","+
                " t.yk_order_id as \"ykOrderId\","+
                " b.idcard as \"idcard\" "+
                " from base_business_order_pay t" +
                " left join base_patient b on t.patient = b.id  where 1=1 ";
        if (StringUtils.isNoneBlank(startTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and t.create_time > '" + startTime + " 00:00:00'";
                }else {
                    sql+=" and t.create_time > to_date('" + startTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.create_time > '" + startTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNoneBlank(endTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and t.create_time <= '" + endTime + " 23:59:59'";
                }else {
                    sql+=" and t.create_time <= to_date('" + endTime + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.create_time <= '" + endTime + " 23:59:59'";
            }
        }
        if (StringUtils.isNoneBlank(orderNo)){
            sql+=" and t.order_no ='"+orderNo+"'";
        }
        if (StringUtils.isNoneBlank(yktOrderNo)){
            sql+=" and t.yk_order_no ='"+yktOrderNo+"'";
        }
        if (StringUtils.isNoneBlank(patientName)){
            sql+=" and t.patient_name  like '%"+patientName+"%'";
        }
        if (StringUtils.isNoneBlank(idCard)){
            sql+=" and b.idcard ='"+idCard+"'";
        }
        if (StringUtils.isNoneBlank(medicard)){
            sql+=" and t.relation_code ='"+medicard+"'";
        }
        if (status!=null){
            sql+=" and t.status ="+status+"";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> listCount  = hibenateUtils.createSQLQuery(sql);
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setTotalCount(listCount==null?0:listCount.size());
        return mixEnvelop;
    }
    /**
     * 眼科就诊卡充值

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java

@ -620,7 +620,7 @@ public class WxTemplateService {
            WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO();
            wlyyOutpatientDO.setConsumer(basePatientDO.getId());
            wlyyOutpatientDO.setDoctorName(senderName);
            //prescriptionService.wxTempalteJPush("consult_remind",wlyyOutpatientDO,null,"","","","");
            prescriptionService.wxTempalteJPush("consult_remind",wlyyOutpatientDO,null,"","","","");
        }else{
            throw new Exception("接收者ID错误,无法找到该账号");
        }

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -39,6 +39,7 @@ public class BaseHospitalRequestMapping {
        public static final String PREFIX  = "/prescription";
        public static final String findDoctorByIdCard = "/findDoctorByIdCard";
        public static final String testJpush = "/testJpush";
        public static final String findYkCardCharge = "/findYkCardCharge";
        public static final String updateChannelId = "/updateChannelId";
        //=====================start=======================================

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -216,7 +216,7 @@ public class UnSettledHISPrescriptionService {
                        BaseDoctorDO baseDoctorDO = doctorDao.findById(doctor);
                        ykyySMSService.sendSmsByTempcode("check_failed",wlyyOutpatientDO,prescriptionDO,baseDoctorDO.getMobile());
                        logger.info("极光推送处方驳回消息");
                       //prescriptionService.wxTempalteJPush("prescription_refuse",wlyyOutpatientDO,null,"","","",prescriptionDO.getId());
                       prescriptionService.wxTempalteJPush("prescription_refuse",wlyyOutpatientDO,null,"","","",prescriptionDO.getId());
                    }
                }

+ 27 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -1697,4 +1697,31 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return success(prescriptionService.wxTempalteJPush(templateCode,wlyyOutpatientDO,consultTeamDo,drugName,mailNo,mailStatus,prescriptionId));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findYkCardCharge)
    @ApiOperation(value = "查询眼科通充值记录", notes = "")
    public MixEnvelop findYkCardCharge(@ApiParam(name = "startTime", value = "")
                             @RequestParam(value = "startTime", required = false)String startTime,
                             @ApiParam(name = "endTime", value = "")
                             @RequestParam(value = "endTime", required = false)String endTime,
                             @ApiParam(name = "orderNo", value = "")
                             @RequestParam(value = "orderNo", required = false)String orderNo,
                             @ApiParam(name = "yktOrderNo", value = "")
                             @RequestParam(value = "yktOrderNo", required = false)String yktOrderNo,
                             @ApiParam(name = "patientName", value = "")
                             @RequestParam(value = "patientName", required = false)String patientName,
                             @ApiParam(name = "idCard", value = "")
                             @RequestParam(value = "idCard", required = false)String idCard,
                                       @ApiParam(name = "medicard", value = "")
                                           @RequestParam(value = "medicard", required = false)String medicard,
                                       @ApiParam(name = "status", value = "")
                                           @RequestParam(value = "status", required = false)Integer status,
                                       @ApiParam(name = "page", value = "")
                                           @RequestParam(value = "page", required = false)Integer page,
                                       @ApiParam(name = "pageSize", value = "")
                                           @RequestParam(value = "pageSize", required = false)Integer pageSize) {
        return businessOrderService.findYktCardCharge(startTime,endTime,orderNo,yktOrderNo,patientName,idCard,medicard,status,page,pageSize);
    }
}