From 83d552f390545d0a2f47f950295399a95734fed4 Mon Sep 17 00:00:00 2001 From: sunxiwang Date: Mon, 2 Nov 2020 10:58:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wecom/WeCustomerController.java | 6 ++-- linkwe-ui/src/api/customer/index.js | 4 ++- .../src/views/customerManage/customer.vue | 29 ++++++++++--------- .../linkwechat/wecom/domain/WeCustomer.java | 5 +--- .../mapper/wecom/WeCustomerMapper.xml | 26 +++++++++++++++++ 5 files changed, 49 insertions(+), 21 deletions(-) diff --git a/linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java b/linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java index 6fab8b7a2..5896b05b9 100644 --- a/linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java +++ b/linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java @@ -2,6 +2,7 @@ package com.linkwechat.web.controller.wecom; import java.util.List; +import com.dtflys.forest.annotation.Post; import com.linkwechat.common.annotation.Log; import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.core.controller.BaseController; @@ -40,11 +41,12 @@ public class WeCustomerController extends BaseController * 查询企业微信客户列表 */ @PreAuthorize("@ss.hasPermi('customerManage:customer:list')") - @GetMapping("/list") - public TableDataInfo list(WeCustomer weCustomer) + @PostMapping("/list") + public TableDataInfo list(@RequestBody WeCustomer weCustomer) { startPage(); List list = weCustomerService.selectWeCustomerList(weCustomer); + return getDataTable(list); } diff --git a/linkwe-ui/src/api/customer/index.js b/linkwe-ui/src/api/customer/index.js index b1f8fd90c..83fa09782 100644 --- a/linkwe-ui/src/api/customer/index.js +++ b/linkwe-ui/src/api/customer/index.js @@ -14,10 +14,12 @@ const service = config.services.wecom + '/customer' "endTime": "结束时间" } */ +console.log(request) export function getList(params) { return request({ url: service + '/list', - params + method: 'post', + data: params }) } diff --git a/linkwe-ui/src/views/customerManage/customer.vue b/linkwe-ui/src/views/customerManage/customer.vue index 8c9bc1b33..f2276e768 100644 --- a/linkwe-ui/src/views/customerManage/customer.vue +++ b/linkwe-ui/src/views/customerManage/customer.vue @@ -12,13 +12,15 @@ export default { data() { return { query: { - pageNum: 1, - pageSize: 10, name: "", // "客户名称", - userId: "", // "添加人id", - tagIds: "", // "标签id,多个标签,id使用逗号隔开", - beginTime: "", // "开始时间", - endTime: "", // "结束时间" + params:{ + pageNum: 1, + pageSize: 10, + beginTime: "", // "开始时间", + endTime: "", // "结束时间", + userId: "", // "添加人id", + tagIds: "", // "标签id,多个标签,id使用逗号隔开", + } }, queryTag: [], // 搜索框选择的标签 queryUser: [], // 搜索框选择的添加人 @@ -92,12 +94,11 @@ export default { mounted() {}, methods: { getList(page) { - // console.log(this.dateRange); if (this.dateRange[0]) { - this.query.beginTime = this.dateRange[0]; - this.query.endTime = this.dateRange[1]; + this.query.params.beginTime = this.dateRange[0]; + this.query.params.endTime = this.dateRange[1]; } - page && (this.query.pageNum = page); + page && (this.query.params.pageNum = page); this.loading = true; api .getList(this.query) @@ -177,11 +178,11 @@ export default { }, selectedUser(list) { this.queryUser = list; - this.query.userId = list.map((d) => d.id) + ""; + this.query.params.userId = list.map((d) => d.id) + ""; }, submitSelectTag(formName) { if (this.tagDialogType.type === "query") { - this.query.tagIds = this.selectedTag.map((d) => d.tagId) + ""; + this.query.params.tagIds = this.selectedTag.map((d) => d.tagId) + ""; // debugger; this.queryTag = this.selectedTag; this.dialogVisible = false; @@ -366,8 +367,8 @@ export default { diff --git a/linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java b/linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java index 01ef177cc..4a0fda20c 100644 --- a/linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java +++ b/linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java @@ -27,10 +27,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; @AllArgsConstructor @NoArgsConstructor @TableName("we_customer") -public class WeCustomer -{ - private static final long serialVersionUID = 1L; - +public class WeCustomer extends BaseEntity { /** 外部联系人的userid */ @TableId diff --git a/linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml b/linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml index cff5432bb..c8d73ceb5 100644 --- a/linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml +++ b/linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml @@ -73,6 +73,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN we_user wu ON wu.user_id=wfcr.user_id LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.id LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id + + + AND wc.name like concat('%', #{name}, '%') + + + AND wfcr.user_id = #{params.userId} + + + + + and wt.tag_id in + + #{item} + + + + and wt.tag_id=#{params.tagIds} + + + + AND date_format(wfcr.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + + + AND date_format(wfcr.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + + +