fhx
2024-08-30 ec92adfb8a91ad8ccdd3ca9af37fe24e4d30971b
1.优化预约匹配推荐时间逻辑
2个文件已修改
24 ■■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/appointment/AppAutoMateController.java 14 ●●●● 补丁 | 查看 | 原始文档 | 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
@@ -311,7 +311,7 @@
        //用户操作时,对应个别时间为0
        if(dto.getOpType() == OperatorConstants.OP_TYPE_USER){
            mzTime = 0;
//            mzTime = 0;
            gtTime = 0;
            sqTime = 0;
            waitDuration = 0;
@@ -523,13 +523,13 @@
            //为空,表示当天已经没有时间段可以预约
            if(aVo == null && upOrDown != 0)
            {
                if (aVoList.size() < 2 && handleNum == 1 && deductHandle) {
                if (aVoList.size() < dto.getMateNum() && handleNum == 1 && deductHandle) {
                    //第二轮(治疗开始时间+10分钟)
                    handleNum = 2;
                    mateData = AppAutoMateHandleUtil.handleTime(commonService, shopWorkTimeVo, activityDay, projectIdsArr, doctorTimeList, shopTimeList
                            , doctorId, dto.getShopId(), handleNum, canAppList);
                    timeMap = mateData.getTimeMap();
                } else if (aVoList.size() < 2 && handleNum == 2 && deductHandle) {
                } else if (aVoList.size() < dto.getMateNum() && handleNum == 2 && deductHandle) {
                    //第三轮(治疗结束时间-10分钟)
                    handleNum = 3;
                    mateData = AppAutoMateHandleUtil.handleTime(commonService, shopWorkTimeVo, activityDay, projectIdsArr, doctorTimeList, shopTimeList
@@ -537,7 +537,7 @@
                    timeMap = mateData.getTimeMap();
                }
                //如果是处理到:向上处理+没满足2个+(第三轮后 或 非扣减处理),则跑向下处理(+等待时间)
                else if(upOrDown == 2 && aVoList.size() < 2 && (handleNum == 3 || !deductHandle)) {
                else if(upOrDown == 2 && aVoList.size() < dto.getMateNum() && (handleNum == 3 || !deductHandle)) {
                    //修改向上匹配时间
                    upOrDown = 1;
                    handleNum = 1;
@@ -667,7 +667,7 @@
                }
                //如果检查返回有不符合的条件
                if(upOrDown == 1 && aVoList.size() < 2){
                if(upOrDown == 1 && aVoList.size() < dto.getMateNum()){
                    //向下
                    //已面诊开始时间为开头加5分钟重新判断
                    cs.setTime(aVo.getMzStartTime());
@@ -677,7 +677,7 @@
                }
                // else if(upOrDown == 2 && aVoList.size() == 1){
                //     break;
                else if(upOrDown == 2 && aVoList.size() < 2){
                else if(upOrDown == 2 && aVoList.size() < dto.getMateNum()){
                    //向上
                    //已初始向上开始时间为开头减5分钟重新判断
                    cs.setTime(aVo.getMzStartTime());
@@ -740,7 +740,7 @@
        }else{
            json.put("errMsg", deviceErr);
        }
        logger.info("预约匹配返回结果:{}", json.toString());
        return Result.success(json);
    }
phi_platform_user/src/main/java/com/hx/phip/controller/appointment/CrmSelfV2Controller.java
@@ -49,7 +49,7 @@
    @RequestMapping("/shop/list")
    public Result shopList(){
        SqlSentence sqlSentence = new SqlSentence();
        sqlSentence.setSqlSentence(" select id, name from shop where isDel = 0 and isUp = 1 ");
        sqlSentence.setSqlSentence(" select id, name, workTime from shop where isDel = 0 and isUp = 1 ");
        List<Map<String, Object>> list = commonService.selectListMap(ShopMapper.class, sqlSentence);
        Map<String, Object> data = new HashMap<>();
        data.put("list", list);
@@ -239,10 +239,14 @@
        //匹配报错提示文案
        JSONObject data = result.getJsonObject(result.getData());
        if(StringUtils.noNull(data.getString("errMsg"))){
            throw new TipsException(data.getString("errMsg"));
        JSONArray arr = data.getJSONArray("list");
        if(arr != null && arr.size() > 0){
            data.remove("errMsg");
        }
        if(StringUtils.noNull(data.getString("errMsg")) ){
            throw new TipsException(data.getString("errMsg"));
        }
        return result;
    }