fhx
2024-08-27 c477dba1319727319dd5efaaa7a415a127e6cd6e
1.修改自助预约问题
2个文件已修改
50 ■■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/appointment/AppAutoMateController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/appointment/CrmSelfV2Controller.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/appointment/AppAutoMateController.java
@@ -56,16 +56,16 @@
        }
        if(StringUtils.isEmpty(dto.getShopId())) {
            throwParamException("请选择门店");
            throw new TipsException("请选择门店");
        }
        Shop shop = commonService.selectOneByKey(ShopMapper.class, dto.getShopId());
        if(shop == null) {
            throwParamException("找不到门店");
            throw new TipsException("找不到门店");
        }
        if(StringUtils.isEmpty(dto.getUserId())) {
            throwParamException("请选择用户");
            throw new TipsException("请选择用户");
        }
        Map<String, Object> values = new HashMap<>();
@@ -78,7 +78,7 @@
        User user = commonService.selectOne(UserMapper.class, sqlSentence);
        if(user == null) {
            throwParamException("找不到用户");
            throw new TipsException("找不到用户");
        }
        Employee doctor = null;
@@ -95,22 +95,22 @@
            doctor = commonService.selectOne(EmployeeMapper.class, sqlSentence);
            if(doctor == null)
            {
                throwParamException("找不到医生");
                throw new TipsException("找不到医生");
            }
        }else{
            doctorId = null;
        }
        if(StringUtils.isEmpty(dto.getArriveDate(), dto.getStartTime())) {
            throwParamException("请选择到店日期和时间");
            throw new TipsException("请选择到店日期和时间");
        }
        if(dto.getVisitType() == null) {
            throwParamException("请选择就诊类型");
            throw new TipsException("请选择就诊类型");
        }
        if(dto.getAppType() == null) {
            throwParamException("请选择预约类型");
            throw new TipsException("请选择预约类型");
        }
        Integer waitDuration = dto.getWaitDuration();
@@ -159,11 +159,13 @@
        //是否再生项目
        String zsProjectId = "";
        boolean isZsP = false;
        //是否有非生美项目
        boolean isNotSm = false;
        //复查可以不选项目
        if(StringUtils.isEmpty(dto.getProjectJson()) && dto.getAppType() != Appointment.APP_TYPE_REVIEW)
        {
            throwParamException("请选择项目");
            throw new TipsException("请选择项目");
        }else {
            //再生项目逻辑,目前写死一个项目
@@ -188,12 +190,12 @@
                num = temp.getIntValue("num");
                if(StringUtils.isEmpty(id) || num <= 0)
                {
                    throwParamException("请选择正确项目和数量");
                    throw new TipsException("请选择正确项目和数量");
                }
                p = commonService.selectOneByKey(ProjectMapper.class, id);
                if(p == null || p.getIsDel().equals(BaseEntity.YES)  || p.getIsUp().equals(BaseEntity.NO))
                {
                    throwParamException("找不到项目或者项目下架");
                    throw new TipsException("找不到项目或者项目下架");
                }
                projectList.add(p);
@@ -212,9 +214,13 @@
                    isDevice++;
                }
                if(!isNotSm && p.getIsLifeBeauty().equals(BaseEntity.NO)){
                    isNotSm = true;
                }
                if(zsProjectId.equals(id)){
                    if(num > 1){
                        throwParamException("再生项目数量不能大于1!");
                        throw new TipsException("再生项目数量不能大于1!");
                    }
                    isZsP = true;
                }
@@ -223,7 +229,11 @@
        //判断如果包含了再生项目,
        if(isZsP && projectList.size() > 1){
            throwParamException("预约项目里面有再生项目,不能和其他项目同时预约!");
            throw new TipsException("预约项目里面有再生项目,不能和其他项目同时预约!");
        }
        if(isNotSm && StringUtils.isEmpty(doctorId)){
            throw new TipsException("预约包含非生美项目,需选择预约医生!");
        }
        /////////////////////////////////////////////////
@@ -349,7 +359,7 @@
            err = TransferUtil.checkTransferNotAccepted(commonService
                    , user, shop, st, doctor, cu, projectList);
            if(err != null){
                throwParamException(err);
                throw new TipsException(err);
            }
            //修改为转疗
@@ -451,7 +461,7 @@
        timeMap = mateData.getTimeMap();
        err = mateData.getErrMsg();
        if(timeMap == null || timeMap.size() <= 0){
            throw new TipsException("当前日期医生没有可用时间");
            throw new TipsException("当前预约医生预约日期无排班时间,无法选择系统推荐时间,请重新选择预约医生");
        }
        ////////////////////////////////////////////////////////////////////////
phi_platform_user/src/main/java/com/hx/phip/controller/appointment/CrmSelfV2Controller.java
@@ -156,7 +156,7 @@
        sqlSentence.setM(values);
        values.put("type", ProjectType.TYPE_APPOINTMENT);
        StringBuilder sql = new StringBuilder();
        sql.append(" select p.id, p.name  ")
        sql.append(" select p.id, p.name, p.isLifeBeauty, p.unit, p.specification  ")
                .append(", p.useDuration / 60 as useDuration ")
                .append(", p.palsyDuration / 60 as palsyDuration ")
                .append(", (p.useDuration + p.palsyDuration) / 60 as duration ")
@@ -175,6 +175,7 @@
        }
        sql.append(" order by p.orderNum asc ");
        sqlSentence.setSqlSentence(sql.toString());
        PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
        List<Map<String, Object>> list = commonService.selectListMap(ProjectMapper.class, sqlSentence);
        PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
@@ -245,6 +246,13 @@
            throw new TipsException("获取预约时间失败!");
        }
        //匹配报错提示文案
        JSONObject data = result.getJsonObject(result.getData());
        if(StringUtils.noNull(data.getString("errMsg"))){
            throw new TipsException(data.getString("errMsg"));
        }
        return result;
    }