Compare commits

...

8 Commits

96 changed files with 6618 additions and 1698 deletions

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"kiroAgent.configureMCP": "Disabled"
}

View File

@@ -9,7 +9,6 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.group.domain.dto.CustGroupMemberTemplate;
import com.ruoyi.group.domain.dto.CustGroupQueryDTO;
import com.ruoyi.group.domain.dto.GridImportDTO;
import com.ruoyi.group.domain.entity.CustGroup;
import com.ruoyi.group.domain.vo.CustGroupVO;
import com.ruoyi.group.service.ICustGroupService;
@@ -60,48 +59,31 @@ public class CustGroupController extends BaseController {
return AjaxResult.success(custGroup);
}
/**
* 异步创建客群(网格导入)
*/
@ApiOperation("异步创建客群(网格导入)")
@Log(title = "客群管理-网格导入创建客群", businessType = BusinessType.INSERT)
@PostMapping("/createByGrid")
public AjaxResult createCustGroupByGrid(@RequestBody @Valid GridImportDTO gridImportDTO) {
String id = custGroupService.createCustGroupByGrid(gridImportDTO);
return AjaxResult.success(id);
}
/**
* 异步创建客群(模板导入)
* gridType、regionGridIds、drawGridIds 包含在 dto 中
*/
@ApiOperation("异步创建客群(模板导入)")
@Log(title = "客群管理-异步创建客群", businessType = BusinessType.INSERT)
@PostMapping(value = "/createByTemplate", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public AjaxResult createCustGroupByTemplate(@RequestPart("dto") @Valid String dtoJson,
public AjaxResult createCustGroupByTemplate(
@RequestPart("dto") @Valid String dtoJson,
@RequestPart("file") MultipartFile file) {
CustGroup custGroup = JSON.parseObject(dtoJson, CustGroup.class);
return AjaxResult.success(custGroupService.createCustGroupByTemplate(custGroup, file));
}
/**
* 更新客群(网格导入)
*/
@ApiOperation("更新客群(网格导入)")
@Log(title = "客群管理-更新客群(网格导入)", businessType = BusinessType.UPDATE)
@PostMapping("/updateByGrid")
public AjaxResult updateCustGroupByGrid(@RequestBody @Valid GridImportDTO gridImportDTO) {
String result = custGroupService.updateCustGroupByGrid(gridImportDTO);
return AjaxResult.success(result);
return AjaxResult.success("操作成功", custGroupService.createCustGroupByTemplate(custGroup, file));
}
/**
* 更新客群(模板导入)
* gridType、regionGridIds、drawGridIds 包含在 dto 中
* file 参数可选:不传文件则只更新客群信息,传文件则追加客户
*/
@ApiOperation("更新客群(模板导入)")
@Log(title = "客群管理-更新客群(模板导入)", businessType = BusinessType.UPDATE)
@PostMapping(value = "/updateByTemplate", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public AjaxResult updateCustGroupByTemplate(@RequestPart("dto") @Valid String dtoJson,
@RequestPart("file") MultipartFile file) {
public AjaxResult updateCustGroupByTemplate(
@RequestPart("dto") @Valid String dtoJson,
@RequestPart(value = "file", required = false) MultipartFile file) {
CustGroup custGroup = JSON.parseObject(dtoJson, CustGroup.class);
return AjaxResult.success(custGroupService.updateCustGroupByTemplate(custGroup, file));
}
@@ -114,7 +96,7 @@ public class CustGroupController extends BaseController {
@GetMapping("/createStatus/{id}")
public AjaxResult getCreateStatus(@PathVariable Long id) {
String status = custGroupService.getCreateStatus(id);
return AjaxResult.success(status);
return AjaxResult.success("操作成功", status);
}
/**
@@ -139,4 +121,15 @@ public class CustGroupController extends BaseController {
return AjaxResult.success(result);
}
/**
* 获取所有已有的客群标签列表
*/
@ApiOperation("获取所有客群标签")
@Log(title = "客群管理-获取客群标签")
@GetMapping("/tags")
public AjaxResult getAllGroupTags() {
List<String> tags = custGroupService.getAllGroupTags();
return AjaxResult.success(tags);
}
}

View File

@@ -36,7 +36,7 @@ public class CustGroupMemberController extends BaseController {
@GetMapping("/list/{groupId}")
public TableDataInfo listCustGroupMembers(@PathVariable Long groupId,
CustGroupMemberQueryDTO dto) {
startPage();
// 注意:startPage()在Service内部调用因为权限检查会先执行SQL导致分页失效
List<CustGroupMemberVO> list = custGroupMemberService.listCustGroupMembers(groupId, dto);
return getDataTable(list);
}

View File

@@ -0,0 +1,125 @@
package com.ruoyi.group.controller;
import com.github.pagehelper.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataPageInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.group.domain.entity.GroupCmpmCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCmpmCountLingshou825;
import com.ruoyi.group.domain.entity.GroupCustCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCustCountLingshou825;
import com.ruoyi.group.service.IGroupPerformanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Api(tags = "客群业绩统计")
@RestController
@RequestMapping("/group/performance")
public class GroupPerformanceController extends BaseController {
@Resource
private IGroupPerformanceService groupPerformanceService;
@ApiOperation("查询零售客群业绩汇总列表")
@GetMapping("/ls/list")
public TableDataPageInfo<GroupCmpmCountLingshou825> selectLsCountList(String dt, String groupName) {
Page<Object> page = startPage();
List<GroupCmpmCountLingshou825> list = groupPerformanceService.selectLsCountList(dt, groupName);
return getDataTable(list, page);
}
@ApiOperation("查询公司客群业绩汇总列表")
@GetMapping("/gs/list")
public TableDataPageInfo<GroupCmpmCountGongsi825> selectGsCountList(String dt, String groupName) {
Page<Object> page = startPage();
List<GroupCmpmCountGongsi825> list = groupPerformanceService.selectGsCountList(dt, groupName);
return getDataTable(list, page);
}
@ApiOperation("查询零售客群客户明细")
@GetMapping("/ls/custList")
public TableDataPageInfo<GroupCustCountLingshou825> selectLsCustList(@RequestParam String groupId,
String custName,
String custIdc,
String dt) {
Page<Object> page = startPage();
List<GroupCustCountLingshou825> list = groupPerformanceService.selectLsCustList(groupId, custName, custIdc, dt);
return getDataTable(list, page);
}
@ApiOperation("查询公司客群客户明细")
@GetMapping("/gs/custList")
public TableDataPageInfo<GroupCustCountGongsi825> selectGsCustList(@RequestParam String groupId,
String custName,
String socialCreditCode,
String dt) {
Page<Object> page = startPage();
List<GroupCustCountGongsi825> list = groupPerformanceService.selectGsCustList(groupId, custName, socialCreditCode, dt);
return getDataTable(list, page);
}
@Log(title = "导出零售客群业绩汇总")
@ApiOperation(value = "导出零售客群业绩汇总", produces = "application/octet-stream")
@GetMapping("/exportLs")
public void exportLs(HttpServletResponse response, String dt, String groupName) {
try {
ExcelUtil<GroupCmpmCountLingshou825> util = new ExcelUtil<>(GroupCmpmCountLingshou825.class);
util.exportExcel(response, groupPerformanceService.selectLsCountList(dt, groupName), "零售客群业绩汇总");
} catch (Exception e) {
logger.error("导出零售客群业绩汇总失败", e);
}
}
@Log(title = "导出公司客群业绩汇总")
@ApiOperation(value = "导出公司客群业绩汇总", produces = "application/octet-stream")
@GetMapping("/exportGs")
public void exportGs(HttpServletResponse response, String dt, String groupName) {
try {
ExcelUtil<GroupCmpmCountGongsi825> util = new ExcelUtil<>(GroupCmpmCountGongsi825.class);
util.exportExcel(response, groupPerformanceService.selectGsCountList(dt, groupName), "公司客群业绩汇总");
} catch (Exception e) {
logger.error("导出公司客群业绩汇总失败", e);
}
}
@Log(title = "导出零售客群客户明细")
@ApiOperation(value = "导出零售客群客户明细", produces = "application/octet-stream")
@GetMapping("/exportLsCust")
public void exportLsCust(HttpServletResponse response,
@RequestParam String groupId,
String custName,
String custIdc,
String dt) {
try {
ExcelUtil<GroupCustCountLingshou825> util = new ExcelUtil<>(GroupCustCountLingshou825.class);
util.exportExcel(response, groupPerformanceService.selectLsCustList(groupId, custName, custIdc, dt), "零售客群客户明细");
} catch (Exception e) {
logger.error("导出零售客群客户明细失败", e);
}
}
@Log(title = "导出公司客群客户明细")
@ApiOperation(value = "导出公司客群客户明细", produces = "application/octet-stream")
@GetMapping("/exportGsCust")
public void exportGsCust(HttpServletResponse response,
@RequestParam String groupId,
String custName,
String socialCreditCode,
String dt) {
try {
ExcelUtil<GroupCustCountGongsi825> util = new ExcelUtil<>(GroupCustCountGongsi825.class);
util.exportExcel(response, groupPerformanceService.selectGsCustList(groupId, custName, socialCreditCode, dt), "公司客群客户明细");
} catch (Exception e) {
logger.error("导出公司客群客户明细失败", e);
}
}
}

View File

@@ -13,6 +13,18 @@ import lombok.Data;
@ApiModel(description = "客群客户查询条件")
public class CustGroupMemberQueryDTO {
/**
* 页码
*/
@ApiModelProperty(value = "页码", hidden = true)
private Integer pageNum;
/**
* 每页数量
*/
@ApiModelProperty(value = "每页数量", hidden = true)
private Integer pageSize;
/**
* 客户类型0=个人, 1=商户, 2=企业
*/
@@ -24,4 +36,34 @@ public class CustGroupMemberQueryDTO {
*/
@ApiModelProperty(value = "客户姓名")
private String custName;
/**
* 客户经理柜员号
*/
@ApiModelProperty(value = "客户经理柜员号")
private String userName;
/**
* 客户经理姓名
*/
@ApiModelProperty(value = "客户经理姓名")
private String nickName;
/**
* 当前用户角色
*/
@ApiModelProperty(value = "当前用户角色", hidden = true)
private String userRole;
/**
* 当前用户名
*/
@ApiModelProperty(value = "当前用户名", hidden = true)
private String currentUserName;
/**
* 当前机构ID
*/
@ApiModelProperty(value = "当前机构ID", hidden = true)
private Long currentDeptId;
}

View File

@@ -39,6 +39,24 @@ public class CustGroupQueryDTO implements Serializable {
@ApiModelProperty(value = "客群状态", name = "groupStatus")
private String groupStatus;
/**
* 客群标签(模糊匹配)
*/
@ApiModelProperty(value = "客群标签", name = "groupTags")
private String groupTags;
/**
* 视图类型mine=我创建的sharedToMe=下发给我的
*/
@ApiModelProperty(value = "视图类型", name = "viewType")
private String viewType;
/**
* 当前用户是否属于总行管理员口径
*/
@ApiModelProperty(value = "当前用户是否总行管理员", hidden = true)
private Boolean headRole;
/**
* 页码
*/

View File

@@ -38,10 +38,10 @@ public class CustGroup {
private String groupMode;
/**
* 创建方式1=模板导入, 2=绩效网格, 3=地理网格, 4=自定义网格
* 客群类型0=零售类(个人+商户), 1=公司类(企业)
*/
@ApiModelProperty(value = "创建方式1=模板导入, 2=绩效网格, 3=地理网格, 4=自定义网格", name = "createMode")
private String createMode;
@ApiModelProperty(value = "客群类型0=零售类(个人+商户), 1=公司类(企业)", name = "groupType")
private String groupType;
/**
* 柜员号
@@ -123,23 +123,18 @@ public class CustGroup {
private String remark;
/**
* 网格类型0=绩效网格, 1=地理网格, 2=绘制网格(动态客群使用
* 客群标签(多个标签用逗号分隔
*/
@ApiModelProperty(value = "网格类型", name = "gridType")
@ApiModelProperty(value = "客群标签(多个标签用逗号分隔)", name = "groupTags")
@TableField("group_tags")
private String groupTags;
/**
* 网格类型0=绩效网格, 1=地理网格, 2=绘制网格(管户关系来源)
*/
@ApiModelProperty(value = "网格类型管户关系来源0=绩效网格, 1=地理网格, 2=绘制网格", name = "gridType")
private String gridType;
/**
* 绩效业务类型retail=零售, corporate=公司(动态客群使用)
*/
@ApiModelProperty(value = "绩效业务类型", name = "cmpmBizType")
private String cmpmBizType;
/**
* 客户经理列表(逗号分隔,动态客群使用)
*/
@ApiModelProperty(value = "客户经理列表", name = "gridUserNames")
private String gridUserNames;
/**
* 地理网格ID列表逗号分隔动态客群使用
*/

View File

@@ -60,6 +60,48 @@ public class CustGroupMember {
@ApiModelProperty(value = "统信码(商户/企业有)", name = "socialCreditCode")
private String socialCreditCode;
/**
* 客户经理柜员号
*/
@ApiModelProperty(value = "客户经理柜员号", name = "userName")
@TableField("user_name")
private String userName;
/**
* 客户经理姓名
*/
@ApiModelProperty(value = "客户经理姓名", name = "nickName")
@TableField("nick_name")
private String nickName;
/**
* 网点ID
*/
@ApiModelProperty(value = "网点ID", name = "outletId")
@TableField("outlet_id")
private Long outletId;
/**
* 网点名称
*/
@ApiModelProperty(value = "网点名称", name = "outletName")
@TableField("outlet_name")
private String outletName;
/**
* 支行ID
*/
@ApiModelProperty(value = "支行ID", name = "branchId")
@TableField("branch_id")
private Long branchId;
/**
* 支行名称
*/
@ApiModelProperty(value = "支行名称", name = "branchName")
@TableField("branch_name")
private String branchName;
/**
* 创建者
*/
@@ -71,6 +113,12 @@ public class CustGroupMember {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 删除标识0=正常, 1=删除
*/

View File

@@ -0,0 +1,199 @@
package com.ruoyi.group.domain.entity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* 客群业绩汇总统计_公司825
*/
@Data
public class GroupCmpmCountGongsi825 implements Serializable {
private static final long serialVersionUID = 1L;
@Excel(name = "统计日期")
private String dt;
private String groupId;
@Excel(name = "客群名称")
private String groupName;
@Excel(name = "客群模式")
private String groupMode;
@Excel(name = "归属支行")
private String deptId;
@Excel(name = "归属支行名称")
private String deptName;
@Excel(name = "归属网点")
private String outletsId;
@Excel(name = "归属网点名称")
private String outletsName;
@Excel(name = "归属客户经理")
private String userName;
@Excel(name = "入格客户数")
private Integer custNum;
@Excel(name = "活期存款余额")
private String hqCurBalance;
@Excel(name = "保证金存款余额")
private String bzCurBalance;
@Excel(name = "贷款余额")
private String loanBalanceCny;
@Excel(name = "贴现余额")
private String financeProd711Balance;
@Excel(name = "承兑汇票余额")
private String financeProd716Balance;
@Excel(name = "贷款年日均")
private String loanYearDailyaverage;
@Excel(name = "签发承兑汇票率")
private String qfcdRat;
@Excel(name = "贴现业务率")
private String txRat;
@Excel(name = "保函业务率")
private String bhRat;
@Excel(name = "有效代发工资率")
private String yxdfgzRat;
@Excel(name = "代扣电费率")
private String dkdfRat;
@Excel(name = "代扣水费率")
private String dksfRat;
@Excel(name = "代扣税费率")
private String dkshfRat;
@Excel(name = "票据宝签约率")
private String pjbRat;
@Excel(name = "财资宝签约率")
private String czbRat;
@Excel(name = "收付宝签约率")
private String sfbRat;
@Excel(name = "贸融宝签约率")
private String mrbRat;
@Excel(name = "数字生态产品签约率")
private String szstRat;
@Excel(name = "开户率")
private String khRat;
@Excel(name = "国际结算业务率")
private String gjjsywRat;
@Excel(name = "远期结算汇业务率")
private String yqjshRat;
@Excel(name = "签发承兑汇票数")
private Integer qfcdNum;
@Excel(name = "贴现业务数")
private Integer txNum;
@Excel(name = "保函业务数")
private Integer bhNum;
@Excel(name = "有效代发工资数")
private Integer yxdfgzNum;
@Excel(name = "月均代发工资笔数")
private String ustrCountPerM;
@Excel(name = "月均代发工资金额(元)")
private String ustrBalM;
@Excel(name = "代扣电费数")
private Integer dkdfNum;
@Excel(name = "代扣水费数")
private Integer dksfNum;
@Excel(name = "代扣税费数")
private Integer dkshfNum;
@Excel(name = "票据宝签约数")
private Integer pjbNum;
@Excel(name = "财资宝签约数")
private Integer czbNum;
@Excel(name = "收付宝签约数")
private Integer sfbNum;
@Excel(name = "贸融宝签约数")
private Integer mrbNum;
@Excel(name = "数字生态产品签约数")
private Integer szstNum;
@Excel(name = "开户数")
private Integer khNum;
@Excel(name = "国际结算业务数")
private Integer gjjsywNum;
@Excel(name = "远期结算汇业务数")
private Integer yqjshNum;
private String regionCode;
private String opsDept;
@Excel(name = "合同签约率")
private String htqyRat;
@Excel(name = "合同签约数")
private Integer htqyNum;
private String deptType;
@Excel(name = "近365天已走访人数")
private String zf365cnt;
@Excel(name = "近180天已走访人数")
private String zf180cnt;
@Excel(name = "近90天已走访人数")
private String zf90cnt;
@Excel(name = "近30天已走访人数")
private String zf30cnt;
@Excel(name = "近365天走访率")
private String zf365rt;
@Excel(name = "近180天走访率")
private String zf180rt;
@Excel(name = "近90天走访率")
private String zf90rt;
@Excel(name = "近30天走访率")
private String zf30rt;
@Excel(name = "建档率")
private String phRat;
@Excel(name = "建档数")
private String phNum;
}

View File

@@ -0,0 +1,158 @@
package com.ruoyi.group.domain.entity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* 客群业绩汇总统计_零售825
*/
@Data
public class GroupCmpmCountLingshou825 implements Serializable {
private static final long serialVersionUID = 1L;
@Excel(name = "统计日期")
private String dt;
private String groupId;
@Excel(name = "客群名称")
private String groupName;
@Excel(name = "客群模式")
private String groupMode;
@Excel(name = "归属支行机构号")
private String deptId;
@Excel(name = "归属支行名称")
private String deptName;
@Excel(name = "归属网点机构号")
private String outletsId;
@Excel(name = "归属网点名称")
private String outletsName;
@Excel(name = "归属客户经理")
private String userName;
@Excel(name = "入格客户数")
private Integer custNum;
@Excel(name = "近365天已走访人数")
private String zf365cnt;
@Excel(name = "近180天已走访人数")
private String zf180cnt;
@Excel(name = "近90天已走访人数")
private String zf90cnt;
@Excel(name = "近30天已走访人数")
private String zf30cnt;
@Excel(name = "近365天走访率")
private String zf365rt;
@Excel(name = "近180天走访率")
private String zf180rt;
@Excel(name = "近90天走访率")
private String zf90rt;
@Excel(name = "近30天走访率")
private String zf30rt;
@Excel(name = "活期存款余额(元)")
private String curBalD;
@Excel(name = "授信率(%")
private String sxRat;
@Excel(name = "用信覆盖率")
private String yxRat;
@Excel(name = "授信户数")
private Integer sxNum;
@Excel(name = "用信户数")
private Integer yxNum;
@Excel(name = "授信金额(合同)")
private String sxBal;
@Excel(name = "贷款余额(元)")
private String balLoan;
@Excel(name = "贷款年日均(元)")
private String loanAve;
@Excel(name = "合同签约率(%")
private String yxhtRat;
@Excel(name = "代扣电费覆盖率(%")
private String dianRat;
@Excel(name = "代扣水费率(%")
private String shuiRat;
@Excel(name = "代扣税费率(%")
private String taxRat;
@Excel(name = "开户率(%")
private String openRat;
@Excel(name = "合同签约客户数")
private Integer yxhtNum;
@Excel(name = "代扣电费客户数")
private Integer dianNum;
@Excel(name = "代扣水费客户数")
private Integer shuiNum;
@Excel(name = "代扣税费数")
private Integer taxNum;
@Excel(name = "开户数")
private Integer openNum;
@Excel(name = "存款余额(元)")
private String depBal;
@Excel(name = "财富余额(元)")
private String finBal;
@Excel(name = "个人核心客户数")
private Integer grhxNum;
@Excel(name = "财富有效客户数")
private Integer cfyxNum;
@Excel(name = "有效信用卡数")
private Integer yxxykNum;
@Excel(name = "有效社保卡户数")
private Integer yxsbkNum;
@Excel(name = "二换三社保卡户数")
private Integer twoTo3SbkNum;
@Excel(name = "养老金迁移至社保卡户数")
private Integer yljToSbkNum;
@Excel(name = "丰收互联客户数")
private Integer fshlNum;
@Excel(name = "有效收单商户")
private Integer yxsdNum;
@Excel(name = "核心收单户数")
private String hxsdNum;
private String regionCode;
private String opsDept;
}

View File

@@ -0,0 +1,138 @@
package com.ruoyi.group.domain.entity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* 客群客户明细统计_公司825
*/
@Data
public class GroupCustCountGongsi825 implements Serializable {
private static final long serialVersionUID = 1L;
private String groupId;
@Excel(name = "客户名称")
private String custName;
@Excel(name = "客户证件号")
private String socialCreditCode;
@Excel(name = "客户内码")
private String custIsn;
@Excel(name = "活期存款余额")
private String hqCurBalance;
@Excel(name = "保证金存款余额")
private String bzCurBalance;
@Excel(name = "是否授信")
private String isCredit;
@Excel(name = "贷款余额")
private String loanBalanceCny;
@Excel(name = "贷款年日均")
private String loanYearDailyaverage;
@Excel(name = "是否有签发承兑汇票")
private String financeProd716OpenFlag;
@Excel(name = "承兑汇票余额")
private String financeProd716Balance;
@Excel(name = "是否有贴现业务")
private String financeProd711OpenFlag;
@Excel(name = "贴现金额")
private String financeProd711Balance;
@Excel(name = "是否有保函业务")
private String intlBussinessJcbhOpenFlag;
@Excel(name = "是否为有效代发工资客户")
private String isUstr;
@Excel(name = "月均代发工资笔数")
private String ustrCountPerM;
@Excel(name = "月均代发工资金额(元)")
private String ustrBalM;
@Excel(name = "是否代扣电费")
private String elecchargeSignFlag;
@Excel(name = "是否代扣水费")
private String waterchargeSignFlag;
@Excel(name = "是否代扣税费")
private String taxdeductionSignFlag;
@Excel(name = "是否票据宝签约")
private String pjb;
@Excel(name = "是否财资宝签约")
private String czb;
@Excel(name = "是否收付宝签约")
private String sfb;
@Excel(name = "是否贸融宝签约")
private String mrb;
@Excel(name = "是否数字生态产品签约")
private String szst;
@Excel(name = "是否开户")
private String isOpenSts;
@Excel(name = "是否国际结算业务")
private String intlBussinessOpenFlag;
@Excel(name = "是否有远期结算汇业务")
private String intlBussiness325OpenFlag;
private String regionCode;
private String opsDept;
private String custType;
@Excel(name = "是否合同签约")
private String isHtqy;
@Excel(name = "归属支行名称")
private String deptName;
@Excel(name = "归属网点id")
private String outletsId;
@Excel(name = "归属网点名称")
private String outletsName;
@Excel(name = "归属客户经理")
private String userName;
@Excel(name = "归属支行id")
private String deptId;
@Excel(name = "近365天有无走访")
private String is365zf;
@Excel(name = "近180天有无走访")
private String is180zf;
@Excel(name = "近90天有无走访")
private String is90zf;
@Excel(name = "近30天有无走访")
private String is30zf;
private String dt;
@Excel(name = "是否建档")
private String isPh;
}

View File

@@ -0,0 +1,111 @@
package com.ruoyi.group.domain.entity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* 客群客户明细统计_零售825
*/
@Data
public class GroupCustCountLingshou825 implements Serializable {
private static final long serialVersionUID = 1L;
private String groupId;
@Excel(name = "客户名称")
private String custName;
@Excel(name = "客户证件号")
private String custIdc;
@Excel(name = "客户内码")
private String custIsn;
@Excel(name = "活期存款余额")
private String curBalD;
@Excel(name = "贷款余额")
private String balLoan;
@Excel(name = "贷款年日均")
private String loanAve;
@Excel(name = "是否授信")
private String isSx;
@Excel(name = "是否用信")
private String isYx;
@Excel(name = "授信金额")
private String sxBal;
@Excel(name = "是否合同签约")
private String isYxht;
@Excel(name = "是否持有信用卡")
private String isXyk;
@Excel(name = "是否开通丰收互联")
private String fshl;
@Excel(name = "是否办理收单")
private String isSd;
@Excel(name = "是否代扣电费")
private String dian;
@Excel(name = "是否代扣水费")
private String shui;
@Excel(name = "是否代扣税费")
private String tax;
@Excel(name = "开户数")
private String openNum;
@Excel(name = "存款余额")
private String depBal;
@Excel(name = "财富余额")
private String finBal;
@Excel(name = "是否个人核心客户")
private String isGrhx;
@Excel(name = "是否财富有效客户")
private String isCfyx;
@Excel(name = "是否有效社保卡客户")
private String isYxsbk;
@Excel(name = "是否二换三社保卡")
private String is2to3Sbk;
@Excel(name = "是否养老金迁移至社保卡")
private String isYljToSbk;
private String regionCode;
private String opsDept;
private String custType;
@Excel(name = "近365天有无走访")
private String is365zf;
@Excel(name = "近180天有无走访")
private String is180zf;
@Excel(name = "近90天有无走访")
private String is90zf;
@Excel(name = "近30天有无走访")
private String is30zf;
private String dt;
@Excel(name = "是否核心收单")
private String isHxsd;
}

View File

@@ -57,10 +57,52 @@ public class CustGroupMemberVO {
@ApiModelProperty(value = "统信码(商户/企业有)", name = "socialCreditCode")
private String socialCreditCode;
/**
* 客户经理柜员号
*/
@ApiModelProperty(value = "客户经理柜员号", name = "userName")
private String userName;
/**
* 客户经理姓名
*/
@ApiModelProperty(value = "客户经理姓名", name = "nickName")
private String nickName;
/**
* 网点ID
*/
@ApiModelProperty(value = "网点ID", name = "outletId")
private Long outletId;
/**
* 网点名称
*/
@ApiModelProperty(value = "网点名称", name = "outletName")
private String outletName;
/**
* 支行ID
*/
@ApiModelProperty(value = "支行ID", name = "branchId")
private Long branchId;
/**
* 支行名称
*/
@ApiModelProperty(value = "支行名称", name = "branchName")
private String branchName;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间", name = "createTime")
private Date createTime;
/**
* 存量状态true=存量客户系统存在false=非存量客户(系统不存在)
*/
@ApiModelProperty(value = "存量状态true=存量客户false=非存量客户", name = "isExisting")
private Boolean isExisting;
}

View File

@@ -35,10 +35,10 @@ public class CustGroupVO {
private String groupMode;
/**
* 创建方式1=模板导入, 2=绩效网格, 3=地理网格, 4=自定义网格
* 客群类型0=零售类(个人+商户), 1=公司类(企业)
*/
@ApiModelProperty(value = "创建方式1=模板导入, 2=绩效网格, 3=地理网格, 4=自定义网格", name = "createMode")
private String createMode;
@ApiModelProperty(value = "客群类型0=零售类(个人+商户), 1=公司类(企业)", name = "groupType")
private String groupType;
/**
* 柜员号
@@ -114,6 +114,12 @@ public class CustGroupVO {
@ApiModelProperty(value = "备注", name = "remark")
private String remark;
/**
* 客群标签(多个标签用逗号分隔)
*/
@ApiModelProperty(value = "客群标签(多个标签用逗号分隔)", name = "groupTags")
private String groupTags;
/**
* 有效期截止时间
*/
@@ -128,23 +134,11 @@ public class CustGroupVO {
private String createStatus;
/**
* 网格类型0=绩效网格, 1=地理网格, 2=绘制网格
* 网格类型(管户关系来源)0=绩效网格, 1=地理网格, 2=绘制网格
*/
@ApiModelProperty(value = "网格类型", name = "gridType")
@ApiModelProperty(value = "网格类型管户关系来源0=绩效网格, 1=地理网格, 2=绘制网格", name = "gridType")
private String gridType;
/**
* 绩效业务类型retail=零售, corporate=公司
*/
@ApiModelProperty(value = "绩效业务类型", name = "cmpmBizType")
private String cmpmBizType;
/**
* 客户经理列表(逗号分隔)
*/
@ApiModelProperty(value = "客户经理列表", name = "gridUserNames")
private String gridUserNames;
/**
* 地理网格ID列表逗号分隔
*/

View File

@@ -32,7 +32,10 @@ public interface CustGroupMapper extends BaseMapper<CustGroup> {
* @param dto 查询条件
* @return 客群VO列表
*/
List<CustGroupVO> selectCustGroupList(@Param("dto") CustGroupQueryDTO dto);
List<CustGroupVO> selectCustGroupList(@Param("dto") CustGroupQueryDTO dto,
@Param("userName") String userName,
@Param("deptId") String deptId,
@Param("headId") String headId);
/**
* 根据ID查询客群详情
@@ -40,5 +43,39 @@ public interface CustGroupMapper extends BaseMapper<CustGroup> {
* @param id 客群ID
* @return 客群VO
*/
CustGroupVO selectCustGroupById(@Param("id") Long id);
CustGroupVO selectCustGroupById(@Param("id") Long id,
@Param("userName") String userName,
@Param("deptId") String deptId,
@Param("headRole") Boolean headRole,
@Param("headId") String headId);
/**
* 校验当前用户是否有客群查看权限
*
* @param id 客群ID
* @param userName 当前用户名
* @param deptId 当前部门ID
* @return 可查看数量
*/
Long countVisibleCustGroup(@Param("id") Long id,
@Param("userName") String userName,
@Param("deptId") String deptId,
@Param("headRole") Boolean headRole,
@Param("headId") String headId);
/**
* 校验客群是否属于总行管理员共享操作范围
*
* @param id 客群ID
* @return 数量
*/
Long countHeadOperableCustGroup(@Param("id") Long id,
@Param("headId") String headId);
/**
* 查询所有已有的客群标签
*
* @return 标签列表
*/
List<String> selectAllGroupTags();
}

View File

@@ -33,4 +33,29 @@ public interface CustGroupMemberMapper extends BaseMapper<CustGroupMember> {
* @param memberList 客户列表
*/
void batchInsertMembers(@Param("list") List<CustGroupMember> memberList);
/**
* 批量查询个人客户是否存在(根据客户号+身份证号)
*
* @param custIds 客户号列表
* @return 存在的客户号列表
*/
List<String> selectExistingRetailCustIds(@Param("list") List<String> custIds);
/**
* 批量查询商户客户是否存在(根据客户号+统信码)
*
* @param custIds 客户号列表
* @return 存在的客户号列表
*/
List<String> selectExistingMerchantCustIds(@Param("list") List<String> custIds);
/**
* 批量查询企业客户是否存在(根据客户号+统信码)
*
* @param custIds 客户号列表
* @return 存在的客户号列表
*/
List<String> selectExistingBusinessCustIds(@Param("list") List<String> custIds);
}

View File

@@ -0,0 +1,22 @@
package com.ruoyi.group.mapper;
import com.ruoyi.group.domain.entity.GroupCmpmCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCmpmCountLingshou825;
import com.ruoyi.group.domain.entity.GroupCustCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCustCountLingshou825;
import org.apache.ibatis.annotations.Mapper;
import java.util.HashMap;
import java.util.List;
@Mapper
public interface GroupPerformanceMapper {
List<GroupCmpmCountLingshou825> selectLsCountList(HashMap<String, Object> paramMap);
List<GroupCmpmCountGongsi825> selectGsCountList(HashMap<String, Object> paramMap);
List<GroupCustCountLingshou825> selectLsCustList(HashMap<String, Object> paramMap);
List<GroupCustCountGongsi825> selectGsCustList(HashMap<String, Object> paramMap);
}

View File

@@ -1,7 +1,6 @@
package com.ruoyi.group.service;
import com.ruoyi.group.domain.dto.CustGroupQueryDTO;
import com.ruoyi.group.domain.dto.GridImportDTO;
import com.ruoyi.group.domain.entity.CustGroup;
import com.ruoyi.group.domain.vo.CustGroupVO;
import org.springframework.web.multipart.MultipartFile;
@@ -17,49 +16,34 @@ public interface ICustGroupService {
/**
* 查询客群列表
*
* @param dto 查询条件
* @return 客群VO列表
*/
List<CustGroupVO> listCustGroup(CustGroupQueryDTO dto);
/**
* 根据ID查询客群详情
*
* @param id 客群ID
* @return 客群VO
*/
CustGroupVO getCustGroup(Long id);
/**
* 校验当前用户是否有客群查看权限
*/
void checkCustGroupViewPermission(Long id);
/**
* 异步创建客群(模板导入)
* gridType、regionGridIds、drawGridIds 从 custGroup 中获取
*
* @param custGroup 客群实体
* @param custGroup 客群实体(包含 gridType、regionGridIds、drawGridIds
* @param file Excel文件
* @return 客群ID
*/
String createCustGroupByTemplate(CustGroup custGroup, MultipartFile file);
/**
* 异步创建客群(网格导入)
*
* @param gridImportDTO 网格导入条件
* @return 客群ID
*/
String createCustGroupByGrid(GridImportDTO gridImportDTO);
/**
* 更新客群(网格导入)
*
* @param gridImportDTO 网格导入条件
* @return 结果消息
*/
String updateCustGroupByGrid(GridImportDTO gridImportDTO);
/**
* 更新客群(模板导入)
* gridType、regionGridIds、drawGridIds 从 custGroup 中获取
*
* @param custGroup 客群实体
* @param custGroup 客群实体(包含 gridType、regionGridIds、drawGridIds
* @param file Excel文件
* @return 结果消息
*/
@@ -67,31 +51,21 @@ public interface ICustGroupService {
/**
* 删除客群
*
* @param idList 客群ID列表
* @return 结果消息
*/
String deleteCustGroup(List<Long> idList);
/**
* 检查客群名称是否存在
*
* @param groupName 客群名称
* @return true=存在, false=不存在
*/
boolean checkGroupNameExist(String groupName);
/**
* 查询客群创建状态
*
* @param id 客群ID
* @return 创建状态0=创建中, 1=创建成功, 2=创建失败
*/
String getCreateStatus(Long id);
/**
* 更新动态客群(定时任务调用)
* 根据原始导入条件重新查询并更新客户列表
*/
void updateDynamicCustGroups();
@@ -100,4 +74,11 @@ public interface ICustGroupService {
*/
void checkAndDisableExpiredGroups();
/**
* 获取所有已有的客群标签列表
*
* @return 标签列表
*/
List<String> getAllGroupTags();
}

View File

@@ -0,0 +1,19 @@
package com.ruoyi.group.service;
import com.ruoyi.group.domain.entity.GroupCmpmCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCmpmCountLingshou825;
import com.ruoyi.group.domain.entity.GroupCustCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCustCountLingshou825;
import java.util.List;
public interface IGroupPerformanceService {
List<GroupCmpmCountLingshou825> selectLsCountList(String dt, String groupName);
List<GroupCmpmCountGongsi825> selectGsCountList(String dt, String groupName);
List<GroupCustCountLingshou825> selectLsCustList(String groupId, String custName, String custIdc, String dt);
List<GroupCustCountGongsi825> selectGsCustList(String groupId, String custName, String socialCreditCode, String dt);
}

View File

@@ -4,14 +4,22 @@ import com.ruoyi.group.domain.dto.CustGroupMemberQueryDTO;
import com.ruoyi.group.domain.entity.CustGroup;
import com.ruoyi.group.domain.entity.CustGroupMember;
import com.ruoyi.group.domain.vo.CustGroupMemberVO;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.group.mapper.CustGroupMapper;
import com.ruoyi.group.mapper.CustGroupMemberMapper;
import com.ruoyi.group.service.ICustGroupService;
import com.ruoyi.group.service.ICustGroupMemberService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 客群客户服务实现类
@@ -27,9 +35,73 @@ public class CustGroupMemberServiceImpl implements ICustGroupMemberService {
@Resource
private CustGroupMapper custGroupMapper;
@Resource
private ICustGroupService custGroupService;
@Override
public List<CustGroupMemberVO> listCustGroupMembers(Long groupId, CustGroupMemberQueryDTO dto) {
return custGroupMemberMapper.selectCustGroupMemberList(groupId, dto);
custGroupService.checkCustGroupViewPermission(groupId);
dto.setUserRole(SecurityUtils.userRole());
dto.setCurrentUserName(SecurityUtils.getUsername());
dto.setCurrentDeptId(SecurityUtils.getDeptId());
// 在权限检查之后启动分页避免权限检查SQL消耗分页设置
int pageNum = dto.getPageNum() != null ? dto.getPageNum() : 1;
int pageSize = dto.getPageSize() != null ? dto.getPageSize() : 10;
PageHelper.startPage(pageNum, pageSize);
// 1. 查询客群成员列表(分页)
List<CustGroupMemberVO> memberList = custGroupMemberMapper.selectCustGroupMemberList(groupId, dto);
if (memberList == null || memberList.isEmpty()) {
return memberList;
}
// 2. 按客户类型分组,批量查询存量状态
// 个人客户
List<String> retailCustIds = memberList.stream()
.filter(m -> "0".equals(m.getCustType()))
.map(CustGroupMemberVO::getCustId)
.collect(Collectors.toList());
// 商户客户
List<String> merchantCustIds = memberList.stream()
.filter(m -> "1".equals(m.getCustType()))
.map(CustGroupMemberVO::getCustId)
.collect(Collectors.toList());
// 企业客户
List<String> businessCustIds = memberList.stream()
.filter(m -> "2".equals(m.getCustType()))
.map(CustGroupMemberVO::getCustId)
.collect(Collectors.toList());
// 3. 批量查询各类型存量客户
Set<String> existingRetailCustIds = new HashSet<>();
Set<String> existingMerchantCustIds = new HashSet<>();
Set<String> existingBusinessCustIds = new HashSet<>();
if (!retailCustIds.isEmpty()) {
existingRetailCustIds.addAll(custGroupMemberMapper.selectExistingRetailCustIds(retailCustIds));
}
if (!merchantCustIds.isEmpty()) {
existingMerchantCustIds.addAll(custGroupMemberMapper.selectExistingMerchantCustIds(merchantCustIds));
}
if (!businessCustIds.isEmpty()) {
existingBusinessCustIds.addAll(custGroupMemberMapper.selectExistingBusinessCustIds(businessCustIds));
}
// 4. 填充存量状态
for (CustGroupMemberVO member : memberList) {
String custType = member.getCustType();
String custId = member.getCustId();
if ("0".equals(custType)) {
member.setIsExisting(existingRetailCustIds.contains(custId));
} else if ("1".equals(custType)) {
member.setIsExisting(existingMerchantCustIds.contains(custId));
} else if ("2".equals(custType)) {
member.setIsExisting(existingBusinessCustIds.contains(custId));
} else {
member.setIsExisting(false);
}
}
return memberList;
}
@Override
@@ -38,7 +110,17 @@ public class CustGroupMemberServiceImpl implements ICustGroupMemberService {
// 检查客群是否存在
CustGroup custGroup = custGroupMapper.selectById(groupId);
if (custGroup == null) {
return "客群不存在";
throw new ServiceException("客群不存在");
}
if (!SecurityUtils.hasRole("headAdmin")
&& !SecurityUtils.hasRole("headPublic")
&& !SecurityUtils.hasRole("headPrivate")
&& !SecurityUtils.hasRole("headOps")) {
throw new ServiceException("无权限操作该客群");
}
Long count = custGroupMapper.countHeadOperableCustGroup(groupId, SecurityUtils.getHeadId());
if (count == null || count <= 0) {
throw new ServiceException("无权限操作该客群");
}
// 删除客户关联
@@ -47,6 +129,7 @@ public class CustGroupMemberServiceImpl implements ICustGroupMemberService {
if (member != null && member.getGroupId().equals(groupId)) {
// 设置手动移除标识
member.setManualRemove(1);
custGroupMemberMapper.updateById(member);
// 逻辑删除
custGroupMemberMapper.deleteById(memberId);
}

View File

@@ -0,0 +1,104 @@
package com.ruoyi.group.service.impl;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.group.domain.entity.GroupCmpmCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCmpmCountLingshou825;
import com.ruoyi.group.domain.entity.GroupCustCountGongsi825;
import com.ruoyi.group.domain.entity.GroupCustCountLingshou825;
import com.ruoyi.group.mapper.GroupPerformanceMapper;
import com.ruoyi.group.service.IGroupPerformanceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
@Service
public class GroupPerformanceServiceImpl implements IGroupPerformanceService {
@Resource
private GroupPerformanceMapper groupPerformanceMapper;
@Override
public List<GroupCmpmCountLingshou825> selectLsCountList(String dt, String groupName) {
return groupPerformanceMapper.selectLsCountList(buildLsCountParams(dt, groupName));
}
private HashMap<String, Object> buildLsCountParams(String dt, String groupName) {
HashMap<String, Object> paramMap = new HashMap<>();
if (SecurityUtils.userRole().equals("branch")) {
paramMap.put("isBranch", true);
}
if (SecurityUtils.userRole().equals("outlet")) {
paramMap.put("isOutlet", true);
}
if (SecurityUtils.userRole().equals("manager")) {
paramMap.put("isManager", true);
}
paramMap.put("deptId", SecurityUtils.getDeptId());
paramMap.put("userName", SecurityUtils.getUsername());
paramMap.put("dt", dt);
paramMap.put("groupName", groupName);
return paramMap;
}
@Override
public List<GroupCmpmCountGongsi825> selectGsCountList(String dt, String groupName) {
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("userRole", "head");
if (SecurityUtils.userRole().equals("branch")) {
paramMap.put("userRole", "branch");
paramMap.put("isBranch", true);
}
if (SecurityUtils.userRole().equals("outlet")) {
paramMap.put("userRole", "outlet");
paramMap.put("isOutlet", true);
}
if (SecurityUtils.userRole().equals("manager")) {
paramMap.put("userRole", "manager");
paramMap.put("isManager", true);
}
paramMap.put("deptId", SecurityUtils.getDeptId());
paramMap.put("userName", SecurityUtils.getUsername());
paramMap.put("dt", dt);
paramMap.put("groupName", groupName);
return groupPerformanceMapper.selectGsCountList(paramMap);
}
@Override
public List<GroupCustCountLingshou825> selectLsCustList(String groupId, String custName, String custIdc, String dt) {
return groupPerformanceMapper.selectLsCustList(buildLsCustParams(groupId, custName, custIdc, dt));
}
private HashMap<String, Object> buildLsCustParams(String groupId, String custName, String custIdc, String dt) {
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("deptId", SecurityUtils.getDeptId());
paramMap.put("userName", SecurityUtils.getUsername());
paramMap.put("groupId", groupId);
paramMap.put("custName", custName);
paramMap.put("custIdc", custIdc);
paramMap.put("dt", dt);
return paramMap;
}
@Override
public List<GroupCustCountGongsi825> selectGsCustList(String groupId, String custName, String socialCreditCode, String dt) {
HashMap<String, Object> paramMap = new HashMap<>();
if (SecurityUtils.userRole().equals("branch")) {
paramMap.put("isBranch", true);
}
if (SecurityUtils.userRole().equals("outlet")) {
paramMap.put("isOutlet", true);
}
if (SecurityUtils.userRole().equals("manager")) {
paramMap.put("isManager", true);
}
paramMap.put("deptId", SecurityUtils.getDeptId());
paramMap.put("userName", SecurityUtils.getUsername());
paramMap.put("groupId", groupId);
paramMap.put("custName", custName);
paramMap.put("socialCreditCode", socialCreditCode);
paramMap.put("dt", dt);
return groupPerformanceMapper.selectGsCustList(paramMap);
}
}

View File

@@ -4,18 +4,80 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.group.mapper.CustGroupMapper">
<sql id="custGroupVisibleBaseCondition">
AND (
<choose>
<when test="headRole != null and headRole">
EXISTS (
SELECT 1
FROM sys_user su
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
LEFT JOIN sys_role sr ON sur.role_id = sr.role_id
WHERE su.user_name = cg.user_name
AND LEFT(CAST(cg.dept_id AS CHAR), 3) = #{headId}
AND sr.role_key IN ('headAdmin', 'headPublic', 'headPrivate', 'headOps')
)
</when>
<otherwise>
1 = 2
</otherwise>
</choose>
OR (
cg.share_enabled = 1
AND cg.group_status = '0'
AND cg.share_dept_ids IS NOT NULL
AND cg.share_dept_ids != ''
AND find_in_set(#{deptId}, cg.share_dept_ids)
)
)
</sql>
<sql id="custGroupVisibleCondition">
<choose>
<when test="dto != null and dto.viewType == 'mine'">
<choose>
<when test="dto.headRole">
AND EXISTS (
SELECT 1
FROM sys_user su
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
LEFT JOIN sys_role sr ON sur.role_id = sr.role_id
WHERE su.user_name = cg.user_name
AND LEFT(CAST(cg.dept_id AS CHAR), 3) = #{headId}
AND sr.role_key IN ('headAdmin', 'headPublic', 'headPrivate', 'headOps')
)
</when>
<otherwise>
AND 1 = 2
</otherwise>
</choose>
</when>
<when test="dto != null and dto.viewType == 'sharedToMe'">
AND cg.share_enabled = 1
AND cg.group_status = '0'
AND cg.share_dept_ids IS NOT NULL
AND cg.share_dept_ids != ''
AND find_in_set(#{deptId}, cg.share_dept_ids)
</when>
<otherwise>
<include refid="custGroupVisibleBaseCondition"/>
</otherwise>
</choose>
</sql>
<select id="selectCustGroupList" resultType="CustGroupVO">
SELECT
cg.id,
cg.group_name,
cg.group_mode,
cg.create_mode,
cg.group_type,
cg.user_name,
cg.nick_name,
cg.dept_id,
cg.share_enabled,
cg.share_dept_ids,
cg.group_status,
cg.group_tags,
cg.create_by,
cg.create_time,
cg.update_by,
@@ -26,19 +88,20 @@
FROM ibs_cust_group cg
<where>
cg.del_flag = '0'
and create_status = '1'
AND cg.create_status = '1'
<include refid="custGroupVisibleCondition"/>
<if test="dto.groupName != null and dto.groupName != ''">
AND cg.group_name LIKE CONCAT('%', #{dto.groupName}, '%')
</if>
<if test="dto.groupMode != null and dto.groupMode != ''">
AND cg.group_mode = #{dto.groupMode}
</if>
<if test="dto.createMode != null and dto.createMode != ''">
AND cg.create_mode = #{dto.createMode}
</if>
<if test="dto.groupStatus != null and dto.groupStatus != ''">
AND cg.group_status = #{dto.groupStatus}
</if>
<if test="dto.groupTags != null and dto.groupTags != ''">
AND cg.group_tags LIKE CONCAT('%', #{dto.groupTags}, '%')
</if>
</where>
ORDER BY cg.create_time DESC
</select>
@@ -48,13 +111,14 @@
cg.id,
cg.group_name,
cg.group_mode,
cg.create_mode,
cg.group_type,
cg.user_name,
cg.nick_name,
cg.dept_id,
cg.share_enabled,
cg.share_dept_ids,
cg.group_status,
cg.group_tags,
cg.valid_time,
cg.create_by,
cg.create_time,
@@ -63,13 +127,49 @@
cg.remark,
cg.create_status,
cg.grid_type,
cg.cmpm_biz_type,
cg.grid_user_names,
cg.region_grid_ids,
cg.draw_grid_ids,
(SELECT COUNT(*) FROM ibs_cust_group_member cgm WHERE cgm.group_id = cg.id AND cgm.del_flag = '0') AS cust_count
FROM ibs_cust_group cg
WHERE cg.id = #{id} AND cg.del_flag = '0'
WHERE cg.id = #{id}
AND cg.del_flag = '0'
AND cg.create_status = '1'
<include refid="custGroupVisibleBaseCondition"/>
</select>
<select id="countVisibleCustGroup" resultType="java.lang.Long">
SELECT COUNT(1)
FROM ibs_cust_group cg
WHERE cg.id = #{id}
AND cg.del_flag = '0'
AND cg.create_status = '1'
<include refid="custGroupVisibleBaseCondition"/>
</select>
<select id="countHeadOperableCustGroup" resultType="java.lang.Long">
SELECT COUNT(1)
FROM ibs_cust_group cg
WHERE cg.id = #{id}
AND cg.del_flag = '0'
AND EXISTS (
SELECT 1
FROM sys_user su
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
LEFT JOIN sys_role sr ON sur.role_id = sr.role_id
WHERE su.user_name = cg.user_name
AND LEFT(CAST(cg.dept_id AS CHAR), 3) = #{headId}
AND sr.role_key IN ('headAdmin', 'headPublic', 'headPrivate', 'headOps')
)
</select>
<select id="selectAllGroupTags" resultType="java.lang.String">
SELECT DISTINCT group_tags
FROM ibs_cust_group
WHERE del_flag = '0'
AND create_status = '1'
AND group_tags IS NOT NULL
AND group_tags != ''
ORDER BY group_tags
</select>
</mapper>

View File

@@ -13,28 +13,94 @@
cgm.cust_name,
cgm.cust_idc,
cgm.social_credit_code,
cgm.user_name,
cgm.nick_name,
cgm.outlet_id,
cgm.outlet_name,
cgm.branch_id,
cgm.branch_name,
cgm.create_time
FROM ibs_cust_group_member cgm
<where>
cgm.group_id = #{groupId}
AND cgm.del_flag = '0'
<choose>
<when test="dto != null and dto.userRole == 'branch'">
AND cgm.branch_id = #{dto.currentDeptId}
</when>
<when test="dto != null and dto.userRole == 'outlet'">
AND cgm.outlet_id = #{dto.currentDeptId}
</when>
<when test="dto != null and dto.userRole == 'manager'">
AND cgm.user_name = #{dto.currentUserName}
</when>
</choose>
<if test="dto != null and dto.custType != null and dto.custType != ''">
AND cgm.cust_type = #{dto.custType}
</if>
<if test="dto != null and dto.custName != null and dto.custName != ''">
AND cgm.cust_name LIKE CONCAT('%', #{dto.custName}, '%')
</if>
<if test="dto != null and dto.userName != null and dto.userName != ''">
AND cgm.user_name = #{dto.userName}
</if>
<if test="dto != null and dto.nickName != null and dto.nickName != ''">
AND cgm.nick_name LIKE CONCAT('%', #{dto.nickName}, '%')
</if>
</where>
ORDER BY cgm.create_time ASC
</select>
<!-- 批量查询个人客户是否存在 -->
<select id="selectExistingRetailCustIds" resultType="String">
SELECT DISTINCT t.cust_id
FROM ibs_cust_group_member t
INNER JOIN cust_info_retail c ON t.cust_id = c.cust_id AND t.cust_idc = c.cust_idc
WHERE t.del_flag = '0'
AND t.cust_type = '0'
AND t.cust_id IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 批量查询商户客户是否存在 -->
<select id="selectExistingMerchantCustIds" resultType="String">
SELECT DISTINCT t.cust_id
FROM ibs_cust_group_member t
INNER JOIN cust_info_merchant c ON t.cust_id = c.cust_id AND t.social_credit_code = c.social_credit_code
WHERE t.del_flag = '0'
AND t.cust_type = '1'
AND t.cust_id IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 批量查询企业客户是否存在 -->
<select id="selectExistingBusinessCustIds" resultType="String">
SELECT DISTINCT t.cust_id
FROM ibs_cust_group_member t
INNER JOIN cust_info_business c ON t.cust_id = c.cust_id AND t.social_credit_code = c.social_credit_code
WHERE t.del_flag = '0'
AND t.cust_type = '2'
AND t.cust_id IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 批量插入客群客户INSERT IGNORE遇到重复键自动跳过 -->
<insert id="batchInsertMembers">
INSERT IGNORE INTO ibs_cust_group_member
(group_id, cust_type, cust_id, cust_name, cust_idc, social_credit_code, create_by, create_time, del_flag, manual_remove)
(group_id, cust_type, cust_id, cust_name, cust_idc, social_credit_code,
user_name, nick_name, outlet_id, outlet_name, branch_id, branch_name,
create_by, create_time, del_flag, manual_remove)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.groupId}, #{item.custType}, #{item.custId}, #{item.custName}, #{item.custIdc}, #{item.socialCreditCode}, #{item.createBy}, NOW(), '0', '0')
(#{item.groupId}, #{item.custType}, #{item.custId}, #{item.custName}, #{item.custIdc}, #{item.socialCreditCode},
#{item.userName}, #{item.nickName}, #{item.outletId}, #{item.outletName}, #{item.branchId}, #{item.branchName},
#{item.createBy}, NOW(), '0', '0')
</foreach>
</insert>

View File

@@ -0,0 +1,245 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.group.mapper.GroupPerformanceMapper">
<select id="selectLsCountList" resultType="com.ruoyi.group.domain.entity.GroupCmpmCountLingshou825">
SELECT
dt,
group_id,
group_name,
group_mode,
dept_id,
dept_name,
outlets_id,
outlets_name,
user_name,
cust_num,
zf_365cnt,
zf_180cnt,
zf_90cnt,
zf_30cnt,
zf_365rt,
zf_180rt,
zf_90rt,
zf_30rt,
cur_bal_d,
sx_rat,
yx_rat,
sx_num,
yx_num,
sx_bal,
bal_loan,
loan_ave,
yxht_rat,
dian_rat,
shui_rat,
tax_rat,
open_rat,
yxht_num,
dian_num,
shui_num,
tax_num,
open_num,
dep_bal,
fin_bal,
grhx_num,
cfyx_num,
yxxyk_num,
yxsbk_num,
`2to3_sbk_num` as twoTo3SbkNum,
ylj_to_sbk_num,
fshl_num,
yxsd_num,
hxsd_num,
region_code,
ops_dept
FROM group_cmpm_count_lingshou_825
<where>
<if test="dt != null and dt != ''">and dt = #{dt}</if>
<if test="groupName != null and groupName != ''">and group_name like concat('%', #{groupName}, '%')</if>
<if test="isBranch == true">and dept_id like concat('%',concat(#{deptId},'%'))</if>
<if test="isOutlet == true">and outlets_id like concat('%',concat(#{deptId},'%'))</if>
<if test="isManager == true">and user_name like concat('%',concat(#{userName},'%'))</if>
</where>
</select>
<select id="selectGsCountList" resultType="com.ruoyi.group.domain.entity.GroupCmpmCountGongsi825">
SELECT
dt,
group_id,
group_name,
group_mode,
dept_id,
dept_name,
outlets_id,
outlets_name,
user_name,
cust_num,
hq_cur_balance,
bz_cur_balance,
loan_balance_cny,
finance_prod_711_balance,
finance_prod_716_balance,
loan_year_dailyaverage,
qfcd_rat,
tx_rat,
bh_rat,
yxdfgz_rat,
dkdf_rat,
dksf_rat,
dkshf_rat,
pjb_rat,
czb_rat,
sfb_rat,
mrb_rat,
szst_rat,
kh_rat,
gjjsyw_rat,
yqjsh_rat,
qfcd_num,
tx_num,
bh_num,
yxdfgz_num,
ustr_count_per_m,
ustr_bal_m,
dkdf_num,
dksf_num,
dkshf_num,
pjb_num,
czb_num,
sfb_num,
mrb_num,
szst_num,
kh_num,
gjjsyw_num,
yqjsh_num,
region_code,
ops_dept,
htqy_rat,
htqy_num,
dept_type,
zf_365cnt,
zf_180cnt,
zf_90cnt,
zf_30cnt,
zf_365rt,
zf_180rt,
zf_90rt,
zf_30rt,
ph_rat,
ph_num
FROM group_cmpm_count_gongsi_825
<where>
<if test="dt != null and dt != ''">and dt = #{dt}</if>
<if test="groupName != null and groupName != ''">and group_name like concat('%', #{groupName}, '%')</if>
<if test=" isBranch == true">and dept_id like concat('%',concat(#{deptId},'%'))</if>
<if test=" isOutlet == true">and outlets_id like concat('%',concat(#{deptId},'%'))</if>
<if test=" isManager == true">and user_name like concat('%',concat(#{userName},'%'))</if>
</where>
</select>
<select id="selectLsCustList" resultType="com.ruoyi.group.domain.entity.GroupCustCountLingshou825">
SELECT
group_id,
cust_name,
cust_idc,
cust_isn,
cur_bal_d,
bal_loan,
loan_ave,
is_sx,
is_yx,
sx_bal,
is_yxht,
is_xyk,
fshl,
is_sd,
dian,
shui,
tax,
open_num,
dep_bal,
fin_bal,
is_grhx,
is_cfyx,
is_yxsbk,
is_2to3_sbk,
is_ylj_to_sbk,
region_code,
ops_dept,
cust_type,
is_365zf,
is_180zf,
is_90zf,
is_30zf,
dt,
is_hxsd
FROM group_cust_count_lingshou_825
<where>
group_id = #{groupId}
<if test="dt != null and dt != ''">and dt = #{dt}</if>
<if test="custName != null and custName != ''">and cust_name like concat('%', #{custName}, '%')</if>
<if test="custIdc != null and custIdc != ''">and cust_idc like concat('%', #{custIdc}, '%')</if>
</where>
</select>
<select id="selectGsCustList" resultType="com.ruoyi.group.domain.entity.GroupCustCountGongsi825">
SELECT
group_id,
cust_name,
social_credit_code,
cust_isn,
hq_cur_balance,
bz_cur_balance,
is_credit,
loan_balance_cny,
loan_year_dailyaverage,
finance_prod_716_open_flag,
finance_prod_716_balance,
finance_prod_711_open_flag,
finance_prod_711_balance,
intl_bussiness_jcbh_open_flag,
is_ustr,
ustr_count_per_m,
ustr_bal_m,
eleccharge_sign_flag,
watercharge_sign_flag,
taxdeduction_sign_flag,
pjb,
czb,
sfb,
mrb,
szst,
is_open_sts,
intl_bussiness_open_flag,
intl_bussiness_325_open_flag,
region_code,
ops_dept,
cust_type,
is_htqy,
dept_name,
outlets_id,
outlets_name,
user_name,
dept_id,
is_365zf,
is_180zf,
is_90zf,
is_30zf,
dt,
is_ph
FROM group_cust_count_gongsi_825
<where>
group_id = #{groupId}
<if test="dt != null and dt != ''">and dt = #{dt}</if>
<if test="isBranch == true">and dept_id like concat('%',concat(#{deptId},'%'))</if>
<if test="isOutlet == true">and outlets_id like concat('%',concat(#{deptId},'%'))</if>
<if test="isManager == true">and user_name like concat('%',concat(#{userName},'%'))</if>
<if test="custName != null and custName != ''">and cust_name like concat('%', #{custName}, '%')</if>
<if test="socialCreditCode != null and socialCreditCode != ''">and social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
</where>
</select>
</mapper>

View File

@@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataPageInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ibs.cmpm.domain.dto.CustLevelDTO;
import com.ruoyi.ibs.cmpm.domain.dto.CustManagerDTO;
@@ -104,6 +105,17 @@ public class GridCmpmController extends BaseController {
return success(gridCmpmService.getCustLevelListForManager());
}
@PostMapping("/custManager/export")
@Log(title = "绩效网格-管户报表异步导出", businessType = BusinessType.EXPORT)
@ApiOperation("管户报表异步导出")
public AjaxResult exportCustManager(@RequestBody(required = false) CustManagerDTO custManagerDTO) {
if (custManagerDTO == null) {
custManagerDTO = new CustManagerDTO();
}
String taskId = gridCmpmService.exportCustManagerAsync(custManagerDTO);
return AjaxResult.success("导出任务创建成功,请稍后前往下载中心下载", taskId);
}
@GetMapping("/custLevel/count")
@Log(title = "绩效网格-查询客户分层等级")
@ApiOperation("查询客户分层等级")
@@ -118,13 +130,4 @@ public class GridCmpmController extends BaseController {
return AjaxResult.success( gridCmpmCustService.selectCustInfoList (custBaseInfo)) ;
}
/**
* 根据网格类型获取客户经理列表
*/
@GetMapping("/managerList")
@Log(title = "绩效网格-获取客户经理列表")
@ApiOperation("获取客户经理列表")
public AjaxResult getManagerListByGridType(@RequestParam String gridType) {
return AjaxResult.success(gridCmpmService.getManagerListByGridType(gridType));
}
}

View File

@@ -1,7 +1,6 @@
package com.ruoyi.ibs.cmpm.domain.vo;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -24,74 +23,92 @@ public class DwbRetailCustLevelManagerDetailVO {
/** 网点号 */
@ApiModelProperty(value = "网点号")
@ExcelProperty("网点号")
private String outletId;
/** 网点名 */
@ApiModelProperty(value = "网点名")
@ExcelProperty("网点名")
private String outletName;
/** 支行号 */
@ApiModelProperty(value = "支行号")
@ExcelProperty("支行号")
private String branchId;
/** 支行名 */
@ApiModelProperty(value = "支行名")
@ExcelProperty("支行名")
private String branchName;
/** 客户名称 */
@ApiModelProperty(value = "客户名称")
@ExcelProperty("客户名称")
private String custName;
/** 客户证件号 */
@ApiModelProperty(value = "客户证件号")
@ExcelProperty("客户证件号")
private String custIdc;
/** 客户内码 */
@ApiModelProperty(value = "客户内码")
@ExcelProperty("客户内码")
private String custIsn;
/** 年龄 */
@ApiModelProperty(value = "年龄")
@ExcelProperty("年龄")
private String custAge;
/** 性别 */
@ApiModelProperty(value = "性别")
@ExcelProperty("性别")
private String custSex;
/** 联系电话 */
@ApiModelProperty(value = "联系电话")
@ExcelProperty("联系电话")
private String custPhone;
/** 联系地址 */
@ApiModelProperty(value = "联系地址")
@ExcelProperty("联系地址")
private String custAddress;
/** 总资产余额 */
@ApiModelProperty(value = "总资产余额")
@ExcelProperty("总资产余额")
private BigDecimal custAumBal;
/** 总资产余额较上月变动 */
@ApiModelProperty(value = "总资产余额较上月变动")
@ExcelProperty("总资产余额较上月变动")
private BigDecimal aumBalCompLm;
/** 总资产月日均 */
@ApiModelProperty(value = "总资产月日均")
@ExcelProperty("总资产余额月日均")
private BigDecimal custAumMonthAvg;
/** 客户星级 */
@ApiModelProperty(value = "客户星级")
@ExcelProperty("客户星级")
private String custLevel;
/** 星级较上月变动 */
@ApiModelProperty(value = "星级较上月变动")
@ExcelProperty("星级较上月变动")
private String custLevelCompLm;
/** 责任人 */
@ApiModelProperty(value = "责任人")
@ExcelProperty("责任人")
private String managerName;
/** 责任人柜员号 */
@ApiModelProperty(value = "责任人柜员号")
@ExcelProperty("责任人柜员号")
private String managerId;
}

View File

@@ -47,6 +47,11 @@ public interface GridCmpmMapper {
List<DwbRetailCustLevelManagerDetailVO> getCustManagerList(CustManagerDTO custManagerDTO);
List<DwbRetailCustLevelManagerDetailVO> getCustManagerListByPage(@Param("dto") CustManagerDTO custManagerDTO,
@Param("headId") String headId,
@Param("offset") Integer offset,
@Param("pageSize") Integer pageSize);
int getCustLevelCount(CustManagerDTO custManagerDTO);
List<CustBaseInfo> selectCustInfoFromGridCmpm(CustBaseInfo custBaseInfo);
@@ -65,30 +70,21 @@ public interface GridCmpmMapper {
List<String> selectManagerList();
/**
* 根据网格类型和总行ID查询客户经理列表
* @param gridType 网格类型零售retail、对公corporate、对公账户corporate_account
* 全量查询绩效网格客户列表(用于客群管户关系匹配,不按客户经理过滤)
* @param gridType 网格类型
* @param headId 总行ID
* @return 客户经理列表(user_name, nick_name
* @return 客户列表(包含管户关系信息
*/
List<Map<String, String>> getManagerListByGridType(@Param("gridType") String gridType, @Param("headId") String headId);
List<GridCmpmVO> getAllCustomerListForImport(@Param("gridType") String gridType, @Param("headId") String headId);
/**
* 根据网格类型、总行ID和客户经理查询客户列表分表查询适用于客群导入
* @param gridType 网格类型
* @param userName 客户经理柜员号
* 根据客户ID和类型列表查询管户关系用于动态客群更新管户关系
* @param gridType 网格类型retail/corporate
* @param headId 总行ID
* @return 客户列表
* @param custInfoList 客户信息列表包含custId和custType
* @return 客户管户关系列表
*/
List<GridCmpmVO> getCustomerListForImport(@Param("gridType") String gridType, @Param("userName") String userName, @Param("headId") String headId);
/**
* 根据网格类型、总行ID和客户经理流式查询客户列表使用Cursor适用于大数据量场景
* @param gridType 网格类型
* @param userName 客户经理柜员号
* @param headId 总行ID
* @return 客户列表游标
*/
Cursor<GridCmpmVO> getCustomerListForImportCursor(@Param("gridType") String gridType, @Param("userName") String userName, @Param("headId") String headId);
List<GridCmpmVO> getRelationshipsByCustList(@Param("gridType") String gridType, @Param("headId") String headId, @Param("custInfoList") List<Map<String, String>> custInfoList);
// List<CustBaseInfo> selectCustInfoRetailFromGridCmpm(CustBaseInfo custBaseInfo);

View File

@@ -1,11 +1,15 @@
package com.ruoyi.ibs.cmpm.service;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.ibs.cmpm.domain.dto.CustLevelDTO;
import com.ruoyi.ibs.cmpm.domain.dto.CustManagerDTO;
import com.ruoyi.ibs.cmpm.domain.dto.GridCmpmListDTO;
@@ -14,11 +18,19 @@ import com.ruoyi.ibs.cmpm.domain.vo.DwbRetailCustLevelManagerDetailVO;
import com.ruoyi.ibs.cmpm.domain.vo.DwbRetailResultVO;
import com.ruoyi.ibs.cmpm.domain.vo.GridCmpmVO;
import com.ruoyi.ibs.cmpm.mapper.GridCmpmMapper;
import com.ruoyi.ibs.task.domain.entity.ImportExportTask;
import com.ruoyi.ibs.task.mapper.ImportExportTaskMapper;
import com.ruoyi.system.enums.OssFileEnum;
import com.ruoyi.system.service.OssFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -27,6 +39,7 @@ import java.util.stream.Collectors;
* @Date 2025/10/15
**/
@Service
@Slf4j
public class GridCmpmService {
@@ -39,6 +52,15 @@ public class GridCmpmService {
@Resource
private RedisCache redisCache;
@Resource
private ImportExportTaskMapper importExportTaskMapper;
@Resource
private OssFileService ossFileService;
@Resource(name = "excelExportExecutor")
private ExecutorService executorService;
private final String CUST_LEVEL_COUNT_KEY = "GRID_CMPM_CUST_LEVEL_COUNT_";
public List<GridCmpmVO> selectManageList(GridCmpmListDTO gridCmpmRetailListDTO){
@@ -94,33 +116,32 @@ public class GridCmpmService {
}
public List<DwbRetailCustLevelManagerDetailVO> selectCustManagerList(CustManagerDTO custManagerDTO) {
String userRole = SecurityUtils.userRole();
if (userRole.equals("manager")){
//客户经理查自己
custManagerDTO.setManagerId(SecurityUtils.getUsername());
}else if (userRole.equals("outlet")){
//网点管理员查网点
custManagerDTO.setOutletId(String.valueOf(SecurityUtils.getDeptId()));
}else if (userRole.equals("branch")){
//支行管理员查支行
custManagerDTO.setBranchId(String.valueOf(SecurityUtils.getDeptId()));
}
//其他角色查全部
applyCustManagerScope(custManagerDTO);
return gridCmpmMapper.getCustManagerList(custManagerDTO);
}
public int custLevelCount(CustManagerDTO custManagerDTO) {
String userRole = SecurityUtils.userRole();
if (userRole.equals("manager")){
//客户经理查自己
custManagerDTO.setManagerId(SecurityUtils.getUsername());
}else if (userRole.equals("outlet")){
//网点管理员查网点
custManagerDTO.setOutletId(String.valueOf(SecurityUtils.getDeptId()));
}else if (userRole.equals("branch")){
//支行管理员查支行
custManagerDTO.setBranchId(String.valueOf(SecurityUtils.getDeptId()));
public String exportCustManagerAsync(CustManagerDTO custManagerDTO) {
applyCustManagerScope(custManagerDTO);
String headId = SecurityUtils.getHeadId();
ImportExportTask task = new ImportExportTask();
String taskId = IdUtils.randomUUID();
task.setId(taskId);
task.setStatus("0");
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
task.setFileName(sdf.format(now) + "管户报表导出");
task.setUserName(SecurityUtils.getUsername());
task.setCreateTime(now);
importExportTaskMapper.insert(task);
String userName = SecurityUtils.getUsername();
executorService.submit(() -> doExportCustManager(taskId, custManagerDTO, userName, headId));
return taskId;
}
public int custLevelCount(CustManagerDTO custManagerDTO) {
applyCustManagerScope(custManagerDTO);
return gridCmpmMapper.getCustLevelCount(custManagerDTO);
}
@@ -274,6 +295,64 @@ public class GridCmpmService {
return custLevelCountMap;
}
private void applyCustManagerScope(CustManagerDTO custManagerDTO) {
String userRole = SecurityUtils.userRole();
if (userRole.equals("manager")) {
custManagerDTO.setManagerId(SecurityUtils.getUsername());
} else if (userRole.equals("outlet")) {
custManagerDTO.setOutletId(String.valueOf(SecurityUtils.getDeptId()));
} else if (userRole.equals("branch")) {
custManagerDTO.setBranchId(String.valueOf(SecurityUtils.getDeptId()));
}
}
private void doExportCustManager(String taskId, CustManagerDTO custManagerDTO, String userName, String headId) {
ImportExportTask task = importExportTaskMapper.selectById(taskId);
File tempFile = null;
try {
tempFile = File.createTempFile("管户报表导出_" + taskId + "-", ".xlsx");
ExcelWriter excelWriter = EasyExcel.write(tempFile, DwbRetailCustLevelManagerDetailVO.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("管户报表").build();
int pageSize = 1000;
int pageNum = 0;
List<DwbRetailCustLevelManagerDetailVO> pageData;
do {
pageData = gridCmpmMapper.getCustManagerListByPage(custManagerDTO, headId, pageNum * pageSize, pageSize);
if (!pageData.isEmpty()) {
excelWriter.write(pageData, writeSheet);
}
pageNum++;
} while (pageData.size() == pageSize);
excelWriter.finish();
String ossUUId = ossFileService.uploadFileToOss(
OssFileEnum.CUST_MANAGER_REPORT,
tempFile,
"管户报表导出_" + taskId + ".xlsx",
userName
);
task.setStatus("1");
task.setFileUrl(ossUUId);
task.setFinishTime(new Date());
importExportTaskMapper.updateById(task);
} catch (Exception e) {
task.setStatus("2");
task.setFinishTime(new Date());
task.setErrorMsg(e.getMessage());
importExportTaskMapper.updateById(task);
} finally {
if (Objects.nonNull(tempFile)) {
boolean deleted = tempFile.delete();
if (!deleted) {
log.warn("临时文件删除失败: {}", tempFile.getAbsolutePath());
}
}
}
}
// 计算客户等级变化情况
private Map<String, Integer> calculateLevelChanges(Map<String, Integer> historyMap, Map<String, Integer> currentMap) {
Map<String, Integer> changesMap = new HashMap<>();
@@ -303,25 +382,27 @@ public class GridCmpmService {
}
/**
* 根据网格类型和总行ID查询客户经理列表
* @param gridType 网格类型零售retail、对公corporate、对公账户corporate_account
* @return 客户经理列表
* 全量查询绩效网格客户列表用于客群管户关系匹配不依赖SecurityUtils
* @param gridType 网格类型
* @param headId 总行ID
* @return 客户列表(包含管户关系信息)
*/
public List<Map<String, String>> getManagerListByGridType(String gridType) {
String headId = SecurityUtils.getHeadId();
return gridCmpmMapper.getManagerListByGridType(gridType, headId);
public List<GridCmpmVO> selectAllForImport(String gridType, String headId) {
return gridCmpmMapper.getAllCustomerListForImport(gridType, headId);
}
/**
* 根据参数查询绩效网格客户列表不依赖SecurityUtils适用于异步线程
* 所有参数由调用者传入,不在方法内部获取用户上下文
* @param gridType 网格类型
* @param userName 客户经理柜员号
* 根据客户ID列表查询管户关系用于动态客群更新管户关系
* @param gridType 网格类型retail/corporate
* @param headId 总行ID
* @return 客户列表
* @param custInfoList 客户信息列表包含custId和custType
* @return 客户管户关系列表
*/
public List<GridCmpmVO> selectManageListForImport(String gridType, String userName, String headId) {
return gridCmpmMapper.getCustomerListForImport(gridType, userName, headId);
public List<GridCmpmVO> getRelationshipsByCustList(String gridType, String headId, List<Map<String, String>> custInfoList) {
if (custInfoList == null || custInfoList.isEmpty()) {
return new ArrayList<>();
}
return gridCmpmMapper.getRelationshipsByCustList(gridType, headId, custInfoList);
}
}

View File

@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ibs.draw.domain.dto.grid.DrawGridCustListDTO;
import com.ruoyi.ibs.draw.domain.entity.DrawGridCustUserUnbind;
import com.ruoyi.ibs.draw.domain.vo.DrawGridCustVO;
import com.ruoyi.ibs.grid.domain.entity.RegionCustUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -19,14 +17,4 @@ public interface DrawGridCustUserUnbindMapper extends BaseMapper<DrawGridCustUse
List<DrawGridCustVO> getCustList(DrawGridCustListDTO drawGridCustListDTO);
List<DrawGridCustVO> getCustListByManager(DrawGridCustListDTO drawGridCustListDTO);
/**
* 根据绘制网格ID查询所有客户用于客群导入拼接headId绕过拦截器
* @param gridId 绘制网格ID
* @param headId 总行机构号前三位(用于拼接动态表名)
* @return 客户列表
*/
List<RegionCustUser> selectCustByDrawGridId(@Param("gridId") Long gridId, @Param("headId") String headId);
}

View File

@@ -2,11 +2,11 @@ package com.ruoyi.ibs.draw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ibs.draw.domain.entity.DrawGridShapeRelate;
import com.ruoyi.ibs.grid.domain.entity.RegionCustUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @Author 吴凯程
@@ -23,10 +23,7 @@ public interface DrawGridShapeRelateMapper extends BaseMapper<DrawGridShapeRelat
List<DrawGridShapeRelate> selectByGridId(@Param("gridId") Long gridId);
/**
* 根据网格ID查询所有客户用于客群导入直接拼接headId绕过拦截器
* @param gridId 网格ID
* @param headId 部门代码(用于拼接动态表名)
* @return 客户列表,包含 custId, custName, custType
* 根据绘制网格ID查询所有客户用于客群导入直接拼接headId绕过拦截器
*/
List<Map<String, Object>> selectCustListByGridId(@Param("gridId") Long gridId, @Param("headId") String headId);
List<RegionCustUser> selectCustByDrawGridId(@Param("gridId") Long gridId, @Param("headId") String headId);
}

View File

@@ -1,56 +1,68 @@
package com.ruoyi.ibs.grid.controller;
import com.github.pagehelper.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataPageInfo;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshouNew825;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshouNew825;
import com.ruoyi.ibs.grid.service.GridCountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Api(tags = "网格汇总")
@RestController
@RequestMapping("/ibs/GridCount/")
public class GridCountController extends BaseController {
@Autowired
GridCountService service;
private GridCountService service;
@ApiOperation(value = "查询零售汇总网格列表")
@GetMapping("LsList")
public TableDataPageInfo<GridCmpmCountLingshou> selectLsCountList(String town, String village,String dt) {
public TableDataPageInfo<?> selectLsCountList(String town, String village, String dt) {
Page<Object> page = startPage();
List<GridCmpmCountLingshou> list = service.selectLsCountList(town, village,dt);
if (isNewRetailTenant()) {
List<GridCmpmCountLingshouNew825> list = service.selectLsCountListNew825(town, village, dt);
return getDataTable(list, page);
}
List<GridCmpmCountLingshou> list = service.selectLsCountList(town, village, dt);
return getDataTable(list, page);
}
@ApiOperation(value = "查询公司汇总网格列表")
@GetMapping("GsList")
public TableDataPageInfo<GridCmpmCountGongsi> selectGsCountList(String town, String village,String dt) {
public TableDataPageInfo<GridCmpmCountGongsi> selectGsCountList(String town, String village, String dt) {
Page<Object> page = startPage();
List<GridCmpmCountGongsi> list = service.selectGsCountList(town, village,dt);
List<GridCmpmCountGongsi> list = service.selectGsCountList(town, village, dt);
return getDataTable(list, page);
}
@ApiOperation(value = "导出零售汇总网格", produces = "application/octet-stream")
@GetMapping("exportLs")
public void exportLs(HttpServletResponse response, String town, String village,String dt) {
public void exportLs(HttpServletResponse response, String town, String village, String dt) {
try {
if (isNewRetailTenant()) {
ExcelUtil<GridCmpmCountLingshouNew825> util = new ExcelUtil<>(GridCmpmCountLingshouNew825.class);
util.exportExcel(response, service.selectLsCountListNew825(town, village, dt), "零售网格汇总");
return;
}
ExcelUtil<GridCmpmCountLingshou> util = new ExcelUtil<>(GridCmpmCountLingshou.class);
util.exportExcel(response, service.selectLsCountList(town, village,dt), "零售网格汇总");
util.exportExcel(response, service.selectLsCountList(town, village, dt), "零售网格汇总");
} catch (Exception e) {
e.printStackTrace();
}
@@ -59,10 +71,10 @@ public class GridCountController extends BaseController {
@Log(title = "导出公司汇总网格")
@ApiOperation(value = "导出公司汇总网格", produces = "application/octet-stream")
@GetMapping("exportGs")
public void exportGs(HttpServletResponse response, String town, String village,String dt) {
public void exportGs(HttpServletResponse response, String town, String village, String dt) {
try {
ExcelUtil<GridCmpmCountGongsi> util = new ExcelUtil<>(GridCmpmCountGongsi.class);
util.exportExcel(response, service.selectGsCountList(town, village,dt), "公司网格汇总");
util.exportExcel(response, service.selectGsCountList(town, village, dt), "公司网格汇总");
} catch (Exception e) {
e.printStackTrace();
}
@@ -71,45 +83,55 @@ public class GridCountController extends BaseController {
@Log(title = "查询零售客户明细")
@ApiOperation(value = "查询零售客户明细")
@GetMapping("LsCustList")
public TableDataPageInfo<GridCustCountLingshou> selectLsCustList(@RequestParam String regionCode, String custName, String custIdc,String dt) {
public TableDataPageInfo<?> selectLsCustList(@RequestParam String regionCode, String custName, String custIdc, String dt) {
Page<Object> page = startPage();
List<GridCustCountLingshou> list = service.selectLsCustList(regionCode, custName, custIdc,dt);
if (isNewRetailTenant()) {
List<GridCustCountLingshouNew825> list = service.selectLsCustListNew825(regionCode, custName, custIdc, dt);
return getDataTable(list, page);
}
List<GridCustCountLingshou> list = service.selectLsCustList(regionCode, custName, custIdc, dt);
return getDataTable(list, page);
}
@Log(title = "查询公司客户明细")
@ApiOperation(value = "查询公司客户明细")
@GetMapping("GsCustList")
public TableDataPageInfo<GridCustCountGongsi> selectGsCustList(@RequestParam String regionCode, String custName, String socialCreditCode,String dt) {
public TableDataPageInfo<GridCustCountGongsi> selectGsCustList(@RequestParam String regionCode, String custName, String socialCreditCode, String dt) {
Page<Object> page = startPage();
List<GridCustCountGongsi> list = service.selectGsCustList(regionCode, custName, socialCreditCode,dt);
List<GridCustCountGongsi> list = service.selectGsCustList(regionCode, custName, socialCreditCode, dt);
return getDataTable(list, page);
}
@Log(title = "导出零售客户明细")
@ApiOperation(value = "导出零售客户明细", produces = "application/octet-stream")
@GetMapping("exportLsCust")
public void exportLsCust(HttpServletResponse response, @RequestParam String regionCode, String custName, String custIdc,String dt) {
public void exportLsCust(HttpServletResponse response, @RequestParam String regionCode, String custName, String custIdc, String dt) {
try {
if (isNewRetailTenant()) {
ExcelUtil<GridCustCountLingshouNew825> util = new ExcelUtil<>(GridCustCountLingshouNew825.class);
util.exportExcel(response, service.selectLsCustListNew825(regionCode, custName, custIdc, dt), "网格客户明细");
return;
}
ExcelUtil<GridCustCountLingshou> util = new ExcelUtil<>(GridCustCountLingshou.class);
util.exportExcel(response, service.selectLsCustList(regionCode, custName, custIdc,dt), "网格客户明细");
util.exportExcel(response, service.selectLsCustList(regionCode, custName, custIdc, dt), "网格客户明细");
} catch (Exception e) {
e.printStackTrace();
}
}
@Log(title = "导出公司客户明细")
@ApiOperation(value = "导出公司客户明细", produces = "application/octet-stream")
@GetMapping("exportGsCust")
public void exportGsCust(HttpServletResponse response, @RequestParam String regionCode, String custName, String socialCreditCode,String dt) {
public void exportGsCust(HttpServletResponse response, @RequestParam String regionCode, String custName, String socialCreditCode, String dt) {
try {
ExcelUtil<GridCustCountGongsi> util = new ExcelUtil<>(GridCustCountGongsi.class);
util.exportExcel(response, service.selectGsCustList(regionCode, custName, socialCreditCode,dt), "网格客户明细");
util.exportExcel(response, service.selectGsCustList(regionCode, custName, socialCreditCode, dt), "网格客户明细");
} catch (Exception e) {
e.printStackTrace();
}
}
private boolean isNewRetailTenant() {
return SecurityUtils.getDeptId().toString().startsWith("825");
}
}

View File

@@ -0,0 +1,115 @@
package com.ruoyi.ibs.grid.domain.entity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* 网格汇总统计_零售825专用对象 grid_cmpm_count_lingshou_new_825
*/
@Data
public class GridCmpmCountLingshouNew825 implements Serializable {
private static final long serialVersionUID = 1L;
@Excel(name = "统计日期")
private String dt;
@Excel(name = "一级网格名称")
private String gridName;
@Excel(name = "二级网格名称")
private String gridName2;
@Excel(name = "县/区")
private String county;
@Excel(name = "镇/街道")
private String town;
@Excel(name = "村/社区")
private String village;
@Excel(name = "归属支行机构号")
private String deptId;
@Excel(name = "归属支行名称")
private String deptName;
@Excel(name = "归属网点机构号")
private String outletsId;
@Excel(name = "归属网点名称")
private String outletsName;
@Excel(name = "归属客户经理")
private String userName;
@Excel(name = "入格客户数")
private Integer custNum;
@Excel(name = "近365天已走访人数")
private String zf365cnt;
@Excel(name = "近180天已走访人数")
private String zf180cnt;
@Excel(name = "近90天已走访人数")
private String zf90cnt;
@Excel(name = "近30天已走访人数")
private String zf30cnt;
@Excel(name = "近365天走访率")
private String zf365rt;
@Excel(name = "近180天走访率")
private String zf180rt;
@Excel(name = "近90天走访率")
private String zf90rt;
@Excel(name = "近30天走访率")
private String zf30rt;
@Excel(name = "活期存款余额(元)")
private String curBalD;
@Excel(name = "授信率(%")
private String sxRat;
@Excel(name = "用信覆盖率")
private String yxRat;
@Excel(name = "授信户数")
private Integer sxNum;
@Excel(name = "用信户数")
private Integer yxNum;
@Excel(name = "授信金额(合同)")
private String sxBal;
@Excel(name = "贷款余额(元)")
private String balLoan;
@Excel(name = "贷款年日均(元)")
private String loanAve;
@Excel(name = "合同签约率(%")
private String yxhtRat;
@Excel(name = "代扣电费覆盖率(%")
private String dianRat;
@Excel(name = "代扣水费率(%")
private String shuiRat;
@Excel(name = "代扣税费率(%")
private String taxRat;
@Excel(name = "开户率(%")
private String openRat;
@Excel(name = "合同签约客户数")
private Integer yxhtNum;
@Excel(name = "代扣电费客户数")
private Integer dianNum;
@Excel(name = "代扣水费客户数")
private Integer shuiNum;
@Excel(name = "代扣税费数")
private Integer taxNum;
@Excel(name = "开户数")
private Integer openNum;
@Excel(name = "存款余额(元)")
private String depBal;
@Excel(name = "财富余额(元)")
private String finBal;
@Excel(name = "个人核心客户数")
private Integer grhxNum;
@Excel(name = "财富有效客户数")
private Integer cfyxNum;
@Excel(name = "有效信用卡数")
private Integer yxxykNum;
@Excel(name = "有效社保卡户数")
private Integer yxsbkNum;
@Excel(name = "有效社保卡新增")
private Integer twoTo3SbkNum;
@Excel(name = "养老金迁移至社保卡户数")
private Integer yljToSbkNum;
@Excel(name = "丰收互联客户数")
private Integer fshlNum;
@Excel(name = "有效收单商户")
private Integer yxsdNum;
@Excel(name = "核心收单户数")
private Integer hxsdNum;
private String regionCode;
private String opsDept;
}

View File

@@ -0,0 +1,77 @@
package com.ruoyi.ibs.grid.domain.entity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* 客户明细统计_零售825专用对象 grid_cust_count_lingshou_new_825
*/
@Data
public class GridCustCountLingshouNew825 implements Serializable {
private static final long serialVersionUID = 1L;
@Excel(name = "客户名称")
private String custName;
@Excel(name = "客户证件号")
private String custIdc;
@Excel(name = "客户内码")
private String custIsn;
@Excel(name = "活期存款余额")
private String curBalD;
@Excel(name = "贷款余额")
private String balLoan;
@Excel(name = "贷款年日均")
private String loanAve;
@Excel(name = "是否授信")
private String isSx;
@Excel(name = "是否用信")
private String isYx;
@Excel(name = "授信金额")
private String sxBal;
@Excel(name = "是否合同签约")
private String isYxht;
@Excel(name = "是否持有信用卡")
private String isXyk;
@Excel(name = "是否开通丰收互联")
private String fshl;
@Excel(name = "是否办理收单")
private String isSd;
@Excel(name = "是否代扣电费")
private String dian;
@Excel(name = "是否代扣水费")
private String shui;
@Excel(name = "是否代扣税费")
private String tax;
@Excel(name = "开户数")
private String openNum;
@Excel(name = "存款余额")
private String depBal;
@Excel(name = "财富余额")
private String finBal;
@Excel(name = "是否个人核心客户")
private String isGrhx;
@Excel(name = "是否财富有效客户")
private String isCfyx;
@Excel(name = "是否有效社保卡客户")
private String isYxsbk;
@Excel(name = "是否有效社保卡新增")
private String is2to3Sbk;
@Excel(name = "是否养老金迁移至社保卡")
private String isYljToSbk;
@Excel(name = "是否核心收单")
private String isHxsd;
private String regionCode;
private String opsDept;
private String custType;
@Excel(name = "近365天有无走访")
private String is365zf;
@Excel(name = "近180天有无走访")
private String is180zf;
@Excel(name = "近90天有无走访")
private String is90zf;
@Excel(name = "近30天有无走访")
private String is30zf;
private String dt;
}

View File

@@ -2,8 +2,10 @@ package com.ruoyi.ibs.grid.mapper;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshouNew825;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshouNew825;
import org.apache.ibatis.annotations.Mapper;
import java.util.HashMap;
@@ -12,10 +14,12 @@ import java.util.List;
@Mapper
public interface GridCountMapper {
List<GridCmpmCountLingshou> selectLsCountList(HashMap<String, Object> paramMap);
List<GridCmpmCountLingshouNew825> selectLsCountListNew825(HashMap<String, Object> paramMap);
List<GridCmpmCountGongsi> selectGsCountList(HashMap<String, Object> paramMap);
List<GridCustCountLingshou> selectLsCustList(HashMap<String, Object> paramMap);
List<GridCustCountLingshouNew825> selectLsCustListNew825(HashMap<String, Object> paramMap);
List<GridCustCountGongsi> selectGsCustList(HashMap<String, Object> paramMap);
}

View File

@@ -2,18 +2,22 @@ package com.ruoyi.ibs.grid.service;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshouNew825;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshouNew825;
import java.util.List;
public interface GridCountService {
List<GridCmpmCountLingshou> selectLsCountList(String town,String village,String dt);
List<GridCmpmCountLingshouNew825> selectLsCountListNew825(String town, String village, String dt);
List<GridCmpmCountGongsi> selectGsCountList(String town, String village,String dt);
List<GridCustCountLingshou> selectLsCustList(String regionCode, String custName, String custIdc,String dt);
List<GridCustCountLingshouNew825> selectLsCustListNew825(String regionCode, String custName, String custIdc, String dt);
List<GridCustCountGongsi> selectGsCustList(String regionCode, String custName, String socialCreditCode,String dt);
}

View File

@@ -3,8 +3,10 @@ package com.ruoyi.ibs.grid.service.impl;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshouNew825;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountGongsi;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshou;
import com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshouNew825;
import com.ruoyi.ibs.grid.mapper.GridCountMapper;
import com.ruoyi.ibs.grid.service.GridCountService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +23,15 @@ public class GridCountServiceimpl implements GridCountService {
@Override
public List<GridCmpmCountLingshou> selectLsCountList(String town,String village,String dt) {
return mapper.selectLsCountList(buildLsCountParams(town, village, dt));
}
@Override
public List<GridCmpmCountLingshouNew825> selectLsCountListNew825(String town, String village, String dt) {
return mapper.selectLsCountListNew825(buildLsCountParams(town, village, dt));
}
private HashMap<String, Object> buildLsCountParams(String town, String village, String dt) {
HashMap<String, Object> paramMap = new HashMap<>();
if(SecurityUtils.userRole().equals("branch")){
paramMap.put("isBranch",true);
@@ -36,7 +47,7 @@ public class GridCountServiceimpl implements GridCountService {
paramMap.put("town",town);
paramMap.put("village",village);
paramMap.put("dt",dt);
return mapper.selectLsCountList(paramMap);
return paramMap;
}
@Override
@@ -65,6 +76,15 @@ public class GridCountServiceimpl implements GridCountService {
@Override
public List<GridCustCountLingshou> selectLsCustList(String regionCode, String custName, String custIdc,String dt) {
return mapper.selectLsCustList(buildLsCustParams(regionCode, custName, custIdc, dt));
}
@Override
public List<GridCustCountLingshouNew825> selectLsCustListNew825(String regionCode, String custName, String custIdc, String dt) {
return mapper.selectLsCustListNew825(buildLsCustParams(regionCode, custName, custIdc, dt));
}
private HashMap<String, Object> buildLsCustParams(String regionCode, String custName, String custIdc, String dt) {
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("deptId",SecurityUtils.getDeptId());
paramMap.put("userName",SecurityUtils.getUsername());
@@ -72,7 +92,7 @@ public class GridCountServiceimpl implements GridCountService {
paramMap.put("custName",custName);
paramMap.put("custIdc",custIdc);
paramMap.put("dt",dt);
return mapper.selectLsCustList(paramMap);
return paramMap;
}
@Override

View File

@@ -312,6 +312,13 @@ public class SysCampaignController extends BaseController {
.stream().collect(HashMap::new, (m, v) -> m.put(v.getUuid(),v.getModelName()), HashMap::putAll)));
}
@PostMapping("/updateVisitInfoFeedback")
@ApiOperation("更新PAD走访反馈")
@Log(title ="pad走访记录-更新走访反馈", businessType = BusinessType.UPDATE)
public AjaxResult updateVisitInfoFeedback(@RequestBody VisitInfoFeedbackUpdateDTO updateDTO) {
return toAjax(sysCampaignService.updateVisitInfoFeedback(updateDTO));
}
@PostMapping("/delete")
@ApiOperation("根据campaignId删除任务")
@Log(title = "走访-根据campaignId删除任务")

View File

@@ -0,0 +1,19 @@
package com.ruoyi.ibs.list.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class VisitFeedbackItemDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "反馈类型")
private String feedbackType;
@ApiModelProperty(value = "反馈产品列表")
private List<String> products;
}

View File

@@ -117,4 +117,40 @@ public class VisitInfo {
@ApiModelProperty(value = "走访备注")
private String remark;
@ApiModelProperty(value = "互动地址")
private String interAddr;
@ApiModelProperty(value = "协同员工名称")
private String colStafName;
@ApiModelProperty(value = "后续备注")
private String laterNote;
@ApiModelProperty(value = "意向产品值")
private String intentionProductValue;
@ApiModelProperty(value = "反馈状态")
private String feedbackStatus;
@ApiModelProperty(value = "走访来源")
private String sourceOfInterview;
@ApiModelProperty(value = "文件名")
private String filename;
@ApiModelProperty(value = "外呼状态")
private String outCallStatus;
@ApiModelProperty(value = "外呼意向")
private String outCallIntention;
@ApiModelProperty(value = "来源")
private String source;
@ApiModelProperty(value = "分析值")
private String analysisValue;
@ApiModelProperty(value = "设备")
private String facility;
}

View File

@@ -13,6 +13,10 @@ public class VisitInfoDTO {
@ApiModelProperty(value = "柜员名称")
private String visName;
/** 柜员号 */
@ApiModelProperty(value = "柜员号")
private String visId;
/** 走访时间 */
@ApiModelProperty(value = "走访时间")
private String visTime;
@@ -29,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;

View File

@@ -0,0 +1,34 @@
package com.ruoyi.ibs.list.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class VisitInfoFeedbackUpdateDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "走访记录ID")
private Long id;
@ApiModelProperty(value = "走访渠道")
private String source;
@ApiModelProperty(value = "走访备注")
private String remark;
@ApiModelProperty(value = "客户意愿结构化数据")
private List<VisitFeedbackItemDTO> feedbackItems;
@ApiModelProperty(value = "客户意愿拼接值")
private String intentionProductValue;
private String userName;
private String userRole;
private String deptId;
}

View File

@@ -128,4 +128,40 @@ public class VisitInfoVO {
@ApiModelProperty(value = "走访结果")
private String interRes;
@ApiModelProperty(value = "实地拜访地址")
private String interAddr;
@ApiModelProperty(value = "协同走访客户经理")
private String colStafName;
@ApiModelProperty(value = "事后备注")
private String laterNote;
@ApiModelProperty(value = "走访反馈")
private String intentionProductValue;
@ApiModelProperty(value = "反馈状态")
private String feedbackStatus;
@ApiModelProperty(value = "走访来源")
private String sourceOfInterview;
@ApiModelProperty(value = "批量导入文件名")
private String filename;
@ApiModelProperty(value = "外呼状态")
private String outCallStatus;
@ApiModelProperty(value = "客户意愿")
private String outCallIntention;
@ApiModelProperty(value = "走访来源1nullpad 2企业微信 3pc")
private String source;
@ApiModelProperty(value = "nlp模型提取")
private String analysisValue;
@ApiModelProperty(value = "预授信额度")
private String facility;
}

View File

@@ -156,6 +156,10 @@ public interface SysCampaignMapper extends BaseMapper<SysCampaign> {
List<VisitInfoVO> selectVisitInfoList(VisitInfoDTO visitInfoDTO);
List<VisitInfoVO> selectVisitInfoList875(VisitInfoDTO visitInfoDTO);
int updateVisitInfoFeedback(VisitInfoFeedbackUpdateDTO updateDTO);
@Update("UPDATE sys_campaign SET del_flag = '2' where campaign_id = #{campaignId}")
int deleteSysCampaignByCampaignId(@Param("campaignId") String campaignId);

View File

@@ -115,5 +115,7 @@ public interface ISysCampaignService {
public List<VisitInfoVO> selectVisitInfoVoList(VisitInfoDTO visitInfoDTO);
int updateVisitInfoFeedback(VisitInfoFeedbackUpdateDTO updateDTO);
public int deleteSysCampaign(String campaignId);
}

View File

@@ -2175,9 +2175,31 @@ 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);
}
@Override
public int updateVisitInfoFeedback(VisitInfoFeedbackUpdateDTO updateDTO) {
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(deptId);
updateDTO.setSource(StringUtils.trimToNull(updateDTO.getSource()));
updateDTO.setRemark(StringUtils.trimToNull(updateDTO.getRemark()));
updateDTO.setIntentionProductValue(buildIntentionProductValue(updateDTO.getFeedbackItems()));
int rows = sysCampaignMapper.updateVisitInfoFeedback(updateDTO);
return rows;
}
@Override
public int deleteSysCampaign(String campaignId) {
SysCampaign sysCampaign = sysCampaignMapper.selectSysCampaignByCampaignId(campaignId);
@@ -2186,4 +2208,28 @@ public class SysCampaignServiceImpl implements ISysCampaignService
}
return sysCampaignMapper.deleteSysCampaignByCampaignId(campaignId);
}
private String buildIntentionProductValue(List<VisitFeedbackItemDTO> feedbackItems) {
if (feedbackItems == null || feedbackItems.isEmpty()) {
return null;
}
String joinedValue = feedbackItems.stream()
.filter(Objects::nonNull)
.map(item -> {
String feedbackType = StringUtils.trimToNull(item.getFeedbackType());
List<String> products = Optional.ofNullable(item.getProducts())
.orElse(Collections.emptyList())
.stream()
.map(StringUtils::trimToNull)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toList());
if (feedbackType == null || products.isEmpty()) {
return null;
}
return feedbackType + ":" + String.join(",", products);
})
.filter(Objects::nonNull)
.collect(Collectors.joining(";"));
return StringUtils.trimToNull(joinedValue);
}
}

View File

@@ -1,12 +1,15 @@
package com.ruoyi.ibs.task.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.github.pagehelper.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.page.TableDataPageInfo;
import com.ruoyi.ibs.task.domain.dto.AlterForwardRequest;
import com.ruoyi.ibs.task.domain.dto.WorkRecordDTO;
import com.ruoyi.ibs.task.domain.entity.Alter;
import com.ruoyi.ibs.task.domain.entity.AlterConfig;
@@ -95,12 +98,37 @@ public class WorkRecordController extends BaseController {
@GetMapping("/alter/allList")
@Log(title = "工作台-查询预警信息")
@ApiOperation("查询所有预警信息")
public TableDataPageInfo<AlterVO> allAlterList(String status, String alterType) {
public TableDataPageInfo<AlterVO> allAlterList(String status, String alterType, String forwardFlag) {
Page<Object> page = startPage();
List<AlterVO> list = workRecordService.getAllAlterList(status, alterType);
List<AlterVO> list = workRecordService.getAllAlterList(status, alterType, forwardFlag);
return getDataTable(list, page);
}
@GetMapping("/alter/forward/meta")
@Log(title = "工作台-查询预警转发元数据")
@ApiOperation("查询预警转发元数据")
public AjaxResult getAlterForwardMeta(@RequestParam String ids) {
List<Long> idList = Arrays.stream(ids.split(","))
.filter(org.apache.commons.lang3.StringUtils::isNotBlank)
.map(Long::valueOf)
.collect(Collectors.toList());
return AjaxResult.success(workRecordService.getAlterForwardMeta(idList));
}
@PostMapping("/alter/forward")
@Log(title = "工作台-转发预警信息")
@ApiOperation("批量转发预警信息")
public AjaxResult forwardAlter(@Validated @RequestBody AlterForwardRequest request) {
AlterForwardResultVO result = workRecordService.forwardAlter(request);
if (result.getSuccessCount() > 0 && result.getFailCount() > 0) {
return AjaxResult.success("成功转发" + result.getSuccessCount() + "条,失败" + result.getFailCount() + "", result);
}
if (result.getSuccessCount() > 0) {
return AjaxResult.success("成功转发" + result.getSuccessCount() + "", result);
}
return AjaxResult.error("未能成功转发,失败" + result.getFailCount() + "");
}
@GetMapping("/alter/count")
@Log(title = "工作台-查询预警推送次数")
@ApiOperation("查询预警推送次数")

View File

@@ -0,0 +1,23 @@
package com.ruoyi.ibs.task.domain.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
public class AlterForwardRequest {
@NotEmpty(message = "请选择需要转发的预警")
private List<Long> ids;
@NotBlank(message = "请选择转发目标类型")
private String targetType;
private Long deptId;
private String userName;
private Boolean useHistory;
}

View File

@@ -0,0 +1,19 @@
package com.ruoyi.ibs.task.domain.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class ForwardTarget {
private String targetType;
private Long deptId;
private String userName;
private String nickName;
private String targetName;
}

View File

@@ -0,0 +1,53 @@
package com.ruoyi.ibs.task.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName("alter_assign_history")
public class AlterAssignHistory implements Serializable {
@TableId(type = IdType.AUTO)
private Long id;
@ApiModelProperty("预警类型")
private String alterType;
@ApiModelProperty("客户号")
private String custId;
@ApiModelProperty("客户姓名")
private String custName;
@ApiModelProperty("所属支行/当前操作机构ID")
private Long deptId;
@ApiModelProperty("最近一次转发目标类型dept/user")
private String lastAssignTargetType;
@ApiModelProperty("最近一次转发目标部门ID")
private Long lastAssignTargetDeptId;
@ApiModelProperty("最近一次转发目标用户账号")
private String lastAssignTargetUser;
@ApiModelProperty("最近一次转发目标名称")
private String lastAssignTargetName;
@ApiModelProperty("最近一次转发操作人账号")
private String lastAssignByUser;
@ApiModelProperty("最近一次转发操作人角色")
private String lastAssignByRole;
@ApiModelProperty("更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
}

View File

@@ -94,4 +94,8 @@ public class WorkRecord implements Serializable {
@ApiModelProperty(value = "是否逾期", notes = "")
private Integer isOverdue;
/** 当前承接部门ID仅转发到网点时使用 */
@ApiModelProperty(value = "当前承接部门ID", notes = "")
private Long deptId;
}

View File

@@ -0,0 +1,14 @@
package com.ruoyi.ibs.task.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AlterAssignTargetVO {
@ApiModelProperty("目标编码")
private String targetCode;
@ApiModelProperty("目标名称")
private String targetName;
}

View File

@@ -0,0 +1,32 @@
package com.ruoyi.ibs.task.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class AlterForwardMetaVO {
@ApiModelProperty("可选网点列表")
private List<AlterAssignTargetVO> deptOptions = new ArrayList<>();
@ApiModelProperty("可选客户经理列表")
private List<AlterAssignTargetVO> userOptions = new ArrayList<>();
@ApiModelProperty("历史推荐目标类型dept/user")
private String recommendedTargetType;
@ApiModelProperty("历史推荐目标编码")
private String recommendedTargetCode;
@ApiModelProperty("历史推荐目标名称")
private String recommendedTargetName;
@ApiModelProperty("是否仅允许按历史推荐转发")
private Boolean historyOnly = false;
@ApiModelProperty("是否存在历史推荐")
private Boolean hasHistoryRecommend = false;
}

View File

@@ -0,0 +1,14 @@
package com.ruoyi.ibs.task.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AlterForwardResultVO {
@ApiModelProperty("成功数量")
private int successCount;
@ApiModelProperty("失败数量")
private int failCount;
}

View File

@@ -47,6 +47,14 @@ public class AlterVO {
@ApiModelProperty(value = "客户内码", notes = "")
private String custIsn;
/** 当前承接部门ID */
@ApiModelProperty(value = "当前承接部门ID", notes = "")
private Long deptId;
/** 当前承接网点名称 */
@ApiModelProperty(value = "当前承接网点名称", notes = "")
private String deptName;
/** 状态 */
@ApiModelProperty(value = "状态", notes = "")
private String status;
@@ -62,4 +70,12 @@ public class AlterVO {
/** 是否需要反馈 */
@ApiModelProperty(value = "是否需要反馈", notes = "")
private String isFeedback;
/** 转发标识1需要转发0无需转发 */
@ApiModelProperty(value = "转发标识", notes = "")
private String forwardFlag;
/** 是否可转发 */
@ApiModelProperty(value = "是否可转发", notes = "")
private Boolean canForward;
}

View File

@@ -0,0 +1,9 @@
package com.ruoyi.ibs.task.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ibs.task.domain.entity.AlterAssignHistory;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AlterAssignHistoryMapper extends BaseMapper<AlterAssignHistory> {
}

View File

@@ -6,9 +6,9 @@ import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ibs.task.domain.entity.WorkRecord;
import com.ruoyi.ibs.task.domain.dto.WorkRecordDTO;
import com.ruoyi.ibs.task.domain.entity.AlterConfig;
import com.ruoyi.ibs.task.domain.entity.WorkRecord;
import com.ruoyi.ibs.task.domain.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -86,10 +86,26 @@ public interface WorkRecordMapper extends BaseMapper<WorkRecord> {
* @return 预警信息
*/
List<AlterVO> selectAllAlterList(@Param("deptId") String deptId, @Param("role") String role,
@Param("status") String status, @Param("alterType") String alterType, @Param("username") String username);
@Param("status") String status, @Param("alterType") String alterType,
@Param("username") String username, @Param("forwardFlag") String forwardFlag);
AlterCountVO selectAlterCount(@Param("reportTime") Date reportTime, @Param("role") String role, @Param("deptId") String deptId);
List<AlterAssignTargetVO> selectForwardDeptTargets(@Param("branchDeptId") Long branchDeptId);
List<AlterAssignTargetVO> selectForwardUserTargets(@Param("deptId") Long deptId, @Param("role") String role);
int updateAlterForwardToDept(@Param("id") Long id, @Param("sourceUserName") String sourceUserName,
@Param("targetDeptId") Long targetDeptId, @Param("updateBy") String updateBy);
int updateAlterForwardToUserByBranch(@Param("id") Long id, @Param("sourceUserName") String sourceUserName,
@Param("targetUserName") String targetUserName, @Param("targetNickName") String targetNickName,
@Param("updateBy") String updateBy);
int updateAlterForwardToUserByOutlet(@Param("id") Long id, @Param("sourceDeptId") Long sourceDeptId,
@Param("targetUserName") String targetUserName, @Param("targetNickName") String targetNickName,
@Param("updateBy") String updateBy);
/**
* 设置工作清单为过期
*

View File

@@ -5,6 +5,7 @@ import java.util.List;
import com.ruoyi.common.core.page.TableDataPageInfo;
import com.ruoyi.ibs.task.domain.dto.WorkRecordDTO;
import com.ruoyi.ibs.task.domain.dto.AlterForwardRequest;
import com.ruoyi.ibs.task.domain.entity.AlterConfig;
import com.ruoyi.ibs.task.domain.entity.WorkRecord;
import com.ruoyi.ibs.task.domain.vo.*;
@@ -61,7 +62,23 @@ public interface WorkRecordService{
* @param alterType
* @return
*/
List<AlterVO> getAllAlterList(String status, String alterType);
List<AlterVO> getAllAlterList(String status, String alterType, String forwardFlag);
/**
* 获取预警转发元数据
*
* @param id 预警ID
* @return 转发元数据
*/
AlterForwardMetaVO getAlterForwardMeta(List<Long> ids);
/**
* 批量转发预警
*
* @param request 转发请求
* @return 结果
*/
AlterForwardResultVO forwardAlter(AlterForwardRequest request);
/**
* 定时任务生成工作清单
*

View File

@@ -11,20 +11,29 @@ import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.Page;
import com.ruoyi.common.core.page.TableDataPageInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.ibs.task.domain.dto.AlterForwardRequest;
import com.ruoyi.ibs.task.domain.dto.ForwardTarget;
import com.ruoyi.ibs.task.domain.dto.WorkRecordDTO;
import com.ruoyi.ibs.task.domain.entity.AlterAssignHistory;
import com.ruoyi.ibs.task.domain.entity.AlterConfig;
import com.ruoyi.ibs.task.domain.entity.WorkRecord;
import com.ruoyi.ibs.task.domain.vo.*;
import com.ruoyi.ibs.task.mapper.AlterAssignHistoryMapper;
import com.ruoyi.ibs.task.mapper.WorkRecordMapper;
import com.ruoyi.ibs.task.service.WorkRecordService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -41,16 +50,31 @@ import org.springframework.transaction.annotation.Transactional;
public class WorkRecordServiceImpl implements WorkRecordService {
private final static String alterTypesRedisKey = "work:record:alter:types";
private static final String ROLE_MANAGER = "manager";
private static final String ROLE_BRANCH = "branch";
private static final String ROLE_OUTLET = "outlet";
private static final String TARGET_TYPE_DEPT = "dept";
private static final String TARGET_TYPE_USER = "user";
private static final Set<String> FORWARD_ALTER_TYPES = new HashSet<>(Arrays.asList(
"个人资产客户定期存款",
"个人资产客户封闭式理财"
));
@Autowired
private WorkRecordMapper workRecordMapper;
@Autowired
private AlterAssignHistoryMapper alterAssignHistoryMapper;
@Autowired
private ISysPostService sysPostService;
@Autowired
private ISysDeptService sysDeptService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private RedisCache redisCache;
@@ -143,7 +167,9 @@ public class WorkRecordServiceImpl implements WorkRecordService {
@Transactional(rollbackFor = Exception.class)
public List<AlterVO> getAlterList(String status, String alterType) {
String username = SecurityUtils.getUsername();
return workRecordMapper.selectAlterList(username, status, alterType);
List<AlterVO> alterVOS = workRecordMapper.selectAlterList(username, status, alterType);
fillAlterExtFields(alterVOS);
return alterVOS;
}
/**
@@ -156,27 +182,98 @@ public class WorkRecordServiceImpl implements WorkRecordService {
* @return 预警信息
*/
@Override
public List<AlterVO> getAllAlterList(String status, String alterType) {
List<AlterVO> alterVOS = workRecordMapper.selectAllAlterList(String.valueOf(SecurityUtils.getDeptId()), SecurityUtils.userRole(), status, alterType, SecurityUtils.getUsername());
// 将 userName 和 nickName 以 "userName-nickName" 的方式拼接后设置到 custInfo 字段
if (alterVOS != null && !alterVOS.isEmpty()) {
alterVOS.forEach(alterVO -> {
String userName = alterVO.getUserName();
String nickName = alterVO.getNickName();
if (userName != null && nickName != null) {
alterVO.setUserInfo(nickName + "-" + userName);
} else if (userName != null) {
alterVO.setUserInfo(userName);
} else if (nickName != null) {
alterVO.setUserInfo(nickName);
} else {
alterVO.setUserInfo("");
}
});
}
public List<AlterVO> getAllAlterList(String status, String alterType, String forwardFlag) {
List<AlterVO> alterVOS = workRecordMapper.selectAllAlterList(
String.valueOf(SecurityUtils.getDeptId()),
SecurityUtils.userRole(),
status,
alterType,
SecurityUtils.getUsername(),
forwardFlag
);
fillAlterExtFields(alterVOS);
return alterVOS;
}
/**
* 查询转发弹窗所需元数据。
* 单选时返回手动选项并附带历史推荐;多选时根据是否存在历史记录决定走手动分配还是历史推荐模式。
*/
@Override
public AlterForwardMetaVO getAlterForwardMeta(List<Long> ids) {
if (ids == null || ids.isEmpty()) {
throw new ServiceException("请选择需要转发的预警");
}
AlterForwardMetaVO metaVO = new AlterForwardMetaVO();
String role = requireForwardRole();
Long currentDeptId = SecurityUtils.getDeptId();
String currentUser = SecurityUtils.getUsername();
List<WorkRecord> workRecords = workRecordMapper.selectBatchIds(ids);
if (workRecords == null || workRecords.size() != ids.size()) {
throw new ServiceException("存在预警记录已不存在,请刷新后重试");
}
workRecords.forEach(item -> validateRecordBeforeForward(item, role, currentUser, currentDeptId));
if (ids.size() > 1) {
boolean hasAnyHistory = workRecords.stream()
.map(item -> getHistoryRecommend(item.getCustId(), currentDeptId, role))
.anyMatch(Objects::nonNull);
metaVO.setHasHistoryRecommend(hasAnyHistory);
metaVO.setHistoryOnly(hasAnyHistory);
if (!hasAnyHistory) {
fillManualOptions(metaVO, role, currentDeptId);
}
return metaVO;
}
WorkRecord workRecord = workRecords.get(0);
fillManualOptions(metaVO, role, currentDeptId);
fillHistoryRecommend(metaVO, workRecord.getCustId(), currentDeptId, role);
return metaVO;
}
/**
* 执行预警转发。
* 支持手动分配和按历史推荐分配两种模式,并分别统计成功和失败数量。
*/
@Override
@Transactional(rollbackFor = Exception.class)
public AlterForwardResultVO forwardAlter(AlterForwardRequest request) {
String role = requireForwardRole();
String currentUser = SecurityUtils.getUsername();
Long currentDeptId = SecurityUtils.getDeptId();
AlterForwardResultVO result = new AlterForwardResultVO();
boolean useHistory = Boolean.TRUE.equals(request.getUseHistory());
ForwardTarget manualTarget = useHistory ? null : resolveManualTarget(request, role, currentDeptId);
List<WorkRecord> workRecords = workRecordMapper.selectBatchIds(request.getIds());
if (workRecords == null || workRecords.size() != request.getIds().size()) {
throw new ServiceException("存在预警记录已不存在,请刷新后重试");
}
for (WorkRecord workRecord : workRecords) {
validateRecordBeforeForward(workRecord, role, currentUser, currentDeptId);
AlterAssignHistory history = useHistory ? getHistoryRecommend(workRecord.getCustId(), currentDeptId, role) : null;
ForwardTarget target = useHistory ? resolveHistoryTarget(history, role, currentDeptId) : manualTarget;
if (target == null) {
result.setFailCount(result.getFailCount() + 1);
continue;
}
int row = doForward(workRecord.getId(), currentUser, currentDeptId, role, target);
if (row <= 0) {
result.setFailCount(result.getFailCount() + 1);
continue;
}
result.setSuccessCount(result.getSuccessCount() + row);
if (useHistory) {
if (history != null) {
saveAssignHistoryByHistory(workRecord, history, role, currentDeptId);
}
} else {
saveAssignHistory(workRecord, manualTarget, role, currentDeptId);
}
}
return result;
}
/**
* 定时任务生成工作清单
*
@@ -351,4 +448,306 @@ public class WorkRecordServiceImpl implements WorkRecordService {
return java.sql.Timestamp.valueOf(endTime);
}
private void fillAlterExtFields(List<AlterVO> alterVOS) {
if (alterVOS == null || alterVOS.isEmpty()) {
return;
}
String role = SecurityUtils.userRole();
Long currentDeptId = SecurityUtils.getDeptId();
String currentUser = SecurityUtils.getUsername();
alterVOS.forEach(alterVO -> {
alterVO.setForwardFlag(parseForwardFlag(alterVO.getAlterDetail()));
alterVO.setAlterDetail(stripForwardPrefix(alterVO.getAlterDetail()));
alterVO.setUserInfo(buildUserInfo(alterVO.getUserName(), alterVO.getNickName()));
alterVO.setCanForward(canForward(alterVO, role, currentDeptId, currentUser));
});
}
private String buildUserInfo(String userName, String nickName) {
if (StringUtils.isNotEmpty(userName) && StringUtils.isNotEmpty(nickName)) {
return nickName + "-" + userName;
}
if (StringUtils.isNotEmpty(userName)) {
return userName;
}
if (StringUtils.isNotEmpty(nickName)) {
return nickName;
}
return "";
}
private String parseForwardFlag(String alterDetail) {
if (StringUtils.isEmpty(alterDetail)) {
return "";
}
if (alterDetail.startsWith("[FORWARD=1]")) {
return "1";
}
if (alterDetail.startsWith("[FORWARD=0]")) {
return "0";
}
return "";
}
private String stripForwardPrefix(String alterDetail) {
if (StringUtils.isEmpty(alterDetail)) {
return alterDetail;
}
if (alterDetail.startsWith("[FORWARD=1] ")) {
return alterDetail.substring(12);
}
if (alterDetail.startsWith("[FORWARD=0] ")) {
return alterDetail.substring(12);
}
if (alterDetail.startsWith("[FORWARD=1]") || alterDetail.startsWith("[FORWARD=0]")) {
return alterDetail.substring(11);
}
return alterDetail;
}
private Boolean canForward(AlterVO alterVO, String role, Long currentDeptId, String currentUser) {
if (!FORWARD_ALTER_TYPES.contains(alterVO.getAlterType())) {
return false;
}
if (!"1".equals(alterVO.getForwardFlag())) {
return false;
}
if ("2".equals(alterVO.getStatus())) {
return false;
}
if (ROLE_BRANCH.equals(role)) {
return StringUtils.equals(currentUser, alterVO.getUserName()) && alterVO.getDeptId() == null;
}
if (ROLE_OUTLET.equals(role)) {
return alterVO.getDeptId() != null && alterVO.getDeptId().equals(currentDeptId) && StringUtils.isEmpty(alterVO.getUserName());
}
return false;
}
/**
* 校验当前登录角色是否具备预警转发能力,并返回角色标识。
*/
private String requireForwardRole() {
String role = SecurityUtils.userRole();
if (!ROLE_BRANCH.equals(role) && !ROLE_OUTLET.equals(role)) {
throw new ServiceException("当前角色不支持转发预警");
}
return role;
}
/**
* 校验预警记录当前是否仍处于登录人可转发范围内,防止页面停留期间数据状态已变化。
*/
private void validateRecordBeforeForward(WorkRecord workRecord, String role, String currentUser, Long currentDeptId) {
if (workRecord == null || workRecord.getId() == null) {
throw new ServiceException("预警记录不存在");
}
if (!Integer.valueOf(1).equals(workRecord.getIsAlter())) {
throw new ServiceException("当前记录不是预警信息");
}
if (!FORWARD_ALTER_TYPES.contains(workRecord.getAlterType())) {
throw new ServiceException("当前预警类型不支持转发");
}
if (!"1".equals(parseForwardFlag(workRecord.getAlterDetail()))) {
throw new ServiceException("当前预警已有管户,无需转发");
}
if ("2".equals(workRecord.getStatus())) {
throw new ServiceException("当前预警已完成,不能转发");
}
if (ROLE_BRANCH.equals(role)) {
if (!StringUtils.equals(currentUser, workRecord.getUserName()) || workRecord.getDeptId() != null) {
throw new ServiceException("当前预警已不在您的待转发范围内");
}
return;
}
if (ROLE_OUTLET.equals(role)) {
if (workRecord.getDeptId() == null || !workRecord.getDeptId().equals(currentDeptId) || StringUtils.isNotEmpty(workRecord.getUserName())) {
throw new ServiceException("当前预警已不在本网点待转发范围内");
}
return;
}
throw new ServiceException("当前角色不支持转发预警");
}
/**
* 解析手动转发目标,并顺带完成目标权限范围校验。
*/
private ForwardTarget resolveManualTarget(AlterForwardRequest request, String role, Long currentDeptId) {
if (TARGET_TYPE_DEPT.equals(request.getTargetType())) {
if (request.getDeptId() == null) {
throw new ServiceException("请选择转发网点");
}
if (!ROLE_BRANCH.equals(role)) {
throw new ServiceException("网点管理员只能转发给客户经理");
}
String deptName = getAllowedDeptName(request.getDeptId(), currentDeptId);
return new ForwardTarget(TARGET_TYPE_DEPT, request.getDeptId(), null, null, deptName);
}
if (!TARGET_TYPE_USER.equals(request.getTargetType()) || StringUtils.isEmpty(request.getUserName())) {
throw new ServiceException("请选择转发客户经理");
}
SysUser user = getAllowedTargetUser(request.getUserName(), role, currentDeptId);
String targetName = StringUtils.isNotEmpty(user.getNickName()) ? user.getNickName() : user.getUserName();
return new ForwardTarget(TARGET_TYPE_USER, null, user.getUserName(), user.getNickName(), targetName);
}
/**
* 将历史分配记录转换成可执行的转发目标;若历史目标已失效,则返回空。
*/
private ForwardTarget resolveHistoryTarget(AlterAssignHistory history, String role, Long currentDeptId) {
if (history == null) {
return null;
}
if (TARGET_TYPE_DEPT.equals(history.getLastAssignTargetType())) {
if (history.getLastAssignTargetDeptId() == null) {
return null;
}
String deptName = getAllowedDeptName(history.getLastAssignTargetDeptId(), currentDeptId);
return new ForwardTarget(TARGET_TYPE_DEPT, history.getLastAssignTargetDeptId(), null, null, deptName);
}
if (!TARGET_TYPE_USER.equals(history.getLastAssignTargetType()) || StringUtils.isEmpty(history.getLastAssignTargetUser())) {
return null;
}
try {
SysUser user = getAllowedTargetUser(history.getLastAssignTargetUser(), role, currentDeptId);
String targetName = StringUtils.isNotEmpty(user.getNickName()) ? user.getNickName() : user.getUserName();
return new ForwardTarget(TARGET_TYPE_USER, null, user.getUserName(), user.getNickName(), targetName);
} catch (ServiceException ex) {
return null;
}
}
/**
* 按目标类型执行真正的转发落库更新。
*/
private int doForward(Long workRecordId, String currentUser, Long currentDeptId, String role, ForwardTarget target) {
if (TARGET_TYPE_DEPT.equals(target.getTargetType())) {
return workRecordMapper.updateAlterForwardToDept(workRecordId, currentUser, target.getDeptId(), currentUser);
}
if (ROLE_BRANCH.equals(role)) {
return workRecordMapper.updateAlterForwardToUserByBranch(
workRecordId, currentUser, target.getUserName(), target.getNickName(), currentUser
);
}
return workRecordMapper.updateAlterForwardToUserByOutlet(
workRecordId, currentDeptId, target.getUserName(), target.getNickName(), currentUser
);
}
/**
* 校验目标网点是否在当前支行管理员的可转发范围内,并返回网点名称。
*/
private String getAllowedDeptName(Long targetDeptId, Long currentDeptId) {
List<AlterAssignTargetVO> deptOptions = workRecordMapper.selectForwardDeptTargets(currentDeptId);
return deptOptions.stream()
.filter(item -> String.valueOf(targetDeptId).equals(item.getTargetCode()))
.map(AlterAssignTargetVO::getTargetName)
.findFirst()
.orElseThrow(() -> new ServiceException("所选网点不在当前支行可转发范围内"));
}
/**
* 校验目标客户经理是否在当前管理员可转发范围内,并返回用户信息。
*/
private SysUser getAllowedTargetUser(String targetUserName, String role, Long currentDeptId) {
List<AlterAssignTargetVO> userOptions = workRecordMapper.selectForwardUserTargets(currentDeptId, ROLE_MANAGER);
boolean matched = userOptions.stream().anyMatch(item -> StringUtils.equals(targetUserName, item.getTargetCode()));
if (!matched) {
if (ROLE_BRANCH.equals(role)) {
throw new ServiceException("所选客户经理不在当前支行可转发范围内");
}
throw new ServiceException("所选客户经理不在当前网点可转发范围内");
}
SysUser user = sysUserService.selectUserByUserName(targetUserName);
if (user == null || StringUtils.isEmpty(user.getUserName())) {
throw new ServiceException("转发目标客户经理不存在");
}
return user;
}
/**
* 填充手动分配弹窗可选项;支行管理员可选网点和客户经理,网点管理员仅可选客户经理。
*/
private void fillManualOptions(AlterForwardMetaVO metaVO, String role, Long currentDeptId) {
if (ROLE_BRANCH.equals(role)) {
metaVO.setDeptOptions(workRecordMapper.selectForwardDeptTargets(currentDeptId));
metaVO.setUserOptions(workRecordMapper.selectForwardUserTargets(currentDeptId, ROLE_MANAGER));
return;
}
if (ROLE_OUTLET.equals(role)) {
metaVO.setUserOptions(workRecordMapper.selectForwardUserTargets(currentDeptId, ROLE_MANAGER));
return;
}
throw new ServiceException("当前角色不支持转发预警");
}
/**
* 按客户、当前部门和当前角色查询历史推荐,并回填到前端元数据中。
*/
private void fillHistoryRecommend(AlterForwardMetaVO metaVO, String custId, Long deptId, String role) {
AlterAssignHistory history = getHistoryRecommend(custId, deptId, role);
if (history == null) {
return;
}
metaVO.setHasHistoryRecommend(true);
metaVO.setRecommendedTargetType(history.getLastAssignTargetType());
if (TARGET_TYPE_DEPT.equals(history.getLastAssignTargetType())) {
metaVO.setRecommendedTargetCode(history.getLastAssignTargetDeptId() == null ? "" : String.valueOf(history.getLastAssignTargetDeptId()));
} else {
metaVO.setRecommendedTargetCode(history.getLastAssignTargetUser());
}
metaVO.setRecommendedTargetName(history.getLastAssignTargetName());
}
/**
* 保存本次手动分配结果;同一客户在同部门、同角色下只维护一条最新历史。
*/
private void saveAssignHistory(WorkRecord workRecord, ForwardTarget target, String role, Long currentDeptId) {
AlterAssignHistory history = getHistoryRecommend(workRecord.getCustId(), currentDeptId, role);
if (history == null) {
history = new AlterAssignHistory();
history.setCustId(workRecord.getCustId());
}
history.setAlterType(workRecord.getAlterType());
history.setCustName(workRecord.getCustName());
history.setDeptId(currentDeptId);
history.setLastAssignTargetType(target.getTargetType());
history.setLastAssignTargetDeptId(target.getDeptId());
history.setLastAssignTargetUser(target.getUserName());
history.setLastAssignTargetName(target.getTargetName());
history.setLastAssignByUser(SecurityUtils.getUsername());
history.setLastAssignByRole(role);
history.setUpdateTime(new Date());
if (history.getId() == null) {
alterAssignHistoryMapper.insert(history);
} else {
alterAssignHistoryMapper.updateById(history);
}
}
/**
* 按历史推荐成功转发后,刷新该客户最新一次分配历史的更新时间和目标信息。
*/
private void saveAssignHistoryByHistory(WorkRecord workRecord, AlterAssignHistory sourceHistory, String role, Long currentDeptId) {
ForwardTarget target = new ForwardTarget(
sourceHistory.getLastAssignTargetType(),
sourceHistory.getLastAssignTargetDeptId(),
sourceHistory.getLastAssignTargetUser(),
null,
sourceHistory.getLastAssignTargetName()
);
saveAssignHistory(workRecord, target, role, currentDeptId);
}
/**
* 获取当前角色在当前部门下,对指定客户的最近一次分配历史。
*/
private AlterAssignHistory getHistoryRecommend(String custId, Long deptId, String role) {
return alterAssignHistoryMapper.selectOne(new LambdaQueryWrapper<AlterAssignHistory>()
.eq(AlterAssignHistory::getCustId, custId)
.eq(AlterAssignHistory::getDeptId, deptId)
.eq(AlterAssignHistory::getLastAssignByRole, role)
.last("limit 1"));
}
}

View File

@@ -184,19 +184,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="selectAlterList" resultType="AlterVO">
select id, user_name, nick_name, alter_type, alter_detail, cust_id, cust_name, read_time, status, remark, is_feedback, cust_isn
from work_record
select wr.id, wr.user_name, wr.nick_name, wr.alter_type, wr.alter_detail, wr.cust_id, wr.cust_name,
wr.read_time, wr.status, wr.remark, wr.is_feedback, wr.cust_isn, wr.dept_id, sd.dept_name
from work_record wr
left join sys_dept sd on wr.dept_id = sd.dept_id
<where>
is_alter = 1
and user_name= #{username}
wr.is_alter = 1
and wr.user_name= #{username}
<if test="status != null and status != ''">
and status = #{status}
and wr.status = #{status}
</if>
<if test="alterType != null and alterType != ''">
and alter_type = #{alterType}
and wr.alter_type = #{alterType}
</if>
</where>
order by create_time desc, status asc
order by wr.create_time desc, wr.status asc
</select>
<select id="selectAlterCount" resultType="AlterCountVO">
@@ -209,24 +211,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from work_record wr
left join sys_user su on su.user_name = wr.user_name
left join sys_dept d on su.dept_id = d.dept_id
left join sys_dept wd on wr.dept_id = wd.dept_id
where wr.is_alter = 1
and wr.create_time &lt;= #{reportTime}
and (
<choose>
<when test="role != null and role == 'outlet'"> su.dept_id = #{deptId} </when>
<when test="role != null and role == 'branch'"> (su.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors)) </when>
<when test="role != null and role == 'private'"> (left(su.dept_id,3) = left(#{deptId},3) and wr.cust_type in ('0', '1')) </when>
<when test="role != null and role == 'public'"> (left(su.dept_id,3) = left(#{deptId},3) and wr.cust_type = '2') </when>
<when test="role != null and role == 'ops'"> left(su.dept_id,3) = left(#{deptId},3) </when>
<when test="role != null and role == 'head'"> left(su.dept_id,3) = left(#{deptId},3) </when>
<when test="role != null and role == 'outlet'"> (su.dept_id = #{deptId} or wr.dept_id = #{deptId}) </when>
<when test="role != null and role == 'branch'"> ((su.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors)) or (wr.dept_id = #{deptId} or find_in_set(#{deptId},wd.ancestors))) </when>
<when test="role != null and role == 'private'"> ((left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) and wr.cust_type in ('0', '1')) </when>
<when test="role != null and role == 'public'"> ((left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) and wr.cust_type = '2') </when>
<when test="role != null and role == 'ops'"> (left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) </when>
<when test="role != null and role == 'head'"> (left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) </when>
</choose>)
</select>
<select id="selectAllAlterList" resultType="AlterVO">
select wr.id, wr.user_name, wr.nick_name, wr.alter_type, wr.alter_detail, wr.cust_id, wr.cust_name, wr.read_time, wr.status, wr.remark, wr.cust_type, wr.is_feedback, wr.cust_isn
select wr.id, wr.user_name, wr.nick_name, wr.alter_type, wr.alter_detail, wr.cust_id, wr.cust_name, wr.read_time,
wr.status, wr.remark, wr.cust_type, wr.is_feedback, wr.cust_isn, wr.dept_id, wd.dept_name
from work_record wr
left join sys_user su on su.user_name = wr.user_name
left join sys_dept d on su.dept_id = d.dept_id
left join sys_dept wd on wr.dept_id = wd.dept_id
where wr.is_alter = 1
<if test="status != null and status != ''">
and wr.status = #{status}
@@ -234,20 +239,120 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="alterType != null and alterType != ''">
and wr.alter_type = #{alterType}
</if>
<if test="forwardFlag != null and forwardFlag != ''">
<choose>
<when test='forwardFlag == "1"'>
and wr.alter_type in ('个人资产客户定期存款', '个人资产客户封闭式理财')
and wr.alter_detail like '[FORWARD=1]%'
</when>
<when test='forwardFlag == "0"'>
and (
(wr.alter_type in ('个人资产客户定期存款', '个人资产客户封闭式理财')
and wr.alter_detail like '[FORWARD=0]%')
or wr.alter_type not in ('个人资产客户定期存款', '个人资产客户封闭式理财')
)
</when>
</choose>
</if>
<!-- "走访异常提醒"类型直接通过用户名匹配,其他类型按角色权限处理 -->
and ((wr.alter_type = '走访异常提醒' and wr.user_name = #{username}) or
(wr.alter_type != '走访异常提醒' and (
<choose>
<when test="role != null and role == 'outlet'"> su.dept_id = #{deptId} </when>
<when test="role != null and role == 'branch'"> (su.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors)) </when>
<when test="role != null and role == 'private'"> (left(su.dept_id,3) = left(#{deptId},3) and wr.cust_type in ('0', '1')) </when>
<when test="role != null and role == 'public'"> (left(su.dept_id,3) = left(#{deptId},3) and wr.cust_type = '2') </when>
<when test="role != null and role == 'ops'"> left(su.dept_id,3) = left(#{deptId},3) </when>
<when test="role != null and role == 'head'"> left(su.dept_id,3) = left(#{deptId},3) </when>
<when test="role != null and role == 'outlet'"> (su.dept_id = #{deptId} or wr.dept_id = #{deptId}) </when>
<when test="role != null and role == 'branch'"> ((su.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors)) or (wr.dept_id = #{deptId} or find_in_set(#{deptId},wd.ancestors))) </when>
<when test="role != null and role == 'private'"> ((left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) and wr.cust_type in ('0', '1')) </when>
<when test="role != null and role == 'public'"> ((left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) and wr.cust_type = '2') </when>
<when test="role != null and role == 'ops'"> (left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) </when>
<when test="role != null and role == 'head'"> (left(su.dept_id,3) = left(#{deptId},3) or left(wr.dept_id,3) = left(#{deptId},3)) </when>
</choose> )))
order by wr.create_time desc, wr.status asc, wr.user_name desc
</select>
<select id="selectForwardDeptTargets" resultType="AlterAssignTargetVO">
select cast(sd.dept_id as char) as targetCode, sd.dept_name as targetName
from sys_dept sd
where sd.del_flag = '0'
and sd.status = '0'
and sd.dept_type = 'outlet'
and sd.parent_id = #{branchDeptId}
order by sd.order_num, sd.dept_id
</select>
<select id="selectForwardUserTargets" resultType="AlterAssignTargetVO">
select su.user_name as targetCode, concat(su.nick_name, '-', su.user_name) as targetName
from sys_user su
where su.del_flag = '0'
and su.status = '0'
and su.dept_id = #{deptId}
<choose>
<when test="role == 'manager'">
and su.role_id = 102
</when>
<when test="role == 'branch'">
and su.role_id = 101
</when>
<when test="role == 'outlet'">
and su.role_id = 116
</when>
<otherwise>
and 1 = 2
</otherwise>
</choose>
order by su.nick_name, su.user_name
</select>
<update id="updateAlterForwardToDept">
update work_record
set user_name = null,
nick_name = null,
dept_id = #{targetDeptId},
read_time = null,
update_time = sysdate(),
update_by = #{updateBy}
where id = #{id}
and user_name = #{sourceUserName}
and dept_id is null
and is_alter = 1
</update>
<update id="updateAlterForwardToUserByBranch">
update work_record
set user_name = #{targetUserName},
nick_name = #{targetNickName},
alter_detail = case
when alter_detail like '[FORWARD=1] %' then concat('[FORWARD=0] ', substring(alter_detail, 13))
when alter_detail like '[FORWARD=1]%' then concat('[FORWARD=0]', substring(alter_detail, 12))
else alter_detail
end,
dept_id = null,
read_time = null,
update_time = sysdate(),
update_by = #{updateBy}
where id = #{id}
and user_name = #{sourceUserName}
and dept_id is null
and is_alter = 1
</update>
<update id="updateAlterForwardToUserByOutlet">
update work_record
set user_name = #{targetUserName},
nick_name = #{targetNickName},
alter_detail = case
when alter_detail like '[FORWARD=1] %' then concat('[FORWARD=0] ', substring(alter_detail, 13))
when alter_detail like '[FORWARD=1]%' then concat('[FORWARD=0]', substring(alter_detail, 12))
else alter_detail
end,
dept_id = null,
read_time = null,
update_time = sysdate(),
update_by = #{updateBy}
where id = #{id}
and dept_id = #{sourceDeptId}
and user_name is null
and is_alter = 1
</update>
<select id="selectAlterConfigList" resultType="AlterConfigVO">
select id, alter_type, prod_type, warn_role, warn_threshold, update_time, update_by, type
from alter_config

View File

@@ -167,6 +167,36 @@
</where>
</select>
<select id="getCustManagerListByPage" resultType="DwbRetailCustLevelManagerDetailVO">
select id, outlet_id, outlet_name, branch_id, branch_name, cust_name, cust_idc, cust_isn, cust_age, cust_sex, cust_phone, cust_address, cust_aum_bal,
aum_bal_comp_lm, cust_aum_month_avg, cust_level, cust_level_comp_lm, manager_name, manager_id
from dwb_retail_cust_level_manager_detail_${headId}
<where>
<if test="dto.managerId != null and dto.managerId !='' ">and manager_id = #{dto.managerId}</if>
<if test="dto.outletId != null and dto.outletId !='' ">and outlet_id = #{dto.outletId}</if>
<if test="dto.branchId != null and dto.branchId !='' ">and branch_id = #{dto.branchId}</if>
<if test="dto.statusType != null and dto.statusType !=''">
<choose>
<when test="dto.statusType == 'current'">
and cust_level = #{dto.custLevel}
</when>
<when test="dto.statusType == 'last'">
and cust_level_lm = #{dto.custLevel}
</when>
<when test="dto.statusType == 'rise'">
and cust_level = #{dto.custLevel}
and cust_level_comp_lm like '上升%'
</when>
<when test="dto.statusType == 'fall'">
and cust_level_lm = #{dto.custLevel}
and cust_level_comp_lm like '下降%'
</when>
</choose>
</if>
</where>
limit #{offset}, #{pageSize}
</select>
<select id="getCustLevelCount" resultType="Integer">
select count(1)
from dwb_retail_cust_level_manager_detail
@@ -505,26 +535,20 @@
where manager_id is not null
</select>
<!-- 根据网格类型和总行ID查询客户经理列表 -->
<select id="getManagerListByGridType" resultType="java.util.HashMap">
select distinct user_name as userName, nick_name as nickName
<!-- 全量查询绩效网格客户列表(用于客群管户关系匹配,不按客户经理过滤)-->
<select id="getAllCustomerListForImport" resultType="GridCmpmVO">
select cust_id, cust_type, user_name, nick_name, outlet_id, outlet_name, branch_id, branch_name
from grid_cmpm_${gridType}_${headId}
where user_name is not null
order by user_name
</select>
<!-- 根据网格类型、总行ID和客户经理查询客户列表分表查询适用于客群导入-->
<select id="getCustomerListForImport" resultType="GridCmpmVO">
select cust_id, cust_name, cust_type, cust_idc, usci
<!-- 根据客户ID列表查询管户关系用于动态客群更新管户关系-->
<select id="getRelationshipsByCustList" resultType="GridCmpmVO">
select cust_id, cust_type, user_name, nick_name, outlet_id, outlet_name, branch_id, branch_name
from grid_cmpm_${gridType}_${headId}
where user_name = #{userName}
</select>
<!-- 根据网格类型、总行ID和客户经理流式查询客户列表使用Cursor适用于大数据量场景-->
<select id="getCustomerListForImportCursor" resultType="GridCmpmVO" fetchSize="1000">
select cust_id, cust_name, cust_type, cust_idc, usci
from grid_cmpm_${gridType}_${headId}
where user_name = #{userName}
where
<foreach item="custInfo" collection="custInfoList" separator=" or " open="(" close=")">
(cust_id = #{custInfo.custId} and cust_type = #{custInfo.custType})
</foreach>
</select>
</mapper>

View File

@@ -56,16 +56,4 @@
<if test="custType != null and custType != ''">AND b.cust_type = #{custType}</if>
</select>
<!-- 根据绘制网格ID查询所有客户用于客群导入直接拼接headId绕过拦截器 -->
<select id="selectCustByDrawGridId" resultType="com.ruoyi.ibs.grid.domain.entity.RegionCustUser">
SELECT DISTINCT
sc.cust_id,
sc.cust_name,
sc.cust_type
FROM grid_draw_shape_relate sr
INNER JOIN draw_shape_cust_${headId} sc ON sc.shape_id = sr.shape_id
WHERE sr.grid_id = #{gridId}
AND sr.delete_flag = '0'
</select>
</mapper>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.ibs.draw.mapper.DrawGridShapeRelateMapper">
<select id="selectByGridId" resultType="com.ruoyi.ibs.draw.domain.entity.DrawGridShapeRelate">
SELECT *
FROM grid_draw_shape_relate
WHERE grid_id = #{gridId}
AND delete_flag = '0'
</select>
<select id="selectCustByDrawGridId" resultType="com.ruoyi.ibs.grid.domain.entity.RegionCustUser">
SELECT DISTINCT
sc.cust_id,
sc.cust_name,
sc.cust_type
FROM grid_draw_shape_relate sr
INNER JOIN draw_shape_cust_${headId} sc ON sc.shape_id = sr.shape_id
WHERE sr.grid_id = #{gridId}
AND sr.delete_flag = '0'
</select>
</mapper>

View File

@@ -21,6 +21,24 @@
</where>
</select>
<select id="selectLsCountListNew825" resultType="com.ruoyi.ibs.grid.domain.entity.GridCmpmCountLingshouNew825">
SELECT dt, grid_name, grid_name2, county, town, village, dept_id, dept_name, outlets_id, outlets_name,
user_name, cust_num, zf_365cnt, zf_180cnt, zf_90cnt, zf_30cnt, zf_365rt, zf_180rt, zf_90rt,
zf_30rt, cur_bal_d, sx_rat, yx_rat, sx_num, yx_num, sx_bal, bal_loan, loan_ave, yxht_rat, dian_rat,
shui_rat, tax_rat, open_rat, yxht_num, dian_num, shui_num, tax_num, open_num, dep_bal, fin_bal,
grhx_num, cfyx_num, yxxyk_num, yxsbk_num, `2to3_sbk_num` as twoTo3SbkNum, ylj_to_sbk_num,
fshl_num, yxsd_num, hxsd_num, region_code, ops_dept
FROM grid_cmpm_count_lingshou_new_825
<where>
<if test=" dt != null and dt != ''">and dt = #{dt}</if>
<if test=" town != null and town != ''">and town like concat('%',concat(#{town},'%'))</if>
<if test=" village != null and village != ''">and village like concat('%',concat(#{village},'%'))</if>
<if test=" isBranch == true">and dept_id like concat('%',concat(#{deptId},'%'))</if>
<if test=" isOutlet == true">and outlets_id like concat('%',concat(#{deptId},'%'))</if>
<if test=" isManager == true">and user_name like concat('%',concat(#{userName},'%'))</if>
</where>
</select>
<select id="selectGsCountList" resultType="com.ruoyi.ibs.grid.domain.entity.GridCmpmCountGongsi">
SELECT dt, grid_name, grid_name2, town, dept_id,dept_name, outlets_id,outlets_name, user_name,
cust_num, hq_cur_balance, bz_cur_balance, loan_balance_cny, finance_prod_711_balance,ustr_count_per_m,ustr_bal_m,
@@ -59,6 +77,47 @@
<if test=" custIdc != null and custIdc != ''">and cust_idc like concat('%',concat(#{custIdc},'%'))</if>
</select>
<select id="selectLsCustListNew825" resultType="com.ruoyi.ibs.grid.domain.entity.GridCustCountLingshouNew825">
SELECT cust_name,
cust_idc,
cust_isn,
cur_bal_d,
bal_loan,
loan_ave,
is_sx,
is_yx,
sx_bal,
is_yxht,
is_xyk,
fshl,
is_sd,
dian,
shui,
tax,
open_num,
dep_bal,
fin_bal,
is_grhx,
is_cfyx,
is_yxsbk,
is_2to3_sbk,
is_ylj_to_sbk,
is_hxsd,
region_code,
ops_dept,
cust_type,
is_365zf,
is_180zf,
is_90zf,
is_30zf,
dt
FROM grid_cust_count_lingshou_new_825
where region_code = #{regionCode}
<if test=" dt != null and dt != ''">and dt = #{dt}</if>
<if test=" custName != null and custName != ''">and cust_name like concat('%',concat(#{custName},'%'))</if>
<if test=" custIdc != null and custIdc != ''">and cust_idc like concat('%',concat(#{custIdc},'%'))</if>
</select>
<select id="selectGsCustList" resultType="com.ruoyi.ibs.grid.domain.entity.GridCustCountGongsi">
SELECT cust_name, social_credit_code, cust_isn, hq_cur_balance, bz_cur_balance, is_credit,

View File

@@ -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'
<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>
<choose>
<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>
<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'">
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 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>
</otherwise>
</choose>

View File

@@ -127,6 +127,18 @@
<result property="remark" column="remark" />
<result property="custType" column="cust_type" />
<result property="deptName" column="dept_name" />
<result property="interAddr" column="inter_addr" />
<result property="colStafName" column="col_staf_name" />
<result property="laterNote" column="later_note" />
<result property="intentionProductValue" column="intention_product_value" />
<result property="feedbackStatus" column="feedback_status" />
<result property="sourceOfInterview" column="source_of_interview" />
<result property="filename" column="filename" />
<result property="outCallStatus" column="out_call_status" />
<result property="outCallIntention" column="out_call_intention" />
<result property="source" column="source" />
<result property="analysisValue" column="analysis_value" />
<result property="facility" column="facility" />
</resultMap>
<sql id="selectSysCampaignVo">
@@ -1388,8 +1400,10 @@
from visit_info 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="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>
@@ -1410,4 +1424,57 @@
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="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>
<update id="updateVisitInfoFeedback" parameterType="VisitInfoFeedbackUpdateDTO">
update visit_info_875 vi
left join sys_dept d on vi.dept_id = d.dept_id
set vi.source = #{source},
vi.remark = #{remark},
vi.intention_product_value = #{intentionProductValue},
vi.inter_res = '0',
vi.update_by = #{userName},
vi.update_time = sysdate()
where vi.id = #{id}
<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>
</update>
</mapper>

View File

@@ -215,6 +215,13 @@
<version>${ruoyi.version}</version>
</dependency>
<!-- 数字支行-客群模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ibs-group</artifactId>
<version>3.8.8</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@@ -28,6 +28,10 @@ spring:
username: root
password: Kfcx@1234
driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://rm-bp17634n45cj631s0ao.mysql.rds.aliyuncs.com/ibs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
# username: znsj
# password: Znsj@123456
# driverClassName: com.mysql.cj.jdbc.Driver
# 从库数据源
slave:
# 从数据源开关/默认关闭
@@ -78,12 +82,14 @@ spring:
redis:
# 地址
host: 116.62.17.81
# host: r-bp1mmtcknvsscsrjrypd.redis.rds.aliyuncs.com
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: Kfcx@1234
# password: N0f3d12c4a927eee1+
# 连接超时时间
timeout: 10s
lettuce:
@@ -121,5 +127,9 @@ oss:
accessKeyId: LTAI5tMsUgorcgnpTxZDV1wS
accessKeySecret: c7qIjXIPx8Cz2CriJpYGyCFwFjRxeB
bucketName: oss-wkc
# endpoint: oss-cn-hangzhou.aliyuncs.comBucket:znjgoss.oss-cn-hangzhou.aliyuncs.com
# accessKeyId: LTAI5tCRocKhQaCtFnYKp46w
# accessKeySecret: 0ovFbMQWas1wOZTG91mpKbV70JgR32
# bucketName: oss-wkc

View File

@@ -68,7 +68,7 @@ mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
mapperLocations: classpath*:mapper/*Mapper.xml,classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
type-handlers-package: com.ruoyi.ibs.handler

View File

@@ -38,6 +38,10 @@
<groupId>com.ruoyi</groupId>
<artifactId>ibs</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ibs-group</artifactId>
</dependency>
</dependencies>

View File

@@ -1,6 +1,7 @@
package com.ruoyi.quartz.task;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.group.service.ICustGroupService;
import com.ruoyi.ibs.cmpm.service.GridCmpmService;
import com.ruoyi.ibs.dashboard.service.FileOptService;
import com.ruoyi.ibs.draw.service.DrawGridCustService;
@@ -47,6 +48,9 @@ public class RyTask
@Resource
private AddressAnalyseService addressAnalyseService;
@Resource
private ICustGroupService custGroupService;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
{
@@ -111,4 +115,12 @@ public class RyTask
addressAnalyseService.pointInGeometryScheduled();
}
public void updateDynamicCustGroups() {
custGroupService.updateDynamicCustGroups();
}
public void checkAndDisableExpiredGroups() {
custGroupService.checkAndDisableExpiredGroups();
}
}

View File

@@ -20,7 +20,9 @@ public enum OssFileEnum {
VISIT_RECORD("VISIT_RECORD/"),
CUST_MAP_EXPORT("CUST_MAP_EXPORT/");
CUST_MAP_EXPORT("CUST_MAP_EXPORT/"),
CUST_MANAGER_REPORT("CUST_MANAGER_REPORT/");
private String PREFIX;

View File

@@ -133,8 +133,13 @@ public class SysDeptServiceImpl implements ISysDeptService
@Override
public List<TreeSelect> selectDeptTreeListForTopGrid(SysDept dept) {
List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
List<SysDept> branchs = depts.stream().filter(sysDept -> !sysDept.getDeptType().equals("outlet"))
.filter(sysDept -> !sysDept.getDeptType().equals("head"))
if (depts == null || depts.isEmpty()) {
return Collections.emptyList();
}
List<SysDept> branchs = depts.stream()
.filter(Objects::nonNull)
.filter(sysDept -> !"outlet".equals(sysDept.getDeptType()))
.filter(sysDept -> !"head".equals(sysDept.getDeptType()))
.collect(Collectors.toList());
return buildDeptTreeSelect(branchs);
}

View File

@@ -23,3 +23,11 @@ export function getCustLevelList() {
method: 'get'
})
}
export function exportCustManagerReport(data) {
return request({
url: '/grid/cmpm/custManager/export',
method: 'post',
data
})
}

View File

@@ -17,15 +17,6 @@ export function getCustGroup(id) {
})
}
// 异步创建客群(网格导入)
export function createCustGroupByGrid(data) {
return request({
url: '/group/cust/createByGrid',
method: 'post',
data: data
})
}
// 异步创建客群(模板导入)
export function createCustGroupByTemplate(data) {
return request({
@@ -36,24 +27,6 @@ export function createCustGroupByTemplate(data) {
})
}
// 更新客群
export function updateCustGroup(data) {
return request({
url: '/group/cust/update',
method: 'post',
data: data
})
}
// 更新客群(网格导入)
export function updateCustGroupByGrid(data) {
return request({
url: '/group/cust/updateByGrid',
method: 'post',
data: data
})
}
// 更新客群(模板导入)
export function updateCustGroupByTemplate(data) {
return request({
@@ -93,31 +66,13 @@ export function deleteCustGroup(idList) {
// 手动移除客群客户
export function removeMembers(groupId, memberIds) {
return request({
url: '/group/cust/removeMembers',
url: '/group/member/remove',
method: 'post',
params: { groupId: groupId },
data: memberIds
})
}
// 检查客群名称是否存在
export function checkGroupNameExist(groupName) {
return request({
url: '/group/cust/checkName',
method: 'get',
params: { groupName: groupName }
})
}
// 根据网格类型获取客户经理列表
export function getManagerList(gridType) {
return request({
url: '/grid/cmpm/managerList',
method: 'get',
params: { gridType: gridType }
})
}
// 分页查询客群成员列表
export function listCustGroupMembers(groupId, query) {
return request({
@@ -135,3 +90,11 @@ export function getRegionGridListForGroup(query) {
params: query
})
}
// 获取所有客群标签列表
export function getAllGroupTags() {
return request({
url: '/group/cust/tags',
method: 'get'
})
}

View File

@@ -0,0 +1,69 @@
import request from '@/utils/request';
export function getGroupPerformanceLsList(params) {
return request({
url: '/group/performance/ls/list',
method: 'get',
params
});
}
export function getGroupPerformanceGsList(params) {
return request({
url: '/group/performance/gs/list',
method: 'get',
params
});
}
export function getGroupPerformanceLsCustList(params) {
return request({
url: '/group/performance/ls/custList',
method: 'get',
params
});
}
export function getGroupPerformanceGsCustList(params) {
return request({
url: '/group/performance/gs/custList',
method: 'get',
params
});
}
export function exportGroupPerformanceLs(params) {
return request({
url: '/group/performance/exportLs',
method: 'get',
params,
responseType: 'blob'
});
}
export function exportGroupPerformanceGs(params) {
return request({
url: '/group/performance/exportGs',
method: 'get',
params,
responseType: 'blob'
});
}
export function exportGroupPerformanceLsCust(params) {
return request({
url: '/group/performance/exportLsCust',
method: 'get',
params,
responseType: 'blob'
});
}
export function exportGroupPerformanceGsCust(params) {
return request({
url: '/group/performance/exportGsCust',
method: 'get',
params,
responseType: 'blob'
});
}

View File

@@ -204,12 +204,22 @@ export function warningworkRecordList(query) {
params: query
})
}
//更新预警工作清单
export function warningworkRecordSubmit(data) {
// 查询预警转发元数据
export function getAlterForwardMeta(query) {
return request({
url: `/work/record/alter/edit`,
url: `/work/record/alter/forward/meta`,
method: 'get',
params: query
})
}
// 预警转发
export function forwardAlter(data) {
return request({
url: `/work/record/alter/forward`,
method: 'post',
data: data,
data
})
}

View File

@@ -7,3 +7,11 @@ export function getPADVisitRecord(query) {
params: query
})
}
export function updatePADVisitFeedback(data) {
return request({
url: `/system/campaign/updateVisitInfoFeedback`,
method: 'post',
data: data
})
}

View File

@@ -15,10 +15,17 @@
<div class="right-menu">
<template v-if="device !== 'mobile'">
<el-badge v-if="downloadUnreadCount > 0" :value="downloadUnreadCount" class="item download-item">
<i
class="el-icon-download right-menu-item notice"
@click="openDownload"
/>
</el-badge>
<i
v-else
class="el-icon-download right-menu-item notice"
@click="openDownload"
/>
<el-badge v-if="notReadCount > 0" :value="notReadCount" class="item">
<i
class="el-icon-chat-dot-round right-menu-item notice"
@@ -168,11 +175,14 @@ export default {
notReadCount: 0,
noticeCenterList: [],
open2: false,
downCenterList: []
downCenterList: [],
downloadUnreadCount: 0,
downloadPollingTimer: null,
downloadStatusMap: {}
};
},
computed: {
...mapGetters(['sidebar', 'avatar', 'device', 'nickName']),
...mapGetters(['sidebar', 'avatar', 'device', 'nickName', 'userName']),
setting: {
get() {
return this.$store.state.settings.showSettings;
@@ -192,10 +202,14 @@ export default {
},
created() {
this.getCenterList();
this.refreshDownloadCenterList();
window.addEventListener('notice-center-refresh', this.getCenterList);
window.addEventListener('download-center-refresh', this.handleDownloadCenterRefresh);
},
beforeDestroy() {
window.removeEventListener('notice-center-refresh', this.getCenterList);
window.removeEventListener('download-center-refresh', this.handleDownloadCenterRefresh);
this.stopDownloadPolling();
},
methods: {
openModal() {
@@ -203,8 +217,9 @@ export default {
this.open = true;
},
openDownload() {
this.getDownCenterList();
this.refreshDownloadCenterList(false, true).finally(() => {
this.open2 = true;
});
},
// 消息已读
handleHasRead(uuid) {
@@ -237,10 +252,115 @@ export default {
});
},
handleDownloadCenterRefresh() {
this.refreshDownloadCenterList(false, false, true);
},
startDownloadPolling() {
if (this.downloadPollingTimer) {
return;
}
this.downloadPollingTimer = setInterval(() => {
this.refreshDownloadCenterList(true);
}, 10000);
},
stopDownloadPolling() {
if (this.downloadPollingTimer) {
clearInterval(this.downloadPollingTimer);
this.downloadPollingTimer = null;
}
},
getDownloadReadStorageKey() {
return `download-center-read-${this.userName || 'default'}`;
},
getReadTaskIds() {
try {
const cache = localStorage.getItem(this.getDownloadReadStorageKey());
const ids = cache ? JSON.parse(cache) : [];
return Array.isArray(ids) ? ids : [];
} catch (e) {
return [];
}
},
setReadTaskIds(ids) {
localStorage.setItem(this.getDownloadReadStorageKey(), JSON.stringify(ids));
},
getDownloadInitStorageKey() {
return `download-center-init-${this.userName || 'default'}`;
},
hasInitializedDownloadReadState() {
return localStorage.getItem(this.getDownloadInitStorageKey()) === '1';
},
markDownloadReadStateInitialized() {
localStorage.setItem(this.getDownloadInitStorageKey(), '1');
},
updateDownloadUnreadCount(taskList = []) {
const readSet = new Set(this.getReadTaskIds());
this.downloadUnreadCount = taskList.filter(item => item.status !== '0' && !readSet.has(item.id)).length;
},
markDownloadTasksAsRead(taskList = []) {
const readSet = new Set(this.getReadTaskIds());
taskList.filter(item => item.status !== '0').forEach(item => readSet.add(item.id));
this.setReadTaskIds(Array.from(readSet));
this.updateDownloadUnreadCount(taskList);
},
refreshDownloadCenterList(showStatusMessage = false, markAsRead = false, allowPolling = false) {
return getDownCenterList({}).then((res) => {
if (res.code == 200) {
const rows = res.rows || [];
const hasPendingTask = rows.some(item => item.status === '0');
if (!this.hasInitializedDownloadReadState()) {
const initialReadIds = rows.filter(item => item.status !== '0').map(item => item.id);
this.setReadTaskIds(initialReadIds);
this.markDownloadReadStateInitialized();
}
if (showStatusMessage) {
rows.forEach(item => {
const prevStatus = this.downloadStatusMap[item.id];
if (prevStatus === '0' && item.status === '1') {
Message.success(`${item.fileName}导出成功,请前往下载中心下载`);
} else if (prevStatus === '0' && item.status === '2') {
Message.warning(`${item.fileName}导出失败,请前往下载中心查看`);
}
});
}
this.downloadStatusMap = rows.reduce((acc, item) => {
acc[item.id] = item.status;
return acc;
}, {});
this.downCenterList = rows;
if (markAsRead) {
this.markDownloadTasksAsRead(rows);
} else {
this.updateDownloadUnreadCount(rows);
}
if (allowPolling && hasPendingTask) {
this.startDownloadPolling();
} else {
this.stopDownloadPolling();
}
}
});
},
// 消息列表下载文件
downLoadFile(item) {
const {fileUrl, fileName, status} = item
if (!fileUrl) return;
if (status === '0') {
Message.warning('正在导出,请稍后下载');
return
@@ -249,9 +369,11 @@ export default {
Message.warning('导出失败,无法下载');
return
}
if (!fileUrl) return;
downCenterDownload({ fileUrl }).then((res) => {
downloadFiles(res, `${fileName}.xlsx`);
Message.success('下载成功');
this.markDownloadTasksAsRead(this.downCenterList);
});
},
@@ -382,6 +504,12 @@ export default {
padding-top: 0;
}
}
.download-item {
::v-deep .el-badge__content.is-fixed {
top: 18px;
right: 18px;
}
}
}
}
.page-common-wrap {

View File

@@ -238,6 +238,28 @@ export const constantRoutes = [
component: () => import('@/views/group/custGroup/detail')
}]
},
{
path: '/center/groupPerformance/list',
component: Layout,
hidden: true,
children: [{
path: '/center/groupPerformance/list',
name: 'GroupPerformanceList',
meta: { title: '客群业绩统计', activeMenu: '/center/groupPerformance/list' },
component: () => import('@/views/group/performance/list')
}]
},
{
path: '/center/groupPerformance/custom',
component: Layout,
hidden: true,
children: [{
path: '/center/groupPerformance/custom',
name: 'GroupPerformanceCustom',
meta: { title: '客群客户明细', activeMenu: '/center/groupPerformance/list' },
component: () => import('@/views/group/performance/custom')
}]
},
{
path: '/checklist/customerlist',
component: Layout,
@@ -353,8 +375,8 @@ export const constantRoutes = [
meta: { title: '个人中心', icon: 'user' }
}
]
},
];
}
];
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [

View File

@@ -432,7 +432,7 @@
v-if="item.cmpmType == '贷款客户经理'"
:label="`${item.cmpmType}`"
>
<span>{{ item.cmpmUserList }}</span>
<span>{{ is932Dept ? `${baseForm.belongUserName}-${baseForm.belongUserId}` : item.cmpmUserList }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -1242,6 +1242,7 @@ export default {
businessScope: '',
gridUserName: '',
belongUserName: '',
belongUserId: '',
updateTime: ''
},
registerLocationNum: '',
@@ -1374,7 +1375,7 @@ export default {
Custom
},
computed: {
...mapGetters(['roles', 'userName']),
...mapGetters(['roles', 'userName', 'deptId']),
isHeadAdmin() {
return this.roles.includes('headAdmin')
},
@@ -1386,6 +1387,10 @@ export default {
isPrivate() {
return this.roles.includes('headPrivate')
},
// 是否932开头部门
is932Dept() {
return String(this.deptId || '').substring(0, 3) === '932'
},
// 运管部
isHeadOps() {
return this.roles.includes('headOps')

View File

@@ -437,7 +437,7 @@
v-if="item.cmpmType == '贷款客户经理'"
:label="`${item.cmpmType}`"
>
<span>{{ item.cmpmUserList }}</span>
<span>{{ is932Dept ? `${baseForm.belongUserName}-${baseForm.belongUserId}` : item.cmpmUserList }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -1460,6 +1460,7 @@ export default {
tel: '',
gridUserName: '',
belongUserName: '',
belongUserId: '',
updateTime: ''
},
registerLocationNum: '',
@@ -1663,6 +1664,9 @@ export default {
},
is825() {
return String(this.deptId || '').substring(0, 3) === '825'
},
is932Dept() {
return String(this.deptId || '').substring(0, 3) === '932'
}
},
created() {

View File

@@ -364,7 +364,7 @@
v-if="item.cmpmType == '贷款客户经理'"
:label="`${item.cmpmType}`"
>
<span>{{ item.cmpmUserList }}</span>
<span>{{ is932Dept ? `${profile.belongUserName}-${profile.belongUserId}` : item.cmpmUserList }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -1663,7 +1663,7 @@ export default {
CustContact
},
computed: {
...mapGetters(['roles', 'userName']),
...mapGetters(['roles', 'userName', 'deptId']),
isHeadAdmin() {
return this.roles.includes('headAdmin')
},
@@ -1675,6 +1675,10 @@ export default {
isPrivate() {
return this.roles.includes('headPrivate')
},
// 是否932开头部门
is932Dept() {
return String(this.deptId || '').substring(0, 3) === '932'
},
// 运管部
isHeadOps() {
return this.roles.includes('headOps')

View File

@@ -142,7 +142,7 @@
<el-dropdown-item @click.native="handleExportAll">导出前1000条<i class="quesiton"></i></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<template v-if="selectedTab === '2' && is825">
<template v-if="selectedTab === '2' && canSeeBusinessImport">
<div class="import-action">
<el-upload
ref="businessImportUploadRef"
@@ -367,6 +367,9 @@ export default {
}
return this.tableData
},
isHeadAdmin() {
return this.roles.includes('headAdmin')
},
isPublic() {
return this.roles.includes('headPublic')
},
@@ -379,6 +382,9 @@ export default {
is825() {
return String(this.deptId || '').substring(0, 3) === '825'
},
canSeeBusinessImport() {
return this.is825 && (this.isHeadAdmin || this.isPublic || this.isPrivate || this.isOps)
},
// 客户经理
isCommonManager() {
return this.roles.includes('commonManager')

View File

@@ -112,6 +112,7 @@ import { Message } from "element-ui";
import {
privateTotalColumns, publicTotalColumns,
privateTotalColumnsNew825,
privateTotalColumnsNm, publicTotalColumnsNm,
privateTotalColumnsMap, publicTotalColumnsMap,
privateTotalColumnsAll, publicTotalColumnsAll,
@@ -163,7 +164,7 @@ export default {
},
computed: {
...mapGetters(["roles"]),
...mapGetters(["roles", "deptId"]),
//对公
isPublic() {
return this.roles.includes("headPublic");
@@ -172,6 +173,9 @@ export default {
isPrivate() {
return this.roles.includes("headPrivate");
},
isRetailNew825Tenant() {
return String(this.deptId || '').slice(0, 3) === '825';
},
},
created() {
const {
@@ -196,7 +200,7 @@ export default {
this.shapeName = shapeName;
this.shapeId = shapeId;
if (type == '1') {
this.tableColumns = this.isActive1 ? privateTotalColumns : this.isActive3 ?
this.tableColumns = this.isActive1 ? (this.isRetailNew825Tenant ? privateTotalColumnsNew825 : privateTotalColumns) : this.isActive3 ?
privateTotalColumnsNm : this.isActive4 ? privateTotalColumnsMap : privateTotalColumnsAll;
}
if (type == '2') {

View File

@@ -279,6 +279,7 @@ import { cloneDeep, isEmpty } from 'lodash'
import { Message } from 'element-ui'
import {
privateColumns,
privateColumnsNew825,
publicColumns,
privateColumnsNm,
publicColumnsNm,
@@ -349,7 +350,7 @@ export default {
}
},
computed: {
...mapGetters(['roles', 'userName']),
...mapGetters(['roles', 'userName', 'deptId']),
// 对公
isPublic() {
return this.roles.includes('headPublic')
@@ -361,52 +362,17 @@ export default {
// 965租户
is965() {
return this.userName.slice(0, 3) == 965
},
isRetailNew825Tenant() {
return String(this.deptId || '').slice(0, 3) === '825'
}
},
watch: {
selectedTab: {
handler(val) {
if (val) {
if (val == '1') {
this.tableColumns = this.isActive1
? privateColumns
: this.isActive3
? privateColumnsNm
: this.isActive4
? privateColumnsMap
: this.isActive7
? customAuth
: privateColumnsAll
this.tableKey = this.isActive1
? '11'
: this.isActive3
? '12'
: this.isActive4
? '13'
: this.isActive7
? '15'
: '14'
}
if (val == '2') {
this.tableColumns = this.isActive1
? publicColumns
: this.isActive3
? publicColumnsNm
: this.isActive4
? publicColumnsMap
: this.isActive7
? customAuth
: publicColumnsAll
this.tableKey = this.isActive1
? '21'
: this.isActive3
? '22'
: this.isActive4
? '23'
: this.isActive7
? '25'
: '24'
}
this.tableColumns = this.getCurrentColumns(val)
this.tableKey = this.getCurrentTableKey(val)
}
},
immediate: true
@@ -432,46 +398,8 @@ export default {
this.isActive3 = isActive == '3'
this.isActive4 = isActive == '4'
this.isActive6 = isActive == '6'
if (type == '1') {
this.tableColumns = this.isActive1
? privateColumns
: this.isActive3
? privateColumnsNm
: this.isActive4
? privateColumnsMap
: this.isActive7
? customAuth
: privateColumnsAll
this.tableKey = this.isActive1
? '11'
: this.isActive3
? '12'
: this.isActive4
? '13'
: this.isActive7
? '15'
: '14'
}
if (type == '2') {
this.tableColumns = this.isActive1
? publicColumns
: this.isActive3
? publicColumnsNm
: this.isActive4
? publicColumnsMap
: this.isActive7
? customAuth
: publicColumnsAll
this.tableKey = this.isActive1
? '21'
: this.isActive3
? '22'
: this.isActive4
? '23'
: this.isActive7
? '25'
: '24'
}
this.tableColumns = this.getCurrentColumns(type)
this.tableKey = this.getCurrentTableKey(type)
for (const key in this.$route.query) {
delete this.$route.query[key]
}
@@ -489,6 +417,53 @@ export default {
this.init()
},
methods: {
getRetailPrivateColumns() {
return this.isRetailNew825Tenant ? privateColumnsNew825 : privateColumns
},
getCurrentColumns(tab) {
if (tab == '1') {
return this.isActive1
? this.getRetailPrivateColumns()
: this.isActive3
? privateColumnsNm
: this.isActive4
? privateColumnsMap
: this.isActive7
? customAuth
: privateColumnsAll
}
return this.isActive1
? publicColumns
: this.isActive3
? publicColumnsNm
: this.isActive4
? publicColumnsMap
: this.isActive7
? customAuth
: publicColumnsAll
},
getCurrentTableKey(tab) {
if (tab == '1') {
return this.isActive1
? (this.isRetailNew825Tenant ? '11-825' : '11')
: this.isActive3
? '12'
: this.isActive4
? '13'
: this.isActive7
? '15'
: '14'
}
return this.isActive1
? '21'
: this.isActive3
? '22'
: this.isActive4
? '23'
: this.isActive7
? '25'
: '24'
},
handleMyApprove(type) {
this.isActive1 = type == '1'
this.isActive2 = type == '2'
@@ -504,46 +479,8 @@ export default {
this.isActive6 ||
this.isActive7
) {
if (this.selectedTab == '1') {
this.tableColumns = this.isActive1
? privateColumns
: this.isActive3
? privateColumnsNm
: this.isActive4
? privateColumnsMap
: this.isActive7
? customAuth
: privateColumnsAll
this.tableKey = this.isActive1
? '11'
: this.isActive3
? '12'
: this.isActive4
? '13'
: this.isActive7
? '15'
: '14'
}
if (this.selectedTab == '2') {
this.tableColumns = this.isActive1
? publicColumns
: this.isActive3
? publicColumnsNm
: this.isActive4
? publicColumnsMap
: this.isActive7
? customAuth
: publicColumnsAll
this.tableKey = this.isActive1
? '21'
: this.isActive3
? '22'
: this.isActive4
? '23'
: this.isActive7
? '25'
: '24'
}
this.tableColumns = this.getCurrentColumns(this.selectedTab)
this.tableKey = this.getCurrentTableKey(this.selectedTab)
const date = new Date()
date.setDate(date.getDate() - 1)
const year = date.getFullYear()

View File

@@ -201,6 +201,58 @@ export const privateColumns = [
}
]
export const privateColumnsNew825 = [
{ prop: 'dt', label: '统计日期(T+1)', width: 140 },
{ prop: 'gridName', label: '一级网格名称', width: 160 },
{ prop: 'gridName2', label: '二级网格名称', width: 160 },
{ prop: 'county', label: '县/区', width: 120 },
{ prop: 'town', label: '镇/街道', width: 140 },
{ prop: 'village', label: '村/社区', width: 140 },
{ prop: 'deptId', label: '归属支行机构号', width: 140 },
{ prop: 'deptName', label: '归属支行名称', width: 140 },
{ prop: 'outletsId', label: '归属网点机构号', width: 140 },
{ prop: 'outletsName', label: '归属网点名称', width: 140 },
{ prop: 'userName', label: '归属客户经理', width: 140 },
{ prop: 'custNum', label: '入格客户数', width: 120 },
{ prop: 'zf365cnt', label: '近365天已走访人数', width: 150 },
{ prop: 'zf180cnt', label: '近180天已走访人数', width: 150 },
{ prop: 'zf90cnt', label: '近90天已走访人数', width: 150 },
{ prop: 'zf30cnt', label: '近30天已走访人数', width: 150 },
{ prop: 'curBalD', label: '活期存款余额(元)', width: 160 },
{ prop: 'sxNum', label: '授信户数', width: 120 },
{ prop: 'yxNum', label: '用信户数', width: 120 },
{ prop: 'sxBal', label: '授信金额(合同)', width: 160 },
{ prop: 'balLoan', label: '贷款余额(元)', width: 150 },
{ prop: 'loanAve', label: '贷款年日均(元)', width: 150 },
{ prop: 'yxhtNum', label: '合同签约客户数', width: 150 },
{ prop: 'dianNum', label: '代扣电费客户数', width: 150 },
{ prop: 'shuiNum', label: '代扣水费客户数', width: 150 },
{ prop: 'taxNum', label: '代扣税费数', width: 140 },
{ prop: 'openNum', label: '开户数', width: 120 },
{ prop: 'depBal', label: '存款余额(元)', width: 150 },
{ prop: 'finBal', label: '财富余额(元)', width: 150 },
{ prop: 'grhxNum', label: '个人核心客户数', width: 150 },
{ prop: 'cfyxNum', label: '财富有效客户数', width: 150 },
{ prop: 'yxxykNum', label: '有效信用卡数', width: 140 },
{ prop: 'yxsbkNum', label: '有效社保卡户数', width: 150 },
{ prop: 'twoTo3SbkNum', label: '有效社保卡新增', width: 160 },
{ prop: 'yljToSbkNum', label: '养老金迁移至社保卡户数', width: 180 },
{ prop: 'fshlNum', label: '丰收互联客户数', width: 150 },
{ prop: 'yxsdNum', label: '有效收单商户', width: 140 },
{ prop: 'hxsdNum', label: '核心收单户数', width: 140 },
{ prop: 'zf365rt', label: '近365天走访率', width: 140 },
{ prop: 'zf180rt', label: '近180天走访率', width: 140 },
{ prop: 'zf90rt', label: '近90天走访率', width: 140 },
{ prop: 'zf30rt', label: '近30天走访率', width: 140 },
{ prop: 'sxRat', label: '授信率(%', width: 120 },
{ prop: 'yxRat', label: '用信覆盖率', width: 120 },
{ prop: 'yxhtRat', label: '合同签约率(%', width: 140 },
{ prop: 'dianRat', label: '代扣电费覆盖率(%', width: 150 },
{ prop: 'shuiRat', label: '代扣水费率(%', width: 140 },
{ prop: 'taxRat', label: '代扣税费率(%', width: 140 },
{ prop: 'openRat', label: '开户率(%', width: 120 }
]
// 公司
export const publicColumns = [
{
@@ -564,6 +616,38 @@ export const privateTotalColumns = [
}
]
export const privateTotalColumnsNew825 = [
{ prop: 'custName', label: '客户名称', width: 120 },
{ prop: 'custIdc', label: '客户证件号', width: 140 },
{ prop: 'custIsn', label: '客户内码', width: 120 },
{ prop: 'curBalD', label: '活期存款余额', width: 140 },
{ prop: 'balLoan', label: '贷款余额', width: 140 },
{ prop: 'loanAve', label: '贷款年日均', width: 140 },
{ prop: 'isSx', label: '是否授信', width: 100 },
{ prop: 'isYx', label: '是否用信', width: 100 },
{ prop: 'sxBal', label: '授信金额', width: 120 },
{ prop: 'isYxht', label: '是否合同签约', width: 120 },
{ prop: 'isXyk', label: '是否持有信用卡', width: 130 },
{ prop: 'fshl', label: '是否开通丰收互联', width: 140 },
{ prop: 'isSd', label: '是否办理收单', width: 120 },
{ prop: 'dian', label: '是否代扣电费', width: 120 },
{ prop: 'shui', label: '是否代扣水费', width: 120 },
{ prop: 'tax', label: '是否代扣税费', width: 120 },
{ prop: 'openNum', label: '开户数', width: 100 },
{ prop: 'depBal', label: '存款余额', width: 120 },
{ prop: 'finBal', label: '财富余额', width: 120 },
{ prop: 'isGrhx', label: '是否个人核心客户', width: 140 },
{ prop: 'isCfyx', label: '是否财富有效客户', width: 140 },
{ prop: 'isYxsbk', label: '是否有效社保卡客户', width: 150 },
{ prop: 'is2to3Sbk', label: '是否有效社保卡新增', width: 150 },
{ prop: 'isYljToSbk', label: '是否养老金迁移至社保卡', width: 180 },
{ prop: 'isHxsd', label: '是否核心收单', width: 120 },
{ prop: 'is365zf', label: '近365天有无走访', width: 140 },
{ prop: 'is180zf', label: '近180天有无走访', width: 140 },
{ prop: 'is90zf', label: '近90天有无走访', width: 140 },
{ prop: 'is30zf', label: '近30天有无走访', width: 140 }
]
// 公司明细
export const publicTotalColumns = [
{

View File

@@ -90,6 +90,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
@@ -150,7 +151,7 @@
</template>
<script>
import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList } from '@/api/gridSearch/accountManageReport/index'
import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList, exportCustManagerReport } from '@/api/gridSearch/accountManageReport/index'
export default {
data() {
return {
@@ -209,6 +210,19 @@ import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList }
this.queryParams.statusType = null
this.handleQuery()
},
handleExport() {
exportCustManagerReport({
custLevel: this.queryParams.custLevel,
statusType: this.queryParams.statusType
}).then(res => {
if (res.code === 200) {
this.$message.success(res.msg)
window.dispatchEvent(new Event('download-center-refresh'))
}
}).catch(err => {
this.$message.error(err?.msg || '导出失败')
})
},
getData() {
this.loading = true;
gridCmpmCustManagerList(this.queryParams).then(res => {

View File

@@ -22,11 +22,22 @@
<el-radio label="0">静态客群</el-radio>
<el-radio label="1">动态客群</el-radio>
</el-radio-group>
<div class="form-tip">
静态客群创建后客户列表固定除非手动更新
<!-- <div class="form-tip">
静态客群创建后客户列表固定
<br />
动态客群系统定期根据原始条件自动刷新客户列表
</div>
</div> -->
</el-form-item>
<el-form-item label="客群类型" prop="groupType">
<el-radio-group v-model="form.groupType" :disabled="isEdit">
<el-radio label="0">零售类</el-radio>
<el-radio label="1">公司类</el-radio>
</el-radio-group>
<!-- <div class="form-tip">
零售类只能导入个人和商户客户
<br />
公司类只能导入企业客户
</div> -->
</el-form-item>
<el-form-item label="有效期" prop="validTime">
<el-date-picker
@@ -42,36 +53,65 @@
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" :rows="2" />
</el-form-item>
<el-form-item label="客群标签">
<div class="tag-input-wrapper">
<el-input
v-model="tagInput"
placeholder="输入标签后点击加号添加"
style="width: calc(100% - 40px)"
@keyup.enter.native="addTag"
/>
<el-button type="primary" icon="el-icon-plus" @click="addTag" style="margin-left: 8px" />
</div>
<div class="tag-list" v-if="allTags.length > 0">
<span class="tag-label">已有标签</span>
<el-tag
v-for="tag in allTags"
:key="tag"
:type="selectedTags.includes(tag) ? 'primary' : 'info'"
:effect="selectedTags.includes(tag) ? 'dark' : 'plain'"
@click="toggleTag(tag)"
style="cursor: pointer; margin-right: 8px; margin-bottom: 8px"
>
{{ tag }}
</el-tag>
</div>
<div class="selected-tags" v-if="selectedTags.length > 0">
<span class="tag-label">已选标签</span>
<el-tag
v-for="tag in selectedTags"
:key="tag"
closable
@close="removeTag(tag)"
style="margin-right: 8px; margin-bottom: 8px"
>
{{ tag }}
</el-tag>
</div>
</el-form-item>
<el-form-item label="开启共享">
<el-switch v-model="shareEnabled" />
</el-form-item>
<el-form-item label="可见部门" v-if="shareEnabled">
<el-select
v-model="form.shareDeptIdList"
v-model="shareDeptList"
multiple
filterable
placeholder="请选择可见部门"
style="width: 100%"
popper-class="dept-select-popper"
>
<el-option
v-for="dept in deptOptions"
:key="dept.deptId"
:label="dept.deptName"
:value="dept.deptId"
:value="String(dept.deptId)"
/>
</el-select>
</el-form-item>
<el-form-item label="创建方式" prop="createMode">
<el-radio-group v-model="form.createMode" :disabled="isEdit">
<el-radio label="1">模板导入</el-radio>
<el-radio label="2">绩效网格</el-radio>
<el-radio label="3">地理网格</el-radio>
<el-radio label="4">绘制网格</el-radio>
</el-radio-group>
</el-form-item>
<!-- 模板导入 -->
<template v-if="form.createMode === '1'">
<el-form-item label="客户文件" prop="file">
<el-upload
ref="upload"
@@ -94,37 +134,22 @@
</div>
</el-upload>
</el-form-item>
</template>
<!-- 绩效网格 -->
<template v-if="form.createMode === '2'">
<el-form-item label="业务类型" prop="cmpmBizType">
<el-select v-model="gridForm.cmpmBizType" placeholder="请选择业务类型" style="width: 100%" @change="handleCmpmBizTypeChange">
<el-option label="零售" value="retail" />
<el-option label="对公" value="corporate" />
<el-option label="对公账户" value="corporate_account" />
</el-select>
<el-form-item label="匹配网格类型" prop="gridType">
<el-radio-group v-model="form.gridType" @change="handleGridTypeChange">
<el-radio label="0">绩效网格</el-radio>
<!-- 暂时隐藏后续版本开放
<el-radio label="1">地理网格</el-radio>
<el-radio label="2">绘制网格</el-radio>
-->
</el-radio-group>
<div class="form-tip">
系统将根据客户信息从所选网格匹配管户关系匹配不上则保存空的管户关系
</div>
</el-form-item>
<el-form-item label="客户经理" prop="userNames">
<el-select
v-model="gridForm.userNames"
multiple
filterable
placeholder="请选择客户经理"
style="width: 100%"
>
<el-option
v-for="user in userOptions"
:key="user.userName"
:label="user.nickName"
:value="user.userName"
/>
</el-select>
</el-form-item>
</template>
<!-- 地理网格 -->
<template v-if="form.createMode === '3'">
<!-- 地理网格筛选 - 暂时隐藏后续版本开放
<template v-if="form.gridType === '1'">
<el-form-item label="网格级别">
<el-radio-group v-model="regionQuery.gridLevel">
<el-radio label="1">总行行政网格</el-radio>
@@ -146,11 +171,11 @@
</el-form-item>
<el-form-item label="选择网格">
<el-select
v-model="gridForm.regionGridIds"
v-model="form.regionGridIds"
multiple
filterable
collapse-tags
placeholder="请先查询网格,然后选择"
placeholder="请选择网格"
style="width: 100%"
>
<el-option
@@ -162,15 +187,16 @@
</el-select>
</el-form-item>
</template>
-->
<!-- 绘制网格 -->
<template v-if="form.createMode === '4'">
<el-form-item label="绘制网格" prop="drawGridIds">
<!-- 绘制网格筛选 - 暂时隐藏后续版本开放
<template v-if="form.gridType === '2'">
<el-form-item label="绘制网格">
<el-select
v-model="gridForm.drawGridIds"
v-model="form.drawGridIds"
multiple
filterable
placeholder="请选择绘制网格"
placeholder="请选择网格"
style="width: 100%"
>
<el-option
@@ -182,6 +208,7 @@
</el-select>
</el-form-item>
</template>
-->
</el-form>
<div slot="footer" class="dialog-footer">
@@ -195,16 +222,14 @@
<script>
import {
createCustGroupByGrid,
createCustGroupByTemplate,
updateCustGroupByGrid,
updateCustGroupByTemplate,
downloadTemplate,
getManagerList,
getRegionGridListForGroup
getRegionGridListForGroup,
getCreateStatus,
getAllGroupTags
} from '@/api/group/custGroup'
import { getToken } from '@/utils/auth'
import { listUser } from '@/api/system/user'
import { listDept } from '@/api/system/dept'
import { getSimpleGridList } from '@/api/grid/list/gridlist'
@@ -231,8 +256,61 @@ export default {
// 上传地址
uploadUrl: process.env.VUE_APP_BASE_API + '/group/cust/createByTemplate',
uploadHeaders: { Authorization: 'Bearer ' + getToken() },
// 处理中提示
processTipVisible: false
// 表单数据
form: {
id: null,
groupName: null,
groupMode: '0',
groupType: '0',
groupStatus: '0',
gridType: '0',
regionGridIds: [],
drawGridIds: [],
shareEnabled: 0,
shareDeptIdList: [],
remark: null,
validTime: null
},
// 共享开关
shareEnabled: false,
// 已选部门列表字符串数组用于el-select绑定
shareDeptList: [],
// 上传文件
uploadFile: null,
// 表单验证规则
rules: {
groupName: [
{ required: true, message: '请输入客群名称', trigger: 'blur' },
{ min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
],
groupMode: [{ required: true, message: '请选择客群模式', trigger: 'change' }],
groupType: [{ required: true, message: '请选择客群类型', trigger: 'change' }],
gridType: [{ required: true, message: '请选择匹配网格类型', trigger: 'change' }]
},
// 部门选项
deptOptions: [],
// 地理网格选项
regionGridOptions: [],
// 地理网格查询条件
regionQuery: {
gridLevel: '1',
gridDutyType: null,
gridName: null
},
// 地理网格加载状态
regionLoading: false,
// 绘制网格选项
drawGridOptions: [],
// 轮询定时器
pollTimer: null,
// 标签输入框内容
tagInput: '',
// 所有已有标签列表
allTags: [],
// 已选标签列表
selectedTags: [],
// 关闭弹窗时是否保留状态轮询
keepPollingOnClose: false
}
},
computed: {
@@ -247,70 +325,18 @@ export default {
return '确 定'
}
},
data() {
return {
// 提交中状态
submitting: false,
// 上传地址
uploadUrl: process.env.VUE_APP_BASE_API + '/group/cust/createByTemplate',
uploadHeaders: { Authorization: 'Bearer ' + getToken() },
// 处理中提示
processTipVisible: false,
// 表单数据
form: {
id: null,
groupName: null,
groupMode: '0',
createMode: '1',
groupStatus: '0',
shareEnabled: 0,
shareDeptIdList: [],
remark: null,
validTime: null
},
// 共享开关
shareEnabled: false,
// 网格表单数据
gridForm: {
gridType: '0',
cmpmBizType: null,
userNames: [],
regionGridIds: [],
drawGridIds: []
},
// 上传文件
uploadFile: null,
// 表单验证规则
rules: {
groupName: [
{ required: true, message: '请输入客群名称', trigger: 'blur' },
{ min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
],
groupMode: [{ required: true, message: '请选择客群模式', trigger: 'change' }],
createMode: [{ required: true, message: '请选择创建方式', trigger: 'change' }]
},
// 部门选项
deptOptions: [],
// 用户选项
userOptions: [],
// 地理网格选项
regionGridOptions: [],
// 地理网格查询条件
regionQuery: {
gridLevel: '1',
gridDutyType: null,
gridName: null
},
// 地理网格加载状态
regionLoading: false,
// 绘制网格选项
drawGridOptions: []
}
},
watch: {
visible(val) {
if (val) {
this.init()
if (this.shareEnabled && this.deptOptions.length === 0) {
this.loadDeptOptions()
}
}
},
shareEnabled(val) {
if (val && this.deptOptions.length === 0) {
this.loadDeptOptions()
}
},
groupData: {
@@ -318,143 +344,141 @@ export default {
if (val && Object.keys(val).length > 0) {
this.form = { ...val }
this.shareEnabled = val.shareEnabled === 1
// 解析 shareDeptIds 字符串为 shareDeptIdList 数组
// 解析 shareDeptIds 字符串为 shareDeptList 数组保持字符串类型以匹配el-option的value
if (val.shareDeptIds) {
this.form.shareDeptIdList = val.shareDeptIds.split(',').filter(id => id)
this.shareDeptList = val.shareDeptIds.split(',').filter(id => id)
} else {
this.form.shareDeptIdList = []
this.shareDeptList = []
}
// 解析网格ID
if (val.regionGridIds) {
this.form.regionGridIds = val.regionGridIds.split(',').map(id => parseInt(id)).filter(id => id)
} else {
this.form.regionGridIds = []
}
if (val.drawGridIds) {
this.form.drawGridIds = val.drawGridIds.split(',').map(id => parseInt(id)).filter(id => id)
} else {
this.form.drawGridIds = []
}
// 解析标签
if (val.groupTags) {
this.selectedTags = val.groupTags.split(',').map(tag => tag.trim()).filter(tag => tag)
} else {
this.selectedTags = []
}
// 反显网格数据(需要在 form.createMode watch 之后执行)
// 反显网格数据
this.$nextTick(() => {
this.restoreGridData(val)
})
}
},
immediate: true
},
'form.createMode'(val) {
// 重置网格表单
this.gridForm = {
gridType: val === '2' ? '0' : val === '3' ? '1' : '2',
regionGridIds: [],
drawGridIds: []
}
// 切换到地理网格模式时,重置查询条件
if (val === '3') {
this.resetRegionQuery()
}
// 切换到绘制网格模式时,加载绘制网格列表
if (val === '4') {
this.loadDrawGridOptions()
}
},
'gridForm.cmpmBizType'(val) {
// 当业务类型改变时,清空已选择的客户经理
if (val) {
this.gridForm.userNames = []
this.loadManagerOptions()
}
},
'form.createStatus'(val) {
// 监听创建状态变化,显示提示
if (this.isEdit && val === '0') {
this.processTipVisible = true
} else if (this.processTipVisible) {
this.processTipVisible = false
}
}
},
created() {
this.loadDeptOptions()
this.loadAllTags()
},
beforeDestroy() {
this.clearPollTimer()
},
methods: {
/** 初始化 */
init() {
this.$nextTick(() => {
this.$refs.form && this.$refs.form.clearValidate()
// 编辑模式下,恢复网格数据
if (this.isEdit && this.groupData && Object.keys(this.groupData).length > 0) {
this.restoreGridData(this.groupData)
}
})
},
/** 反显网格数据 */
restoreGridData(data) {
if (!this.isEdit) return
if (!this.isEdit || !data.gridType) return
const createMode = String(data.createMode)
// 根据创建方式反显网格数据
if (createMode === '2' && data.gridType === '0') {
// 绩效网格
this.gridForm.gridType = '0'
this.gridForm.cmpmBizType = data.cmpmBizType
if (data.gridUserNames) {
this.gridForm.userNames = data.gridUserNames.split(',').filter(n => n)
// 加载客户经理选项
this.loadManagerOptions()
}
} else if (createMode === '3' && data.gridType === '1') {
// 地理网格 - 需要查询所有网格以便正确反显
this.gridForm.gridType = '1'
// 设置默认查询条件(获取所有网格)
this.regionQuery = {
gridLevel: '1',
gridDutyType: null,
gridName: null
}
if (data.gridType === '1') {
this.resetRegionQuery()
if (data.regionGridIds) {
this.gridForm.regionGridIds = data.regionGridIds.split(',').map(id => parseInt(id)).filter(id => id)
// 加载地理网格选项(无查询条件,获取全部)
this.loadRegionGridOptions()
}
} else if (createMode === '4' && data.gridType === '2') {
// 绘制网格
this.gridForm.gridType = '2'
if (data.drawGridIds) {
this.gridForm.drawGridIds = data.drawGridIds.split(',').map(id => parseInt(id)).filter(id => id)
// 加载绘制网格选项
} else if (data.gridType === '2') {
this.loadDrawGridOptions()
}
}
},
/** 加载部门选项 */
loadDeptOptions() {
listDept().then(response => {
this.deptOptions = response.data || []
// 将树形结构扁平化以便el-select遍历
this.deptOptions = this.flattenDeptList(response.data || [])
}).catch(() => {
this.deptOptions = []
})
},
/** 加载用户选项 */
loadUserOptions() {
listUser().then(response => {
this.userOptions = response.rows || []
/** 扁平化部门树 */
flattenDeptList(list, result = []) {
list.forEach(item => {
result.push({ deptId: item.deptId, deptName: item.deptName })
if (item.children && item.children.length > 0) {
this.flattenDeptList(item.children, result)
}
})
return result
},
/** 加载所有已有标签 */
loadAllTags() {
getAllGroupTags().then(response => {
this.allTags = response.data || []
}).catch(() => {
this.userOptions = []
this.allTags = []
})
},
/** 根据业务类型加载客户经理选项 */
loadManagerOptions() {
if (!this.gridForm.cmpmBizType) {
this.userOptions = []
/** 添加标签 */
addTag() {
const tag = this.tagInput.trim()
if (!tag) return
if (this.selectedTags.includes(tag)) {
this.$message.warning('该标签已添加')
return
}
getManagerList(this.gridForm.cmpmBizType).then(response => {
this.userOptions = response.data || []
}).catch(() => {
this.userOptions = []
})
this.selectedTags.push(tag)
// 如果是新标签添加到allTags中
if (!this.allTags.includes(tag)) {
this.allTags.push(tag)
}
this.tagInput = ''
},
/** 业务类型改变处理 */
handleCmpmBizTypeChange(val) {
// 清空已选择的客户经理
this.gridForm.userNames = []
/** 切换标签选中状态 */
toggleTag(tag) {
const index = this.selectedTags.indexOf(tag)
if (index > -1) {
this.selectedTags.splice(index, 1)
} else {
this.selectedTags.push(tag)
}
},
/** 移除已选标签 */
removeTag(tag) {
const index = this.selectedTags.indexOf(tag)
if (index > -1) {
this.selectedTags.splice(index, 1)
}
},
/** 网格类型改变处理 */
handleGridTypeChange(val) {
if (val === '1') {
this.resetRegionQuery()
} else if (val === '2') {
this.loadDrawGridOptions()
}
// 清空网格选择
this.form.regionGridIds = []
this.form.drawGridIds = []
},
/** 加载地理网格选项 */
@@ -486,7 +510,7 @@ export default {
gridDutyType: null,
gridName: null
}
this.gridForm.regionGridIds = []
this.form.regionGridIds = []
},
/** 加载绘制网格选项 */
@@ -534,28 +558,21 @@ export default {
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
// 处理共享设置
this.form.shareEnabled = this.shareEnabled ? 1 : 0
// 转换 shareDeptIdList 数组为 shareDeptIds 逗号分隔字符串
this.form.shareDeptIds = this.form.shareDeptIdList.join(',')
// 根据创建方式处理提交数据
if (this.form.createMode === '1') {
this.handleTemplateSubmit()
} else {
this.handleGridSubmit()
}
}
})
},
/** 模板导入提交 */
handleTemplateSubmit() {
if (!this.uploadFile && !this.isEdit) {
this.$modal.msgWarning('请选择要上传的文件')
return
}
// 处理共享设置
this.form.shareEnabled = this.shareEnabled ? 1 : 0
// 转换 shareDeptIdList 数组为 shareDeptIds 逗号分隔字符串
this.form.shareDeptIds = this.shareDeptList.join(',')
// 转换选中的标签为逗号分隔字符串
this.form.groupTags = this.selectedTags.join(',')
// 转换网格ID数组为逗号分隔字符串
this.form.regionGridIds = this.form.regionGridIds.join(',')
this.form.drawGridIds = this.form.drawGridIds.join(',')
this.submitting = true
// 构建表单数据
@@ -566,11 +583,19 @@ export default {
}
if (this.isEdit) {
// 编辑模式:重新导入模板文件
// 编辑模式
updateCustGroupByTemplate(formData).then(response => {
this.$modal.msgSuccess('客群更新中,请稍后刷新查看')
this.submitting = false
this.$emit('submit', { id: this.form.id })
if (response.msg === '客群更新成功') {
// 没有上传文件,直接更新成功
this.$modal.msgSuccess('客群更新成功')
this.$emit('submit', { id: this.form.id, refresh: true })
} else {
// 有上传文件,后台正在处理
this.$modal.msgSuccess('客群更新任务已提交,后台正在处理')
this.keepPollingOnClose = true
this.startPollingStatus(this.form.id)
}
this.handleClose()
}).catch(() => {
this.submitting = false
@@ -578,57 +603,24 @@ export default {
} else {
// 新增模式
createCustGroupByTemplate(formData).then(response => {
this.$modal.msgSuccess('客群创建中,请稍后刷新查看')
const groupId = response && response.data ? response.data : null
if (!groupId) {
this.$modal.msgError('客群创建成功但未获取到任务ID请稍后在列表中查看状态')
this.submitting = false
this.$emit('submit', { id: response.data })
this.handleClose()
return
}
this.$modal.msgSuccess('客群创建任务已提交,后台正在处理')
this.submitting = false
this.keepPollingOnClose = true
this.startPollingStatus(groupId)
this.handleClose()
}).catch(() => {
this.submitting = false
})
}
},
/** 网格导入提交 */
handleGridSubmit() {
this.submitting = true
// 构建提交数据
const submitData = {
custGroup: { ...this.form },
gridType: this.form.createMode === '2' ? '0' : this.form.createMode === '3' ? '1' : '2',
cmpmBizType: this.gridForm.cmpmBizType,
userNames: this.gridForm.userNames,
regionGridIds: this.gridForm.regionGridIds,
drawGridIds: this.gridForm.drawGridIds
}
if (this.isEdit) {
// 编辑模式:重新导入网格
updateCustGroupByGrid(submitData).then(response => {
// 使用后端返回的消息
const msg = response.msg || '客群更新成功'
if (msg.includes('更新中')) {
this.$modal.msgSuccess('客群更新中,请稍后刷新查看')
} else {
this.$modal.msgSuccess(msg)
}
this.submitting = false
this.$emit('submit', { id: this.form.id })
this.handleClose()
}).catch(() => {
this.submitting = false
})
} else {
// 新增模式
createCustGroupByGrid(submitData).then(response => {
this.$modal.msgSuccess('客群创建中,请稍后刷新查看')
this.submitting = false
this.$emit('submit', { id: response.data })
this.handleClose()
}).catch(() => {
this.submitting = false
})
}
},
/** 关闭弹窗 */
@@ -637,27 +629,67 @@ export default {
this.resetForm()
},
/** 开始轮询创建状态 */
startPollingStatus(groupId) {
if (!groupId || groupId === 'undefined' || groupId === 'null') {
return
}
this.clearPollTimer()
// 每30秒轮询一次
this.pollTimer = setInterval(() => {
getCreateStatus(groupId).then(res => {
const status = res.data
if (status === '1') {
// 创建成功
this.clearPollTimer()
this.keepPollingOnClose = false
window.dispatchEvent(new Event('notice-center-refresh'))
this.$modal.msgSuccess('客群导入完成')
this.$emit('submit', { id: groupId, refresh: true })
} else if (status === '2') {
// 创建失败
this.clearPollTimer()
this.keepPollingOnClose = false
window.dispatchEvent(new Event('notice-center-refresh'))
this.$modal.msgError('客群导入失败,请查看消息中心了解详情')
}
}).catch(() => {
// 查询失败,继续轮询
})
}, 30000)
},
/** 清除轮询定时器 */
clearPollTimer() {
if (this.pollTimer) {
clearInterval(this.pollTimer)
this.pollTimer = null
}
},
/** 重置表单 */
resetForm() {
if (!this.keepPollingOnClose) {
this.clearPollTimer()
}
this.form = {
id: null,
groupName: null,
groupMode: '0',
createMode: '1',
groupType: '0',
groupStatus: '0',
gridType: '0',
regionGridIds: [],
drawGridIds: [],
shareEnabled: 0,
shareDeptIdList: [],
remark: null,
validTime: null
}
this.shareEnabled = false
this.gridForm = {
gridType: '0',
cmpmBizType: null,
userNames: [],
regionGridIds: [],
drawGridIds: []
}
this.shareDeptList = []
this.tagInput = ''
this.selectedTags = []
this.uploadFile = null
if (this.$refs.upload) {
this.$refs.upload.clearFiles()
@@ -677,4 +709,31 @@ export default {
line-height: 1.5;
margin-top: 5px;
}
.tag-input-wrapper {
display: flex;
align-items: center;
}
.tag-list,
.selected-tags {
margin-top: 10px;
padding: 10px;
background-color: #f5f7fa;
border-radius: 4px;
}
.tag-label {
display: block;
font-size: 12px;
color: #909399;
margin-bottom: 8px;
}
</style>
<style>
/* 解决弹窗内下拉框被遮挡的问题 */
.dept-select-popper {
z-index: 9999 !important;
}
</style>

View File

@@ -36,18 +36,55 @@
<div class="main_table">
<el-table v-loading="loading" :data="memberList">
<el-table-column label="序号" type="index" width="60" align="center" :index="indexMethod" />
<el-table-column label="客户类型" align="center" width="100">
<el-table-column label="存量状态" align="center" width="90">
<template slot-scope="scope">
<el-tag v-if="scope.row.isExisting" size="small" type="success">存量</el-tag>
<el-tag v-else size="small" type="danger">非存量</el-tag>
</template>
</el-table-column>
<el-table-column label="客户类型" align="center" width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.custType === '0'" size="small">个人</el-tag>
<el-tag v-else-if="scope.row.custType === '1'" size="small" type="warning">商户</el-tag>
<el-tag v-else-if="scope.row.custType === '2'" size="small" type="success">企业</el-tag>
</template>
</el-table-column>
<el-table-column label="客户号" prop="custId" width="150" />
<el-table-column label="客户姓名" prop="custName" width="120" />
<el-table-column label="客户号" prop="custId" width="150">
<template slot-scope="scope">
<el-button type="text" @click="handleCustClick(scope.row)">{{ scope.row.custId }}</el-button>
</template>
</el-table-column>
<el-table-column label="客户姓名" prop="custName" width="120">
<template slot-scope="scope">
<el-button type="text" @click="handleCustClick(scope.row)">{{ scope.row.custName || '-' }}</el-button>
</template>
</el-table-column>
<el-table-column label="身份证号" prop="custIdc" show-overflow-tooltip />
<el-table-column label="统信码" prop="socialCreditCode" show-overflow-tooltip />
<el-table-column label="客户经理" prop="nickName" width="100">
<template slot-scope="scope">
<span v-if="scope.row.nickName">{{ scope.row.nickName }}</span>
<span v-else class="text-muted">-</span>
</template>
</el-table-column>
<el-table-column label="所属网点" prop="outletName" width="150">
<template slot-scope="scope">
<span v-if="scope.row.outletName">{{ scope.row.outletName }}</span>
<span v-else class="text-muted">-</span>
</template>
</el-table-column>
<el-table-column label="所属支行" prop="branchName" width="150">
<template slot-scope="scope">
<span v-if="scope.row.branchName">{{ scope.row.branchName }}</span>
<span v-else class="text-muted">-</span>
</template>
</el-table-column>
<el-table-column label="添加时间" prop="createTime" width="180" />
<el-table-column v-if="isMineView" label="操作" align="center" width="80" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="handleRemove(scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
@@ -63,7 +100,8 @@
</template>
<script>
import { listCustGroupMembers } from '@/api/group/custGroup'
import { listCustGroupMembers, removeMembers } from '@/api/group/custGroup'
import { mapGetters } from 'vuex'
export default {
name: 'CustGroupDetail',
@@ -71,6 +109,7 @@ export default {
return {
loading: false,
groupId: null,
viewType: 'mine',
memberList: [],
total: 0,
queryParams: {
@@ -81,8 +120,28 @@ export default {
}
}
},
watch: {
'$route.query.groupId'(newGroupId) {
if (newGroupId && newGroupId !== this.groupId) {
this.groupId = newGroupId
this.viewType = this.resolveViewType(this.$route.query.viewType)
this.queryParams.pageNum = 1
this.getList()
}
}
},
computed: {
...mapGetters(['roles']),
isHeadCustGroupAdmin() {
return ['headAdmin', 'headPublic', 'headPrivate', 'headOps'].some(role => this.roles.includes(role))
},
isMineView() {
return this.viewType === 'mine'
}
},
created() {
this.groupId = this.$route.query.groupId
this.viewType = this.resolveViewType(this.$route.query.viewType)
if (this.groupId) {
this.getList()
} else {
@@ -90,16 +149,14 @@ export default {
this.goBack()
}
},
watch: {
'$route.query.groupId'(newGroupId) {
if (newGroupId && newGroupId !== this.groupId) {
this.groupId = newGroupId
this.queryParams.pageNum = 1
this.getList()
}
}
},
methods: {
resolveViewType(viewType) {
if (!this.isHeadCustGroupAdmin) {
return 'sharedToMe'
}
return viewType === 'sharedToMe' ? 'sharedToMe' : 'mine'
},
/** 查询客户列表 */
getList(param) {
if (param) {
@@ -128,9 +185,64 @@ export default {
this.handleQuery()
},
handleRemove(row) {
this.$modal.confirm(`确认移除客户“${row.custName || row.custId}”吗?移除后后续动态更新不会再加入客群。`).then(() => {
return removeMembers(this.groupId, [row.id])
}).then(() => {
this.$modal.msgSuccess('移除成功')
if (this.memberList.length === 1 && this.queryParams.pageNum > 1) {
this.queryParams.pageNum -= 1
}
this.getList()
}).catch(() => {})
},
/** 返回 */
goBack() {
this.$router.push({ path: '/group/custGroup' })
const fromPerformance = this.$route.query.fromPerformance
if (fromPerformance === '1') {
this.$router.push({
path: '/center/performance/list',
query: { isActive: '8' }
})
return
}
// 返回上一级客群列表;没有历史记录时兜底跳客群列表
if (window.history.length > 1) {
this.$router.back()
} else {
this.$router.push({
path: '/group/custGroup',
query: {
tab: this.resolveViewType(this.viewType),
refresh: Date.now()
}
})
}
},
/** 点击客户号/姓名跳转360视图 */
handleCustClick(row) {
const custType = row.custType
let path = ''
if (custType === '0') {
// 个人客户
path = '/360charts/indexcharts'
} else if (custType === '1') {
// 商户
path = '/360charts/commercial/'
} else if (custType === '2') {
// 企业
path = '/360charts/firm/'
}
this.$router.push({
path: path,
query: {
custId: row.custId,
selectedTab: custType,
backUrl: '/group/custGroup'
}
})
},
/** 序号计算方法 */
@@ -183,5 +295,9 @@ export default {
margin-top: 15px;
}
}
.text-muted {
color: #909399;
}
}
</style>

View File

@@ -1,8 +1,32 @@
<template>
<div class="customer-wrap">
<!-- 搜索区域 -->
<div class="search-area" v-show="showSearch">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px">
<div class="nav_box">
<el-radio-group v-model="activeTab" class="header-radio" @input="handleTabChange">
<el-radio-button
label="mine"
:disabled="!isHeadCustGroupAdmin"
:class="{ 'btn-disabled': !isHeadCustGroupAdmin }"
>
我创建的
</el-radio-button>
<el-radio-button
label="sharedToMe"
:disabled="isHeadCustGroupAdmin"
:class="{ 'btn-disabled': isHeadCustGroupAdmin }"
>
下发给我的
</el-radio-button>
</el-radio-group>
</div>
<div v-show="showSearch" class="search-area">
<el-form
ref="queryForm"
:model="queryParams"
size="small"
:inline="true"
label-width="80px"
>
<el-form-item label="客群名称" prop="groupName">
<el-input
v-model="queryParams.groupName"
@@ -13,79 +37,151 @@
/>
</el-form-item>
<el-form-item label="客群模式" prop="groupMode">
<el-select v-model="queryParams.groupMode" placeholder="请选择" clearable style="width: 150px">
<el-select
v-model="queryParams.groupMode"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option label="静态" value="0" />
<el-option label="动态" value="1" />
</el-select>
</el-form-item>
<el-form-item label="创建方式" prop="createMode">
<el-select v-model="queryParams.createMode" placeholder="请选择" clearable style="width: 150px">
<el-option label="模板导入" value="1" />
<el-option label="绩效网格" value="2" />
<el-option label="地理网格" value="3" />
<el-option label="绘制网格" value="4" />
</el-select>
</el-form-item>
<el-form-item label="客群状态" prop="groupStatus">
<el-select v-model="queryParams.groupStatus" placeholder="请选择" clearable style="width: 150px">
<el-select
v-model="queryParams.groupStatus"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option label="正常" value="0" />
<el-option label="已禁用" value="1" />
</el-select>
</el-form-item>
<el-form-item label="客群标签" prop="groupTags">
<el-select
v-model="queryParams.groupTags"
placeholder="请选择"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="tag in allTags"
:key="tag"
:label="tag"
:value="tag"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">
搜索
</el-button>
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">
重置
</el-button>
</el-form-item>
</el-form>
</div>
<!-- 操作栏 -->
<section class="operate-cnt">
<div class="operate-left">
<el-button type="primary" icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
<el-button type="danger" icon="el-icon-delete" size="small" :disabled="multiple" @click="handleDelete">删除</el-button>
<template v-if="isMineTab">
<el-button type="primary" icon="el-icon-plus" size="small" @click="handleAdd">
新增
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="small"
:disabled="multiple"
@click="handleDelete"
>
删除
</el-button>
</template>
</div>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</section>
<!-- 表格区域 -->
<div class="main_table">
<el-table v-loading="loading" :data="groupList" @selection-change="handleSelectionChange" style="width: 100%" max-height="625">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="客群名称" prop="groupName" min-width="180" show-overflow-tooltip />
<el-table-column label="客群模式" align="center" width="100">
<el-table
v-loading="loading"
:data="groupList"
style="width: 100%"
max-height="625"
@selection-change="handleSelectionChange"
>
<el-table-column
v-if="isMineTab"
type="selection"
width="55"
align="center"
/>
<el-table-column label="客群名称" prop="groupName" width="120" show-overflow-tooltip />
<el-table-column label="客群模式" align="center" width="120">
<template slot-scope="scope">
<el-tag v-if="scope.row.groupMode === '0'" type="info" size="small">静态</el-tag>
<el-tag v-else-if="scope.row.groupMode === '1'" type="success" size="small">动态</el-tag>
</template>
</el-table-column>
<el-table-column label="创建方式" align="center" width="120">
<template slot-scope="scope">
<span v-if="scope.row.createMode === '1'">模板导入</span>
<span v-else-if="scope.row.createMode === '2'">绩效网格</span>
<span v-else-if="scope.row.createMode === '3'">地理网格</span>
<span v-else-if="scope.row.createMode === '4'">绘制网格</span>
</template>
</el-table-column>
<el-table-column label="客户数量" align="center" prop="custCount" width="100" />
<el-table-column label="客群状态" align="center" width="100">
<el-table-column label="客户数量" align="center" prop="custCount" width="120" />
<el-table-column label="客群状态" align="center" width="120">
<template slot-scope="scope">
<el-tag v-if="scope.row.groupStatus === '0'" type="success" size="small">正常</el-tag>
<el-tag v-else-if="scope.row.groupStatus === '1'" type="danger" size="small">已禁用</el-tag>
</template>
</el-table-column>
<el-table-column label="客群标签" min-width="150">
<template slot-scope="scope">
<template v-if="scope.row.groupTags">
<el-tag
v-for="tag in scope.row.groupTags.split(',')"
:key="tag"
size="small"
style="margin-right: 5px; margin-bottom: 3px"
>
{{ tag.trim() }}
</el-tag>
</template>
</template>
</el-table-column>
<el-table-column label="创建者" prop="nickName" width="120" show-overflow-tooltip />
<el-table-column label="创建时间" prop="createTime" width="180" />
<el-table-column label="操作" align="center" width="180" fixed="right">
<el-table-column label="备注" prop="remark" min-width="150" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="200" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
>
查看
</el-button>
<template v-if="isMineTab">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>
删除
</el-button>
</template>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
@@ -95,7 +191,6 @@
/>
</div>
<!-- 创建/编辑客群弹窗 -->
<create-dialog
:visible.sync="dialogVisible"
:group-data="form"
@@ -106,7 +201,8 @@
</template>
<script>
import { listCustGroup, getCustGroup, deleteCustGroup } from '@/api/group/custGroup'
import { listCustGroup, getCustGroup, deleteCustGroup, getAllGroupTags } from '@/api/group/custGroup'
import { mapGetters } from 'vuex'
import CreateDialog from './components/create-dialog'
export default {
@@ -114,44 +210,92 @@ export default {
components: { CreateDialog },
data() {
return {
// 加载状态
loading: false,
// 显示搜索
showSearch: true,
// 选中ID数组
activeTab: 'mine',
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 客群列表
groupList: [],
// 弹窗显示
dialogVisible: false,
// 是否编辑
isEdit: false,
// 表单数据
form: {},
// 查询参数
refreshTimer: null,
queryParams: {
pageNum: 1,
pageSize: 10,
groupName: null,
groupMode: null,
createMode: null,
groupStatus: null
groupStatus: null,
groupTags: null,
viewType: 'mine'
},
// 所有标签列表
allTags: []
}
},
computed: {
...mapGetters(['roles']),
isHeadCustGroupAdmin() {
return ['headAdmin', 'headPublic', 'headPrivate', 'headOps'].some(role => this.roles.includes(role))
},
isMineTab() {
return this.activeTab === 'mine'
}
},
created() {
this.activeTab = this.resolveTab(this.$route.query.tab)
this.getList()
this.loadAllTags()
},
watch: {
'$route.query.refresh'() {
this.activeTab = this.resolveTab(this.$route.query.tab)
this.queryParams.pageNum = 1
this.getList()
},
roles() {
const nextTab = this.resolveTab(this.activeTab)
if (nextTab !== this.activeTab) {
this.activeTab = nextTab
}
}
},
beforeDestroy() {
this.clearRefreshTimer()
},
methods: {
/** 查询客群列表 */
resolveTab(tab) {
if (!this.isHeadCustGroupAdmin) {
return 'sharedToMe'
}
return tab === 'sharedToMe' ? 'sharedToMe' : 'mine'
},
clearRefreshTimer() {
if (this.refreshTimer) {
clearTimeout(this.refreshTimer)
this.refreshTimer = null
}
},
refreshList(delay = 0) {
this.clearRefreshTimer()
if (delay > 0) {
this.refreshTimer = setTimeout(() => {
this.getList()
this.refreshTimer = null
}, delay)
return
}
this.getList()
},
getList() {
this.loading = true
this.activeTab = this.resolveTab(this.activeTab)
this.queryParams.viewType = this.activeTab
listCustGroup(this.queryParams).then(response => {
this.groupList = response.rows
this.total = response.total
@@ -161,33 +305,56 @@ export default {
})
},
/** 搜索按钮操作 */
/** 加载所有标签列表 */
loadAllTags() {
getAllGroupTags().then(response => {
this.allTags = response.data || []
}).catch(() => {
this.allTags = []
})
},
handleTabChange() {
this.activeTab = this.resolveTab(this.activeTab)
this.ids = []
this.single = true
this.multiple = true
this.queryParams.pageNum = 1
this.queryParams.viewType = this.activeTab
this.getList()
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.queryParams.viewType = this.activeTab
this.handleQuery()
},
/** 多选框选中数据 */
handleSelectionChange(selection) {
if (!this.isMineTab) {
this.ids = []
this.single = true
this.multiple = true
return
}
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.isEdit = false
this.dialogVisible = true
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids[0]
@@ -198,38 +365,40 @@ export default {
})
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push({
path: '/group/custGroup/detail',
query: { groupId: row.id }
query: { groupId: row.id, viewType: this.resolveTab(this.activeTab) }
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id ? [row.id] : this.ids
this.$modal.confirm('是否确认删除选中的客群?').then(() => {
return deleteCustGroup(ids)
}).then(() => {
this.getList()
if (this.groupList.length <= ids.length && this.queryParams.pageNum > 1) {
this.queryParams.pageNum -= 1
}
this.ids = []
this.single = true
this.multiple = true
this.refreshList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {})
},
/** 提交表单 */
handleSubmit() {
this.dialogVisible = false
this.getList()
this.queryParams.pageNum = 1
this.refreshList(800)
},
/** 表单重置 */
reset() {
this.form = {
id: null,
groupName: null,
groupMode: '0',
createMode: null,
groupStatus: '0',
shareEnabled: 0,
shareDeptIdList: [],
@@ -247,7 +416,78 @@ export default {
overflow: hidden;
box-shadow: 0 3px 8px 0 #00000017;
border-radius: 16px 16px 0 0;
padding: 24px 30px;
padding: 0 30px 24px;
.nav_box {
overflow: hidden;
margin: 0 -30px 8px;
border-radius: 16px 16px 0 0;
.header-radio {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #ebebeb;
.btn-disabled {
::v-deep .el-radio-button__inner {
background-color: #e7e7e7;
color: #999999;
cursor: not-allowed;
}
}
.el-radio-button {
flex: 1;
::v-deep .el-radio-button__inner {
width: 100%;
border: none;
font-weight: 400;
letter-spacing: 0.44px;
line-height: 25px;
font-size: 16px;
color: #666666;
padding: 11px 0 12px 0;
border-radius: 0;
box-shadow: none;
}
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
background-color: #4886f8;
font-weight: 400;
color: #ffffff;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
&:nth-child(2) {
&::before,
&::after {
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
height: 21px;
width: 1px;
background: #ebebeb;
z-index: 1;
}
&::after {
right: 1px;
}
}
&.is-active {
&::before,
&::after {
content: none;
}
}
}
}
}
.search-area {
padding: 16px 0;
@@ -272,6 +512,7 @@ export default {
.operate-left {
display: flex;
gap: 8px;
min-height: 32px;
}
.el-button {

View File

@@ -0,0 +1,275 @@
<template>
<div class="customer-wrap">
<div class="content-box">
<div class="form-box">
<el-form ref="searchForm" :model="searchForm">
<el-row>
<el-col :span="6">
<el-form-item label="客户名称" prop="custName" label-width="80px">
<el-input
v-model="searchForm.custName"
clearable
@keyup.enter.native="handleSearch"
@clear="handleSearch"
/>
</el-form-item>
</el-col>
<el-col v-if="selectedTab === '1'" :span="6">
<el-form-item label="证件号" prop="custIdc" label-width="80px">
<el-input
v-model="searchForm.custIdc"
clearable
@keyup.enter.native="handleSearch"
@clear="handleSearch"
/>
</el-form-item>
</el-col>
<el-col v-else :span="6">
<el-form-item label="统一信用码" prop="socialCreditCode" label-width="100px">
<el-input
v-model="searchForm.socialCreditCode"
clearable
@keyup.enter.native="handleSearch"
@clear="handleSearch"
/>
</el-form-item>
</el-col>
<el-col :span="5" :offset="1" style="text-align: left">
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-col>
</el-row>
</el-form>
</div>
<div class="operate-btn">
<el-button @click="returnLastPage">返回上一级</el-button>
<el-button type="primary" @click="handleDownload">导出</el-button>
</div>
<div class="remark">
<span>统计日期<span class="span-value">{{ dt }}</span></span>
<span>客群名称<span class="span-value">{{ groupName }}</span></span>
<span>客群模式<span class="span-value">{{ groupModeText }}</span></span>
</div>
<div class="main_table">
<el-table v-loading="loading" :data="tableData" style="width: 100%">
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
align="center"
:prop="item.prop"
:label="item.label"
show-overflow-tooltip
:width="item.width || 120"
>
<template slot-scope="scope">
<el-button
v-if="item.prop === 'custName'"
type="text"
class="special-btn"
@click="openCustomer(scope.row)"
>
{{ scope.row[item.prop] || '-' }}
</el-button>
<span v-else>{{ scope.row[item.prop] || '-' }}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout="->,total,prev,pager,next,sizes"
:total="total"
:current-page="pageNum"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
</div>
</template>
<script>
import {
getGroupPerformanceLsCustList,
getGroupPerformanceGsCustList,
exportGroupPerformanceLsCust,
exportGroupPerformanceGsCust
} from '@/api/group/performance';
import { retailDetailColumns, publicDetailColumns, groupModeDict } from '../list/list';
import { downloadFiles } from '@/utils';
export default {
name: 'GroupPerformanceCustom',
data() {
return {
loading: false,
tableData: [],
total: 0,
pageSize: 10,
pageNum: 1,
tableColumns: [],
selectedTab: '1',
dt: '',
groupId: '',
groupName: '',
groupMode: '',
searchForm: {
custName: '',
custIdc: '',
socialCreditCode: ''
}
};
},
computed: {
groupModeText() {
return groupModeDict[this.groupMode] || '-';
}
},
created() {
const { type, dt, groupId, groupName, groupMode } = this.$route.query;
this.selectedTab = type || '1';
this.dt = dt || '';
this.groupId = groupId || '';
this.groupName = groupName || '';
this.groupMode = groupMode || '';
this.tableColumns = this.selectedTab === '1' ? retailDetailColumns : publicDetailColumns;
this.getList();
},
methods: {
getList() {
this.loading = true;
const api = this.selectedTab === '1' ? getGroupPerformanceLsCustList : getGroupPerformanceGsCustList;
const params = {
groupId: this.groupId,
dt: this.dt,
custName: this.searchForm.custName,
custIdc: this.searchForm.custIdc,
socialCreditCode: this.searchForm.socialCreditCode,
pageNum: this.pageNum,
pageSize: this.pageSize
};
api(params).then(res => {
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
handleSearch() {
this.pageNum = 1;
this.getList();
},
handleReset() {
this.searchForm = {
custName: '',
custIdc: '',
socialCreditCode: ''
};
this.pageNum = 1;
this.getList();
},
handleSizeChange(size) {
this.pageSize = size;
this.getList();
},
handleCurrentChange(page) {
this.pageNum = page;
this.getList();
},
handleDownload() {
const api = this.selectedTab === '1' ? exportGroupPerformanceLsCust : exportGroupPerformanceGsCust;
const fileName = this.selectedTab === '1' ? '零售客群客户明细' : '公司客群客户明细';
api({
groupId: this.groupId,
dt: this.dt,
custName: this.searchForm.custName,
custIdc: this.searchForm.custIdc,
socialCreditCode: this.searchForm.socialCreditCode
}).then(res => {
downloadFiles(res, `${fileName}_${new Date().getTime()}.xlsx`);
});
},
returnLastPage() {
this.$router.replace({
path: '/center/groupPerformance/list'
});
},
openCustomer(row) {
const custType = row.custType;
let path = '';
const rawId = this.selectedTab === '1' ? row.custIdc : row.socialCreditCode;
const custId = rawId ? (custType === '0' ? `101${rawId}` : `202${rawId}`) : '';
if (custType === '0') {
path = '/360charts/indexcharts';
} else if (custType === '1') {
path = '/360charts/commercial/';
} else if (custType === '2') {
path = '/360charts/firm/';
}
if (!path || !custId) {
return;
}
this.$router.push({
path: path,
query: {
custId,
selectedTab: custType,
backUrl: '/center/groupPerformance/list'
}
});
}
}
};
</script>
<style lang="scss" scoped>
.customer-wrap {
background-color: #ffffff;
overflow: hidden;
box-shadow: 0 3px 8px 0 #00000017;
}
.content-box {
padding: 20px 24px 24px;
}
.operate-btn {
margin-bottom: 12px;
.el-button + .el-button {
margin-left: 12px;
}
}
.remark {
margin-bottom: 12px;
color: #666666;
span {
display: inline-block;
margin-right: 20px;
margin-bottom: 8px;
}
.span-value {
color: #333333;
font-weight: 500;
}
}
.main_table {
margin-top: 15px;
}
::v-deep .el-input {
width: 100%;
}
::v-deep .el-pagination {
margin-top: 15px;
}
</style>

View File

@@ -0,0 +1,294 @@
<template>
<div class="customer-wrap">
<el-radio-group
v-model="selectedTab"
class="header-radio"
@input="handleTabChange"
>
<el-radio-button
label="1"
:disabled="isPublic"
:class="{ 'btn-disabled': isPublic }"
>零售部</el-radio-button>
<el-radio-button
label="2"
:disabled="isPrivate"
:class="{ 'btn-disabled': isPrivate }"
>公司部</el-radio-button>
</el-radio-group>
<div class="content-box">
<div class="form-box">
<el-form ref="searchForm" :model="searchForm">
<el-row>
<el-col :span="6">
<el-form-item label="客群名称" prop="groupName" label-width="80px">
<el-input
v-model="searchForm.groupName"
clearable
@keyup.enter.native="handleSearch"
@clear="handleSearch"
/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="统计日期" prop="dt" label-width="80px">
<el-date-picker
v-model="searchForm.dt"
type="date"
value-format="yyyy-MM-dd"
:clearable="false"
:picker-options="pickerOptions"
@change="handleSearch"
/>
</el-form-item>
</el-col>
<el-col :span="4" style="text-align: right">
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-col>
</el-row>
</el-form>
</div>
<div>
<el-button type="primary" @click="handleDownload">导出</el-button>
</div>
<div class="main_table">
<el-table
:key="tableKey"
v-loading="loading"
:data="tableData"
style="width: 100%"
max-height="650"
>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
align="center"
:prop="item.prop"
:label="item.label"
show-overflow-tooltip
:width="item.width || 120"
>
<template slot-scope="scope">
<span v-if="item.dict">{{ item.dict[scope.row[item.prop]] || '-' }}</span>
<span v-else>{{ scope.row[item.prop] || '-' }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="handleView(scope.row)">客户明细</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout="->,total,prev,pager,next,sizes"
:total="total"
:current-page="pageNum"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
</div>
</template>
<script>
import {
getGroupPerformanceLsList,
getGroupPerformanceGsList,
exportGroupPerformanceLs,
exportGroupPerformanceGs
} from '@/api/group/performance';
import { retailColumns, publicColumns } from './list';
import { mapGetters } from 'vuex';
import { downloadFiles } from '@/utils';
export default {
name: 'GroupPerformanceList',
data() {
return {
pickerOptions: {
disabledDate(time) {
const today = new Date();
today.setHours(0, 0, 0, 0);
return time.getTime() >= today.getTime();
}
},
selectedTab: '1',
loading: false,
tableData: [],
total: 0,
pageSize: 10,
pageNum: 1,
tableColumns: [],
tableKey: 'group-performance-1',
searchForm: {
groupName: '',
dt: ''
}
};
},
computed: {
...mapGetters(['roles']),
isPublic() {
return this.roles.includes('headPublic');
},
isPrivate() {
return this.roles.includes('headPrivate');
}
},
created() {
const date = new Date();
date.setDate(date.getDate() - 1);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
this.searchForm.dt = `${year}-${month}-${day}`;
if (this.isPublic) {
this.selectedTab = '2';
} else if (this.isPrivate) {
this.selectedTab = '1';
}
this.updateColumns();
this.getList();
},
methods: {
updateColumns() {
this.tableColumns = this.selectedTab === '1' ? retailColumns : publicColumns;
this.tableKey = `group-performance-${this.selectedTab}`;
},
getList() {
this.loading = true;
const api = this.selectedTab === '1' ? getGroupPerformanceLsList : getGroupPerformanceGsList;
api({
...this.searchForm,
pageNum: this.pageNum,
pageSize: this.pageSize
}).then(res => {
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
handleTabChange() {
this.updateColumns();
this.pageNum = 1;
this.getList();
},
handleSearch() {
this.pageNum = 1;
this.getList();
},
handleReset() {
const date = new Date();
date.setDate(date.getDate() - 1);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
this.searchForm = {
groupName: '',
dt: `${year}-${month}-${day}`
};
this.pageNum = 1;
this.getList();
},
handleSizeChange(size) {
this.pageSize = size;
this.getList();
},
handleCurrentChange(page) {
this.pageNum = page;
this.getList();
},
handleView(row) {
this.$router.push({
path: '/center/groupPerformance/custom',
query: {
type: this.selectedTab,
dt: row.dt,
groupId: row.groupId,
groupName: row.groupName,
groupMode: row.groupMode
}
});
},
handleDownload() {
const api = this.selectedTab === '1' ? exportGroupPerformanceLs : exportGroupPerformanceGs;
const fileName = this.selectedTab === '1' ? '零售客群业绩汇总' : '公司客群业绩汇总';
api(this.searchForm).then(res => {
downloadFiles(res, `${fileName}_${new Date().getTime()}.xlsx`);
});
}
}
};
</script>
<style lang="scss" scoped>
.customer-wrap {
background-color: #ffffff;
overflow: hidden;
border-radius: 16px 16px 0 0;
box-shadow: 0 3px 8px 0 #00000017;
.header-radio {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #ebebeb;
.btn-disabled {
::v-deep .el-radio-button__inner {
background-color: #e7e7e7;
}
}
.el-radio-button {
flex: 1;
::v-deep .el-radio-button__inner {
width: 100%;
border: none;
font-weight: 400;
letter-spacing: 0.44px;
line-height: 25px;
font-size: 16px;
color: #666666;
padding: 11px 0 12px 0;
}
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
background-color: #4886f8;
font-weight: 400;
color: #ffffff;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
}
}
.content-box {
padding: 20px 24px 24px;
}
.main_table {
margin-top: 15px;
}
::v-deep .el-date-editor,
::v-deep .el-input,
::v-deep .el-select {
width: 100%;
}
::v-deep .el-pagination {
margin-top: 15px;
}
</style>

View File

@@ -0,0 +1,194 @@
export const groupModeDict = {
'0': '静态',
'1': '动态'
};
export const retailColumns = [
{ prop: 'dt', label: '统计日期', width: 140 },
{ prop: 'groupName', label: '客群名称', width: 180 },
{ prop: 'groupMode', label: '客群模式', width: 100, dict: groupModeDict },
{ prop: 'deptId', label: '归属支行机构号', width: 140 },
{ prop: 'deptName', label: '归属支行名称', width: 160 },
{ prop: 'outletsId', label: '归属网点机构号', width: 140 },
{ prop: 'outletsName', label: '归属网点名称', width: 160 },
{ prop: 'userName', label: '归属客户经理', width: 140 },
{ prop: 'custNum', label: '入格客户数', width: 120 },
{ prop: 'zf365cnt', label: '近365天已走访人数', width: 150 },
{ prop: 'zf180cnt', label: '近180天已走访人数', width: 150 },
{ prop: 'zf90cnt', label: '近90天已走访人数', width: 150 },
{ prop: 'zf30cnt', label: '近30天已走访人数', width: 150 },
{ prop: 'zf365rt', label: '近365天走访率', width: 140 },
{ prop: 'zf180rt', label: '近180天走访率', width: 140 },
{ prop: 'zf90rt', label: '近90天走访率', width: 140 },
{ prop: 'zf30rt', label: '近30天走访率', width: 140 },
{ prop: 'curBalD', label: '活期存款余额(元)', width: 160 },
{ prop: 'sxRat', label: '授信率(%', width: 120 },
{ prop: 'yxRat', label: '用信覆盖率', width: 120 },
{ prop: 'sxNum', label: '授信户数', width: 120 },
{ prop: 'yxNum', label: '用信户数', width: 120 },
{ prop: 'sxBal', label: '授信金额(合同)', width: 160 },
{ prop: 'balLoan', label: '贷款余额(元)', width: 150 },
{ prop: 'loanAve', label: '贷款年日均(元)', width: 150 },
{ prop: 'yxhtRat', label: '合同签约率(%', width: 140 },
{ prop: 'dianRat', label: '代扣电费覆盖率(%', width: 150 },
{ prop: 'shuiRat', label: '代扣水费率(%', width: 140 },
{ prop: 'taxRat', label: '代扣税费率(%', width: 140 },
{ prop: 'openRat', label: '开户率(%', width: 120 },
{ prop: 'yxhtNum', label: '合同签约客户数', width: 150 },
{ prop: 'dianNum', label: '代扣电费客户数', width: 150 },
{ prop: 'shuiNum', label: '代扣水费客户数', width: 150 },
{ prop: 'taxNum', label: '代扣税费数', width: 140 },
{ prop: 'openNum', label: '开户数', width: 120 },
{ prop: 'depBal', label: '存款余额(元)', width: 150 },
{ prop: 'finBal', label: '财富余额(元)', width: 150 },
{ prop: 'grhxNum', label: '个人核心客户数', width: 150 },
{ prop: 'cfyxNum', label: '财富有效客户数', width: 150 },
{ prop: 'yxxykNum', label: '有效信用卡数', width: 140 },
{ prop: 'yxsbkNum', label: '有效社保卡户数', width: 150 },
{ prop: 'twoTo3SbkNum', label: '二换三社保卡户数', width: 160 },
{ prop: 'yljToSbkNum', label: '养老金迁移至社保卡户数', width: 180 },
{ prop: 'fshlNum', label: '丰收互联客户数', width: 150 },
{ prop: 'yxsdNum', label: '有效收单商户', width: 140 },
{ prop: 'hxsdNum', label: '核心收单户数', width: 140 },
{ prop: 'regionCode', label: '归属行政区划编码', width: 160 }
];
export const publicColumns = [
{ prop: 'dt', label: '统计日期', width: 140 },
{ prop: 'groupName', label: '客群名称', width: 180 },
{ prop: 'groupMode', label: '客群模式', width: 100, dict: groupModeDict },
{ prop: 'deptId', label: '归属支行', width: 120 },
{ prop: 'deptName', label: '归属支行名称', width: 140 },
{ prop: 'outletsId', label: '归属网点', width: 120 },
{ prop: 'outletsName', label: '归属网点名称', width: 140 },
{ prop: 'userName', label: '归属客户经理', width: 140 },
{ prop: 'custNum', label: '入格客户数', width: 120 },
{ prop: 'hqCurBalance', label: '活期存款余额', width: 140 },
{ prop: 'bzCurBalance', label: '保证金存款余额', width: 150 },
{ prop: 'loanBalanceCny', label: '贷款余额', width: 140 },
{ prop: 'financeProd711Balance', label: '贴现余额', width: 140 },
{ prop: 'financeProd716Balance', label: '承兑汇票余额', width: 150 },
{ prop: 'loanYearDailyaverage', label: '贷款年日均', width: 140 },
{ prop: 'qfcdRat', label: '签发承兑汇票率', width: 140 },
{ prop: 'txRat', label: '贴现业务率', width: 120 },
{ prop: 'bhRat', label: '保函业务率', width: 120 },
{ prop: 'yxdfgzRat', label: '有效代发工资率', width: 150 },
{ prop: 'dkdfRat', label: '代扣电费率', width: 120 },
{ prop: 'dksfRat', label: '代扣水费率', width: 120 },
{ prop: 'dkshfRat', label: '代扣税费率', width: 120 },
{ prop: 'pjbRat', label: '票据宝签约率', width: 130 },
{ prop: 'czbRat', label: '财资宝签约率', width: 130 },
{ prop: 'sfbRat', label: '收付宝签约率', width: 130 },
{ prop: 'mrbRat', label: '贸融宝签约率', width: 130 },
{ prop: 'szstRat', label: '数字生态产品签约率', width: 170 },
{ prop: 'khRat', label: '开户率', width: 120 },
{ prop: 'gjjsywRat', label: '国际结算业务率', width: 150 },
{ prop: 'yqjshRat', label: '远期结算汇业务率', width: 160 },
{ prop: 'qfcdNum', label: '签发承兑汇票数', width: 150 },
{ prop: 'txNum', label: '贴现业务数', width: 120 },
{ prop: 'bhNum', label: '保函业务数', width: 120 },
{ prop: 'yxdfgzNum', label: '有效代发工资数', width: 150 },
{ prop: 'ustrCountPerM', label: '月均代发工资笔数', width: 150 },
{ prop: 'ustrBalM', label: '月均代发工资金额(元)', width: 170 },
{ prop: 'dkdfNum', label: '代扣电费数', width: 120 },
{ prop: 'dksfNum', label: '代扣水费数', width: 120 },
{ prop: 'dkshfNum', label: '代扣税费数', width: 120 },
{ prop: 'pjbNum', label: '票据宝签约数', width: 130 },
{ prop: 'czbNum', label: '财资宝签约数', width: 130 },
{ prop: 'sfbNum', label: '收付宝签约数', width: 130 },
{ prop: 'mrbNum', label: '贸融宝签约数', width: 130 },
{ prop: 'szstNum', label: '数字生态产品签约数', width: 170 },
{ prop: 'khNum', label: '开户数', width: 120 },
{ prop: 'gjjsywNum', label: '国际结算业务数', width: 150 },
{ prop: 'yqjshNum', label: '远期结算汇业务数', width: 160 },
{ prop: 'htqyRat', label: '合同签约率', width: 130 },
{ prop: 'htqyNum', label: '合同签约数', width: 130 },
{ prop: 'zf365cnt', label: '近365天已走访人数', width: 150 },
{ prop: 'zf180cnt', label: '近180天已走访人数', width: 150 },
{ prop: 'zf90cnt', label: '近90天已走访人数', width: 150 },
{ prop: 'zf30cnt', label: '近30天已走访人数', width: 150 },
{ prop: 'zf365rt', label: '近365天走访率', width: 140 },
{ prop: 'zf180rt', label: '近180天走访率', width: 140 },
{ prop: 'zf90rt', label: '近90天走访率', width: 140 },
{ prop: 'zf30rt', label: '近30天走访率', width: 140 },
{ prop: 'phRat', label: '建档率', width: 120 },
{ prop: 'phNum', label: '建档数', width: 120 },
{ prop: 'regionCode', label: '归属行政区划编码', width: 160 }
];
export const retailDetailColumns = [
{ prop: 'custName', label: '客户名称', width: 160 },
{ prop: 'custIdc', label: '客户证件号', width: 180 },
{ prop: 'custIsn', label: '客户内码', width: 140 },
{ prop: 'curBalD', label: '活期存款余额', width: 140 },
{ prop: 'balLoan', label: '贷款余额', width: 140 },
{ prop: 'loanAve', label: '贷款年日均', width: 140 },
{ prop: 'isSx', label: '是否授信', width: 100 },
{ prop: 'isYx', label: '是否用信', width: 100 },
{ prop: 'sxBal', label: '授信金额', width: 120 },
{ prop: 'isYxht', label: '是否合同签约', width: 120 },
{ prop: 'isXyk', label: '是否持有信用卡', width: 130 },
{ prop: 'fshl', label: '是否开通丰收互联', width: 140 },
{ prop: 'isSd', label: '是否办理收单', width: 120 },
{ prop: 'dian', label: '是否代扣电费', width: 120 },
{ prop: 'shui', label: '是否代扣水费', width: 120 },
{ prop: 'tax', label: '是否代扣税费', width: 120 },
{ prop: 'openNum', label: '开户数', width: 100 },
{ prop: 'depBal', label: '存款余额', width: 120 },
{ prop: 'finBal', label: '财富余额', width: 120 },
{ prop: 'isGrhx', label: '是否个人核心客户', width: 140 },
{ prop: 'isCfyx', label: '是否财富有效客户', width: 140 },
{ prop: 'isYxsbk', label: '是否有效社保卡客户', width: 150 },
{ prop: 'is2to3Sbk', label: '是否二换三社保卡', width: 140 },
{ prop: 'isYljToSbk', label: '是否养老金迁移至社保卡', width: 180 },
{ prop: 'is365zf', label: '近365天有无走访', width: 140 },
{ prop: 'is180zf', label: '近180天有无走访', width: 140 },
{ prop: 'is90zf', label: '近90天有无走访', width: 140 },
{ prop: 'is30zf', label: '近30天有无走访', width: 140 },
{ prop: 'isHxsd', label: '是否核心收单', width: 120 },
{ prop: 'custType', label: '客户类型', width: 100 },
{ prop: 'regionCode', label: '归属行政区划编码', width: 160 }
];
export const publicDetailColumns = [
{ prop: 'custName', label: '客户名称', width: 160 },
{ prop: 'socialCreditCode', label: '客户证件号', width: 200 },
{ prop: 'custIsn', label: '客户内码', width: 140 },
{ prop: 'hqCurBalance', label: '活期存款余额', width: 140 },
{ prop: 'bzCurBalance', label: '保证金存款余额', width: 150 },
{ prop: 'isCredit', label: '是否授信', width: 100 },
{ prop: 'loanBalanceCny', label: '贷款余额', width: 140 },
{ prop: 'loanYearDailyaverage', label: '贷款年日均', width: 140 },
{ prop: 'financeProd716OpenFlag', label: '是否有签发承兑汇票', width: 160 },
{ prop: 'financeProd716Balance', label: '承兑汇票余额', width: 150 },
{ prop: 'financeProd711OpenFlag', label: '是否有贴现业务', width: 140 },
{ prop: 'financeProd711Balance', label: '贴现金额', width: 120 },
{ prop: 'intlBussinessJcbhOpenFlag', label: '是否有保函业务', width: 140 },
{ prop: 'isUstr', label: '是否为有效代发工资客户', width: 170 },
{ prop: 'ustrCountPerM', label: '月均代发工资笔数', width: 150 },
{ prop: 'ustrBalM', label: '月均代发工资金额(元)', width: 170 },
{ prop: 'elecchargeSignFlag', label: '是否代扣电费', width: 120 },
{ prop: 'waterchargeSignFlag', label: '是否代扣水费', width: 120 },
{ prop: 'taxdeductionSignFlag', label: '是否代扣税费', width: 120 },
{ prop: 'pjb', label: '是否票据宝签约', width: 130 },
{ prop: 'czb', label: '是否财资宝签约', width: 130 },
{ prop: 'sfb', label: '是否收付宝签约', width: 130 },
{ prop: 'mrb', label: '是否贸融宝签约', width: 130 },
{ prop: 'szst', label: '是否数字生态产品签约', width: 170 },
{ prop: 'isOpenSts', label: '是否开户', width: 100 },
{ prop: 'intlBussinessOpenFlag', label: '是否国际结算业务', width: 150 },
{ prop: 'intlBussiness325OpenFlag', label: '是否有远期结算汇业务', width: 170 },
{ prop: 'isHtqy', label: '是否合同签约', width: 120 },
{ prop: 'deptName', label: '归属支行名称', width: 140 },
{ prop: 'outletsId', label: '归属网点id', width: 120 },
{ prop: 'outletsName', label: '归属网点名称', width: 140 },
{ prop: 'userName', label: '归属客户经理', width: 140 },
{ prop: 'deptId', label: '归属支行id', width: 120 },
{ prop: 'is365zf', label: '近365天有无走访', width: 140 },
{ prop: 'is180zf', label: '近180天有无走访', width: 140 },
{ prop: 'is90zf', label: '近90天有无走访', width: 140 },
{ prop: 'is30zf', label: '近30天有无走访', width: 140 },
{ prop: 'isPh', label: '是否建档', width: 100 },
{ prop: 'custType', label: '客户类型', width: 100 },
{ prop: 'regionCode', label: '归属行政区划编码', width: 160 }
];

View File

@@ -63,6 +63,15 @@
@clear="handleSearch"
/>
</el-form-item>
<el-form-item label="柜员号" class="staff-id-filter">
<el-input
v-model="searchForm.visId"
placeholder="请输入"
@blur="handleSearch"
clearable
@clear="handleSearch"
/>
</el-form-item>
<el-form-item label="走访时间">
<el-date-picker
v-model="searchForm.visTime"
@@ -211,7 +220,16 @@
show-overflow-tooltip
width="150px"
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
align="left"
prop="custIdc"
@@ -219,7 +237,16 @@
show-overflow-tooltip
width="200px"
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
align="left"
prop="socialCreditCode"
@@ -362,6 +389,32 @@
width="150px"
v-if="columns[16].visible"
></el-table-column>
<el-table-column align="left" prop="interAddr" label="实地拜访地址" show-overflow-tooltip width="180px" v-if="isPersonalFeedbackTab && columns[17].visible"></el-table-column>
<el-table-column align="left" prop="colStafName" label="协同走访客户经理" show-overflow-tooltip width="160px" v-if="isPersonalFeedbackTab && columns[18].visible"></el-table-column>
<el-table-column align="left" prop="laterNote" label="事后备注" show-overflow-tooltip width="180px" v-if="isPersonalFeedbackTab && columns[19].visible"></el-table-column>
<el-table-column align="left" prop="intentionProductValue" label="走访反馈" show-overflow-tooltip width="160px" v-if="isPersonalFeedbackTab && columns[20].visible"></el-table-column>
<el-table-column align="left" prop="feedbackStatus" label="反馈状态" show-overflow-tooltip width="120px" v-if="isPersonalFeedbackTab && columns[21].visible"></el-table-column>
<el-table-column align="left" prop="sourceOfInterview" label="走访来源" show-overflow-tooltip width="140px" v-if="isPersonalFeedbackTab && columns[22].visible"></el-table-column>
<el-table-column align="left" prop="filename" label="批量导入文件名" show-overflow-tooltip width="180px" v-if="isPersonalFeedbackTab && columns[23].visible"></el-table-column>
<el-table-column align="left" prop="outCallStatus" label="外呼状态" show-overflow-tooltip width="120px" v-if="isPersonalFeedbackTab && columns[24].visible"></el-table-column>
<el-table-column align="left" prop="outCallIntention" label="客户意愿" show-overflow-tooltip width="140px" v-if="isPersonalFeedbackTab && columns[25].visible"></el-table-column>
<el-table-column align="left" prop="source" label="走访渠道" show-overflow-tooltip width="120px" v-if="isPersonalFeedbackTab && columns[26].visible">
<template slot-scope="scope">
<span>{{ formatSourceLabel(scope.row.source) }}</span>
</template>
</el-table-column>
<el-table-column align="left" prop="analysisValue" label="nlp模型提取" show-overflow-tooltip width="140px" v-if="isPersonalFeedbackTab && columns[27].visible"></el-table-column>
<el-table-column align="left" prop="facility" label="预授信额度" show-overflow-tooltip width="140px" v-if="isPersonalFeedbackTab && columns[28].visible"></el-table-column>
<el-table-column v-if="isPersonalFeedbackTab" align="center" label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button
type="text"
size="mini"
:disabled="isFeedbackCompleted(scope.row)"
@click="handleEditFeedback(scope.row)"
>反馈</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@@ -372,24 +425,103 @@
:total="total"
:current-page="pageNum"
></el-pagination>
<el-dialog
title="编辑走访反馈"
:visible.sync="feedbackDialogVisible"
width="960px"
custom-class="feedback-dialog"
append-to-body
@close="resetFeedbackForm"
>
<el-form ref="feedbackFormRef" :model="feedbackForm" label-width="100px" class="feedback-form">
<el-form-item label="走访渠道" required>
<el-radio-group v-model="feedbackForm.source">
<el-radio v-for="item in sourceOptions" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="走访备注">
<el-input
v-model="feedbackForm.remark"
type="textarea"
:rows="3"
maxlength="200"
show-word-limit
/>
</el-form-item>
<el-form-item label="客户意愿" required>
<div class="feedback-groups">
<section v-for="type in feedbackTypeOptions" :key="type" class="feedback-group">
<div class="feedback-group__title">{{ type }}</div>
<el-checkbox-group v-model="feedbackForm.feedbackSelections[type]">
<el-checkbox
v-for="product in feedbackProductOptions"
:key="`${type}-${product}`"
:label="product"
>
{{ product }}
</el-checkbox>
</el-checkbox-group>
</section>
</div>
</el-form-item>
<el-form-item label="走访反馈">
<div class="feedback-preview">{{ feedbackPreview || "-" }}</div>
</el-form-item>
</el-form>
<span slot="footer">
<el-button @click="feedbackDialogVisible = false">取消</el-button>
<el-button type="primary" :loading="feedbackSubmitting" @click="handleSubmitFeedback">确定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { getPADVisitRecord } from "@/api/task/PADvisitRecord.js";
import { Message } from "element-ui";
import { getPADVisitRecord, updatePADVisitFeedback } from "@/api/task/PADvisitRecord.js";
const SOURCE_OPTIONS = [
{ label: "PAD", value: "1" },
{ label: "企业微信", value: "2" },
{ label: "电话", value: "4" }
];
const FEEDBACK_TYPE_OPTIONS = ["拒绝", "考虑", "意愿", "其他", "愿意", "现场办理"];
const FEEDBACK_PRODUCT_OPTIONS = [
"丰收互联",
"贷款",
"电子社保卡签约",
"基金",
"贵金属",
"信用卡",
"医保电子凭证",
"社保卡",
"理财签约"
];
function createEmptyFeedbackSelections() {
return FEEDBACK_TYPE_OPTIONS.reduce((result, item) => {
result[item] = [];
return result;
}, {});
}
export default {
data() {
return {
selectedTab: "0",
tableData: [],
Loading: false,
feedbackDialogVisible: false,
feedbackSubmitting: false,
total: 0,
pageSize: 10,
pageNum: 1,
sourceOptions: SOURCE_OPTIONS,
feedbackTypeOptions: FEEDBACK_TYPE_OPTIONS,
feedbackProductOptions: FEEDBACK_PRODUCT_OPTIONS,
searchForm: {
visName: "",
visId: "",
visTime: "",
custIdc: "",
socialCreditCode: '',
@@ -415,12 +547,30 @@ export default {
{ key: 13, label: "签到坐标", visible: true },
{ key: 14, label: "签退坐标", visible: true },
{ key: 15, label: "是否为有效客户", visible: true },
{ key: 16, label: "走访备注", visible: true }
{ key: 16, label: "走访备注", visible: true },
{ key: 17, label: "实地拜访地址", visible: true },
{ key: 18, label: "协同走访客户经理", visible: true },
{ key: 19, label: "事后备注", visible: true },
{ key: 20, label: "走访反馈", visible: true },
{ key: 21, label: "反馈状态", visible: true },
{ key: 22, label: "走访来源", visible: true },
{ key: 23, label: "批量导入文件名", visible: true },
{ key: 24, label: "外呼状态", visible: true },
{ key: 25, label: "客户意愿", visible: true },
{ key: 26, label: "走访渠道", visible: true },
{ key: 27, label: "nlp模型提取", visible: true },
{ key: 28, label: "预授信额度", visible: true }
],
columns875: [
{ key: 17, label: "异常走访标签", visible: true },
{ key: 18, label: "异常走访信息", visible: true },
]
{ key: 29, label: "异常走访标签", visible: true },
{ key: 30, label: "异常走访信息", visible: true },
],
feedbackForm: {
id: null,
source: "",
remark: "",
feedbackSelections: createEmptyFeedbackSelections()
}
};
},
computed: {
@@ -458,7 +608,14 @@ export default {
},
// 海宁
is875() {
return this.userName.slice(0, 3) === '875'
const deptId = this.deptId === null || this.deptId === undefined ? '' : String(this.deptId)
return deptId.slice(0, 3) === '875'
},
isPersonalFeedbackTab() {
return this.is875 && this.selectedTab === '0'
},
feedbackPreview() {
return this.buildFeedbackValue(this.feedbackForm.feedbackSelections)
}
},
created() {
@@ -482,6 +639,119 @@ export default {
this.initVisitingTaskList();
},
methods: {
resetFeedbackForm() {
this.feedbackSubmitting = false;
this.feedbackForm = {
id: null,
source: "",
remark: "",
feedbackSelections: createEmptyFeedbackSelections()
};
},
parseFeedbackValue(value) {
const feedbackSelections = createEmptyFeedbackSelections();
if (!value) {
return feedbackSelections;
}
value.split(";").forEach((segment) => {
const [type, products] = segment.split(":");
if (!type || !feedbackSelections[type]) {
return;
}
feedbackSelections[type] = (products || "")
.split(",")
.map(item => item && item.trim())
.filter(Boolean);
});
return feedbackSelections;
},
buildFeedbackItems(feedbackSelections) {
return this.feedbackTypeOptions
.map((type) => ({
feedbackType: type,
products: (feedbackSelections[type] || []).filter(Boolean)
}))
.filter(item => item.products.length > 0);
},
buildFeedbackValue(feedbackSelections) {
return this.buildFeedbackItems(feedbackSelections)
.map(item => `${item.feedbackType}:${item.products.join(",")}`)
.join(";");
},
isFeedbackCompleted(row) {
const interRes = row && row.interRes !== null && row.interRes !== undefined ? String(row.interRes).trim() : "";
return interRes === "0";
},
formatSourceLabel(source) {
const sourceValue = source === null || source === undefined ? "" : String(source);
const matched = this.sourceOptions.find(item => 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;
}
this.feedbackForm = {
id: row.id,
source: row.source === null || row.source === undefined ? "" : String(row.source),
remark: row.remark || "",
feedbackSelections: this.parseFeedbackValue(row.intentionProductValue)
};
this.feedbackDialogVisible = true;
},
handleSubmitFeedback() {
const feedbackItems = this.buildFeedbackItems(this.feedbackForm.feedbackSelections);
if (!this.feedbackForm.source) {
this.$message.warning("请选择走访渠道");
return;
}
if (!feedbackItems.length) {
this.$message.warning("请至少选择一组客户意愿和营销产品");
return;
}
const payload = {
id: this.feedbackForm.id,
source: this.feedbackForm.source || null,
remark: this.feedbackForm.remark || null,
feedbackItems
};
this.feedbackSubmitting = true;
updatePADVisitFeedback(payload).then(() => {
this.$message.success("保存成功");
this.feedbackDialogVisible = false;
this.resetFeedbackForm();
this.initVisitingTaskList();
}).finally(() => {
this.feedbackSubmitting = false;
});
},
handleChange(val) {
this.pageSize = 10;
this.pageNum = 1;
@@ -492,6 +762,7 @@ export default {
custType: this.selectedTab,
visTime: this.searchForm.visTime,
visName: this.searchForm.visName,
visId: this.searchForm.visId,
custIdc: this.searchForm.custIdc,
socialCreditCode: this.searchForm.socialCreditCode,
abnormalVisitTag: this.searchForm.abnormalVisitTag,
@@ -508,7 +779,16 @@ export default {
});
},
handleRefersh() {
this.searchForm = {};
this.searchForm = {
visName: "",
visId: "",
visTime: "",
custIdc: "",
socialCreditCode: '',
abnormalVisitTag: '',
marketingWay: '',
interRes: ''
};
this.initVisitingTaskList();
},
handleSizeChange(newSize) {
@@ -523,7 +803,16 @@ export default {
this.initVisitingTaskList();
},
resetFilters() {
this.searchForm = {};
this.searchForm = {
visName: "",
visId: "",
visTime: "",
custIdc: "",
socialCreditCode: '',
abnormalVisitTag: '',
marketingWay: '',
interRes: ''
};
this.initVisitingTaskList();
},
},
@@ -565,67 +854,6 @@ export default {
line-height: 30px;
}
.header-radio {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #ebebeb;
.btn-disabled {
::v-deep .el-radio-button__inner {
background-color: #e7e7e7;
}
}
.el-radio-button {
flex: 1;
::v-deep .el-radio-button__inner {
width: 100%;
border: none;
font-weight: 400;
letter-spacing: 0.44px;
line-height: 25px;
font-size: 16px;
color: #666666;
padding: 11px 0 12px 0;
}
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
background-color: #4886f8;
font-weight: 400;
color: #ffffff;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
&:nth-child(2) {
&::before,
&::after {
content: "";
position: absolute;
top: 50%;
transform: translateY(-50%);
height: 21px;
width: 1px;
background: #ebebeb;
z-index: 1;
}
&::after {
right: 1px;
}
}
&.is-active {
&::before,
&::after {
content: none;
}
}
}
}
.btn-disabled {
::v-deep .el-radio-button__inner {
background-color: #e7e7e7;
@@ -647,7 +875,6 @@ export default {
.el-radio-button {
flex: 1;
border: 1px solid #ccc;
::v-deep .el-radio-button__inner {
width: 100%;
@@ -725,6 +952,11 @@ export default {
.searchForm {
margin-top: 20px;
.staff-id-filter {
clear: left;
margin-left: 0 !important;
}
}
.operate-cnt {
@@ -756,6 +988,67 @@ export default {
}
}
.feedback-form {
::v-deep .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before {
color: #f56c6c;
margin-right: 4px;
}
.feedback-groups {
display: flex;
flex-direction: column;
gap: 12px;
}
.feedback-group {
padding: 10px 12px;
border: 1px solid #ebeef5;
border-radius: 8px;
background: #fafbfc;
}
.feedback-group__title {
margin-bottom: 10px;
color: #303133;
font-weight: 600;
}
::v-deep .el-checkbox-group {
display: flex;
flex-wrap: wrap;
gap: 6px 8px;
}
::v-deep .el-checkbox {
margin-right: 0;
min-width: auto;
white-space: nowrap;
}
.feedback-preview {
min-height: 20px;
color: #606266;
word-break: break-all;
}
}
::v-deep .feedback-dialog {
border-radius: 18px;
overflow: hidden;
.el-dialog__header {
padding: 20px 24px 16px;
}
.el-dialog__body {
padding: 12px 24px 20px;
}
.el-dialog__footer {
padding: 10px 24px 20px;
}
}
.quesiton {
color: #b9b9b9;
}

View File

@@ -64,13 +64,37 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="有无管户" prop="forwardFlag">
<el-select
v-model="searchArray.forwardFlag"
placeholder="请选择"
clearable
style="width:100%"
>
<el-option
v-for="item in forwardFlagOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="searchFn">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetFn">重置</el-button>
<el-button
v-if="canForwardByRole"
type="warning"
icon="el-icon-share"
size="mini"
:disabled="!canBatchForward"
@click="openForwardDialog()"
>批量转发</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableData">
<el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
<template>
<el-table-column v-if="canForwardByRole" type="selection" width="55" :selectable="canSelectForwardRow" />
<el-table-column label="序号" prop="xh" width="80">
<template slot-scope="scope">
<span>{{ scope.$index+1 }}</span>
@@ -80,6 +104,7 @@
<el-table-column label="客户号" width="230" prop="custId" min-width="140" show-overflow-tooltip />
<el-table-column label="客户内码" width="200" prop="custIsn" min-width="140" show-overflow-tooltip />
<el-table-column label="客户经理" width="200" prop="userInfo" min-width="140" show-overflow-tooltip />
<el-table-column label="承接网点" width="180" prop="deptName" min-width="120" show-overflow-tooltip />
<el-table-column label="预警类型" width="250" prop="alterType" min-width="100" show-overflow-tooltip />
<el-table-column label="预警详情" prop="alterDetail" min-width="100" show-overflow-tooltip />
<el-table-column label="是否已读" prop="isReed" min-width="100" show-overflow-tooltip>
@@ -94,11 +119,18 @@
<span>{{ scope.row.status | formatFilter('status',statusList) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" width="160">
<el-table-column v-if="canForwardByRole" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="editFn(scope.row)">处理</el-button>
<el-button
v-if="scope.row.canForward"
size="mini"
type="text"
icon="el-icon-share"
@click="openForwardDialog(scope.row)"
>转发</el-button>
<span v-else>-</span>
</template>
</el-table-column> -->
</el-table-column>
</template>
</el-table>
<el-pagination
@@ -112,92 +144,65 @@
></el-pagination>
<el-dialog
:title="dialogTitle"
:visible.sync="visibleFlag"
width="800px"
title="转发预警"
:visible.sync="forwardVisible"
width="520px"
append-to-body
v-if="visibleFlag"
v-if="forwardVisible"
>
<el-form ref="dialogFormRef" :model="dialogForm" :rules="dialogFormRules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="客户姓名" prop="custName">
<el-input
v-model="dialogForm.custName"
placeholder="请输入客户姓名"
clearable
style="width:100%"
>
</el-input>
<el-form ref="forwardFormRef" :model="forwardForm" :rules="forwardRules" label-width="100px">
<el-form-item v-if="forwardMeta.historyOnly" label="转发方式">
<span>按历史推荐转发</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="客户号" prop="custId">
<el-input
v-model="dialogForm.custId"
placeholder="请输入客户号"
clearable
style="width:100%"
/>
<el-form-item v-if="isBranchAdmin" label="转发类型" prop="targetType">
<template v-if="!forwardMeta.historyOnly">
<el-radio-group v-model="forwardForm.targetType">
<el-radio label="dept">转给网点</el-radio>
<el-radio label="user">转给客户经理</el-radio>
</el-radio-group>
</template>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="预警类型" prop="alterType">
<el-input
v-model="dialogForm.alterType"
placeholder="请输入预警类型"
clearable
style="width:100%"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="预警详情" prop="alterDetail">
<el-input
v-model="dialogForm.alterDetail"
placeholder="请输入预警详情"
clearable
style="width:100%"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" prop="status">
<el-select
v-model="dialogForm.status"
placeholder="请选择状态"
clearable
style="width:100%"
>
<el-form-item v-if="!forwardMeta.historyOnly && forwardForm.targetType === 'dept'" label="目标网点" prop="deptId">
<el-select v-model="forwardForm.deptId" placeholder="请选择网点" style="width:100%">
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in forwardMeta.deptOptions"
:key="item.targetCode"
:label="item.targetName"
:value="Number(item.targetCode)"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dialogForm.remark"
placeholder="请输入备注"
clearable
<el-form-item v-else-if="!forwardMeta.historyOnly" label="客户经理" prop="userName">
<el-select
v-model="forwardForm.userName"
placeholder="请选择客户经理"
filterable
style="width:100%"
>
</el-input>
<el-option
v-for="item in forwardMeta.userOptions"
:key="item.targetCode"
:label="item.targetName"
:value="item.targetCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="forwardMeta.recommendedTargetCode && !isBatchForward && !forwardMeta.historyOnly"
label="历史推荐"
>
<div class="recommend-row">
<span>{{ recommendLabel }}</span>
<el-button type="text" @click="applyRecommend">使用历史推荐</el-button>
</div>
</el-form-item>
<el-form-item v-if="forwardMeta.historyOnly && isBatchForward" label="提示">
<span>本次多选中包含有历史分配记录的客户将按各自历史推荐自动转发没有历史记录的预警将保留不动</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="dialogOkfn"> </el-button>
<el-button @click="dialogCancelfn"> </el-button>
<el-button type="primary" :loading="forwardSubmitting" @click="submitForward"> </el-button>
<el-button @click="closeForwardDialog"> </el-button>
</div>
</el-dialog>
</div>
@@ -206,9 +211,10 @@
<script>
import {
warningworkRecordList,
warningworkRecordSubmit,
warningCardNum,
getAlterTypes
getAlterTypes,
getAlterForwardMeta,
forwardAlter
} from "@/api/system/home";
import _ from "lodash";
import dayjs from "dayjs";
@@ -232,6 +238,24 @@ export default {
} else {
return false;
}
},
isBranchAdmin() {
return this.roles.includes("branchAdmin");
},
isOutletAdmin() {
return this.roles.includes("outletAdmin");
},
canForwardByRole() {
return this.isBranchAdmin || this.isOutletAdmin;
},
canBatchForward() {
return this.selectedRows.length > 0 && this.selectedRows.every(item => item.canForward);
},
recommendLabel() {
if (!this.forwardMeta.recommendedTargetCode) {
return "";
}
return `${this.forwardMeta.recommendedTargetType === "dept" ? "网点" : "客户经理"}${this.forwardMeta.recommendedTargetName}`;
}
},
data() {
@@ -253,35 +277,45 @@ export default {
],
alterTypeOptions: [],
forwardFlagOptions: [
{ label: "有管户", value: "0" },
{ label: "无管户", value: "1" }
],
searchArray: {
status: "",
alterType: ""
alterType: "",
forwardFlag: ""
},
pageNum: 1,
pageSize: 10,
tableData: [],
selectedRows: [],
total: 0,
loading: false,
dialogTitle: '',
dialogForm: {
custName: '',
custId: '',
alterType: '',
alterDetail: '',
status: ''
forwardVisible: false,
forwardSubmitting: false,
isBatchForward: false,
forwardMeta: {
deptOptions: [],
userOptions: [],
recommendedTargetType: "",
recommendedTargetCode: "",
recommendedTargetName: "",
historyOnly: false,
hasHistoryRecommend: false
},
visibleFlag: false,
dialogFormRules: {
status: [{ required: true, message: "不能为空", trigger: "blur" }],
custName: [{ required: true, message: "不能为空", trigger: "blur" }],
custId: [{ required: true, message: "不能为空", trigger: "blur" }],
alterType: [
{ required: true, message: "不能为空", trigger: "blur" }
],
alterDetail: [
{ required: true, message: "不能为空", trigger: "blur" }
]
forwardForm: {
ids: [],
targetType: "user",
deptId: "",
userName: "",
useHistory: false
},
forwardRules: {
targetType: [{ required: true, message: "请选择转发类型", trigger: "change" }],
deptId: [{ required: true, message: "请选择目标网点", trigger: "change" }],
userName: [{ required: true, message: "请选择客户经理", trigger: "change" }]
}
};
},
@@ -314,7 +348,8 @@ export default {
resetFn() {
this.searchArray = {
status: "",
alterType: ""
alterType: "",
forwardFlag: ""
};
this.searchFn();
},
@@ -335,6 +370,7 @@ export default {
this.loading = false;
if (response.code == 200) {
this.tableData = response.rows || [];
this.selectedRows = [];
this.total = response.total || 0;
} else {
this.$message.error(response.msg || "操作失败");
@@ -349,33 +385,95 @@ export default {
this.pageSize = val;
this.queryListFn();
},
editFn(row) {
this.dialogTitle = "修改";
this.dialogForm = row;
this.visibleFlag = true;
// this.$nextTick(() => {
// this.$refs.dialogFormRef.resetFields();
// });
handleSelectionChange(rows) {
this.selectedRows = rows || [];
},
dialogOkfn() {
this.$refs["dialogFormRef"].validate(valid => {
if (valid) {
warningworkRecordSubmit(this.dialogForm).then(response => {
if (response.code == "200") {
let msg = "修改成功";
this.$message.success(msg);
this.visibleFlag = false;
this.resetFn();
canSelectForwardRow(row) {
return !!row.canForward;
},
openForwardDialog(row) {
const rows = row ? [row] : this.selectedRows.filter(item => item.canForward);
if (!rows.length) {
this.$message.warning("请先选择可转发的预警信息");
return;
}
this.isBatchForward = rows.length > 1;
this.forwardVisible = true;
this.forwardSubmitting = false;
this.forwardForm = {
ids: rows.map(item => item.id),
targetType: this.isBranchAdmin ? "dept" : "user",
deptId: "",
userName: "",
useHistory: false
};
this.forwardMeta = {
deptOptions: [],
userOptions: [],
recommendedTargetType: "",
recommendedTargetCode: "",
recommendedTargetName: "",
historyOnly: false,
hasHistoryRecommend: false
};
this.$nextTick(() => {
this.$refs.forwardFormRef && this.$refs.forwardFormRef.clearValidate();
});
getAlterForwardMeta({ ids: rows.map(item => item.id).join(",") }).then(res => {
if (res.code !== 200) {
this.$message.error(res.msg || "获取转发信息失败");
return;
}
this.forwardMeta = res.data || this.forwardMeta;
this.forwardForm.useHistory = !!this.forwardMeta.historyOnly;
});
},
applyRecommend() {
if (!this.forwardMeta.recommendedTargetCode) {
return;
}
if (this.forwardMeta.recommendedTargetType === "dept" && this.isOutletAdmin) {
return;
}
this.forwardForm.targetType = this.forwardMeta.recommendedTargetType || this.forwardForm.targetType;
if (this.forwardForm.targetType === "dept") {
this.forwardForm.deptId = Number(this.forwardMeta.recommendedTargetCode);
this.forwardForm.userName = "";
} else {
this.forwardForm.userName = this.forwardMeta.recommendedTargetCode;
this.forwardForm.deptId = "";
}
},
submitForward() {
if (this.forwardMeta.historyOnly) {
this.forwardForm.useHistory = true;
}
if (!this.forwardMeta.historyOnly && this.forwardForm.targetType === "dept" && !this.forwardForm.deptId) {
this.$message.warning("请选择目标网点");
return;
}
if (!this.forwardMeta.historyOnly && this.forwardForm.targetType === "user" && !this.forwardForm.userName) {
this.$message.warning("请选择客户经理");
return;
}
this.forwardSubmitting = true;
forwardAlter(this.forwardForm).then(response => {
this.forwardSubmitting = false;
if (response.code == 200) {
this.$message.success(response.msg || "转发完成");
this.closeForwardDialog();
this.queryListFn();
this.initCardList();
} else {
this.$message.error(response.msg || "操作失败");
}
});
}).catch(() => {
this.forwardSubmitting = false;
})
},
closeForwardDialog() {
this.forwardVisible = false;
}
});
},
dialogCancelfn() {
this.visibleFlag = false;
},
}
};
</script>
@@ -509,4 +607,11 @@ export default {
}
}
}
.recommend-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
</style>