Bladeren bron

同城物流对接

wangzhinan 3 dagen geleden
bovenliggende
commit
74a5728322

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

@ -17147,15 +17147,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findByRealOrder(realOrder);
        List<WlyyPrescriptionExpressageDO> expressageDOS = prescriptionExpressageDao.findByOutpatientId(prescriptionDO.getOutpatientId());
        WlyyPrescriptionExpressageDO expressageDO = expressageDOS.get(0);
        if(type==1){
            expressageDO.setType(1);
            expressageDO.setOneselfPickupFlg(0);
            expressageDO.setUpdateTime(new Date());
        if (StringUtils.isNoneBlank(expressageDO.getMailno())){
            throw new Exception("已下单,请勿重新下单");
        }else {
            if (StringUtils.isNoneBlank(expressageDO.getMailno())){
                throw new Exception("已下单,请勿重新下单");
            if(type==1){
                expressageDO.setType(1);
                expressageDO.setOneselfPickupFlg(0);
                expressageDO.setUpdateTime(new Date());
            }else {
                res = sfUtils.createorder(realOrder);
                if(!selectTime()){
                    throw new Exception("当前时间段不支持同城配送。");
                }
                else {
                    res = sfUtils.createorder(realOrder);
                }
            }
        }
        return res;
@ -17232,19 +17237,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            Date pmStartDate = DateUtil.strToDateLong(pmStartStr);
            Date pmEndDate = DateUtil.strToDateLong(pmEndStr);
            if (sftcFlag.equalsIgnoreCase("1")){
                if (amStartDate.compareTo(nowDate)<0&&amEndDate.compareTo(nowDate)>0){
                    flag = true;
                } else if (pmStartDate.compareTo(nowDate)<0&&pmEndDate.compareTo(nowDate)>0) {
                    flag = true;
                }else {
                    flag = false;
                }
                LocalDate today = LocalDate.now();
                int dayOfWeek = today.getDayOfWeek().getValue();
                System.out.println(dayOfWeek+"=====================");
                if (dayOfWeek==6){
                if (dayOfWeek==6) {
                    if (amStartDate.compareTo(nowDate) < 0 && amEndDate.compareTo(nowDate) > 0) {
                        flag = true;
                    }else{
                        flag=false;
                    }
                }else if(dayOfWeek==7){
                    flag=false;
                }else{
                    if (amStartDate.compareTo(nowDate)<0&&amEndDate.compareTo(nowDate)>0){
                        flag = true;
                    } else if (pmStartDate.compareTo(nowDate)<0&&pmEndDate.compareTo(nowDate)>0) {
                        flag = true;
                    }else {
                        flag = false;
                    }
                }
            }else {