Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1911051a
authored
Oct 27, 2021
by
linkwechat8856@163.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
群发bug修复
1 parent
61e9b476
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
32 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerMessagePushClient.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
View file @
1911051
package
com
.
linkwechat
.
web
.
controller
.
wecom
;
package
com
.
linkwechat
.
web
.
controller
.
wecom
;
import
cn.hutool.core.collection.CollectionUtil
;
import
c
om.alibaba.fastjson.JSONObject
;
import
c
n.hutool.core.collection.ListUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.constant.Constants
;
...
@@ -10,10 +10,12 @@ import com.linkwechat.common.core.controller.BaseController;
...
@@ -10,10 +10,12 @@ import com.linkwechat.common.core.controller.BaseController;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.utils.poi.ExcelUtil
;
import
com.linkwechat.wecom.domain.*
;
import
com.linkwechat.wecom.domain.*
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeCustomerTrajectoryService
;
import
com.linkwechat.wecom.service.IWeCustomerTrajectoryService
;
import
com.linkwechat.wecom.service.IWeFlowerCustomerRelService
;
import
com.linkwechat.wecom.service.IWeFlowerCustomerTagRelService
;
import
com.linkwechat.wecom.service.IWeFlowerCustomerTagRelService
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -21,6 +23,7 @@ import org.springframework.context.annotation.Lazy;
...
@@ -21,6 +23,7 @@ import org.springframework.context.annotation.Lazy;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -40,6 +43,12 @@ public class WeCustomerController extends BaseController
...
@@ -40,6 +43,12 @@ public class WeCustomerController extends BaseController
@Autowired
@Autowired
private
IWeFlowerCustomerTagRelService
weFlowerCustomerTagRelService
;
@Autowired
private
IWeFlowerCustomerRelService
weFlowerCustomerRelService
;
@Autowired
private
IWeCustomerTrajectoryService
iWeCustomerTrajectoryService
;
private
IWeCustomerTrajectoryService
iWeCustomerTrajectoryService
;
...
@@ -80,23 +89,47 @@ public class WeCustomerController extends BaseController
...
@@ -80,23 +89,47 @@ public class WeCustomerController extends BaseController
{
{
startPage
();
startPage
();
List
<
WeCustomerList
>
list
=
weCustomerService
.
findWeCustomerList
(
weCustomerList
);
List
<
WeCustomerList
>
list
=
weCustomerService
.
findWeCustomerList
(
weCustomerList
);
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
list
.
stream
().
forEach
(
k
->{
List
<
WeFlowerCustomerRel
>
relList
=
weFlowerCustomerRelService
.
list
(
new
LambdaQueryWrapper
<
WeFlowerCustomerRel
>()
.
eq
(
WeFlowerCustomerRel:
:
getUserId
,
k
.
getFirstUserId
())
.
eq
(
WeFlowerCustomerRel:
:
getExternalUserid
,
k
.
getExternalUserid
()));
if
(
CollectionUtil
.
isNotEmpty
(
relList
)){
WeFlowerCustomerRel
customerRel
=
relList
.
stream
().
findFirst
().
get
();
if
(
customerRel
!=
null
){
customerRel
.
setWeFlowerCustomerTagRels
(
weFlowerCustomerTagRelService
.
list
(
new
LambdaQueryWrapper
<
WeFlowerCustomerTagRel
>()
.
eq
(
WeFlowerCustomerTagRel:
:
getUserId
,
k
.
getFirstUserId
())
.
eq
(
WeFlowerCustomerTagRel:
:
getExternalUserid
,
k
.
getExternalUserid
()))
);
}
k
.
setWeFlowerCustomerRels
(
ListUtil
.
toList
(
customerRel
));
}
});
}
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
//
/**
/**
//
* 导出企业微信客户列表
* 导出企业微信客户列表
//
*/
*/
//
// @PreAuthorize("@ss.hasPermi('wecom:customer:export')")
// @PreAuthorize("@ss.hasPermi('wecom:customer:export')")
//
@Log(title = "企业微信客户", businessType = BusinessType.EXPORT)
@Log
(
title
=
"企业微信客户"
,
businessType
=
BusinessType
.
EXPORT
)
//
@GetMapping("/export")
@GetMapping
(
"/export"
)
//
public AjaxResult export(WeCustomer weCustomer)
public
AjaxResult
export
(
WeCustomer
weCustomer
)
//
{
{
//
List<WeCustomer> list = weCustomerService.selectWeCustomerList(weCustomer);
List
<
WeCustomer
>
list
=
weCustomerService
.
selectWeCustomerList
(
weCustomer
);
//
ExcelUtil<WeCustomer> util = new ExcelUtil<WeCustomer>(WeCustomer.class);
ExcelUtil
<
WeCustomer
>
util
=
new
ExcelUtil
<
WeCustomer
>(
WeCustomer
.
class
);
//
return util.exportExcel(list, "customer");
return
util
.
exportExcel
(
list
,
"customer"
);
//
}
}
/**
/**
* 获取企业微信客户详细信息
* 获取企业微信客户详细信息
...
@@ -111,17 +144,14 @@ public class WeCustomerController extends BaseController
...
@@ -111,17 +144,14 @@ public class WeCustomerController extends BaseController
/**
/**
* 修改企业微信客户
(目前只更新生日)
* 修改企业微信客户
*/
*/
// @PreAuthorize("@ss.hasPermi('wecom:customer:edit')")
// @PreAuthorize("@ss.hasPermi('wecom:customer:edit')")
@Log
(
title
=
"企业微信客户"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"企业微信客户"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@Validated
@RequestBody
WeCustomer
weCustomer
)
public
AjaxResult
edit
(
@Validated
@RequestBody
WeCustomer
weCustomer
)
{
{
weCustomerService
.
update
(
weCustomer
,
new
LambdaQueryWrapper
<
WeCustomer
>()
weCustomerService
.
saveOrUpdate
(
weCustomer
);
.
eq
(
WeCustomer:
:
getExternalUserid
,
weCustomer
.
getExternalUserid
())
.
eq
(
WeCustomer:
:
getFirstUserId
,
weCustomer
.
getFirstUserId
()));
return
AjaxResult
.
success
();
return
AjaxResult
.
success
();
}
}
...
@@ -169,7 +199,7 @@ public class WeCustomerController extends BaseController
...
@@ -169,7 +199,7 @@ public class WeCustomerController extends BaseController
@DeleteMapping
(
"/removeLabel"
)
@DeleteMapping
(
"/removeLabel"
)
public
AjaxResult
removeLabel
(
@RequestBody
WeMakeCustomerTag
weMakeCustomerTag
){
public
AjaxResult
removeLabel
(
@RequestBody
WeMakeCustomerTag
weMakeCustomerTag
){
weCustomerService
.
mak
eLabel
(
weMakeCustomerTag
);
weCustomerService
.
remov
eLabel
(
weMakeCustomerTag
);
return
AjaxResult
.
success
();
return
AjaxResult
.
success
();
...
@@ -215,16 +245,5 @@ public class WeCustomerController extends BaseController
...
@@ -215,16 +245,5 @@ public class WeCustomerController extends BaseController
);
);
}
}
/**
* 客户条件检索
* @param params 检索条件
* @return
*/
@ApiOperation
(
value
=
"客户条件检索"
,
httpMethod
=
"POST"
)
@PostMapping
(
value
=
"/getCustomerByCondition"
)
public
AjaxResult
getCustomerByCondition
(
@RequestBody
JSONObject
params
){
weCustomerService
.
getCustomerByCondition
(
params
);
return
AjaxResult
.
success
(
""
);
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerMessagePushClient.java
View file @
1911051
...
@@ -24,7 +24,7 @@ public interface WeCustomerMessagePushClient {
...
@@ -24,7 +24,7 @@ public interface WeCustomerMessagePushClient {
*/
*/
@Deprecated
@Deprecated
@Request
(
url
=
"/externalcontact/add_msg_template"
,
type
=
"POST"
)
@Request
(
url
=
"/externalcontact/add_msg_template"
,
type
=
"POST"
)
SendMessageResultDto
sendCustomerMessageToUser
(
@Body
WeCustomerMessagePushDto
customerMessagePushDto
);
SendMessageResultDto
sendCustomerMessageToUser
(
@
JSON
Body
WeCustomerMessagePushDto
customerMessagePushDto
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment