0327-海宁pad走访修改、北仑网格业绩统计修改
This commit is contained in:
@@ -131,10 +131,7 @@ public class GridCountController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试环境先放开965,上线前改回825。
|
|
||||||
*/
|
|
||||||
private boolean isNewRetailTenant() {
|
private boolean isNewRetailTenant() {
|
||||||
return SecurityUtils.getDeptId().toString().startsWith("965");
|
return SecurityUtils.getDeptId().toString().startsWith("825");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ public class VisitInfoDTO {
|
|||||||
@ApiModelProperty(value = "客户类型 0个人,1商户,2企业")
|
@ApiModelProperty(value = "客户类型 0个人,1商户,2企业")
|
||||||
private String custType;
|
private String custType;
|
||||||
|
|
||||||
|
/** 活动ID */
|
||||||
|
@ApiModelProperty(value = "活动ID")
|
||||||
|
private String campaignId;
|
||||||
|
|
||||||
/** 异常走访标签(筛选是否异常) */
|
/** 异常走访标签(筛选是否异常) */
|
||||||
@ApiModelProperty(value = "异常走访标签 0正常 1走访频率异常 2走访持续时长异常 3签退时间异常")
|
@ApiModelProperty(value = "异常走访标签 0正常 1走访频率异常 2走访持续时长异常 3签退时间异常")
|
||||||
private String abnormalVisitTag;
|
private String abnormalVisitTag;
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ public interface SysCampaignMapper extends BaseMapper<SysCampaign> {
|
|||||||
|
|
||||||
List<VisitInfoVO> selectVisitInfoList(VisitInfoDTO visitInfoDTO);
|
List<VisitInfoVO> selectVisitInfoList(VisitInfoDTO visitInfoDTO);
|
||||||
|
|
||||||
|
List<VisitInfoVO> selectVisitInfoList875(VisitInfoDTO visitInfoDTO);
|
||||||
|
|
||||||
int updateVisitInfoFeedback(VisitInfoFeedbackUpdateDTO updateDTO);
|
int updateVisitInfoFeedback(VisitInfoFeedbackUpdateDTO updateDTO);
|
||||||
|
|
||||||
@Update("UPDATE sys_campaign SET del_flag = '2' where campaign_id = #{campaignId}")
|
@Update("UPDATE sys_campaign SET del_flag = '2' where campaign_id = #{campaignId}")
|
||||||
|
|||||||
@@ -2175,6 +2175,9 @@ public class SysCampaignServiceImpl implements ISysCampaignService
|
|||||||
visitInfoDTO.setUserName(SecurityUtils.getUsername());
|
visitInfoDTO.setUserName(SecurityUtils.getUsername());
|
||||||
visitInfoDTO.setUserRole(SecurityUtils.userRole());
|
visitInfoDTO.setUserRole(SecurityUtils.userRole());
|
||||||
visitInfoDTO.setDeptId(String.valueOf(SecurityUtils.getDeptId()));
|
visitInfoDTO.setDeptId(String.valueOf(SecurityUtils.getDeptId()));
|
||||||
|
if ("875".equals(SecurityUtils.getHeadId())) {
|
||||||
|
return sysCampaignMapper.selectVisitInfoList875(visitInfoDTO);
|
||||||
|
}
|
||||||
return sysCampaignMapper.selectVisitInfoList(visitInfoDTO);
|
return sysCampaignMapper.selectVisitInfoList(visitInfoDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2183,9 +2186,13 @@ public class SysCampaignServiceImpl implements ISysCampaignService
|
|||||||
if (updateDTO == null || updateDTO.getId() == null) {
|
if (updateDTO == null || updateDTO.getId() == null) {
|
||||||
throw new ServiceException("走访记录ID不能为空");
|
throw new ServiceException("走访记录ID不能为空");
|
||||||
}
|
}
|
||||||
|
String deptId = String.valueOf(SecurityUtils.getDeptId());
|
||||||
|
if (!deptId.startsWith("875")) {
|
||||||
|
throw new ServiceException("当前机构无权维护PAD走访反馈");
|
||||||
|
}
|
||||||
updateDTO.setUserName(SecurityUtils.getUsername());
|
updateDTO.setUserName(SecurityUtils.getUsername());
|
||||||
updateDTO.setUserRole(SecurityUtils.userRole());
|
updateDTO.setUserRole(SecurityUtils.userRole());
|
||||||
updateDTO.setDeptId(String.valueOf(SecurityUtils.getDeptId()));
|
updateDTO.setDeptId(deptId);
|
||||||
updateDTO.setSource(StringUtils.trimToNull(updateDTO.getSource()));
|
updateDTO.setSource(StringUtils.trimToNull(updateDTO.getSource()));
|
||||||
updateDTO.setRemark(StringUtils.trimToNull(updateDTO.getRemark()));
|
updateDTO.setRemark(StringUtils.trimToNull(updateDTO.getRemark()));
|
||||||
updateDTO.setIntentionProductValue(buildIntentionProductValue(updateDTO.getFeedbackItems()));
|
updateDTO.setIntentionProductValue(buildIntentionProductValue(updateDTO.getFeedbackItems()));
|
||||||
|
|||||||
@@ -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 left(vc.campaign_id,7)='appoint' then '-1' else sc.create_role end as create_role ,
|
||||||
|
|
||||||
case
|
case
|
||||||
when dep2.dept_type = 'head' then dep.dept_id
|
when hist_branch_dep.dept_id is not null then hist_branch_dep.dept_id
|
||||||
else dep2.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,
|
end as dept_id,
|
||||||
case
|
case
|
||||||
when dep2.dept_type = 'head' then ''
|
when hist_branch_dep.dept_id is not null then ifnull(hist_outlet_dep.dept_name, '')
|
||||||
else 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,
|
end as outlets,
|
||||||
|
|
||||||
case
|
case
|
||||||
when dep2.dept_type = 'head' then dep.dept_name
|
when hist_branch_dep.dept_id is not null then hist_branch_dep.dept_name
|
||||||
else dep2.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,
|
end as dept_name,
|
||||||
|
|
||||||
concat( su.nick_name, '-', su.user_name ) as nick_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
|
visit_campaign_count vc left join sys_campaign sc on
|
||||||
vc.campaign_id = sc.campaign_id left join sys_user su on
|
vc.campaign_id = sc.campaign_id left join sys_user su on
|
||||||
vc.dept_id = su.user_name
|
vc.dept_id = su.user_name
|
||||||
left join sys_dept dep on su.dept_id = dep.dept_id
|
left join (
|
||||||
left join sys_dept dep2 on dep.parent_id = dep2.dept_id
|
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
|
where
|
||||||
vc.dept_type = '3'
|
vc.dept_type = '3'
|
||||||
<if test="campaignId != null and campaignId != ''"> and vc.campaign_id = #{campaignId}</if>
|
<if test="campaignId != null and campaignId != ''"> and vc.campaign_id = #{campaignId}</if>
|
||||||
<if test="campaignName != null and campaignName != ''"> AND sc.campaign_name like concat('%', #{campaignName}, '%')</if>
|
<if test="campaignName != null and campaignName != ''"> AND sc.campaign_name like concat('%', #{campaignName}, '%')</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="outletsId != null">
|
<when test="outletsId != null">
|
||||||
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}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
<if test="deptId != null and personType == 'branch' and deptId.toString().endsWith('000')">
|
|
||||||
AND dep.dept_id = #{deptId}
|
|
||||||
</if>
|
|
||||||
<if test="deptId != null and personType == 'branch'">
|
<if test="deptId != null and personType == 'branch'">
|
||||||
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}
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and personType == 'outlet'">
|
<if test="deptId != null and personType == 'outlet'">
|
||||||
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}
|
||||||
</if>
|
</if>
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
@@ -370,4 +396,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{dt}
|
#{dt}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1396,12 +1396,44 @@
|
|||||||
<select id="selectVisitInfoList" parameterType="VisitInfoDTO" resultType="VisitInfoVO">
|
<select id="selectVisitInfoList" parameterType="VisitInfoDTO" resultType="VisitInfoVO">
|
||||||
select vi.id,vi.campaign_id,vi.campaign_name,vi.vis_name,vi.vis_id,vi.dept_id,d.dept_name,vi.vis_time,vi.cust_name,vi.cust_type,vi.cust_idc,
|
select vi.id,vi.campaign_id,vi.campaign_name,vi.vis_name,vi.vis_id,vi.dept_id,d.dept_name,vi.vis_time,vi.cust_name,vi.cust_type,vi.cust_idc,
|
||||||
vi.social_credit_code,vi.create_by,vi.create_time,vi.update_by,vi.update_time,vi.remark,vi.sign_in_time,vi.sign_out_time,vi.sign_in_address,
|
vi.social_credit_code,vi.create_by,vi.create_time,vi.update_by,vi.update_time,vi.remark,vi.sign_in_time,vi.sign_out_time,vi.sign_in_address,
|
||||||
vi.sign_out_address,vi.abnormal_visit_tag,vi.abnormal_visit_info,vi.sign_in_coordinate,vi.sign_out_coordinate,vi.is_valid_cust,vi.marketing_way,vi.inter_res,
|
vi.sign_out_address,vi.abnormal_visit_tag,vi.abnormal_visit_info,vi.sign_in_coordinate,vi.sign_out_coordinate,vi.is_valid_cust,vi.marketing_way,vi.inter_res
|
||||||
vi.inter_addr,vi.col_staf_name,vi.later_note,vi.intention_product_value,vi.feedback_status,vi.source_of_interview,vi.filename,
|
|
||||||
vi.out_call_status,vi.out_call_intention,vi.source,vi.analysis_value,vi.facility
|
|
||||||
from visit_info vi
|
from visit_info vi
|
||||||
left join sys_dept d on vi.dept_id = d.dept_id
|
left join sys_dept d on vi.dept_id = d.dept_id
|
||||||
<where>
|
<where>
|
||||||
|
<if test="campaignId != null and campaignId != ''"> and vi.campaign_id = #{campaignId}</if>
|
||||||
|
<if test="custType != null and custType != ''"> and vi.cust_type = #{custType}</if>
|
||||||
|
<if test="visName != null and visName != ''"> and vi.vis_name like concat('%', #{visName}, '%')</if>
|
||||||
|
<if test="visId != null and visId != ''"> and vi.vis_id = #{visId}</if>
|
||||||
|
<if test="custIdc != null and custIdc != ''"> and vi.cust_idc = #{custIdc}</if>
|
||||||
|
<if test="socialCreditCode != null and socialCreditCode != ''"> and vi.social_credit_code = #{socialCreditCode}</if>
|
||||||
|
<if test="abnormalVisitTag != null and abnormalVisitTag != ''"> and vi.abnormal_visit_tag = #{abnormalVisitTag}</if>
|
||||||
|
<if test="marketingWay != null and marketingWay != ''"> and vi.marketing_way = #{marketingWay}</if>
|
||||||
|
<if test="interRes != null and interRes != ''"> and vi.inter_res = #{interRes}</if>
|
||||||
|
<if test="visTime != null">
|
||||||
|
and (vi.sign_in_time like concat(#{visTime}, '%') or vi.sign_out_time like concat(#{visTime}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="userRole != null">
|
||||||
|
<choose>
|
||||||
|
<when test="userRole == 'manager'"> and vi.vis_id = #{userName} </when>
|
||||||
|
<when test="userRole == 'outlet'"> and d.dept_id = #{deptId} </when>
|
||||||
|
<when test="userRole == 'branch'"> and (d.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors)) </when>
|
||||||
|
<when test="userRole in {'head', 'ops', 'public', 'private'}"> and left(d.dept_id,3) = left(#{deptId},3) </when>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by vi.sign_in_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectVisitInfoList875" parameterType="VisitInfoDTO" resultType="VisitInfoVO">
|
||||||
|
select vi.id,vi.campaign_id,vi.campaign_name,vi.vis_name,vi.vis_id,vi.dept_id,d.dept_name,vi.vis_time,vi.cust_name,vi.cust_type,vi.cust_idc,
|
||||||
|
vi.social_credit_code,vi.create_by,vi.create_time,vi.update_by,vi.update_time,vi.remark,vi.sign_in_time,vi.sign_out_time,vi.sign_in_address,
|
||||||
|
vi.sign_out_address,vi.abnormal_visit_tag,vi.abnormal_visit_info,vi.sign_in_coordinate,vi.sign_out_coordinate,vi.is_valid_cust,vi.marketing_way,vi.inter_res,
|
||||||
|
vi.inter_addr,vi.col_staf_name,vi.later_note,vi.intention_product_value,vi.feedback_status,vi.source_of_interview,vi.filename,
|
||||||
|
vi.out_call_status,vi.out_call_intention,vi.source,vi.analysis_value,vi.facility
|
||||||
|
from visit_info_875 vi
|
||||||
|
left join sys_dept d on vi.dept_id = d.dept_id
|
||||||
|
<where>
|
||||||
|
<if test="campaignId != null and campaignId != ''"> and vi.campaign_id = #{campaignId}</if>
|
||||||
<if test="custType != null and custType != ''"> and vi.cust_type = #{custType}</if>
|
<if test="custType != null and custType != ''"> and vi.cust_type = #{custType}</if>
|
||||||
<if test="visName != null and visName != ''"> and vi.vis_name like concat('%', #{visName}, '%')</if>
|
<if test="visName != null and visName != ''"> and vi.vis_name like concat('%', #{visName}, '%')</if>
|
||||||
<if test="visId != null and visId != ''"> and vi.vis_id = #{visId}</if>
|
<if test="visId != null and visId != ''"> and vi.vis_id = #{visId}</if>
|
||||||
@@ -1426,7 +1458,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateVisitInfoFeedback" parameterType="VisitInfoFeedbackUpdateDTO">
|
<update id="updateVisitInfoFeedback" parameterType="VisitInfoFeedbackUpdateDTO">
|
||||||
update visit_info vi
|
update visit_info_875 vi
|
||||||
left join sys_dept d on vi.dept_id = d.dept_id
|
left join sys_dept d on vi.dept_id = d.dept_id
|
||||||
set vi.source = #{source},
|
set vi.source = #{source},
|
||||||
vi.remark = #{remark},
|
vi.remark = #{remark},
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export default {
|
|||||||
return this.roles.includes("headPrivate");
|
return this.roles.includes("headPrivate");
|
||||||
},
|
},
|
||||||
isRetailNew825Tenant() {
|
isRetailNew825Tenant() {
|
||||||
return String(this.deptId || '').slice(0, 3) === '965';
|
return String(this.deptId || '').slice(0, 3) === '825';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ export default {
|
|||||||
return this.userName.slice(0, 3) == 965
|
return this.userName.slice(0, 3) == 965
|
||||||
},
|
},
|
||||||
isRetailNew825Tenant() {
|
isRetailNew825Tenant() {
|
||||||
return String(this.deptId || '').slice(0, 3) === '965'
|
return String(this.deptId || '').slice(0, 3) === '825'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -220,7 +220,16 @@
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
width="150px"
|
width="150px"
|
||||||
v-if="columns[5].visible"
|
v-if="columns[5].visible"
|
||||||
></el-table-column>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
v-if="isPersonalFeedbackTab && getPersonalViewCustId(scope.row)"
|
||||||
|
type="text"
|
||||||
|
@click="openPersonalView(scope.row)"
|
||||||
|
>{{ scope.row.custName }}</el-button>
|
||||||
|
<span v-else>{{ scope.row.custName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="left"
|
align="left"
|
||||||
prop="custIdc"
|
prop="custIdc"
|
||||||
@@ -228,7 +237,16 @@
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
width="200px"
|
width="200px"
|
||||||
v-if="columns[6].visible && selectedTab === '0'"
|
v-if="columns[6].visible && selectedTab === '0'"
|
||||||
></el-table-column>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
v-if="isPersonalFeedbackTab && getPersonalViewCustId(scope.row)"
|
||||||
|
type="text"
|
||||||
|
@click="openPersonalView(scope.row)"
|
||||||
|
>{{ scope.row.custIdc }}</el-button>
|
||||||
|
<span v-else>{{ scope.row.custIdc || "-" }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="left"
|
align="left"
|
||||||
prop="socialCreditCode"
|
prop="socialCreditCode"
|
||||||
@@ -591,7 +609,7 @@ export default {
|
|||||||
// 海宁
|
// 海宁
|
||||||
is875() {
|
is875() {
|
||||||
const deptId = this.deptId === null || this.deptId === undefined ? '' : String(this.deptId)
|
const deptId = this.deptId === null || this.deptId === undefined ? '' : String(this.deptId)
|
||||||
return deptId.slice(0, 3) === '965'
|
return deptId.slice(0, 3) === '875'
|
||||||
},
|
},
|
||||||
isPersonalFeedbackTab() {
|
isPersonalFeedbackTab() {
|
||||||
return this.is875 && this.selectedTab === '0'
|
return this.is875 && this.selectedTab === '0'
|
||||||
@@ -670,6 +688,33 @@ export default {
|
|||||||
const matched = this.sourceOptions.find(item => item.value === sourceValue);
|
const matched = this.sourceOptions.find(item => item.value === sourceValue);
|
||||||
return matched ? matched.label : (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) {
|
handleEditFeedback(row) {
|
||||||
if (this.isFeedbackCompleted(row)) {
|
if (this.isFeedbackCompleted(row)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user