Browse Source

同城物流对接

wangzhinan 1 week ago
parent
commit
b52d9e9c3e

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

@ -17142,24 +17142,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param type
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public String updateExpressInfo(String realOrder,Integer type) throws Exception {
        String res = "";
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findByRealOrder(realOrder);
        List<WlyyPrescriptionExpressageDO> expressageDOS = prescriptionExpressageDao.findByOutpatientId(prescriptionDO.getOutpatientId());
        WlyyPrescriptionExpressageDO expressageDO = expressageDOS.get(0);
        if (StringUtils.isNoneBlank(expressageDO.getMailno())){
            throw new Exception("已下单,请勿重新下单");
        }else {
            if(type==1){
                expressageDO.setType(1);
                expressageDO.setOneselfPickupFlg(0);
                expressageDO.setUpdateTime(new Date());
        synchronized(realOrder.intern()){
            if (StringUtils.isNoneBlank(expressageDO.getMailno())){
                throw new Exception("已下单,请勿重新下单");
            }else {
                if(!selectTime()){
                    throw new Exception("当前时间段不支持同城配送。");
                }
                else {
                    res = sfUtils.createorder(realOrder);
                if(type==1){
                    expressageDO.setType(1);
                    expressageDO.setOneselfPickupFlg(0);
                    expressageDO.setUpdateTime(new Date());
                }else {
                    if(!selectTime()){
                        throw new Exception("当前时间段不支持同城配送。");
                    }
                    else {
                        res = sfUtils.createorder(realOrder);
                    }
                }
            }
        }