fhx
2024-09-02 5c9020c60b537ecddbccbcc8769428ae46d2c7fb
Merge branch 'fhx-base-治疗单改版0829' into master-test
2个文件已修改
33 ■■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderPayMoneyUtil.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatController.java
@@ -739,10 +739,12 @@
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "公用项目标识不能为空");
            }
            if(StringUtils.noNull(treatProject.getUserProjectItemId()) && idSet.contains(treatProject.getUserProjectItemId())){
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "治疗单选择用户项目重复!");
            if(StringUtils.noNull(treatProject.getUserProjectItemId())){
                idSet.add(treatProject.getUserProjectItemId());
                if(idSet.contains(treatProject.getUserProjectItemId())){
                    throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "治疗单选择用户项目重复!");
                }
            }
            idSet.add(treatProject.getUserProjectItemId());
            if(StringUtils.noNull(treatProject.getId())){
                oldData = commonService.selectOneByKey(TreatProjectMapper.class, treatProject.getId());
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderPayMoneyUtil.java
@@ -2000,6 +2000,8 @@
            }
            setUserProjectItem(ordersTotal, userProject, userProjectItem, date, vo,orderItemSon,1);
            commonService.insert(UserProjectItemMapper.class,userProjectItem);//新增用户项目子项记录
            //结账更新治疗单项目关联用户项目
            updateTreatProjectAssocUserProjectItem(commonService, userProjectItem, ordersTotal.getId(), vo.getId(), orderItemSon == null ? null : orderItemSon.getId());
        }else{
            map.put("commonId",vo.getCommonId());
            UserProject userProject=commonService.selectOne(UserProjectMapper.class,sqlSentence);
@@ -2030,6 +2032,9 @@
            }
            setUserProjectItem(ordersTotal, userProject, userProjectItem, date, vo,orderItemSon,0);
            commonService.insert(UserProjectItemMapper.class,userProjectItem);//新增用户项目子项记录
            //结账更新治疗单项目关联用户项目
            updateTreatProjectAssocUserProjectItem(commonService, userProjectItem, ordersTotal.getId(), vo.getId(), orderItemSon == null ? null : orderItemSon.getId());
        }
    }
@@ -2388,4 +2393,24 @@
        }
        return stringBuffer.toString();
    }
    /** 结账更新治疗单项目关联用户项目 */
    private static void updateTreatProjectAssocUserProjectItem(CommonService commonService, UserProjectItem userProjectItem, String orderId, String orderItemId, String orderItemSonId){
        if(userProjectItem == null || StringUtils.isEmpty(userProjectItem.getId())){
            return;
        }
        SqlSentence sqlSentence = new SqlSentence();
        Map<String, Object> values = new HashMap<>();
        sqlSentence.setM(values);
        values.put("userProjectItemId", userProjectItem.getId());
        values.put("orderId", orderId);
        values.put("orderItemId", orderItemId);
        if(StringUtils.isEmpty(orderItemSonId)){
            sqlSentence.setSqlSentence(" userProjectItemId = #{m.userProjectItemId} where orderId = #{m.orderId} and orderItemId = #{m.orderItemId} and userProjectItemId is null ");
        }else{
            values.put("orderItemSonId", orderItemSonId);
            sqlSentence.setSqlSentence(" userProjectItemId = #{m.userProjectItemId} where orderId = #{m.orderId} and orderItemId = #{m.orderItemId} and orderItemSonId = #{m.orderItemSonId} and userProjectItemId is null ");
        }
        commonService.updateWhere(TreatProjectMapper.class, sqlSentence);
    }
}