xuhy
2025-10-27 e61046030a9b6967fcf9968c328ba140438f2df7
bug修改
1个文件已删除
13个文件已修改
207 ■■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DataStatisticsController.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmBranchController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysAppUserController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/TaskUtil.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/task/TbillTask.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TCrmClinic.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/SysUserQuery.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/SupplierSalesStatisticsGoodsTypeVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TCrmClinicMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TErpProcurementMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TSysOrderMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DataStatisticsController.java
@@ -97,7 +97,8 @@
        }
        TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
                .eq(TCrmSupplier::getUserId, userId));
                .eq(TCrmSupplier::getUserId, userId)
                .last("LIMIT 1"));
        Map<String, Object> map = new HashMap<>();
@@ -138,11 +139,20 @@
        String supplierAndClinicId = null;
        if (roleType == 4) {
            TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
                    .eq(TCrmSupplier::getUserId, userId));
                    .eq(TCrmSupplier::getUserId, userId)
                    .last("LIMIT 1"));
            supplierAndClinicId = crmSupplier.getId();
        } else {
            TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                    .eq(TCrmClinic::getUserId, userId));
                    .eq(TCrmClinic::getUserId, userId)
                    .last("LIMIT 1"));
            if(Objects.isNull(crmClinic)){
                SysUser sysUser = sysUserService.selectUserById(userId);
                crmClinic = crmClinicService.getById(sysUser.getObjectId());
            }
            if(Objects.isNull(crmClinic)){
                return R.fail("未找到该账号诊所信息");
            }
            supplierAndClinicId = crmClinic.getId();
        }
@@ -192,7 +202,15 @@
        Long userId = tokenService.getLoginUser().getUserId();
        TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                .eq(TCrmClinic::getUserId, userId));
                .eq(TCrmClinic::getUserId, userId)
                .last("LIMIT 1"));
        if(Objects.isNull(crmClinic)){
            SysUser sysUser = sysUserService.selectUserById(userId);
            crmClinic = crmClinicService.getById(sysUser.getObjectId());
        }
        if(Objects.isNull(crmClinic)){
            return R.fail("未找到该账号诊所信息");
        }
        List<TSysAppUser> sysAppUsers = sysAppUserService.list(Wrappers.lambdaQuery(TSysAppUser.class)
                .eq(TSysAppUser::getClinicId, crmClinic.getId()));
@@ -212,8 +230,15 @@
        Long userId = tokenService.getLoginUser().getUserId();
        TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                .eq(TCrmClinic::getUserId, userId));
                .eq(TCrmClinic::getUserId, userId)
                .last("LIMIT 1"));
        if(Objects.isNull(crmClinic)){
            SysUser sysUser = sysUserService.selectUserById(userId);
            crmClinic = crmClinicService.getById(sysUser.getObjectId());
        }
        if(Objects.isNull(crmClinic)){
            return R.fail("未找到该账号诊所信息");
        }
        List<TCrmClinicPoints> crmClinicPoints = crmClinicPointsService.clinicPointsStatistics(crmClinic.getId(), LocalDate.now() + " 23:59:59");
        Map<String, Integer> map = new HashMap<>();
        if (CollectionUtils.isEmpty(crmClinicPoints)) {
@@ -237,7 +262,8 @@
        Long userId = tokenService.getLoginUser().getUserId();
        TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
                .eq(TCrmSupplier::getUserId, userId));
                .eq(TCrmSupplier::getUserId, userId)
                .last("LIMIT 1"));
        // 查询药品总类和总数
        Integer typeTotalCount = erpProcurementService.supplierSalesStatisticsTypeCount(crmSupplier.getId());
        Integer totalCount = erpProcurementService.supplierSalesStatisticsCount(crmSupplier.getId());
@@ -281,7 +307,8 @@
                break;
        }
        TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
                .eq(TCrmSupplier::getUserId, userId));
                .eq(TCrmSupplier::getUserId, userId)
                .last("LIMIT 1"));
        SupplierSalesStatisticsVO supplierSalesStatisticsVO = new SupplierSalesStatisticsVO();
        // 销售金额
        BigDecimal totalMoney = erpProcurementService.supplierSalesStatisticsMoney(crmSupplier.getId(), startTime, endTime);
@@ -390,10 +417,18 @@
        Long userId = tokenService.getLoginUser().getUserId();
        TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                .eq(TCrmClinic::getUserId, userId));
                .eq(TCrmClinic::getUserId, userId)
                .last("LIMIT 1"));
        if(Objects.isNull(crmClinic)){
            SysUser sysUser = sysUserService.selectUserById(userId);
            crmClinic = crmClinicService.getById(sysUser.getObjectId());
        }
        if(Objects.isNull(crmClinic)){
            return R.fail("未找到该账号诊所信息");
        }
        // 查询药品总类和总数
        Integer typeTotalCount = sysOrderService.clinicSalesStatisticsTypeCount(Arrays.asList(crmClinic.getId()));
        Integer totalCount = sysOrderService.clinicSalesStatisticsCount(Arrays.asList(crmClinic.getId()));
        Integer typeTotalCount = sysOrderService.clinicSalesStatisticsTypeCount(Collections.singletonList(crmClinic.getId()));
        Integer totalCount = sysOrderService.clinicSalesStatisticsCount(Collections.singletonList(crmClinic.getId()));
        Map<String, Integer> map = new HashMap<>();
        map.put("typeTotalCount", typeTotalCount);
        map.put("totalCount", totalCount);
@@ -434,7 +469,15 @@
                break;
        }
        TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                .eq(TCrmClinic::getUserId, userId));
                .eq(TCrmClinic::getUserId, userId)
                .last("LIMIT 1"));
        if(Objects.isNull(crmClinic)){
            SysUser sysUser = sysUserService.selectUserById(userId);
            crmClinic = crmClinicService.getById(sysUser.getObjectId());
        }
        if(Objects.isNull(crmClinic)){
            return R.fail("未找到该账号诊所信息");
        }
        ClinicSalesStatisticsVO clinicSalesStatisticsVO = new ClinicSalesStatisticsVO();
        // 销售金额
        BigDecimal totalMoney = sysOrderService.clinicSalesStatisticsMoney(crmClinic.getId(), startTime, endTime);
@@ -557,7 +600,8 @@
        Integer roleType = user.getRoleType();
        if (roleType == 2) {
            TCrmBranch branch = crmBranchService.getOne(Wrappers.lambdaQuery(TCrmBranch.class)
                    .eq(TCrmBranch::getUserId, user.getUserId()));
                    .eq(TCrmBranch::getUserId, user.getUserId())
                    .last("LIMIT 1"));
            if (branch != null) {
                List<TCrmClinic> list = crmClinicService.list(Wrappers.lambdaQuery(TCrmClinic.class).eq(TCrmClinic::getBranchId, branch.getId()).in(TCrmClinic::getStatus, Arrays.asList(3, 4, 5)));
                if (!list.isEmpty()) {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmBranchController.java
@@ -196,19 +196,24 @@
        crmBranchService.updateById(crmBranch);
        // 查询用户
        SysUser sysUser = sysUserService.selectUserById(crmBranch.getUserId());
        // 查询业务员
        List<TCrmSalesperson> crmSalespersons = crmSalespersonService.list(Wrappers.lambdaQuery(TCrmSalesperson.class)
                .eq(TCrmSalesperson::getBranchId, id));
        switch (status){
            case 1:
                // 解冻
                sysUser.setStatus("0");
                sysUserService.updateUser(sysUser);
                if(!CollectionUtils.isEmpty(crmSalespersons)){
                    List<Long> userIds = crmSalespersons.stream().map(TCrmSalesperson::getUserId).collect(Collectors.toList());
                    sysUserService.updateUserStatusByUserIds(userIds, "0");
                }
                break;
            case 2:
                // 冻结
                sysUser.setStatus("1");
                sysUserService.updateUser(sysUser);
                // 查询业务员
                List<TCrmSalesperson> crmSalespersons = crmSalespersonService.list(Wrappers.lambdaQuery(TCrmSalesperson.class)
                        .eq(TCrmSalesperson::getBranchId, id));
                if(!CollectionUtils.isEmpty(crmSalespersons)){
                    List<Long> userIds = crmSalespersons.stream().map(TCrmSalesperson::getUserId).collect(Collectors.toList());
                    sysUserService.updateUserStatusByUserIds(userIds, "1");
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysAppUserController.java
@@ -64,8 +64,9 @@
    private final TSysMessageTemplateService sysMessageTemplateService;
    private final TCrmClinicService crmClinicService;
    private final TokenService tokenService;
    private final TSysOtherConfigService sysOtherConfigService;
    @Autowired
    public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService, TCrmClinicService crmClinicService, TokenService tokenService) {
    public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService, TCrmClinicService crmClinicService, TokenService tokenService, TSysOtherConfigService sysOtherConfigService) {
        this.sysAppUserService = sysAppUserService;
        this.sysInspectionService = sysInspectionService;
        this.sysOrderService = sysOrderService;
@@ -74,6 +75,7 @@
        this.sysMessageTemplateService = sysMessageTemplateService;
        this.crmClinicService = crmClinicService;
        this.tokenService = tokenService;
        this.sysOtherConfigService = sysOtherConfigService;
    }
    /**
@@ -106,6 +108,21 @@
    @GetMapping(value = "/medicationReminder")
    public R<String> medicationReminder(@RequestParam(value = "userId") String userId,
                                                         @RequestParam(value = "templateId") String templateId) {
        Long clinicUserId = tokenService.getLoginUser().getUserId();
        TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                .eq(TCrmClinic::getUserId, clinicUserId)
                .last("LIMIT 1"));
        if(crmClinic == null){
            return R.fail("未找到该诊所信息");
        }
        // 查询其他设置
        TSysOtherConfig sysOtherConfig = sysOtherConfigService.getById(1);
        if(crmClinic.getSendMessageCount()>=sysOtherConfig.getMsgCount()){
            return R.fail("该诊所今日发送短信次数已达上限");
        }
        crmClinic.setSendMessageCount(crmClinic.getSendMessageCount() + 1);
        crmClinicService.updateById(crmClinic);
        TSysAppUser sysAppUser = sysAppUserService.getById(userId);
        if(StringUtils.isNotBlank(sysAppUser.getPhone())){
            sysAppUser.setLastReminderTime(LocalDateTime.now());
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -1,5 +1,7 @@
package com.ruoyi.web.controller.system;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.controller.BaseController;
@@ -12,6 +14,8 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.SysUserUpdateStatusDTO;
import com.ruoyi.system.model.TCrmClinic;
import com.ruoyi.system.model.TCrmSupplier;
import com.ruoyi.system.query.SysUserQuery;
import com.ruoyi.system.service.*;
import com.ruoyi.system.vo.SysUserVO;
@@ -47,6 +51,10 @@
    private ISysDeptService deptService;
    @Autowired
    private TokenService tokenService;
    @Autowired
    private TCrmSupplierService crmSupplierService;
    @Autowired
    private TCrmClinicService crmClinicService;
    /**
     * 获取用户列表
@@ -57,8 +65,23 @@
    public AjaxResult list(@RequestBody SysUserQuery query)
    {
        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
        Long userId = tokenService.getLoginUser().getUserId();
        if(roleType == 1 || roleType == 4 || roleType == 5){
            query.setRoleType(roleType);
        }
        if(roleType == 4){
            // 查询供应商
            TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
                    .eq(TCrmSupplier::getUserId, userId)
                    .last("LIMIT 1"));
            query.setObjectId(crmSupplier.getId());
        }
        if(roleType == 5){
            // 查询诊所
            TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                    .eq(TCrmClinic::getUserId, userId)
                    .last("LIMIT 1"));
            query.setObjectId(crmClinic.getId());
        }
        PageInfo<SysUserVO> list = userService.pageList(query);
        return AjaxResult.success(list);
@@ -159,7 +182,22 @@
    @PostMapping("/add")
    public AjaxResult add(@Validated @RequestBody SysUser user)
    {
        Long userId = tokenService.getLoginUser().getUserId();
        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
        if(roleType == 4){
            // 查询供应商
            TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
                    .eq(TCrmSupplier::getUserId, userId)
                    .last("LIMIT 1"));
            user.setObjectId(crmSupplier.getId());
        }
        if(roleType == 5){
            // 查询诊所
            TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                    .eq(TCrmClinic::getUserId, userId)
                    .last("LIMIT 1"));
            user.setObjectId(crmClinic.getId());
        }
        user.setRoleType(roleType);
        user.setUserName(user.getUserName());
        if (!userService.checkUserNameUnique(user))
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/TaskUtil.java
@@ -83,5 +83,18 @@
        }
    }
    @Scheduled(cron = "0 0 0 * * ?")
    public void dayUpdateClinicMessageCount() {
        try {
            // 判断哪些诊所本月没有业绩达标
            List<TCrmClinic> clinics = crmClinicService.list();
            for (TCrmClinic clinic : clinics) {
                clinic.setSendMessageCount(0);
            }
            crmClinicService.updateBatchById(clinics);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/task/TbillTask.java
File was deleted
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
@@ -138,6 +138,10 @@
    @ApiModelProperty(value = "微信openid")
    @TableField("open_id")
    private String openId;
    @ApiModelProperty(value = "供应商-诊所使用,判断账号属于哪个供应商和诊所")
    @TableField("object_id")
    private String objectId;
    public String getRoleName() {
        return roleName;
    }
ruoyi-system/src/main/java/com/ruoyi/system/model/TCrmClinic.java
@@ -85,4 +85,8 @@
    @TableField("performance_count")
    private Integer performanceCount;
    @ApiModelProperty(value = "发送短信次数")
    @TableField("send_message_count")
    private Integer sendMessageCount;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/SysUserQuery.java
@@ -27,4 +27,6 @@
    @ApiModelProperty(value = "角色类型 1=平台 2=分公司 3=业务员 4=供应商 5=诊所端 6=仓库员 前端忽略")
    private Integer roleType;
    @ApiModelProperty(value = "前端忽略")
    private String objectId;
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/SupplierSalesStatisticsGoodsTypeVO.java
@@ -13,6 +13,6 @@
    @ApiModelProperty(value = "类型名称")
    private String typeName;
    @ApiModelProperty(value = "商品数量")
    private Integer goodsCount;
    private Integer goodsCount=0;
}
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -134,7 +134,7 @@
        select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar,
               u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp,
               u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack,
               u.districtId AS districtId,u.role_type as roleType,
               u.districtId AS districtId,u.role_type as roleType,u.object_id as objectId,
               ur.role_id AS roleId,sr.role_name AS roleName,u.deptName as deptName
        from sys_user u
        left join sys_user_role ur on u.user_id = ur.user_id
@@ -256,6 +256,9 @@
        <if test="query.roleType != null">
            AND u.role_type = #{query.roleType}
        </if>
        <if test="query.objectId != null and query.objectId != ''">
            AND u.object_id = #{query.objectId}
        </if>
        <if test="query.deptIds != null and query.deptIds.size()>0">
            AND u.user_id IN (select DISTINCT user_id from t_dept_to_user where dept_id IN
            <foreach collection="query.deptIds" close=")" open="(" item="deptId" separator=",">
@@ -298,6 +301,7 @@
             <if test="ifBlack != null">ifBlack,</if>
             <if test="districtId != null">districtId,</if>
             <if test="roleType != null">role_type,</if>
             <if test="objectId != null">object_id,</if>
             create_time
         )values(
             <if test="userId != null and userId != ''">#{userId},</if>
@@ -315,6 +319,7 @@
             <if test="remark != null and remark != ''">#{remark},</if>
            <if test="ifBlack != null">#{ifBlack},</if>
            <if test="roleType != null">#{roleType},</if>
            <if test="objectId != null">#{objectId},</if>
             sysdate()
         )
    </insert>
ruoyi-system/src/main/resources/mapper/system/TCrmClinicMapper.xml
@@ -18,6 +18,7 @@
        <result column="status" property="status" />
        <result column="audit_remark" property="auditRemark" />
        <result column="performance_count" property="performanceCount" />
        <result column="send_message_count" property="sendMessageCount" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
@@ -28,13 +29,14 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, branch_id, salesperson_id, warehouse_id,user_id, clinic_name, person_charge_name, phone, low_procurement_money,
          clinic_address, qualification_picture, status,audit_remark,performance_count, create_time, update_time, create_by, update_by, disabled
          clinic_address, qualification_picture, status,audit_remark,performance_count,send_message_count,
          create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TCrmClinicVO">
        SELECT
        tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name,
        tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count,
        tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name
        from t_crm_clinic tcc
        left join t_crm_branch tcb on tcc.branch_id = tcb.id
@@ -92,7 +94,7 @@
        SELECT
        tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name,
        tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count,
        tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name
        from t_crm_clinic tcc
        left join t_crm_branch tcb on tcc.branch_id = tcb.id
@@ -126,7 +128,7 @@
        SELECT
        tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name,
        tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count,
        tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name
        from t_crm_clinic tcc
        left join t_crm_branch tcb on tcc.branch_id = tcb.id
@@ -160,7 +162,7 @@
        SELECT
        tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name,
        tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,
        tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count,
        tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name
        from t_crm_clinic tcc
        left join t_crm_branch tcb on tcc.branch_id = tcb.id
ruoyi-system/src/main/resources/mapper/system/TErpProcurementMapper.xml
@@ -274,7 +274,7 @@
                and tcc.person_charge_name like concat('%',#{query.personChargeName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                and tep.phone like concat('%',#{query.phone},'%')
                and tcc.phone like concat('%',#{query.phone},'%')
            </if>
            AND tep.status in (3,4,5)
            AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
@@ -316,7 +316,7 @@
                and tcc.person_charge_name like concat('%',#{query.personChargeName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                and tep.phone like concat('%',#{query.phone},'%')
                and tcc.phone like concat('%',#{query.phone},'%')
            </if>
            AND tep.status in (3,4,5)
            AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
@@ -358,7 +358,7 @@
                and tcc.person_charge_name like concat('%',#{query.personChargeName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                and tep.phone like concat('%',#{query.phone},'%')
                and tcc.phone like concat('%',#{query.phone},'%')
            </if>
            AND tep.status in (3,4,5)
            AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
@@ -400,7 +400,7 @@
                and tcc.person_charge_name like concat('%',#{query.personChargeName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                and tep.phone like concat('%',#{query.phone},'%')
                and tcc.phone like concat('%',#{query.phone},'%')
            </if>
            AND tep.status in (3,4,5)
            AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
@@ -441,7 +441,7 @@
                and tcc.person_charge_name like concat('%',#{query.personChargeName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                and tep.phone like concat('%',#{query.phone},'%')
                and tcc.phone like concat('%',#{query.phone},'%')
            </if>
            AND tep.is_platform_commission = 1
            AND tep.status in (3,4,5)
@@ -483,7 +483,7 @@
                and tcc.person_charge_name like concat('%',#{query.personChargeName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                and tep.phone like concat('%',#{query.phone},'%')
                and tcc.phone like concat('%',#{query.phone},'%')
            </if>
            AND tep.is_platform_commission = 1
            AND tep.status in (3,4,5)
ruoyi-system/src/main/resources/mapper/system/TSysOrderMapper.xml
@@ -55,13 +55,12 @@
          and tso.clinic_id in <foreach collection="clinicIds" open="(" separator="," item="id" close=")">#{id}</foreach>
    </select>
    <select id="clinicSalesStatisticsTypeCount" resultType="java.lang.Integer">
        select count(1)
        select count(DISTINCT teg.type_id)
        from t_sys_order tso
                 left join t_sys_order_goods tsog on tso.id = tsog.order_id
                 left join t_erp_goods teg on tsog.goods_id = teg.id
        where tso.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
          and tso.clinic_id in <foreach collection="clinicIds" open="(" separator="," item="id" close=")">#{id}</foreach>
        group by teg.type_id
    </select>
    <select id="clinicSalesStatisticsMoney" resultType="java.math.BigDecimal">
        select sum(total_money) from t_sys_order