Parcourir la source

添加门诊手动执行取消

wangjun il y a 4 ans
Parent
commit
72f66ce6f0

+ 87 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -702,4 +702,91 @@ public class PrescriptionStatusUpdateService {
        }
       return  msgReturn;
    }
    public void cancelRecieve(){
        //将所有的已接诊的处方记录
        List<WlyyOutpatientDO> outpatientDOs = outpatientDao.findByStatus();
        if(outpatientDOs!=null&&outpatientDOs.size()>0){
            System.out.println(outpatientDOs.get(0).getId()+"id______-");
            for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                //结束门诊
                outpatientDO.setStatus("3");
                outpatientDO.setEndTime(new Date());
                String consultCode ="";
                try {
                    consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
                    logger.info("consultCode"+consultCode);
                    if(StringUtils.isNoneBlank(consultCode)){
                        imService.finish(consultCode,"admin",2);
                    }
                }catch(Exception e)  {
                    e.printStackTrace();
                    logger.info("自动结束咨询报错 consultCode: "+consultCode);
                }
                logger.info(outpatientDO.getId()+"的处方记录设置为结束");
            }
            outpatientDao.save(outpatientDOs);
            //退费
            for (WlyyOutpatientDO outpatientDO:outpatientDOs){
                try {
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                    if (businessOrderDO!=null){
                        if (businessOrderDO.getPayType()==1){
                            businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
                        }else if (businessOrderDO.getPayType()==3){
        /*
                            businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
        */
                        }
                    } } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            logger.info("setOutPatientOver count :"+outpatientDOs.size());
        }else {
            logger.info("setOutPatientOver count :"+0);
        }
        logger.info("setOutPatientOver end ");
    }
    public void cancelRecieveSingle(String outpatientId){
        //将所有的已接诊的处方记录
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        if(outpatientDO!=null){
            System.out.println(outpatientDO.getId()+"id______-");
            //结束门诊
            outpatientDO.setStatus("3");
            outpatientDO.setEndTime(new Date());
            String consultCode ="";
            try {
                consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
                logger.info("consultCode"+consultCode);
                if(StringUtils.isNoneBlank(consultCode)){
                    imService.finish(consultCode,"admin",2);
                }
            }catch(Exception e)  {
                e.printStackTrace();
                logger.info("自动结束咨询报错 consultCode: "+consultCode);
            }
            logger.info(outpatientDO.getId()+"的处方记录设置为结束");
            outpatientDao.save(outpatientDO);
            //退费
            try {
                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                if (businessOrderDO!=null){
                    if (businessOrderDO.getPayType()==1){
                        businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
                    }else if (businessOrderDO.getPayType()==3){
    /*
                        businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
    */
                    }
                } } catch (Exception e) {
                e.printStackTrace();
            }
        }else {
            logger.info("setOutPatientOver count :"+0);
        }
        logger.info("setOutPatientOver end ");
    }
}

+ 9 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -643,8 +643,15 @@ public class JobController extends BaseController {
        }else {
            return prescriptionStatusUpdateService.cancelAll();
        }
    }
    @RequestMapping(value = "cancelRecivePre", method = RequestMethod.GET)
    public void cancelRecivePre(String outpatientId){
        if (StringUtils.isNotBlank(outpatientId)){
            System.out.println(outpatientId);
            prescriptionStatusUpdateService.cancelRecieveSingle(outpatientId);
        }else {
            prescriptionStatusUpdateService.cancelRecieve();
        }
    }
}