From a9ac968749702ec0abb6e1343971e47e7e5951a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=B9=90=E8=A8=80?= Date: Fri, 27 Mar 2026 17:27:00 +0800 Subject: [PATCH] =?UTF-8?q?0327-=E6=B5=B7=E5=AE=81pad=E8=B5=B0=E8=AE=BF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=81=E5=8C=97=E4=BB=91=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E4=B8=9A=E7=BB=A9=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grid/controller/GridCountController.java | 5 +- .../ruoyi/ibs/list/domain/VisitInfoDTO.java | 4 ++ .../ibs/list/mapper/SysCampaignMapper.java | 2 + .../service/impl/SysCampaignServiceImpl.java | 9 ++- .../mapper/list/CampaignCountMapper.xml | 56 ++++++++++++++----- .../mapper/list/SysCampaignMapper.xml | 40 +++++++++++-- .../views/grid/performance/custom/index.vue | 2 +- .../src/views/grid/performance/list/index.vue | 2 +- .../views/taskManage/PADvisitRecord/index.vue | 51 ++++++++++++++++- 9 files changed, 142 insertions(+), 29 deletions(-) diff --git a/ibs/src/main/java/com/ruoyi/ibs/grid/controller/GridCountController.java b/ibs/src/main/java/com/ruoyi/ibs/grid/controller/GridCountController.java index 245ebdf..c14b022 100644 --- a/ibs/src/main/java/com/ruoyi/ibs/grid/controller/GridCountController.java +++ b/ibs/src/main/java/com/ruoyi/ibs/grid/controller/GridCountController.java @@ -131,10 +131,7 @@ public class GridCountController extends BaseController { } } - /** - * 测试环境先放开965,上线前改回825。 - */ private boolean isNewRetailTenant() { - return SecurityUtils.getDeptId().toString().startsWith("965"); + return SecurityUtils.getDeptId().toString().startsWith("825"); } } diff --git a/ibs/src/main/java/com/ruoyi/ibs/list/domain/VisitInfoDTO.java b/ibs/src/main/java/com/ruoyi/ibs/list/domain/VisitInfoDTO.java index b7f45a9..e970cdc 100644 --- a/ibs/src/main/java/com/ruoyi/ibs/list/domain/VisitInfoDTO.java +++ b/ibs/src/main/java/com/ruoyi/ibs/list/domain/VisitInfoDTO.java @@ -33,6 +33,10 @@ public class VisitInfoDTO { @ApiModelProperty(value = "客户类型 0个人,1商户,2企业") private String custType; + /** 活动ID */ + @ApiModelProperty(value = "活动ID") + private String campaignId; + /** 异常走访标签(筛选是否异常) */ @ApiModelProperty(value = "异常走访标签 0正常 1走访频率异常 2走访持续时长异常 3签退时间异常") private String abnormalVisitTag; diff --git a/ibs/src/main/java/com/ruoyi/ibs/list/mapper/SysCampaignMapper.java b/ibs/src/main/java/com/ruoyi/ibs/list/mapper/SysCampaignMapper.java index 06f2303..b318323 100644 --- a/ibs/src/main/java/com/ruoyi/ibs/list/mapper/SysCampaignMapper.java +++ b/ibs/src/main/java/com/ruoyi/ibs/list/mapper/SysCampaignMapper.java @@ -156,6 +156,8 @@ public interface SysCampaignMapper extends BaseMapper { List selectVisitInfoList(VisitInfoDTO visitInfoDTO); + List selectVisitInfoList875(VisitInfoDTO visitInfoDTO); + int updateVisitInfoFeedback(VisitInfoFeedbackUpdateDTO updateDTO); @Update("UPDATE sys_campaign SET del_flag = '2' where campaign_id = #{campaignId}") diff --git a/ibs/src/main/java/com/ruoyi/ibs/list/service/impl/SysCampaignServiceImpl.java b/ibs/src/main/java/com/ruoyi/ibs/list/service/impl/SysCampaignServiceImpl.java index fc778f1..c597b0e 100644 --- a/ibs/src/main/java/com/ruoyi/ibs/list/service/impl/SysCampaignServiceImpl.java +++ b/ibs/src/main/java/com/ruoyi/ibs/list/service/impl/SysCampaignServiceImpl.java @@ -2175,6 +2175,9 @@ public class SysCampaignServiceImpl implements ISysCampaignService visitInfoDTO.setUserName(SecurityUtils.getUsername()); visitInfoDTO.setUserRole(SecurityUtils.userRole()); visitInfoDTO.setDeptId(String.valueOf(SecurityUtils.getDeptId())); + if ("875".equals(SecurityUtils.getHeadId())) { + return sysCampaignMapper.selectVisitInfoList875(visitInfoDTO); + } return sysCampaignMapper.selectVisitInfoList(visitInfoDTO); } @@ -2183,9 +2186,13 @@ public class SysCampaignServiceImpl implements ISysCampaignService if (updateDTO == null || updateDTO.getId() == null) { throw new ServiceException("走访记录ID不能为空"); } + String deptId = String.valueOf(SecurityUtils.getDeptId()); + if (!deptId.startsWith("875")) { + throw new ServiceException("当前机构无权维护PAD走访反馈"); + } updateDTO.setUserName(SecurityUtils.getUsername()); updateDTO.setUserRole(SecurityUtils.userRole()); - updateDTO.setDeptId(String.valueOf(SecurityUtils.getDeptId())); + updateDTO.setDeptId(deptId); updateDTO.setSource(StringUtils.trimToNull(updateDTO.getSource())); updateDTO.setRemark(StringUtils.trimToNull(updateDTO.getRemark())); updateDTO.setIntentionProductValue(buildIntentionProductValue(updateDTO.getFeedbackItems())); diff --git a/ibs/src/main/resources/mapper/list/CampaignCountMapper.xml b/ibs/src/main/resources/mapper/list/CampaignCountMapper.xml index 9d67cc7..f1177ff 100644 --- a/ibs/src/main/resources/mapper/list/CampaignCountMapper.xml +++ b/ibs/src/main/resources/mapper/list/CampaignCountMapper.xml @@ -239,17 +239,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" case when left(vc.campaign_id,7)='appoint' then '-1' else sc.create_role end as create_role , case - when dep2.dept_type = 'head' then dep.dept_id - else dep2.dept_id + when hist_branch_dep.dept_id is not null then hist_branch_dep.dept_id + when current_branch_dep.dept_type = 'head' or current_branch_dep.dept_type is null then current_outlet_dep.dept_id + else current_branch_dep.dept_id end as dept_id, case - when dep2.dept_type = 'head' then '' - else dep.dept_name + when hist_branch_dep.dept_id is not null then ifnull(hist_outlet_dep.dept_name, '') + when current_branch_dep.dept_type = 'head' or current_branch_dep.dept_type is null then '' + else current_outlet_dep.dept_name end as outlets, case - when dep2.dept_type = 'head' then dep.dept_name - else dep2.dept_name + when hist_branch_dep.dept_id is not null then hist_branch_dep.dept_name + when current_branch_dep.dept_type = 'head' or current_branch_dep.dept_type is null then current_outlet_dep.dept_name + else current_branch_dep.dept_name end as dept_name, concat( su.nick_name, '-', su.user_name ) as nick_name, @@ -261,25 +264,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" visit_campaign_count vc left join sys_campaign sc on vc.campaign_id = sc.campaign_id left join sys_user su on vc.dept_id = su.user_name - left join sys_dept dep on su.dept_id = dep.dept_id - left join sys_dept dep2 on dep.parent_id = dep2.dept_id + left join ( + select campaign_id, user_id, max(dept_id) as dept_id, max(outlets_id) as outlets_id + from sys_campaign_group_customer + where user_id is not null + group by campaign_id, user_id + ) scgc_his on scgc_his.campaign_id = vc.campaign_id and scgc_his.user_id = su.user_id + left join sys_dept hist_branch_dep on scgc_his.dept_id = hist_branch_dep.dept_id + left join sys_dept hist_outlet_dep on scgc_his.outlets_id = hist_outlet_dep.dept_id + left join sys_dept current_outlet_dep on su.dept_id = current_outlet_dep.dept_id + left join sys_dept current_branch_dep on current_outlet_dep.parent_id = current_branch_dep.dept_id where vc.dept_type = '3' and vc.campaign_id = #{campaignId} AND sc.campaign_name like concat('%', #{campaignName}, '%') - AND (dep.dept_id = #{outletsId} OR dep2.dept_id = #{outletsId}) + AND ifnull( + scgc_his.outlets_id, + case + when current_branch_dep.dept_type = 'head' or current_branch_dep.dept_type is null then null + else current_outlet_dep.dept_id + end + ) = #{outletsId} - - AND dep.dept_id = #{deptId} - - AND (dep.dept_id = #{deptId} OR dep2.dept_id = #{deptId}) + AND ifnull( + scgc_his.dept_id, + case + when current_branch_dep.dept_type = 'head' or current_branch_dep.dept_type is null then current_outlet_dep.dept_id + else current_branch_dep.dept_id + end + ) = #{deptId} - AND (dep.dept_id = #{deptId}) + AND ifnull( + scgc_his.outlets_id, + case + when current_branch_dep.dept_type = 'head' or current_branch_dep.dept_type is null then null + else current_outlet_dep.dept_id + end + ) = #{deptId} @@ -370,4 +396,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{dt} - \ No newline at end of file + diff --git a/ibs/src/main/resources/mapper/list/SysCampaignMapper.xml b/ibs/src/main/resources/mapper/list/SysCampaignMapper.xml index d22ba8d..7c40da3 100644 --- a/ibs/src/main/resources/mapper/list/SysCampaignMapper.xml +++ b/ibs/src/main/resources/mapper/list/SysCampaignMapper.xml @@ -1396,12 +1396,44 @@ + + - update visit_info vi + update visit_info_875 vi left join sys_dept d on vi.dept_id = d.dept_id set vi.source = #{source}, vi.remark = #{remark}, diff --git a/ruoyi-ui/src/views/grid/performance/custom/index.vue b/ruoyi-ui/src/views/grid/performance/custom/index.vue index 22b67b0..be59361 100644 --- a/ruoyi-ui/src/views/grid/performance/custom/index.vue +++ b/ruoyi-ui/src/views/grid/performance/custom/index.vue @@ -174,7 +174,7 @@ export default { return this.roles.includes("headPrivate"); }, isRetailNew825Tenant() { - return String(this.deptId || '').slice(0, 3) === '965'; + return String(this.deptId || '').slice(0, 3) === '825'; }, }, created() { diff --git a/ruoyi-ui/src/views/grid/performance/list/index.vue b/ruoyi-ui/src/views/grid/performance/list/index.vue index fd818c3..cfe7381 100644 --- a/ruoyi-ui/src/views/grid/performance/list/index.vue +++ b/ruoyi-ui/src/views/grid/performance/list/index.vue @@ -364,7 +364,7 @@ export default { return this.userName.slice(0, 3) == 965 }, isRetailNew825Tenant() { - return String(this.deptId || '').slice(0, 3) === '965' + return String(this.deptId || '').slice(0, 3) === '825' } }, watch: { diff --git a/ruoyi-ui/src/views/taskManage/PADvisitRecord/index.vue b/ruoyi-ui/src/views/taskManage/PADvisitRecord/index.vue index 079637a..c0ce3c9 100644 --- a/ruoyi-ui/src/views/taskManage/PADvisitRecord/index.vue +++ b/ruoyi-ui/src/views/taskManage/PADvisitRecord/index.vue @@ -220,7 +220,16 @@ show-overflow-tooltip width="150px" v-if="columns[5].visible" - > + > + + + > + + item.value === sourceValue); return matched ? matched.label : (sourceValue || "-"); }, + getPersonalViewCustId(row) { + const custId = row && row.custId ? String(row.custId).trim() : ""; + if (custId) { + return custId; + } + const custIdc = row && row.custIdc ? String(row.custIdc).trim() : ""; + return custIdc ? `101${custIdc}` : ""; + }, + openPersonalView(row) { + if (!this.isPersonalFeedbackTab) { + this.$message.warning("当前机构暂无个人客户视图跳转权限"); + return; + } + const custId = this.getPersonalViewCustId(row); + if (!custId) { + this.$message.warning("未获取到客户标识,暂时无法跳转个人视图"); + return; + } + this.$router.push({ + path: "/360charts/indexcharts", + query: { + custId, + selectedTab: this.selectedTab, + backUrl: this.$route.path + } + }); + }, handleEditFeedback(row) { if (this.isFeedbackCompleted(row)) { return;