liubing 3 years ago
parent
commit
bceaa3f41b

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/order/dao/BusinessOrderDao.java

@ -32,4 +32,7 @@ public interface BusinessOrderDao extends PagingAndSortingRepository<BusinessOrd
    @Query("from BusinessOrderDO w where w.status = ?1 and w.orderCategory <>4")
    List<BusinessOrderDO> selectByStatus(Integer status);
    @Query("from BusinessOrderDO w where w.patient = ?1 and w.status=?2  and w.orderCategory =?3")
    List<BusinessOrderDO> selectByPatientAndStatusAndOrderCategory(String patient,Integer status,String orderCategory);
}

+ 4 - 0
common/common-entity/sql记录

@ -1078,3 +1078,7 @@ CREATE TABLE `base_wx_pay_http_log` (
  KEY `index1` (`order_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信支付日志表';
-- 2021-06-30
alter table base.base_door_coach_order add column pay_status TINYINT(2) DEFAULT null COMMENT '0待扣费 1已支付 2已退款';
alter table base.base_life_care_order add column pay_status TINYINT(2) DEFAULT null COMMENT '0待扣费 1已支付 2已退款';

+ 37 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachOrderDO.java

@ -217,6 +217,32 @@ public class BaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
    }
    /**
     * 支付状态
     */
    public enum payStatus {
        waitForPay(0, "待支付"),
        paid(1, "已支付"),
        Refunded(1, "已退款");
        private Integer type;
        private String desc;
        payStatus(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 服务编号
     */
@ -565,7 +591,10 @@ public class BaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
     */
    private String shortcutType;
    /**
     * 0待扣费 1已扣费 2已退费
     */
    private Integer payStatus;//支付状态
    @Column(name = "number")
    public String getNumber() {
@ -1193,4 +1222,11 @@ public class BaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
        this.followupDate = followupDate;
    }
    public Integer getPayStatus() {
        return payStatus;
    }
    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }
}

+ 37 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/lifeCare/LifeCareOrderDO.java

@ -72,6 +72,31 @@ public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
    }
    /**
     * 支付状态
     */
    public enum payStatus {
        waitForPay(0, "待支付"),
        paid(1, "已支付"),
        Refunded(1, "已退款");
        private Integer type;
        private String desc;
        payStatus(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 服务编号
@ -301,6 +326,10 @@ public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
     * 签到医生姓名
     */
    private String signDoctorName;
    /**
     * 0待扣费 1已扣费 2已退费
     */
    private Integer payStatus;//支付状态
    @Column(name = "number")
    public String getNumber() {
@ -706,4 +735,12 @@ public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
    public void setConclusionTime(Date conclusionTime) {
        this.conclusionTime = conclusionTime;
    }
    public Integer getPayStatus() {
        return payStatus;
    }
    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }
}

+ 34 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PayEndpoint.java

@ -121,6 +121,40 @@ public class PayEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "existWaitForPay")
    @ApiOperation(value = "查询患者是否存在未支付订单")
    public ObjEnvelop existWaitForPay(
            @ApiParam(name = "patient", value = "patient", required = true)
            @RequestParam(value = "patient") String patient,
            @ApiParam(name ="orderCategory",value = "订单分类 1招生,2 课程,3 上门辅导托幼) 4 生活照料")
            @RequestParam(value = "orderCategory")String orderCategory) {
        try{
            JSONObject result =  result = payService.existWaitForPay(patient,orderCategory);
            return ObjEnvelop.getSuccess("查询成功",result);
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }
    }
    @GetMapping(value = "getPayInfo")
    @ApiOperation(value = "通过工单id获取支付信息")
    public ObjEnvelop getPayInfo(
            @ApiParam(name = "orderId", value = "工单id", required = true)
            @RequestParam String orderId,
            @ApiParam(name ="orderCategory",value = "3 上门辅导托幼 4 生活照料")
            @RequestParam(value = "orderCategory")String orderCategory) {
        try {
            JSONObject result = payService.getPayInfo(orderId,orderCategory);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return ObjEnvelop.getSuccess("查询成功",result.getJSONObject(ResponseContant.resultMsg));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }
    }
    @PostMapping(value = "wxWapPay")
    @ApiOperation(value = "微信wap支付")
    public ObjEnvelop wxWapPay(

+ 5 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/YsDeviceService.java

@ -66,8 +66,8 @@ public class YsDeviceService {
            assToken = responseBody.getJSONObject("data").getString("accessToken");
            Long expireTime = responseBody.getJSONObject("data").getLong("expiresIn");//token有效期
            redisTemplate.opsForValue().set(YsConfig.redisKey,assToken,expireTime, TimeUnit.SECONDS);
            Long ss= redisTemplate.getExpire(YsConfig.redisKey);
            System.out.println(expireTime+"---"+ss);
//            Long ss= redisTemplate.getExpire(YsConfig.redisKey);
//            System.out.println(expireTime+"---"+ss);
        }else {
@ -93,7 +93,7 @@ public class YsDeviceService {
        String assToken = null;
        if (responseBody.getInteger("code")==200){
            assToken = responseBody.getJSONObject("data").getString("ezOpenAccessToken");
            Long expireTime = responseBody.getJSONObject("data").getLong("expireTime");//token有效期
            Long expireTime = responseBody.getJSONObject("data").getLong("expireTime");//token有效截止日期
            Long nowTime = System.currentTimeMillis();
            expireTime = expireTime-nowTime;
@ -101,8 +101,8 @@ public class YsDeviceService {
            //设备解密密钥
            String secretKey = responseBody.getJSONObject("data").getString("secretKey");
            redisTemplate.opsForValue().set(YsConfig.secretKey,secretKey,expireTime, TimeUnit.MILLISECONDS);
            Long ss= redisTemplate.getExpire(YsConfig.iotRedisKey);
            System.out.println(expireTime+"---"+ss);
//            Long ss= redisTemplate.getExpire(YsConfig.iotRedisKey);
//            System.out.println(expireTime+"---"+ss);
        }else {
            throw new Exception("获取token失败");
        }

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

@ -811,7 +811,7 @@ public class DoctorDoorCoachOrderService {
                " LEFT JOIN base_patient p ON o.patient = p.id ) LEFT JOIN wlyy_consult c on o.id = c.relation_code"+
                applicationSql+" WHERE " +
                "  o.hospital = '{hospital}' and o.type != 3 " +buffer+
                " AND ( o.`status` = {status} OR -100 = {status} ) and o.status<>=0 "+//自主预约、医生代预约未付款不展示
                " AND ( o.`status` = {status} OR -100 = {status} ) and o.pay_status>0 "+//未付款不展示
                " ORDER BY o.create_time desc " +
                " LIMIT {start},{end};";
@ -829,7 +829,7 @@ public class DoctorDoorCoachOrderService {
                applicationSql +
                " WHERE  " +
                "  o.hospital = '{hospital}' and o.type != 3 " +buffer+
                " AND (o.`status` = {status} or -100 = {status})  and o.status<>=0  " ;
                " AND (o.`status` = {status} or -100 = {status})  and o.pay_status>0  " ;
        String finqlCountSql = countSql.replace("{hospital}", hospital)
                .replace("{status}", String.valueOf(status));

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

@ -14,6 +14,7 @@ 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.care.lifeCare.LifeCareFeeDetailDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareOrderDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
@ -143,6 +144,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        orderDO.setCreateUserName(orderDO.getProxyPatientName());
        orderDO.setOrderInfo("0");
        orderDO.setStatus(0);//待付款
        orderDO.setPayStatus(0);//待付款
//        orderDO.setConclusionStatus(1);
        if(StringUtils.isEmpty(orderDO.getPatient())){
@ -163,7 +165,9 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        //已取消的订单也可以申请
        boolean bool = baseDoorCoachOrderDao.existsByPatientAndStatusIn(orderDO.getPatient(),
                new Integer[]{BaseDoorCoachOrderDO.Status.waitForSend.getType(),
                new Integer[]{
                        BaseDoorCoachOrderDO.Status.waitForPay.getType(),
                        BaseDoorCoachOrderDO.Status.waitForSend.getType(),
                        BaseDoorCoachOrderDO.Status.waitForAccept.getType(),
                        BaseDoorCoachOrderDO.Status.waitForServe.getType(),
                        BaseDoorCoachOrderDO.Status.accept.getType(),
@ -202,6 +206,11 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
    @Transactional
    public JSONObject proxyCreate(String jsonData,String doctorCode) {
        JSONObject result = new JSONObject();
        //医养暂无该功能--屏蔽
        result.put(ResponseContant.resultFlag, ResponseContant.fail);
        result.put(ResponseContant.resultMsg, "暂无该功能");
        return result;
        /*
        JSONObject jsonObjectParam;
        try {
            jsonObjectParam = JSONObject.parseObject(jsonData);
@ -243,7 +252,8 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        if(StringUtils.isBlank(orderDO.getId())) {
            //已取消的订单也可以申请
            boolean bool = baseDoorCoachOrderDao.existsByPatientAndStatusIn(orderDO.getPatient(),
                    new Integer[]{BaseDoorCoachOrderDO.Status.waitForAccept.getType(),
                    new Integer[]{BaseDoorCoachOrderDO.Status.waitForPay.getType(),
                            BaseDoorCoachOrderDO.Status.waitForAccept.getType(),
                            BaseDoorCoachOrderDO.Status.waitForServe.getType(),
                            BaseDoorCoachOrderDO.Status.accept.getType(),
                            BaseDoorCoachOrderDO.Status.waitForSend.getType()
@ -279,6 +289,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            orderDO.setUpdateUserName(orderDO.getProxyPatientName());
        }
        orderDO.setStatus(0);//待付款
        orderDO.setPayStatus(0);//待付款
        orderDO.setType(3);
        orderDO.setDispatcherResponseTime(new Date());
        this.save(orderDO);
@ -292,24 +303,26 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        sendWeixinMessage(4,orderDO.getDoctor(),orderDO.getPatient());
        //发起支付订单
        payService.submitOrder(orderDO.getPatient(),"3",orderDO.getId(),orderDO.getTotalFee().doubleValue());
        BusinessOrderDO businessOrderDO =  payService.submitOrder(orderDO.getPatient(),"3",orderDO.getId(),orderDO.getTotalFee().doubleValue());
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        return result;
        */
    }
    //支付完成后开始上门辅导订单
    public JSONObject payOrderAfter(String orderId) {
        JSONObject result = new JSONObject();
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(orderId);
        if (businessOrderDO==null){
            String failMsg = "未查询到该订单";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);
            return result;
        }
        BaseDoorCoachOrderDO orderDO= baseDoorCoachOrderDao.findOne(orderId);
        if (orderDO!=null){
            if (businessOrderDO.getStatus() == 0){
        try {
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(orderId);
            if (businessOrderDO==null){
                String failMsg = "未查询到该订单";
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                result.put(ResponseContant.resultMsg, failMsg);
                return result;
            }
            BaseDoorCoachOrderDO orderDO= baseDoorCoachOrderDao.findOne(orderId);
            if (orderDO!=null){
                orderDO.setPayStatus(1);
                orderDO.setPayWay(1);
                orderDO.setPayTime(new Date());
                if (orderDO.getType()== 3){//医生代预约
@ -370,16 +383,14 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
                    result.put(ResponseContant.resultFlag, ResponseContant.success);
                    result.put(ResponseContant.resultMsg, failMsg);
                }
            }else {
                String failMsg = "订单已支付或已取消";
            }
            else {
                String failMsg = "工单不存在";
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                result.put(ResponseContant.resultMsg, failMsg);
            }
        }
        else {
            String failMsg = "工单不存在";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
    }
@ -387,19 +398,22 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
    //退款后回调
    public JSONObject refundOrderAfter(String orderId) {
        JSONObject result = new JSONObject();
        BaseDoorCoachOrderDO orderDO= baseDoorCoachOrderDao.findOne(orderId);
        if (orderDO == null){
            String failMsg = "工单不存在";
        try {
            BaseDoorCoachOrderDO orderDO= baseDoorCoachOrderDao.findOne(orderId);
            if (orderDO == null){
                String failMsg = "工单不存在";
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                result.put(ResponseContant.resultMsg, failMsg);
                return result;
            }
            orderDO.setPayStatus(2);
            this.save(orderDO);
            String failMsg = "success";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);
            return result;
        }catch (Exception e){
            e.printStackTrace();
        }
        orderDO.setStatus(-1);
        orderDO.setPayWay(-1);
        this.save(orderDO);
        String failMsg = "success";
        result.put(ResponseContant.resultFlag, ResponseContant.fail);
        result.put(ResponseContant.resultMsg, failMsg);
        return result;
    }
@ -842,7 +856,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            logger.error(failMsg);
            return result;
        }
        if(type==2){//患者仅未支付的订单能取消
        if(type==2){//v0.5.1 患者仅未支付的订单能取消此时未正式开始工单,未创建咨询
            if(orderDO.getStatus() != BaseDoorCoachOrderDO.Status.waitForPay.getType()){
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                String failMsg = "无法取消工单,已支付的工单需要到我的订单中进行取消," + orderId;
@ -851,16 +865,16 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
                return result;
            }
        }else{//调度员拒单,此时工单已支付抵达调度员
            //触发退款流程,退款失败时无法取消工单
            try {
                if (orderDO.getStatus() > BaseDoorCoachOrderDO.Status.waitForPay.getType()&&1==orderDO.getPayWay()){
                }
                if(!StringUtils.isEmpty(dispatcher)){
                    orderDO.setDoctor(dispatcher);
                    orderDO.setDoctorName(dispatcherName);
                    orderDO.setDispatcher(dispatcher);
                    orderDO.setDispatcherName(dispatcherName);
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(orderDO.getId());
                    if (businessOrderDO!=null){
                        if (1 == businessOrderDO.getStatus()){
                            //退款流程
                            payService.orderRefund(businessOrderDO.getOrderNo(),"调度员拒单退款");
                            orderDO.setPayStatus(2);
                        }
                    }
                }
                //如果是调度员取消,推送IM取消工单json消息,
                if (StringUtils.isNotBlank(dispatcher)){
@ -871,15 +885,12 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
                        return result;
                    }
                }
                else {
                    if (!consultTeamService.finishConsult(orderDO.getId(),orderDO.getPatient(),orderDO.getPatient(),1)){
                        String failMsg = "咨询结束失败 无法取消工单";
                        result.put(ResponseContant.resultFlag, ResponseContant.fail);
                        result.put(ResponseContant.resultMsg,failMsg);
                        return result;
                    }
                if(!StringUtils.isEmpty(dispatcher)){
                    orderDO.setDoctor(dispatcher);
                    orderDO.setDoctorName(dispatcherName);
                    orderDO.setDispatcher(dispatcher);
                    orderDO.setDispatcherName(dispatcherName);
                }
                if(type == BaseDoorCoachOrderDO.CancelType.dispatcher.getType()){
                    messageUtil.updateDoorCoachMessage(orderDO,new String[]{"702","703","730"},"732",dispatcher,dispatcher);
                }
@ -897,10 +908,9 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
                if (basePatientWechatDos.size()>0){
                    String openId = basePatientWechatDos.get(0).getOpenid();
                    messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyqx",openId,first,null,null,2,json, DateUtil.dateToChineseDate(new Date()),"上门预约已取消","已取消");
                }
            }catch (Exception e){
                e.printStackTrace();
                String failMsg = "退款失败,无法取消工单:," + orderId;
                result.put(ResponseContant.resultMsg, failMsg);
                return result;

+ 14 - 15
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -465,6 +465,8 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        try {
            jsonObjectParam = JSONObject.parseObject(jsonData);
            orderDO = EntityUtils.jsonToEntity(jsonObjectParam.get("order").toString(), LifeCareOrderDO.class);
            //存在未支付的订单不能发起
            Integer type = orderDO.getType();
            if (type==1||type==2){
                //本人或家人代发起
@ -479,6 +481,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
                orderDO.setProxyPatientName(doctorDO.getName());
                orderDO.setProxyPatientPhone(doctorDO.getMobile());
            }
            //todo 代发起时推送待支付模板给患者
        } catch (Exception e) {
            e.printStackTrace();
@ -529,7 +532,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
    }
    //支付完成后开始上门辅导订单
    //支付完成后开始订单
    public JSONObject payOrderAfter(String orderId) {
        JSONObject result = new JSONObject();
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(orderId);
@ -541,19 +544,15 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        }
        LifeCareOrderDO orderDO = lifeCareOrderDao.findOne(orderId);
        if (orderDO!=null) {
            if (businessOrderDO.getStatus() == 0) {
                orderDO.setPayWay(1);
                orderDO.setPayTime(new Date());
                orderDO.setStatus(1);
                if(orderDO.getType() == 3){
                    serviceNewsService.addServiceNews(orderDO.getProxyPatientName(),orderDO.getProxyPatient(),"4",orderDO.getPatientName());
                }else {
                    serviceNewsService.addServiceNews(orderDO.getPatientName(),orderDO.getPatient(),"3",null);
                }
            orderDO.setPayStatus(1);
            orderDO.setPayWay(1);
            orderDO.setPayTime(new Date());
            orderDO.setStatus(1);
            this.save(orderDO);
            if(orderDO.getType() == 3){
                serviceNewsService.addServiceNews(orderDO.getProxyPatientName(),orderDO.getProxyPatient(),"4",orderDO.getPatientName());
            }else {
                String failMsg = "订单已支付或已取消";
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                result.put(ResponseContant.resultMsg, failMsg);
                serviceNewsService.addServiceNews(orderDO.getPatientName(),orderDO.getPatient(),"3",null);
            }
        }
        else {
@ -566,6 +565,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        return result;
    }
    //退款成功后回调
    public JSONObject refundOrderAfter(String orderId) {
        JSONObject result = new JSONObject();
        LifeCareOrderDO orderDO = lifeCareOrderDao.findOne(orderId);
@ -575,8 +575,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
            result.put(ResponseContant.resultMsg, failMsg);
            return result;
        }
        orderDO.setStatus(-1);
        orderDO.setPayWay(-1);
        orderDO.setPayStatus(2);
        this.save(orderDO);
        String failMsg = "success";
        result.put(ResponseContant.resultFlag, ResponseContant.fail);

+ 57 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/pay/PayService.java

@ -229,6 +229,7 @@ public class PayService {
                BaseDoorCoachOrderDO orderDO = baseDoorCoachOrderDao.findOne(orderId);
                if(orderDO.getStatus()==0){
                    orderDO.setStatus(-1);
                    orderDO.setCancelReason("居民取消上门辅导订单");
                    baseDoorCoachOrderDao.save(orderDO);
                }
            }else if("4".equals(type)){
@ -246,6 +247,62 @@ public class PayService {
        return null;
    }
    /**
     * 居民是否存在未支付订单
     * @param patient
     * @param orderCategory
     * @return
     */
    public JSONObject existWaitForPay(String patient,String orderCategory){
        JSONObject result = new JSONObject();
        List<BusinessOrderDO> businessOrderDOs = businessOrderDao.selectByPatientAndStatusAndOrderCategory(patient,0,orderCategory);
        if (businessOrderDOs.size()>0){
            result.put("flag",true);
            result.put("OrderDO",businessOrderDOs.get(0));
        }
        else {
            result.put("flag",false);
            result.put("OrderDO",null);
        }
        return result;
    }
    /**
     * 工单获取支付信息
     * @param orderId
     * @param category
     * @return
     */
    public JSONObject getPayInfo(String orderId,String category){
        JSONObject result = new JSONObject();
//        if("3".equals(category)){
//            BaseDoorCoachOrderDO orderDO = baseDoorCoachOrderDao.findOne(orderId);
//            if (orderDO==null){
//                result.put(ResponseContant.resultFlag, ResponseContant.fail);
//                result.put(ResponseContant.resultMsg, "支付工单不存在");
//                return result;
//            }
//
//        }else if("4".equals(category)){
//            LifeCareOrderDO orderDO = lifeCareOrderDao.findOne(orderId);
//            if (orderDO==null){
//                result.put(ResponseContant.resultFlag, ResponseContant.fail);
//                result.put(ResponseContant.resultMsg, "支付工单不存在");
//                return result;
//            }
//        }
//        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(orderId);
//        if (businessOrderDO==null){
//            result.put(ResponseContant.resultFlag, ResponseContant.fail);
//            result.put(ResponseContant.resultMsg, "工单未创建支付订单");
//            return result;
//        }
        JSONObject payInfo = orderInfo(917);
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg, payInfo);
        return result;
    }
    /**
     * 微信退款
     * @param orderNo