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 912bc591
authored
May 12, 2021
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更新主分支代码
1 parent
d528574f
Show whitespace changes
Inline
Side-by-side
Showing
93 changed files
with
740 additions
and
700 deletions
linkwe-admin/src/main/java/com/linkwechat/LinkWeChatApplication.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCategoryController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCorpAccountController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeUserController.java
linkwe-admin/src/main/resources/application.yml
linkwe-common/pom.xml
linkwe-common/src/main/java/com/linkwechat/common/aop/CustomerTrajectoryAop.java
linkwe-common/src/main/java/com/linkwechat/common/config/RuoYiConfig.java
linkwe-common/src/main/java/com/linkwechat/common/constant/Constants.java
linkwe-common/src/main/java/com/linkwechat/common/core/domain/entity/WeCorpAccount.java
linkwe-common/src/main/java/com/linkwechat/common/enums/TrajectoryType.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/ResourcesConfig.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
linkwe-framework/src/main/java/com/linkwechat/framework/web/service/UserDetailsServiceImpl.java
linkwe-generator/src/main/resources/generator.yml
linkwe-generator/src/main/resources/vm/java/controller.java.vm
linkwe-generator/src/main/resources/vm/java/domain.java.vm
linkwe-generator/src/main/resources/vm/java/mapper.java.vm
linkwe-generator/src/main/resources/vm/java/service.java.vm
linkwe-generator/src/main/resources/vm/java/serviceImpl.java.vm
linkwe-generator/src/main/resources/vm/java/sub-domain.java.vm
linkwe-generator/src/main/resources/vm/xml/mapper.xml.vm
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/CustomerPortraitTask.java
linkwe-system/src/main/resources/mapper/system/SysUserMapper.xml
linkwe-wecom/src/main/java/com/linkwechat/wecom/annotation/CustomerTrajectoryRecord.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeAccessTokenClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeAppClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeMessagePushClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeUserClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCategory.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerTrajectory.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeTag.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeTaskFissionCompleteRecord.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeUser.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeChatUserDTO.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeMessagePushDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/TextMessageDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeCustomerMessagePushDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/ConversationArchiveVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackDelExternalContactImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customergroup/WeCallBackUpdateGroupImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCategoryMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatCollectionMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatItemMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCorpAccountMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessageMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessageOriginalMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessgaeResultMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTaskFissionMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeUserMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCategoryService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatCollectionService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatItemService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCorpAccountService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerMessageOriginalService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerMessagePushService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerMessageService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerTrajectoryService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMemberService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeMaterialService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWePosterFontService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTagGroupService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTaskFissionCompleteRecordService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTaskFissionService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeUserBehaviorDataService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeUserService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWxAuthService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCategoryServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCorpAccountServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerTrajectoryServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMemberServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionCompleteRecordServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionRewardServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeUserServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCategoryMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeCorpAccountMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeEmpleCodeMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupStatisticMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeTaskFissionCompleteRecordMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeUserBehaviorDataMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
linkwe-admin/src/main/java/com/linkwechat/LinkWeChatApplication.java
View file @
912bc59
...
...
@@ -18,7 +18,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
@MapperScan
(
"com.linkwechat.*.mapper"
)
@ForestScan
(
basePackages
=
{
"com.linkwechat.wecom.client"
,
"com.linkwechat.wecom.wxclient"
})
@EnableAsync
//
@EnableDiscoveryClient
@EnableDiscoveryClient
public
class
LinkWeChatApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCategoryController.java
View file @
912bc59
package
com
.
linkwechat
.
web
.
controller
.
wecom
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.Tree
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.wecom.domain.WeCategory
;
import
com.linkwechat.wecom.service.IWeCategoryService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -22,14 +25,14 @@ import java.util.List;
*/
@RestController
@RequestMapping
(
"/wecom/category"
)
@Api
(
"企业微信素材分类"
)
public
class
WeCategoryController
extends
BaseController
{
@Autowired
private
IWeCategoryService
weCategoryService
;
/**
* 类目树
*/
// @PreAuthorize("@ss.hasPermi('wechat:category:list')")
@GetMapping
(
"/list"
)
@ApiOperation
(
"类目树"
)
...
...
@@ -44,7 +47,7 @@ public class WeCategoryController extends BaseController {
@GetMapping
(
value
=
"/{id}"
)
@ApiOperation
(
"通过id查询类目详细信息"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
AjaxResult
.
success
(
weCategoryService
.
findWeCategory
ById
(
id
));
return
AjaxResult
.
success
(
weCategoryService
.
get
ById
(
id
));
}
/**
...
...
@@ -55,7 +58,8 @@ public class WeCategoryController extends BaseController {
@PostMapping
@ApiOperation
(
"添加类目"
)
public
AjaxResult
add
(
@RequestBody
WeCategory
category
)
{
return
toAjax
(
weCategoryService
.
insertWeCategory
(
category
));
weCategoryService
.
insertWeCategory
(
category
);
return
AjaxResult
.
success
();
}
/**
...
...
@@ -66,7 +70,8 @@ public class WeCategoryController extends BaseController {
@PutMapping
@ApiOperation
(
"更新目录"
)
public
AjaxResult
edit
(
@RequestBody
WeCategory
category
)
{
return
toAjax
(
weCategoryService
.
updateWeCategory
(
category
));
weCategoryService
.
updateWeCategory
(
category
);
return
AjaxResult
.
success
();
}
...
...
@@ -78,7 +83,17 @@ public class WeCategoryController extends BaseController {
@DeleteMapping
(
"/{ids}"
)
@ApiOperation
(
"删除类目"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
return
toAjax
(
weCategoryService
.
deleteWeCategoryByIds
(
ids
));
List
<
WeCategory
>
categorys
=
new
ArrayList
<>();
for
(
Long
id:
ids
)
{
categorys
.
add
(
WeCategory
.
builder
()
.
id
(
id
)
.
delFlag
(
Constants
.
DELETE_CODE
)
.
build
()
);
}
weCategoryService
.
updateBatchById
(
categorys
);
return
AjaxResult
.
success
();
}
}
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCorpAccountController.java
View file @
912bc59
package
com
.
linkwechat
.
web
.
controller
.
wecom
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
com.linkwechat.wecom.service.IWeCorpAccountService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -21,84 +25,76 @@ import java.util.List;
*/
@RestController
@RequestMapping
(
"/wecom/corp"
)
@Api
(
"企业id配置接口"
)
public
class
WeCorpAccountController
extends
BaseController
{
@Autowired
private
IWeCorpAccountService
weCorpAccountService
;
/**
* 查询企业id相关配置列表
*/
// @PreAuthorize("@ss.hasPermi('wechat:corp:list')")
@GetMapping
(
"/list"
)
@ApiOperation
(
"查询企业id相关配置列表"
)
public
TableDataInfo
list
(
WeCorpAccount
weCorpAccount
)
{
startPage
();
List
<
WeCorpAccount
>
list
=
weCorpAccountService
.
selectWeCorpAccountList
(
weCorpAccount
);
List
<
WeCorpAccount
>
list
=
weCorpAccountService
.
list
(
new
LambdaQueryWrapper
<
WeCorpAccount
>()
.
eq
(
WeCorpAccount:
:
getDelFlag
,
Constants
.
NORMAL_CODE
)
.
like
(
WeCorpAccount:
:
getCompanyName
,
weCorpAccount
.
getCompanyName
()));
return
getDataTable
(
list
);
}
/**
* 获取企业id相关配置详细信息
*/
// @PreAuthorize("@ss.hasPermi('wechat:corp:query')")
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
AjaxResult
.
success
(
weCorpAccountService
.
selectWeCorpAccountById
(
id
));
}
/**
* 新增企业id相关配置
*/
// @PreAuthorize("@ss.hasPermi('wechat:corp:add')")
@Log
(
title
=
"新增企业id相关配置"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@ApiOperation
(
"新增企业id相关配置"
)
public
AjaxResult
add
(
@Validated
@RequestBody
WeCorpAccount
weCorpAccount
)
{
return
toAjax
(
weCorpAccountService
.
insertWeCorpAccount
(
weCorpAccount
));
weCorpAccountService
.
save
(
weCorpAccount
);
return
AjaxResult
.
success
();
}
/**
* 修改企业id相关配置
*/
// @PreAuthorize("@ss.hasPermi('wechat:corp:edit')")
@Log
(
title
=
"修改企业id相关配置"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@ApiOperation
(
"修改企业id相关配置"
)
public
AjaxResult
edit
(
@Validated
@RequestBody
WeCorpAccount
weCorpAccount
)
{
return
toAjax
(
weCorpAccountService
.
updateWeCorpAccount
(
weCorpAccount
));
weCorpAccountService
.
updateById
(
weCorpAccount
);
return
AjaxResult
.
success
();
}
/**
* 启用有效企业微信账号
*/
// @PreAuthorize("@ss.hasPermi('wechat:corp:startVailWeCorpAccount')")
@Log
(
title
=
"启用有效企业微信账号"
,
businessType
=
BusinessType
.
DELETE
)
@PutMapping
(
"/startVailWeCorpAccount/{corpId}"
)
@ApiOperation
(
"启用有效企业微信账号"
)
public
AjaxResult
startWeCorpAccount
(
@PathVariable
String
corpId
)
{
return
toAjax
(
weCorpAccountService
.
startVailWeCorpAccount
(
corpId
));
}
/**
* 客户流失通知开关
*/
// @PreAuthorize("@ss.hasPermi('wechat:corp:startCustomerChurnNoticeSwitch')")
@Log
(
title
=
"客户流失通知开关"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/startCustomerChurnNoticeSwitch/{status}"
)
@ApiOperation
(
"客户流失通知开关"
)
public
AjaxResult
startCustomerChurnNoticeSwitch
(
@PathVariable
String
status
)
{
return
toAjax
(
weCorpAccountService
.
startCustomerChurnNoticeSwitch
(
status
));
weCorpAccountService
.
startCustomerChurnNoticeSwitch
(
status
);
return
AjaxResult
.
success
();
}
/**
* 客户流失通知开关查询
*/
// @PreAuthorize("@ss.hasPermi('wechat:corp:getCustomerChurnNoticeSwitch')")
@Log
(
title
=
"客户流失通知开关查询"
,
businessType
=
BusinessType
.
OTHER
)
@GetMapping
(
"/getCustomerChurnNoticeSwitch"
)
@ApiOperation
(
"客户流失通知开关查询"
)
public
AjaxResult
getCustomerChurnNoticeSwitch
()
{
return
AjaxResult
.
success
(
"操作成功"
,
weCorpAccountService
.
getCustomerChurnNoticeSwitch
());
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
View file @
912bc59
...
...
@@ -12,6 +12,7 @@ import com.linkwechat.wecom.domain.WeCustomer;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.security.core.context.SecurityContext
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -30,7 +31,9 @@ import java.util.List;
@RequestMapping
(
"/wecom/customer"
)
public
class
WeCustomerController
extends
BaseController
{
@Autowired
@Lazy
private
IWeCustomerService
weCustomerService
;
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
View file @
912bc59
...
...
@@ -51,14 +51,14 @@ public class WeCustomerPortraitController extends BaseController {
/**
* 根据客户id和当前企业员工id获取客户详细信息
* @param externalUserid
* @param user
i
d
* @param user
I
d
* @return
*/
@GetMapping
(
value
=
"/findWeCustomerInfo"
)
public
AjaxResult
findWeCustomerInfo
(
String
externalUserid
,
String
user
i
d
)
throws
Exception
{
public
AjaxResult
findWeCustomerInfo
(
String
externalUserid
,
String
user
I
d
)
throws
Exception
{
return
AjaxResult
.
success
(
iWeCustomerService
.
findCustomerByOperUseridAndCustomerId
(
externalUserid
,
user
i
d
)
iWeCustomerService
.
findCustomerByOperUseridAndCustomerId
(
externalUserid
,
user
I
d
)
);
}
...
...
@@ -73,7 +73,6 @@ public class WeCustomerPortraitController extends BaseController {
iWeCustomerService
.
updateWeCustomerPortrait
(
weCustomerPortrait
);
...
...
@@ -224,4 +223,6 @@ public class WeCustomerPortraitController extends BaseController {
}
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
View file @
912bc59
...
...
@@ -16,9 +16,7 @@ import com.linkwechat.wecom.service.IWePosterService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -44,11 +42,10 @@ public class WeMaterialController extends BaseController {
@Resource
private
IWePosterService
wePosterService
;
/**
* 查询素材列表
*/
// @PreAuthorize("@ss.hasPermi('wecom:material:list')")
@GetMapping
(
"/list"
)
@ApiOperation
(
"查询素材列表"
)
public
TableDataInfo
list
(
@RequestParam
(
value
=
"categoryId"
,
required
=
false
)
String
categoryId
,
@RequestParam
(
value
=
"search"
,
required
=
false
)
String
search
,
@RequestParam
(
value
=
"mediaType"
)
String
mediaType
)
{
startPage
();
...
...
@@ -69,9 +66,8 @@ public class WeMaterialController extends BaseController {
return
getDataTable
(
list
);
}
/**
* 查询素材详细信息
*/
// @PreAuthorize("@ss.hasPermi('wechat:material:query')")
@GetMapping
(
value
=
"/{id}"
)
@ApiOperation
(
"查询素材详细信息"
)
...
...
@@ -79,9 +75,7 @@ public class WeMaterialController extends BaseController {
return
AjaxResult
.
success
(
materialService
.
findWeMaterialById
(
id
));
}
/**
* 添加素材信息
*/
// @PreAuthorize("@ss.hasPermi('wechat:material:add')")
@Log
(
title
=
"添加素材信息"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
...
...
@@ -90,9 +84,7 @@ public class WeMaterialController extends BaseController {
return
toAjax
(
materialService
.
insertWeMaterial
(
material
));
}
/**
* 更新素材信息
*/
// @PreAuthorize("@ss.hasPermi('wechat:material:edit')")
@Log
(
title
=
"更新素材信息"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
...
...
@@ -101,9 +93,7 @@ public class WeMaterialController extends BaseController {
return
toAjax
(
materialService
.
updateWeMaterial
(
material
));
}
/**
* 删除素材信息
*/
// @PreAuthorize("@ss.hasPermi('wechat:material:remove')")
@Log
(
title
=
"删除素材信息"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
...
...
@@ -112,9 +102,7 @@ public class WeMaterialController extends BaseController {
return
toAjax
(
materialService
.
deleteWeMaterialByIds
(
ids
));
}
/**
* 上传素材信息
*/
// @PreAuthorize("@ss.hasPermi('wechat:material:upload')")
@Log
(
title
=
"上传素材信息"
,
businessType
=
BusinessType
.
OTHER
)
@PostMapping
(
"/upload"
)
...
...
@@ -124,9 +112,7 @@ public class WeMaterialController extends BaseController {
return
AjaxResult
.
success
(
weMaterialFileVO
);
}
/**
* 更换分组
*/
// @PreAuthorize("@ss.hasPermi('wechat:material:resetCategory')")
@Log
(
title
=
"更换分组"
,
businessType
=
BusinessType
.
OTHER
)
@PutMapping
(
"/resetCategory"
)
...
...
@@ -147,6 +133,8 @@ public class WeMaterialController extends BaseController {
return
AjaxResult
.
success
(
weMediaDto
);
}
@Log
(
title
=
"上传素材图片"
,
businessType
=
BusinessType
.
OTHER
)
@PostMapping
(
"/uploadimg"
)
@ApiOperation
(
"上传素材图片"
)
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeUserController.java
View file @
912bc59
...
...
@@ -13,6 +13,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.core.context.SecurityContext
;
import
org.springframework.security.core.context.SecurityContextHolder
;
...
...
@@ -35,6 +36,7 @@ import java.util.List;
public
class
WeUserController
extends
BaseController
{
@Autowired
@Lazy
private
IWeUserService
weUserService
;
...
...
linkwe-admin/src/main/resources/application.yml
View file @
912bc59
...
...
@@ -16,7 +16,37 @@ ruoyi:
captchaType
:
math
# 企业微信用户首次登录系统默认密码
weUserDefaultPwd
:
123456
#匿名访问的URL
anonUrl
:
-
/login
-
/captchaImage
-
/findWxQrLoginInfo
-
/wxQrLogin
-
/profile/**
-
/common/download**
-
/common/download/resource**
-
/common/download/url**
-
/swagger-ui.html
-
/swagger-resources/**
-
/webjars/**
-
/*/api-docs
-
/druid/**
-
/wecom/callback/**
-
/wecom/chat/item/list
-
/wecom/chat/collection/list
-
/wecom/chat/collection/cancleCollection
-
/wecom/chat/collection/addCollection
-
/wecom/chat/side/h5List
-
/wecom/ticket/**
-
/wecom/user/getUserInfo
-
/wecom/portrait/**
-
/wecom/fission/poster
-
/wecom/fission/*/progress/*
-
/wecom/reward/getRewardByFissionId/**
-
/wecom/groupCode/getActualCode/**
-
/wecom/community/h5/**
-
/weixin/auth/**
-
/wecom/material/temporaryMaterialMediald
# 开发环境配置
server
:
# 服务器的HTTP端口,默认为8090
...
...
linkwe-common/pom.xml
View file @
912bc59
...
...
@@ -260,6 +260,12 @@
<artifactId>
bcpkix-jdk15on
</artifactId>
<version>
1.68
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
linkwe-common/src/main/java/com/linkwechat/common/aop/CustomerTrajectoryAop.java
0 → 100644
View file @
912bc59
package
com
.
linkwechat
.
common
.
aop
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.stereotype.Component
;
/**
* @description: 客户轨迹记录AOP
* @author: HaoN
* @create: 2021-05-02 22:51
**/
@Aspect
@Component
public
class
CustomerTrajectoryAop
{
@Pointcut
(
"@annotation(com.linkwechat.wecom.annotation.CustomerTrajectoryRecord)"
)
public
void
customerTrajectoryPointCut
(){}
/**
* 记录轨迹
* @param joinPoint
*/
@Around
(
"customerTrajectoryPointCut()"
)
public
void
customerTrajectoryRecord
(
ProceedingJoinPoint
joinPoint
){
}
}
linkwe-common/src/main/java/com/linkwechat/common/config/RuoYiConfig.java
View file @
912bc59
...
...
@@ -33,6 +33,11 @@ public class RuoYiConfig
/** 企业微信账号登录系统默认密码 */
private
static
String
weUserDefaultPwd
=
"123456"
;
/**匿名访问的URL*/
private
String
[]
anonUrl
;
public
String
getName
()
{
return
name
;
...
...
@@ -132,4 +137,12 @@ public class RuoYiConfig
public
void
setWeUserDefaultPwd
(
String
weUserDefaultPwd
)
{
RuoYiConfig
.
weUserDefaultPwd
=
weUserDefaultPwd
;
}
public
String
[]
getAnonUrl
()
{
return
anonUrl
;
}
public
void
setAnonUrl
(
String
[]
anonUrl
)
{
this
.
anonUrl
=
anonUrl
;
}
}
linkwe-common/src/main/java/com/linkwechat/common/constant/Constants.java
View file @
912bc59
...
...
@@ -163,7 +163,7 @@ public class Constants
public
static
final
String
DEFAULT_WECOME_CORP_ADMIN
=
"CROP_ADMIN_ROLE"
;
/**完成待办*/
public
static
final
String
HANDLE_SUCCESS
=
"
1
"
;
public
static
final
String
HANDLE_SUCCESS
=
"
3
"
;
...
...
linkwe-common/src/main/java/com/linkwechat/common/core/domain/entity/WeCorpAccount.java
View file @
912bc59
package
com
.
linkwechat
.
common
.
core
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -8,7 +11,6 @@ import lombok.AllArgsConstructor;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.validation.constraints.NotBlank
;
...
...
@@ -23,11 +25,14 @@ import javax.validation.constraints.NotBlank;
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"企业id配置相关实体"
)
@TableName
(
"we_corp_account"
)
public
class
WeCorpAccount
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
@TableId
@ApiModelProperty
(
"主键"
)
private
Long
id
=
SnowFlakeUtil
.
nextId
();
/** 企业名称 */
...
...
@@ -36,12 +41,12 @@ public class WeCorpAccount extends BaseEntity
private
String
companyName
;
/** 企业ID */
@ApiModelProperty
(
"企业
ID
"
)
@ApiModelProperty
(
"企业
corpId
"
)
@NotBlank
(
message
=
"企业ID不能为空"
)
private
String
corpId
;
/** 应用的密钥凭证 */
@ApiModelProperty
(
"
应用的密钥凭证
"
)
@ApiModelProperty
(
"
企业为corpSecret
"
)
@NotBlank
(
message
=
"应用的密钥凭证不能为空"
)
private
String
corpSecret
;
...
...
@@ -75,7 +80,7 @@ public class WeCorpAccount extends BaseEntity
private
String
wxQrLoginRedirectUri
;
@ApiModelProperty
(
"客户流失通知开关 0:关闭 1:开启"
)
private
String
customerChurnNoticeSwitch
=
new
String
(
"0"
)
;
private
String
customerChurnNoticeSwitch
=
Constants
.
NORMAL_CODE
;
@ApiModelProperty
(
"企业管理员账号"
)
...
...
linkwe-common/src/main/java/com/linkwechat/common/enums/TrajectoryType.java
0 → 100644
View file @
912bc59
package
com
.
linkwechat
.
common
.
enums
;
import
lombok.Getter
;
import
java.util.stream.Stream
;
/**
* 客户轨迹枚举
*/
@Getter
public
enum
TrajectoryType
{
TRAJECTORY_TYPE_XXDT
(
1
,
"信息动态"
),
TRAJECTORY_TYPE_SJDT
(
2
,
"社交动态"
),
TRAJECTORY_TYPE_HDGZ
(
3
,
"活动规则"
),
TRAJECTORY_TYPE_DBDT
(
4
,
"待办动态"
);
private
String
name
;
private
Integer
type
;
TrajectoryType
(
Integer
type
,
String
name
)
{
this
.
name
=
name
;
this
.
type
=
type
;
}
}
linkwe-framework/src/main/java/com/linkwechat/framework/config/ResourcesConfig.java
View file @
912bc59
...
...
@@ -24,6 +24,8 @@ public class ResourcesConfig implements WebMvcConfigurer
@Autowired
private
RepeatSubmitInterceptor
repeatSubmitInterceptor
;
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
...
...
@@ -66,4 +68,5 @@ public class ResourcesConfig implements WebMvcConfigurer
}
\ No newline at end of file
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
View file @
912bc59
package
com
.
linkwechat
.
framework
.
config
;
import
com.linkwechat.common.config.RuoYiConfig
;
import
com.linkwechat.framework.security.filter.JwtAuthenticationTokenFilter
;
import
com.linkwechat.framework.security.handle.AuthenticationEntryPointImpl
;
import
com.linkwechat.framework.security.handle.LogoutSuccessHandlerImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.http.HttpMethod
;
...
...
@@ -55,6 +57,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private
CorsFilter
corsFilter
;
@Autowired
private
RuoYiConfig
ruoYiConfig
;
/**
* 解决 无法直接注入 AuthenticationManager
*
...
...
@@ -84,6 +91,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
*/
@Override
protected
void
configure
(
HttpSecurity
httpSecurity
)
throws
Exception
{
System
.
out
.
println
(
StringUtils
.
join
(
ruoYiConfig
.
getAnonUrl
(),
","
)
);
httpSecurity
// CSRF禁用,因为不使用session
.
csrf
().
disable
()
...
...
@@ -93,8 +105,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
sessionManagement
().
sessionCreationPolicy
(
SessionCreationPolicy
.
STATELESS
).
and
()
// 过滤请求
.
authorizeRequests
()
// 对于登录login 验证码captchaImage 允许匿名访问
.
antMatchers
(
"/login"
,
"/captchaImage"
,
"/findWxQrLoginInfo"
,
"/wxQrLogin"
).
anonymous
()
.
antMatchers
(
ruoYiConfig
.
getAnonUrl
()).
anonymous
()
// .antMatchers("/login", "/captchaImage", "/findWxQrLoginInfo", "/wxQrLogin").anonymous()
.
antMatchers
(
HttpMethod
.
GET
,
"/*.html"
,
...
...
@@ -102,34 +116,34 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/**/*.css"
,
"/**/*.js"
).
permitAll
()
.
antMatchers
(
"/profile/**"
).
anonymous
()
.
antMatchers
(
"/common/download**"
).
anonymous
()
.
antMatchers
(
"/common/download/resource**"
).
anonymous
()
.
antMatchers
(
"/common/download/url**"
).
anonymous
()
.
antMatchers
(
"/swagger-ui.html"
).
anonymous
()
.
antMatchers
(
"/swagger-resources/**"
).
anonymous
()
.
antMatchers
(
"/webjars/**"
).
anonymous
()
.
antMatchers
(
"/*/api-docs"
).
anonymous
()
.
antMatchers
(
"/druid/**"
).
anonymous
()
.
antMatchers
(
"/wecom/callback/**"
).
anonymous
()
.
antMatchers
(
"/wecom/chat/item/list"
).
anonymous
()
.
antMatchers
(
"/wecom/chat/collection/list"
).
anonymous
()
.
antMatchers
(
"/wecom/chat/collection/cancleCollection"
).
anonymous
()
.
antMatchers
(
"/wecom/chat/collection/addCollection"
).
anonymous
()
.
antMatchers
(
"/wecom/chat/side/h5List"
).
anonymous
()
.
antMatchers
(
"/wecom/ticket/**"
).
anonymous
()
.
antMatchers
(
"/wecom/user/getUserInfo"
).
anonymous
()
// .antMatchers("/common/uploadFile2Cos").anonymous()
// .antMatchers("/wecom/material/temporaryMaterialMediaId").anonymous()
.
antMatchers
(
"/wecom/portrait/**"
).
anonymous
()
.
antMatchers
(
"/wecom/fission/poster"
,
"/wecom/fission/*/progress/*"
,
"/wecom/reward/getRewardByFissionId/**"
).
anonymous
()
// 获取实际群活码和社群运营H5页面不需要登录
.
antMatchers
(
"/wecom/groupCode/getActualCode/**"
).
anonymous
()
.
antMatchers
(
"/wecom/community/h5/**"
).
anonymous
()
//微信授权接口
.
antMatchers
(
"/weixin/auth/**"
).
anonymous
()
//
.antMatchers("/profile/**").anonymous()
//
.antMatchers("/common/download**").anonymous()
//
.antMatchers("/common/download/resource**").anonymous()
//
.antMatchers("/common/download/url**").anonymous()
//
.antMatchers("/swagger-ui.html").anonymous()
//
.antMatchers("/swagger-resources/**").anonymous()
//
.antMatchers("/webjars/**").anonymous()
//
.antMatchers("/*/api-docs").anonymous()
//
.antMatchers("/druid/**").anonymous()
//
.antMatchers("/wecom/callback/**").anonymous()
//
//
.antMatchers("/wecom/chat/item/list").anonymous()
//
.antMatchers("/wecom/chat/collection/list").anonymous()
//
.antMatchers("/wecom/chat/collection/cancleCollection").anonymous()
//
.antMatchers("/wecom/chat/collection/addCollection").anonymous()
//
.antMatchers("/wecom/chat/side/h5List").anonymous()
//
.antMatchers("/wecom/ticket/**").anonymous()
//
//
.antMatchers("/wecom/user/getUserInfo").anonymous()
//
// .antMatchers("/common/uploadFile2Cos").anonymous()
//
//
.antMatchers("/wecom/material/temporaryMaterialMediaId").anonymous()
//
.antMatchers("/wecom/portrait/**").anonymous()
//
.antMatchers("/wecom/fission/poster", "/wecom/fission/*/progress/*", "/wecom/reward/getRewardByFissionId/**").anonymous()
//
// 获取实际群活码和社群运营H5页面不需要登录
//
.antMatchers("/wecom/groupCode/getActualCode/**").anonymous()
//
.antMatchers("/wecom/community/h5/**").anonymous()
//
//微信授权接口
//
.antMatchers("/weixin/auth/**").anonymous()
// 除上面外的所有请求全部需要鉴权认证
.
anyRequest
().
authenticated
()
...
...
@@ -141,6 +155,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 添加CORS filter
httpSecurity
.
addFilterBefore
(
corsFilter
,
JwtAuthenticationTokenFilter
.
class
);
httpSecurity
.
addFilterBefore
(
corsFilter
,
LogoutFilter
.
class
);
String
join
=
StringUtils
.
join
(
ruoYiConfig
.
getAnonUrl
(),
","
);
}
...
...
@@ -159,4 +175,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
protected
void
configure
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
auth
.
userDetailsService
(
userDetailsService
).
passwordEncoder
(
bCryptPasswordEncoder
());
}
}
linkwe-framework/src/main/java/com/linkwechat/framework/web/service/UserDetailsServiceImpl.java
View file @
912bc59
package
com
.
linkwechat
.
framework
.
web
.
service
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.linkwechat.common.config.RuoYiConfig
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.core.domain.entity.SysRole
;
import
com.linkwechat.common.core.domain.entity.SysUser
;
import
com.linkwechat.common.core.domain.model.LoginUser
;
import
com.linkwechat.common.enums.UserStatus
;
import
com.linkwechat.common.exception.BaseException
;
import
com.linkwechat.common.utils.SecurityUtils
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.system.mapper.SysRoleMapper
;
import
com.linkwechat.system.service.ISysUserService
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
com.linkwechat.wecom.service.IWeCorpAccountService
;
import
com.linkwechat.wecom.service.IWeUserService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -23,8 +14,6 @@ import org.springframework.security.core.userdetails.UserDetailsService;
import
org.springframework.security.core.userdetails.UsernameNotFoundException
;
import
org.springframework.stereotype.Service
;
import
java.util.stream.Collectors
;
/**
* 用户验证处理
*
...
...
@@ -41,19 +30,8 @@ public class UserDetailsServiceImpl implements UserDetailsService
@Autowired
private
SysPermissionService
permissionService
;
@Autowired
private
IWeUserService
iWeUserService
;
@Autowired
private
RuoYiConfig
ruoYiConfig
;
@Autowired
private
SysRoleMapper
roleMapper
;
@Autowired
private
IWeCorpAccountService
iWeCorpAccountService
;
@Override
...
...
@@ -62,6 +40,9 @@ public class UserDetailsServiceImpl implements UserDetailsService
SysUser
user
=
userService
.
selectUserByUserName
(
username
);
if
(
StringUtils
.
isNull
(
user
))
{
log
.
info
(
"登录用户:{} 不存在."
,
username
);
throw
new
BaseException
(
"对不起,您的账号:"
+
username
+
" 不存在"
);
// //企业管理登录
// //查询企业管理相关账号
// WeCorpAccount weCorpByAccount = iWeCorpAccountService.findWeCorpByAccount(username);
...
...
@@ -103,9 +84,9 @@ public class UserDetailsServiceImpl implements UserDetailsService
// .password(SecurityUtils.encryptPassword(ruoYiConfig.getWeUserDefaultPwd()))
// .build();
// }
userService
.
insertUser
(
user
);
//
userService.insertUser(
//
user
//
);
}
else
if
(
UserStatus
.
DELETED
.
getCode
().
equals
(
user
.
getDelFlag
()))
{
...
...
linkwe-generator/src/main/resources/generator.yml
View file @
912bc59
...
...
@@ -3,7 +3,7 @@ gen:
# 作者
author
:
ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName
:
com.
ruoyi.system
packageName
:
com.
linkwechat
# 自动去除表前缀,默认是false
autoRemovePre
:
false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
...
...
linkwe-generator/src/main/resources/vm/java/controller.java.vm
View file @
912bc59
package ${packageName}.
controller
;
package ${packageName}.
web.controller.wecom
;
import java.util.List;
import java.util.Arrays;
...
...
linkwe-generator/src/main/resources/vm/java/domain.java.vm
View file @
912bc59
package ${packageName}.domain;
package ${packageName}.
wecom.
domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
...
...
linkwe-generator/src/main/resources/vm/java/mapper.java.vm
View file @
912bc59
package ${packageName}.mapper;
package ${packageName}.
wecom.
mapper;
import ${packageName}.domain.${ClassName};
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
...
linkwe-generator/src/main/resources/vm/java/service.java.vm
View file @
912bc59
package ${packageName}.service;
package ${packageName}.
wecom.
service;
import ${packageName}.domain.${ClassName};
import com.baomidou.mybatisplus.extension.service.IService;
...
...
linkwe-generator/src/main/resources/vm/java/serviceImpl.java.vm
View file @
912bc59
package ${packageName}.service.impl;
package ${packageName}.
wecom.
service.impl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...
...
linkwe-generator/src/main/resources/vm/java/sub-domain.java.vm
View file @
912bc59
package ${packageName}.domain;
package ${packageName}.
wecom.
domain;
#foreach ($import in $subImportList)
import ${import};
...
...
linkwe-generator/src/main/resources/vm/xml/mapper.xml.vm
View file @
912bc59
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"${packageName}.mapper.${ClassName}Mapper"
>
<mapper
namespace=
"${packageName}.
wecom.
mapper.${ClassName}Mapper"
>
<resultMap
type=
"${ClassName}"
id=
"${ClassName}Result"
>
#foreach ($column in $columns)
...
...
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/CustomerPortraitTask.java
0 → 100644
View file @
912bc59
package
com
.
linkwechat
.
quartz
.
task
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
/**
* @description: 客户画像
* @author: HaoN
* @create: 2021-05-02 21:08
**/
@Slf4j
@Component
(
"customerPortraitTask"
)
public
class
CustomerPortraitTask
{
}
linkwe-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
912bc59
...
...
@@ -92,15 +92,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select
id=
"checkUserNameUnique"
parameterType=
"String"
resultType=
"int"
>
select count(1) from sys_user where user_name = #{userName} limit 1
select count(1) from sys_user where user_name = #{userName}
and del_flag='0'
limit 1
</select>
<select
id=
"checkPhoneUnique"
parameterType=
"String"
resultMap=
"SysUserResult"
>
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber}
and del_flag='0'
limit 1
</select>
<select
id=
"checkEmailUnique"
parameterType=
"String"
resultMap=
"SysUserResult"
>
select user_id, email from sys_user where email = #{email} limit 1
select user_id, email from sys_user where email = #{email}
and del_flag='0'
limit 1
</select>
<insert
id=
"insertUser"
parameterType=
"SysUser"
useGeneratedKeys=
"true"
keyProperty=
"userId"
>
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/annotation/CustomerTrajectoryRecord.java
0 → 100644
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
annotation
;
import
java.lang.annotation.*
;
/**
* 客户轨迹记录相关注解
*/
@Target
({
ElementType
.
PARAMETER
,
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
CustomerTrajectoryRecord
{
int
trajectoryType
();
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeAccessTokenClient.java
View file @
912bc59
...
...
@@ -33,7 +33,7 @@ public interface WeAccessTokenClient {
*/
@Request
(
url
=
"/service/get_provider_token"
,
type
=
"POST"
)
WeAccessTokenDtoDto
getProviderToken
(
@Body
(
"corpid"
)
String
corpid
,
@Body
(
"provider_secret"
)
String
provider_secret
);
WeAccessTokenDtoDto
getProviderToken
(
@Body
(
"corpid"
)
String
corpid
,
@Body
(
"provider_secret"
)
String
provider_secret
);
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeAppClient.java
View file @
912bc59
...
...
@@ -33,5 +33,5 @@ public interface WeAppClient {
* @return
*/
@Request
(
url
=
"/agent/set"
,
type
=
"POST"
)
WeResultDto
updateAgentById
(
@DataObject
WeAppDetailDto
weAppDetailDto
,
@Header
(
"agentid"
)
String
agentid
);
WeResultDto
updateAgentById
(
@DataObject
WeAppDetailDto
weAppDetailDto
,
@Header
(
"agentid"
)
String
agentid
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerClient.java
View file @
912bc59
...
...
@@ -49,7 +49,7 @@ public interface WeCustomerClient {
* @return
*/
@Request
(
url
=
"/externalcontact/batch/get_by_user"
,
type
=
"POST"
)
ExternalUserList
getByUser
(
@DataObject
Map
<
String
,
Object
>
query
);
ExternalUserList
getByUser
(
@DataObject
Map
<
String
,
Object
>
query
);
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeMessagePushClient.java
View file @
912bc59
...
...
@@ -24,7 +24,7 @@ public interface WeMessagePushClient {
@Request
(
url
=
"/message/send"
,
type
=
"POST"
)
WeMessagePushResultDto
sendMessageToUser
(
@DataObject
WeMessagePushDto
weMessagePushDto
,
@Header
(
"agentId"
)
String
agentId
);
WeMessagePushResultDto
sendMessageToUser
(
@DataObject
WeMessagePushDto
weMessagePushDto
,
@Header
(
"agentId"
)
String
agentId
);
/**
* 应用推送消息
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeUserClient.java
View file @
912bc59
...
...
@@ -59,7 +59,7 @@ public interface WeUserClient {
* @return
*/
@Request
(
url
=
"/user/list"
)
WeUserListDto
list
(
@Query
(
"department_id"
)
Long
departmentId
,
@Query
(
"fetch_child"
)
Integer
fetchChild
);
WeUserListDto
list
(
@Query
(
"department_id"
)
Long
departmentId
,
@Query
(
"fetch_child"
)
Integer
fetchChild
);
/**
...
...
@@ -100,5 +100,5 @@ public interface WeUserClient {
* @return
*/
@Request
(
url
=
"/user/getuserinfo"
)
WeUserInfoDto
getuserinfo
(
@Query
(
"code"
)
String
code
,
@Header
(
"agentId"
)
String
agentId
);
WeUserInfoDto
getuserinfo
(
@Query
(
"code"
)
String
code
,
@Header
(
"agentId"
)
String
agentId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCategory.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@TableName
(
"we_category"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"素材分类"
)
public
class
WeCategory
extends
BaseEntity
{
private
Long
id
=
SnowFlakeUtil
.
nextId
();
/**
* 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本
*/
@TableId
@ApiModelProperty
(
"素材主键"
)
private
Long
id
;
@ApiModelProperty
(
"素材分类:0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本"
)
private
String
mediaType
;
/**
* 分类名称
*/
@ApiModelProperty
(
"分类名称"
)
private
String
name
;
/**
* 父分类的id
*/
@ApiModelProperty
(
"素材上级父节点id"
)
private
Long
parentId
;
@ApiModelProperty
(
"素材状态:0 未删除 2 已删除"
)
private
String
delFlag
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.util.Date
;
...
...
@@ -20,11 +21,14 @@ public class WeCustomerPortrait {
private
String
flowerCustomerRelId
;
//客户昵称
private
String
name
;
//客户性别(0-未知 1-男性 2-女性)
private
Integer
gender
;
//客户备注
private
String
remark
;
//备注客户手机号
private
String
remarkMobiles
;
//客户生日
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
birthday
;
//邮箱
private
String
email
;
...
...
@@ -40,6 +44,8 @@ public class WeCustomerPortrait {
private
String
description
;
//年纪
private
int
age
;
//客户头像
private
String
avatar
;
//客户标签
private
List
<
WeTagGroup
>
weTagGroupList
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerTrajectory.java
View file @
912bc59
...
...
@@ -36,6 +36,15 @@ public class WeCustomerTrajectory {
//处理结束时间
private
Time
endTime
;
//0:正常;1:删除;2:完成
private
String
status
;
//当前员工的id
private
String
userId
;
//当前应用的id
private
String
agentId
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeTag.java
View file @
912bc59
...
...
@@ -10,6 +10,7 @@ import lombok.Builder;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
...
...
@@ -23,7 +24,7 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"we_tag"
)
public
class
WeTag
public
class
WeTag
implements
Serializable
{
/** 标签组id */
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeTaskFissionCompleteRecord.java
View file @
912bc59
...
...
@@ -60,6 +60,12 @@ public class WeTaskFissionCompleteRecord {
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
=
new
Date
();
@ApiModelProperty
(
"状态 0 有效 1 无效"
)
private
Integer
status
;
@ApiModelProperty
(
"客户头像"
)
private
String
customerAvatar
;
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeUser.java
View file @
912bc59
...
...
@@ -34,7 +34,7 @@ import java.util.Date;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeUser
public
class
WeUser
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -123,7 +123,7 @@ public class WeUser
/** 是否激活(1:是;2:否)该字段主要表示当前信息是否同步微信 */
/** 激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业,6=删除 */
@ApiModelProperty
(
"激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业,6=删除"
)
private
Integer
isActivate
;
private
Integer
isActivate
=
new
Integer
(
4
)
;
/** 离职是否分配(1:已分配;0:未分配;) */
@ApiModelProperty
(
"离职是否分配(1:已分配;0:未分配;)"
)
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeChatUserDTO.java
View file @
912bc59
...
...
@@ -12,4 +12,5 @@ public class WeChatUserDTO {
private
String
userid
;
private
String
unionid
;
private
String
name
;
private
String
avatar
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeMessagePushDto.java
View file @
912bc59
...
...
@@ -4,12 +4,18 @@ import com.linkwechat.wecom.domain.dto.message.ImageMessageDto;
import
com.linkwechat.wecom.domain.dto.message.LinkMessageDto
;
import
com.linkwechat.wecom.domain.dto.message.MiniprogramMessageDto
;
import
com.linkwechat.wecom.domain.dto.message.TextMessageDto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@SuppressWarnings
(
"all"
)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeMessagePushDto
{
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/TextMessageDto.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
domain
.
dto
.
message
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
TextMessageDto
{
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeCustomerMessagePushDto.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
domain
.
dto
.
message
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeCustomerMessagePushDto
{
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/ConversationArchiveVo.java
View file @
912bc59
...
...
@@ -123,6 +123,9 @@ public class ConversationArchiveVo {
@ApiModel
@Data
private
class
Content
{
@ApiModelProperty
(
"文件路径"
)
private
String
attachment
;
@ApiModelProperty
(
"文本消息内容"
)
private
String
content
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackDelExternalContactImpl.java
View file @
912bc59
...
...
@@ -36,7 +36,7 @@ public class WeCallBackDelExternalContactImpl extends WeEventStrategy {
@Override
public
void
eventHandle
(
WxCpXmlMessageVO
message
)
{
if
(
message
.
getExternalUserId
()
!=
null
)
{
weCustomerService
.
deleteCustomersByEid
(
message
.
getExternalUserId
());
//
weCustomerService.deleteCustomersByEid(message.getExternalUserId());
weFlowerCustomerRelService
.
deleteFollowUser
(
message
.
getUserId
(),
message
.
getExternalUserId
());
//增加敏感行为记录,员工删除客户
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customergroup/WeCallBackUpdateGroupImpl.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
factory
.
impl
.
customergroup
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.thread.ThreadUtil
;
import
com.linkwechat.common.enums.CallbackEventUpdateDetail
;
import
com.linkwechat.wecom.domain.*
;
import
com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO
;
import
com.linkwechat.wecom.factory.WeEventStrategy
;
import
com.linkwechat.wecom.service.IWeGroupCodeActualService
;
import
com.linkwechat.wecom.service.IWeGroupService
;
import
com.linkwechat.wecom.service.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author danmo
* @description 客户群变更事件
...
...
@@ -23,6 +28,18 @@ public class WeCallBackUpdateGroupImpl extends WeEventStrategy {
@Autowired
private
IWeGroupCodeActualService
groupCodeActualService
;
@Autowired
private
IWeTaskFissionService
taskFissionService
;
@Autowired
private
IWeTaskFissionRecordService
taskFissionRecordService
;
@Autowired
private
IWeTaskFissionCompleteRecordService
taskFissionCompleteRecordService
;
@Autowired
private
IWeGroupMemberService
groupMemberService
;
@Override
public
void
eventHandle
(
WxCpXmlMessageVO
message
)
{
try
{
...
...
@@ -31,10 +48,52 @@ public class WeCallBackUpdateGroupImpl extends WeEventStrategy {
if
(
updateDetail
.
equals
(
CallbackEventUpdateDetail
.
ADD_MEMBER
.
getType
()))
{
// 添加成员,该群的实际群活码扫码次数需要加1
groupCodeActualService
.
updateScanTimesByChatId
(
message
.
getChatId
());
ThreadUtil
.
execAsync
(()
->{
groupFissionEnterCheck
(
message
.
getChatId
());
});
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"update>>>>>>>>>param:{},ex:{}"
,
message
.
getChatId
(),
e
);
}
}
/**
* 群裂变客户入群校验
* @param chatId
*/
private
void
groupFissionEnterCheck
(
String
chatId
){
log
.
info
(
"群裂变客户入群校验>>>>>>>>>>>>>>>>>>>>>start"
);
WeGroupCodeActual
weGroupCodeActual
=
groupCodeActualService
.
selectActualCodeByChatId
(
chatId
);
//查询群活码id
Long
groupCodeId
=
Optional
.
ofNullable
(
weGroupCodeActual
).
map
(
WeGroupCodeActual:
:
getGroupCodeId
).
orElse
(
0L
);
//根据群活码id 查询任务列表
List
<
WeTaskFission
>
taskFissionList
=
taskFissionService
.
getTaskFissionListByGroupCodeId
(
groupCodeId
);
if
(
CollectionUtil
.
isNotEmpty
(
taskFissionList
)){
Set
<
Long
>
taskFissionIdSet
=
taskFissionList
.
stream
().
map
(
WeTaskFission:
:
getId
).
collect
(
Collectors
.
toSet
());
Map
<
Long
,
Long
>
taskFissionIdNumMap
=
taskFissionList
.
stream
().
collect
(
Collectors
.
toMap
(
WeTaskFission:
:
getId
,
WeTaskFission:
:
getFissNum
));
//根据任务id查询裂变任务完成无效哦记录列表
List
<
WeTaskFissionCompleteRecord
>
completeRecordList
=
taskFissionCompleteRecordService
.
getListByTaskIds
(
taskFissionIdSet
);
if
(
CollectionUtil
.
isNotEmpty
(
completeRecordList
)){
completeRecordList
.
forEach
(
completeRecord
->{
//查询该成员是否入群
WeGroupMember
weGroupMember
=
groupMemberService
.
selectWeGroupMemberByUnionId
(
chatId
,
completeRecord
.
getCustomerId
());
if
(
weGroupMember
!=
null
){
completeRecord
.
setStatus
(
0
);
if
(
taskFissionCompleteRecordService
.
updateWeTaskFissionCompleteRecord
(
completeRecord
)
>
0
){
WeTaskFissionRecord
record
=
taskFissionRecordService
.
selectWeTaskFissionRecordById
(
completeRecord
.
getFissionRecordId
());
if
(
record
!=
null
){
Long
fissNum
=
record
.
getFissNum
()
+
1
;
if
(
fissNum
>=
taskFissionIdNumMap
.
get
(
record
.
getTaskFissionId
())){
record
.
setCompleteTime
(
new
Date
());
}
record
.
setFissNum
(
fissNum
);
taskFissionRecordService
.
updateWeTaskFissionRecord
(
record
);
}
}
}
});
}
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCategoryMapper.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeCategory
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
WeCategoryMapper
{
public
interface
WeCategoryMapper
extends
BaseMapper
<
WeCategory
>
{
/**
* 保存素材分类
*
* @param category 素材分类 信息
* @return {@link int}
*/
int
insertWeCategory
(
WeCategory
category
);
/**
* 保存素材分类
*
* @param category 素材分类 信息
* @return {@link int}
*/
int
updateWeCategory
(
WeCategory
category
);
/**
* 删除分类信息
*
* @param id 主键id
* @return {@link int}
*/
int
deleteWeCategoryById
(
@Param
(
"id"
)
Long
id
);
/**
* 批量删除
*
* @param ids id列表
* @return {@link int}
*/
int
deleteWeCategoryByIds
(
Long
[]
ids
);
/**
* 通过类型查询对应类目的分类信息列表
*
* @param mediaType 类型
* @return {@link WeCategory}s
*/
List
<
WeCategory
>
findWeCategoryByMediaType
(
@Param
(
"mediaType"
)
String
mediaType
);
/**
* 通过id查询分类信息
*
* @param id 主键id
* @return {@link WeCategory}
*/
WeCategory
findWeCategoryById
(
@Param
(
"id"
)
Long
id
);
/**
* 通过类型和名称查询类目信息
*
* @param mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本
* @param name 分类名称
* @return {@link WeCategory}
*/
WeCategory
findWeCategoryByMediaTypeAndName
(
@Param
(
"mediaType"
)
String
mediaType
,
@Param
(
"name"
)
String
name
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatCollectionMapper.java
View file @
912bc59
...
...
@@ -29,7 +29,7 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return 结果
*/
public
int
dropCollection
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"userId"
)
String
userId
);
public
int
dropCollection
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"userId"
)
String
userId
);
/**
* 通过素材id和用户id查询当前素材的收藏条数
...
...
@@ -38,7 +38,7 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return 当前素材收藏的条数
*/
public
int
countCollectionByMaterialIdAndUserId
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"userId"
)
String
userId
);
public
int
countCollectionByMaterialIdAndUserId
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"userId"
)
String
userId
);
/**
* 收藏列表
...
...
@@ -46,6 +46,6 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public
List
<
WeChatSideVo
>
findCollections
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"keyword"
)
String
keyword
);
public
List
<
WeChatSideVo
>
findCollections
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"keyword"
)
String
keyword
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatItemMapper.java
View file @
912bc59
...
...
@@ -39,5 +39,5 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
* @param keyword 关键词
* @return
*/
public
List
<
WeChatSideVo
>
findChatItems
(
@Param
(
"sideId"
)
Long
sideId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"mediaType"
)
String
mediaType
,
@Param
(
"userId"
)
String
userId
);
public
List
<
WeChatSideVo
>
findChatItems
(
@Param
(
"sideId"
)
Long
sideId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"mediaType"
)
String
mediaType
,
@Param
(
"userId"
)
String
userId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCorpAccountMapper.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
mapper
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -10,47 +10,8 @@ import org.apache.ibatis.annotations.Param;
* @author ruoyi
* @date 2020-08-24
*/
public
interface
WeCorpAccountMapper
public
interface
WeCorpAccountMapper
extends
BaseMapper
<
WeCorpAccount
>
{
/**
* 查询企业id相关配置
*
* @param id 企业id相关配置ID
* @return 企业id相关配置
*/
public
WeCorpAccount
selectWeCorpAccountById
(
Long
id
);
/**
* 查询企业id相关配置列表
*
* @param wxCorpAccount 企业id相关配置
* @return 企业id相关配置集合
*/
public
List
<
WeCorpAccount
>
selectWeCorpAccountList
(
WeCorpAccount
wxCorpAccount
);
/**
* 新增企业id相关配置
*
* @param wxCorpAccount 企业id相关配置
* @return 结果
*/
public
int
insertWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
/**
* 修改企业id相关配置
*
* @param wxCorpAccount 企业id相关配置
* @return 结果
*/
public
int
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
/**
* 获取有效cropid
* @return
*/
public
WeCorpAccount
findValidWeCorpAccount
();
/**
...
...
@@ -58,13 +19,7 @@ public interface WeCorpAccountMapper
* @param corpId
* @return
*/
public
int
startVailWeCorpAccount
(
@Param
(
"corpId"
)
String
corpId
);
int
startVailWeCorpAccount
(
@Param
(
"corpId"
)
String
corpId
);
/**
* 根据企业账号获取企业相关配置
* @param corpAccount
* @return
*/
WeCorpAccount
findWeCorpByAccount
(
@Param
(
"corpAccount"
)
String
corpAccount
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
View file @
912bc59
...
...
@@ -87,7 +87,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @param userid
* @return
*/
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"userid"
)
String
userid
);
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"userid"
)
String
userid
);
/**
...
...
@@ -96,7 +96,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @param userid 员工id
* @return
*/
WeCustomerSocialConn
countSocialConn
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"userid"
)
String
userid
);
WeCustomerSocialConn
countSocialConn
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"userid"
)
String
userid
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessageMapper.java
View file @
912bc59
...
...
@@ -20,7 +20,7 @@ public interface WeCustomerMessageMapper extends BaseMapper<WeCustomerMessage> {
* @param actualSend 实际发送消息数(客户对应多少人 客户群对应多个群)
* @return int
*/
int
updateWeCustomerMessageActualSend
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"actualSend"
)
Integer
actualSend
);
int
updateWeCustomerMessageActualSend
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"actualSend"
)
Integer
actualSend
);
/**
* 更新消息发送状态
...
...
@@ -28,6 +28,6 @@ public interface WeCustomerMessageMapper extends BaseMapper<WeCustomerMessage> {
* @param status 消息发送状态 0 未发送 1 已发送
* @return int
*/
int
updateWeCustomerMessageCheckStatusById
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"status"
)
String
status
);
int
updateWeCustomerMessageCheckStatusById
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"status"
)
String
status
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessageOriginalMapper.java
View file @
912bc59
...
...
@@ -25,8 +25,8 @@ public interface WeCustomerMessageOriginalMapper extends BaseMapper<WeCustomerMe
* @param endTime 结束时间
* @return {@link CustomerMessagePushVo}s
*/
public
List
<
CustomerMessagePushVo
>
selectCustomerMessagePushs
(
@Param
(
"sender"
)
String
sender
,
@Param
(
"content"
)
String
content
,
@Param
(
"pushType"
)
String
pushType
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
public
List
<
CustomerMessagePushVo
>
selectCustomerMessagePushs
(
@Param
(
"sender"
)
String
sender
,
@Param
(
"content"
)
String
content
,
@Param
(
"pushType"
)
String
pushType
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
/**
* 群发详情
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessgaeResultMapper.java
View file @
912bc59
...
...
@@ -26,8 +26,8 @@ public interface WeCustomerMessgaeResultMapper extends BaseMapper<WeCustomerMess
* @param sendTime 发送时间,发送状态为1时返回(为时间戳的形式)
* @return int
*/
int
updateWeCustomerMessgaeResult
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"chatId"
)
String
chatId
,
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"status"
)
String
status
,
@Param
(
"sendTime"
)
String
sendTime
);
int
updateWeCustomerMessgaeResult
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"chatId"
)
String
chatId
,
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"status"
)
String
status
,
@Param
(
"sendTime"
)
String
sendTime
);
/**
* 查询微信消息发送情况
...
...
@@ -36,7 +36,7 @@ public interface WeCustomerMessgaeResultMapper extends BaseMapper<WeCustomerMess
* @param status 发送状态 0-未发送 1-已发送 2-因客户不是好友导致发送失败 3-因客户已经收到其他群发消息导致发送失败
* @return {@link WeCustomerMessageResultVo}s
*/
List
<
WeCustomerMessageResultVo
>
customerMessagePushs
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"status"
)
String
status
);
List
<
WeCustomerMessageResultVo
>
customerMessagePushs
(
@Param
(
"messageId"
)
Long
messageId
,
@Param
(
"status"
)
String
status
);
/**
* 检查是否已经同步群发结果
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMapper.java
View file @
912bc59
...
...
@@ -29,5 +29,5 @@ public interface WeGroupMapper extends BaseMapper<WeGroup> {
//
// int batchInsetWeGroup(@Param("weGroups") List<WeGroup> weGroups);
List
<
WeCustomerAddGroup
>
findWeGroupByCustomer
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"externalUserid"
)
String
externalUserid
);
List
<
WeCustomerAddGroup
>
findWeGroupByCustomer
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"externalUserid"
)
String
externalUserid
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTaskFissionMapper.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeTaskFission
;
import
java.util.List
;
...
...
@@ -10,7 +11,7 @@ import java.util.List;
* @author leejoker
* @date 2021-01-20
*/
public
interface
WeTaskFissionMapper
{
public
interface
WeTaskFissionMapper
extends
BaseMapper
<
WeTaskFission
>
{
/**
* 查询任务宝
*
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeUserMapper.java
View file @
912bc59
...
...
@@ -7,7 +7,6 @@ import com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo;
import
com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
...
...
@@ -17,7 +16,6 @@ import java.util.List;
* @author ruoyi
* @date 2020-08-31
*/
@Repository
public
interface
WeUserMapper
extends
BaseMapper
<
WeUser
>
{
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCategoryService.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.common.core.domain.Tree
;
import
com.linkwechat.wecom.domain.WeCategory
;
import
com.linkwechat.wecom.domain.vo.WeCategoryVo
;
...
...
@@ -7,39 +8,23 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
IWeCategoryService
{
public
interface
IWeCategoryService
extends
IService
<
WeCategory
>
{
/**
* 保存素材分类
*
* @param category 素材分类 信息
* @return {@link int}
*/
int
insertWeCategory
(
WeCategory
category
);
void
insertWeCategory
(
WeCategory
category
);
/**
* 保存素材分类
*
* @param category 素材分类 信息
* @return {@link int}
*/
int
updateWeCategory
(
WeCategory
category
);
void
updateWeCategory
(
WeCategory
category
);
/**
* 删除分类信息
*
* @param id 主键id
* @return {@link int}
*/
int
deleteWeCategoryById
(
Long
id
);
/**
* 批量删除
*
* @param ids id列表
* @return {@link int}
*/
int
deleteWeCategoryByIds
(
Long
[]
ids
);
/**
* 通过类型查询对应类目的分类信息列表
...
...
@@ -49,12 +34,6 @@ public interface IWeCategoryService {
*/
List
<?
extends
Tree
<?>>
findWeCategoryByMediaType
(
@Param
(
"mediaType"
)
String
mediaType
);
/**
* 通过id查询分类信息
*
* @param id 主键id
* @return {@link WeCategory}
*/
WeCategory
findWeCategoryById
(
@Param
(
"id"
)
Long
id
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatCollectionService.java
View file @
912bc59
...
...
@@ -20,7 +20,7 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return 结果
*/
public
int
addCollection
(
Long
materialId
,
String
userId
);
public
int
addCollection
(
Long
materialId
,
String
userId
);
/**
* 取消收藏
...
...
@@ -29,7 +29,7 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return 结果
*/
public
int
cancleCollection
(
Long
materialId
,
String
userId
);
public
int
cancleCollection
(
Long
materialId
,
String
userId
);
/**
* 收藏列表
...
...
@@ -37,6 +37,6 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public
List
<
WeChatSideVo
>
collections
(
String
userId
,
String
keyword
);
public
List
<
WeChatSideVo
>
collections
(
String
userId
,
String
keyword
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatItemService.java
View file @
912bc59
...
...
@@ -27,6 +27,6 @@ public interface IWeChatItemService extends IService<WeChatItem> {
* @param sideId 侧边栏id
* @return
*/
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
,
String
keyword
,
String
mediaType
,
String
userId
);
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
,
String
keyword
,
String
mediaType
,
String
userId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCorpAccountService.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
java.util.List
;
/**
* 企业id相关配置Service接口
*
* @author ruoyi
* @date 2020-08-24
*/
public
interface
IWeCorpAccountService
public
interface
IWeCorpAccountService
extends
IService
<
WeCorpAccount
>
{
/**
* 查询企业id相关配置
*
* @param id 企业id相关配置ID
* @return 企业id相关配置
*/
public
WeCorpAccount
selectWeCorpAccountById
(
Long
id
);
/**
* 查询企业id相关配置列表
*
* @param wxCorpAccount 企业id相关配置
* @return 企业id相关配置集合
*/
public
List
<
WeCorpAccount
>
selectWeCorpAccountList
(
WeCorpAccount
wxCorpAccount
);
/**
* 新增企业id相关配置
*
* @param wxCorpAccount 企业id相关配置
* @return 结果
*/
public
int
insertWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
/**
* 修改企业id相关配置
...
...
@@ -42,7 +19,7 @@ public interface IWeCorpAccountService
* @param wxCorpAccount 企业id相关配置
* @return 结果
*/
public
int
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
void
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
...
...
@@ -51,27 +28,27 @@ public interface IWeCorpAccountService
*
* @return 结果
*/
public
WeCorpAccount
findValidWeCorpAccount
();
WeCorpAccount
findValidWeCorpAccount
();
/**
* 启用有效的企业微信账号
* @param corpId
*/
public
int
startVailWeCorpAccount
(
String
corpId
);
int
startVailWeCorpAccount
(
String
corpId
);
/**
* 客户流失通知开关
* @param status 开关状态
* @return
*/
public
int
startCustomerChurnNoticeSwitch
(
String
status
);
void
startCustomerChurnNoticeSwitch
(
String
status
);
/**
* 客户流失通知开关查询
*/
public
String
getCustomerChurnNoticeSwitch
();
String
getCustomerChurnNoticeSwitch
();
WeCorpAccount
findWeCorpByAccount
(
String
corpAccount
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerMessageOriginalService.java
View file @
912bc59
...
...
@@ -28,7 +28,7 @@ public interface IWeCustomerMessageOriginalService extends IService<WeCustomerMe
* @param endTime 结束时间
* @return {@link CustomerMessagePushVo}s
*/
List
<
CustomerMessagePushVo
>
customerMessagePushs
(
String
sender
,
String
content
,
String
pushType
,
String
beginTime
,
String
endTime
);
List
<
CustomerMessagePushVo
>
customerMessagePushs
(
String
sender
,
String
content
,
String
pushType
,
String
beginTime
,
String
endTime
);
/**
* 群发详情
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerMessagePushService.java
View file @
912bc59
...
...
@@ -32,6 +32,6 @@ public interface IWeCustomerMessagePushService {
* @param endTime 结束时间
* @return {@link CustomerMessagePushVo}s
*/
public
List
<
CustomerMessagePushVo
>
customerMessagePushs
(
String
sender
,
String
content
,
String
pushType
,
String
beginTime
,
String
endTime
);
public
List
<
CustomerMessagePushVo
>
customerMessagePushs
(
String
sender
,
String
content
,
String
pushType
,
String
beginTime
,
String
endTime
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerMessageService.java
View file @
912bc59
...
...
@@ -24,7 +24,7 @@ public interface IWeCustomerMessageService extends IService<WeCustomerMessage> {
* @param actualSend 实际发送消息数(客户对应多少人 客户群对应多个群)
* @return int
*/
int
updateWeCustomerMessageActualSend
(
Long
messageId
,
Integer
actualSend
);
int
updateWeCustomerMessageActualSend
(
Long
messageId
,
Integer
actualSend
);
/**
* 保存微信消息 WeCustomerMessage
...
...
@@ -33,7 +33,7 @@ public interface IWeCustomerMessageService extends IService<WeCustomerMessage> {
* @param customerMessagePushDto
* @param size
*/
void
saveWeCustomerMessage
(
long
messageId
,
long
messageOriginalId
,
CustomerMessagePushDto
customerMessagePushDto
,
int
size
,
String
content
);
void
saveWeCustomerMessage
(
long
messageId
,
long
messageOriginalId
,
CustomerMessagePushDto
customerMessagePushDto
,
int
size
,
String
content
);
/**
*
...
...
@@ -50,6 +50,6 @@ public interface IWeCustomerMessageService extends IService<WeCustomerMessage> {
* @param messageId
* @throws JsonProcessingException
*/
public
void
sendMessgae
(
CustomerMessagePushDto
customerMessagePushDto
,
long
messageId
,
List
<
WeCustomer
>
customers
,
List
<
WeGroup
>
groups
)
throws
JsonProcessingException
;
public
void
sendMessgae
(
CustomerMessagePushDto
customerMessagePushDto
,
long
messageId
,
List
<
WeCustomer
>
customers
,
List
<
WeGroup
>
groups
)
throws
JsonProcessingException
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
View file @
912bc59
...
...
@@ -118,7 +118,7 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param userid
* @return
*/
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
String
externalUserid
,
String
userid
)
throws
Exception
;
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
String
externalUserid
,
String
userid
)
throws
Exception
;
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerTrajectoryService.java
View file @
912bc59
...
...
@@ -5,4 +5,6 @@ import com.linkwechat.wecom.domain.WeCustomerTrajectory;
public
interface
IWeCustomerTrajectoryService
extends
IService
<
WeCustomerTrajectory
>
{
void
waitHandleMsg
(
String
url
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMemberService.java
View file @
912bc59
...
...
@@ -17,4 +17,5 @@ public interface IWeGroupMemberService extends IService<WeGroupMember> {
List
<
WeGroupMemberDto
>
selectWeGroupMemberListByChatId
(
String
chatId
);
WeGroupMember
selectWeGroupMemberByUnionId
(
String
chatId
,
String
unionId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupService.java
View file @
912bc59
...
...
@@ -28,5 +28,5 @@ public interface IWeGroupService extends IService<WeGroup> {
void
deleteWeGroup
(
String
chatId
);
List
<
WeCustomerAddGroup
>
findWeGroupByCustomer
(
String
userId
,
String
externalUserid
);
List
<
WeCustomerAddGroup
>
findWeGroupByCustomer
(
String
userId
,
String
externalUserid
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeMaterialService.java
View file @
912bc59
...
...
@@ -73,7 +73,7 @@ public interface IWeMaterialService {
* @param search 搜索值
* @return {@link WeMaterial}s
*/
List
<
WeMaterial
>
findWeMaterials
(
String
categoryId
,
String
search
,
String
mediaType
);
List
<
WeMaterial
>
findWeMaterials
(
String
categoryId
,
String
search
,
String
mediaType
);
/**
* 更换分组
...
...
@@ -92,7 +92,7 @@ public interface IWeMaterialService {
* @param name 素材名称
* @return
*/
public
WeMediaDto
uploadTemporaryMaterial
(
String
url
,
String
type
,
String
name
);
public
WeMediaDto
uploadTemporaryMaterial
(
String
url
,
String
type
,
String
name
);
/**
* 上传素材图片
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWePosterFontService.java
View file @
912bc59
...
...
@@ -18,6 +18,6 @@ public interface IWePosterFontService extends IService<WePosterFont> {
* @param fontStyle 字体类型 0 通常 1 粗体 2 斜体
* @return
*/
public
Font
getFont
(
Long
id
,
Integer
size
,
Integer
fontStyle
);
public
Font
getFont
(
Long
id
,
Integer
size
,
Integer
fontStyle
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTagGroupService.java
View file @
912bc59
...
...
@@ -62,7 +62,7 @@ public interface IWeTagGroupService extends IService<WeTagGroup>
* @param tagGroup
* @param isSync
*/
public
void
batchSaveOrUpdateTagGroupAndTag
(
List
<
WeCropGroupTagDto
>
tagGroup
,
Boolean
isSync
);
public
void
batchSaveOrUpdateTagGroupAndTag
(
List
<
WeCropGroupTagDto
>
tagGroup
,
Boolean
isSync
);
void
createTagGroup
(
String
id
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTaskFissionCompleteRecordService.java
View file @
912bc59
...
...
@@ -6,6 +6,7 @@ import com.linkwechat.wecom.domain.WeTaskFissionCompleteRecord;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
/**
* 裂变任务完成记录Service接口
...
...
@@ -63,4 +64,18 @@ public interface IWeTaskFissionCompleteRecordService extends IService<WeTaskFiss
public
int
deleteWeTaskFissionCompleteRecordById
(
Long
id
);
public
List
<
WeTaskFissionCompleteRecord
>
statisticCompleteRecords
(
Long
taskFissionId
,
Date
startTime
,
Date
endTime
);
/**
* 根据任务id查询裂变任务完成记录列表
* @param taskFissionIds 任务id
* @return
*/
List
<
WeTaskFissionCompleteRecord
>
getListByTaskIds
(
Set
<
Long
>
taskFissionIds
);
/**
* 根据任务id查询裂变任务完成记录列表
* @param taskFissionId
* @return
*/
List
<
WeTaskFissionCompleteRecord
>
getCompleteListByTaskId
(
Long
taskFissionId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTaskFissionService.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeTaskFission
;
import
com.linkwechat.wecom.domain.dto.WeChatUserDTO
;
...
...
@@ -17,7 +18,7 @@ import java.util.List;
* @author leejoker
* @date 2021-01-20
*/
public
interface
IWeTaskFissionService
{
public
interface
IWeTaskFissionService
extends
IService
<
WeTaskFission
>
{
/**
* 查询任务宝
*
...
...
@@ -100,4 +101,11 @@ public interface IWeTaskFissionService {
* @return
*/
public
void
updateExpiredWeTaskFission
();
/**
* 根据群活码id 查询任务列表
* @param groupCodeId 群活码id
* @return
*/
List
<
WeTaskFission
>
getTaskFissionListByGroupCodeId
(
Long
groupCodeId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeUserBehaviorDataService.java
View file @
912bc59
...
...
@@ -25,7 +25,7 @@ public interface IWeUserBehaviorDataService extends IService<WeUserBehaviorData>
* @param dateTime
* @return WeUserBehaviorDataDto
*/
WePageCountDto
getCountDataByDay
(
String
dateTime
,
String
type
);
WePageCountDto
getCountDataByDay
(
String
dateTime
,
String
type
);
/**
* 按天维度查询数据统计
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeUserService.java
View file @
912bc59
...
...
@@ -145,7 +145,7 @@ public interface IWeUserService extends IService<WeUser>
* @param code
* @return
*/
WeUserInfoVo
getUserInfo
(
String
code
,
String
agentId
);
WeUserInfoVo
getUserInfo
(
String
code
,
String
agentId
);
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWxAuthService.java
View file @
912bc59
...
...
@@ -9,7 +9,7 @@ import com.linkwechat.wecom.domain.weixin.dto.WxTokenDto;
* @date 2021/4/5 22:45
**/
public
interface
IWxAuthService
{
WxTokenDto
getToken
(
String
code
,
String
openId
);
WxTokenDto
getToken
(
String
code
,
String
openId
);
WxAuthUserInfoDto
getUserInfo
(
String
openId
,
String
lang
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCategoryServiceImpl.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.core.domain.Tree
;
import
com.linkwechat.common.exception.wecom.WeComException
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
...
...
@@ -10,7 +13,6 @@ import com.linkwechat.wecom.domain.vo.WeCategoryVo;
import
com.linkwechat.wecom.mapper.WeCategoryMapper
;
import
com.linkwechat.wecom.service.IWeCategoryService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
...
...
@@ -18,47 +20,49 @@ import java.util.List;
@Slf4j
@Service
public
class
WeCategoryServiceImpl
implements
IWeCategoryService
{
public
class
WeCategoryServiceImpl
extends
ServiceImpl
<
WeCategoryMapper
,
WeCategory
>
implements
IWeCategoryService
{
@Autowired
private
WeCategoryMapper
weCategoryMapper
;
@Override
public
int
insertWeCategory
(
WeCategory
category
)
{
public
void
insertWeCategory
(
WeCategory
category
)
{
//判断是否存在相同的名称
WeCategory
weCategory
=
weCategoryMapper
.
findWeCategoryByMediaTypeAndName
(
category
.
getMediaType
(),
category
.
getName
());
WeCategory
weCategory
=
this
.
getOne
(
new
LambdaQueryWrapper
<
WeCategory
>()
.
eq
(
WeCategory:
:
getMediaType
,
category
.
getMediaType
())
.
eq
(
WeCategory:
:
getName
,
category
.
getName
())
.
eq
(
WeCategory:
:
getDelFlag
,
Constants
.
NORMAL_CODE
));
if
(
null
!=
weCategory
)
{
throw
new
WeComException
(
"名称已存在!"
);
}
category
.
setCreateTime
(
DateUtil
.
date
());
category
.
setId
(
SnowFlakeUtil
.
nextId
());
return
weCategoryMapper
.
insertWeCategory
(
category
);
this
.
save
(
category
);
}
@Override
public
int
updateWeCategory
(
WeCategory
category
)
{
public
void
updateWeCategory
(
WeCategory
category
)
{
//判断是否存在相同的名称
WeCategory
weCategory
=
weCategoryMapper
.
findWeCategoryByMediaTypeAndName
(
category
.
getMediaType
(),
category
.
getName
());
WeCategory
weCategory
=
this
.
getOne
(
new
LambdaQueryWrapper
<
WeCategory
>()
.
eq
(
WeCategory:
:
getMediaType
,
category
.
getMediaType
())
.
eq
(
WeCategory:
:
getName
,
category
.
getName
())
.
eq
(
WeCategory:
:
getDelFlag
,
Constants
.
NORMAL_CODE
));
if
(
null
!=
weCategory
)
{
throw
new
WeComException
(
"名称已存在!"
);
}
category
.
setUpdateTime
(
DateUtil
.
date
());
return
weCategoryMapper
.
updateWeCategory
(
category
);
this
.
updateById
(
category
);
}
@Override
public
int
deleteWeCategoryById
(
Long
id
)
{
return
weCategoryMapper
.
deleteWeCategoryById
(
id
);
}
@Override
public
int
deleteWeCategoryByIds
(
Long
[]
ids
)
{
return
weCategoryMapper
.
deleteWeCategoryByIds
(
ids
);
}
@Override
public
List
<?
extends
Tree
<?>>
findWeCategoryByMediaType
(
String
mediaType
)
{
List
<
WeCategory
>
weCategories
=
weCategoryMapper
.
findWeCategoryByMediaType
(
mediaType
);
List
<
WeCategory
>
weCategories
=
this
.
list
(
new
LambdaQueryWrapper
<
WeCategory
>()
.
eq
(
WeCategory:
:
getMediaType
,
mediaType
)
.
eq
(
WeCategory:
:
getDelFlag
,
Constants
.
NORMAL_CODE
));
List
<
WeCategoryVo
>
weCategoryVos
=
new
ArrayList
<>();
weCategories
.
forEach
(
c
->
{
WeCategoryVo
weCategoryVo
=
new
WeCategoryVo
();
...
...
@@ -70,10 +74,6 @@ public class WeCategoryServiceImpl implements IWeCategoryService {
return
TreeUtil
.
build
(
weCategoryVos
);
}
@Override
public
WeCategory
findWeCategoryById
(
Long
id
)
{
return
weCategoryMapper
.
findWeCategoryById
(
id
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCorpAccountServiceImpl.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
java.util.List
;
import
java.util.Optional
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
com.linkwechat.wecom.mapper.WeCorpAccountMapper
;
import
com.linkwechat.wecom.service.IWeAccessTokenService
;
import
com.linkwechat.wecom.service.IWeCorpAccountService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.linkwechat.wecom.mapper.WeCorpAccountMapper
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
java.util.Optional
;
/**
* 企业id相关配置Service业务层处理
...
...
@@ -19,51 +20,14 @@ import com.linkwechat.common.core.domain.entity.WeCorpAccount;
* @date 2020-08-24
*/
@Service
public
class
WeCorpAccountServiceImpl
implements
IWeCorpAccountService
{
public
class
WeCorpAccountServiceImpl
extends
ServiceImpl
<
WeCorpAccountMapper
,
WeCorpAccount
>
implements
IWeCorpAccountService
{
@Autowired
private
WeCorpAccountMapper
weCorpAccountMapper
;
@Autowired
private
IWeAccessTokenService
iWeAccessTokenService
;
/**
* 查询企业id相关配置
*
* @param id 企业id相关配置ID
* @return 企业id相关配置
*/
@Override
public
WeCorpAccount
selectWeCorpAccountById
(
Long
id
)
{
return
weCorpAccountMapper
.
selectWeCorpAccountById
(
id
);
}
/**
* 查询企业id相关配置列表
*
* @param wxCorpAccount 企业id相关配置
* @return 企业id相关配置
*/
@Override
public
List
<
WeCorpAccount
>
selectWeCorpAccountList
(
WeCorpAccount
wxCorpAccount
)
{
return
weCorpAccountMapper
.
selectWeCorpAccountList
(
wxCorpAccount
);
}
/**
* 新增企业id相关配置
*
* @param wxCorpAccount 企业id相关配置
* @return 结果
*/
@Override
public
int
insertWeCorpAccount
(
WeCorpAccount
wxCorpAccount
)
{
return
weCorpAccountMapper
.
insertWeCorpAccount
(
wxCorpAccount
);
}
/**
* 修改企业id相关配置
...
...
@@ -72,18 +36,16 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
* @return 结果
*/
@Override
public
int
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
)
public
void
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
)
{
int
returnCode
=
weCorpAccountMapper
.
updateWeCorpAccount
(
wxCorpAccount
);
if
(
Constants
.
SERVICE_RETURN_SUCCESS_CODE
<
returnCode
){
if
(
this
.
updateById
(
wxCorpAccount
)){
iWeAccessTokenService
.
removeToken
();
}
return
returnCode
;
}
...
...
@@ -95,7 +57,10 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
*/
@Override
public
WeCorpAccount
findValidWeCorpAccount
()
{
return
weCorpAccountMapper
.
findValidWeCorpAccount
();
return
this
.
getOne
(
new
LambdaQueryWrapper
<
WeCorpAccount
>()
.
eq
(
WeCorpAccount:
:
getDelFlag
,
Constants
.
NORMAL_CODE
)
.
eq
(
WeCorpAccount:
:
getStatus
,
Constants
.
NORMAL_CODE
));
}
...
...
@@ -106,7 +71,7 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
@Override
public
int
startVailWeCorpAccount
(
String
corpId
)
{
int
returnCode
=
weCorpAccount
Mapper
.
startVailWeCorpAccount
(
corpId
);
int
returnCode
=
this
.
base
Mapper
.
startVailWeCorpAccount
(
corpId
);
if
(
Constants
.
SERVICE_RETURN_SUCCESS_CODE
<
returnCode
){
...
...
@@ -120,24 +85,20 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
}
@Override
public
int
startCustomerChurnNoticeSwitch
(
String
status
)
{
public
void
startCustomerChurnNoticeSwitch
(
String
status
)
{
WeCorpAccount
validWeCorpAccount
=
findValidWeCorpAccount
();
validWeCorpAccount
.
setCustomerChurnNoticeSwitch
(
status
);
return
weCorpAccountMapper
.
updateWeCorpAccount
(
validWeCorpAccount
);
this
.
updateWeCorpAccount
(
validWeCorpAccount
);
}
@Override
public
String
getCustomerChurnNoticeSwitch
()
{
WeCorpAccount
validWeCorpAccount
=
weCorpAccountMapper
.
findValidWeCorpAccount
();
WeCorpAccount
validWeCorpAccount
=
this
.
findValidWeCorpAccount
();
String
noticeSwitch
=
Optional
.
ofNullable
(
validWeCorpAccount
).
map
(
WeCorpAccount:
:
getCustomerChurnNoticeSwitch
)
.
orElse
(
WeConstans
.
DEL_FOLLOW_USER_SWITCH_CLOSE
);
return
noticeSwitch
;
}
@Override
public
WeCorpAccount
findWeCorpByAccount
(
String
corpAccount
)
{
return
weCorpAccountMapper
.
findWeCorpByAccount
(
corpAccount
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
View file @
912bc59
...
...
@@ -74,17 +74,24 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addWeCustomerMessagePush
(
CustomerMessagePushDto
customerMessagePushDto
)
throws
JsonProcessingException
,
ParseException
{
if
((
null
!=
customerMessagePushDto
.
getSettingTime
()
&&
!
""
.
equals
(
customerMessagePushDto
.
getSettingTime
()))
&&
DateUtils
.
diffTime
(
new
Date
(),
DateUtil
.
parse
(
customerMessagePushDto
.
getSettingTime
(),
"yyyy-MM-dd HH:mm"
))
>
0
)
{
// if ((null != customerMessagePushDto.getSettingTime() && !"".equals(customerMessagePushDto.getSettingTime()))
// && DateUtils.diffTime(new Date(), DateUtil.parse(customerMessagePushDto.getSettingTime(), "yyyy-MM-dd HH:mm")) > 0) {
// throw new WeComException("发送时间不能小于当前时间");
// }
if
(
StrUtil
.
isNotBlank
(
customerMessagePushDto
.
getSettingTime
())){
if
(
DateUtils
.
diffTime
(
new
Date
(),
DateUtil
.
parse
(
customerMessagePushDto
.
getSettingTime
(),
"yyyy-MM-dd HH:mm"
))
>
0
){
throw
new
WeComException
(
"发送时间不能小于当前时间"
);
}
}
/*if(StrUtil.isBlank(customerMessagePushDto.getSettingTime())){
throw new WeComException("发送时间不能为空");
}*/
List
<
WeCustomer
>
customers
=
Lists
.
newArrayList
();
List
<
WeGroup
>
groups
=
new
ArrayList
<>();
// 0 发给客户
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerTrajectoryServiceImpl.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.enums.MediaType
;
import
com.linkwechat.common.enums.MessageType
;
import
com.linkwechat.wecom.client.WeCustomerMessagePushClient
;
import
com.linkwechat.wecom.client.WeMessagePushClient
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeCustomerTrajectory
;
import
com.linkwechat.wecom.domain.dto.WeMessagePushDto
;
import
com.linkwechat.wecom.domain.dto.message.TextMessageDto
;
import
com.linkwechat.wecom.domain.dto.message.WeCustomerMessagePushDto
;
import
com.linkwechat.wecom.mapper.WeCustomerTrajectoryMapper
;
import
com.linkwechat.wecom.service.IWeCustomerMessageService
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeCustomerTrajectoryService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.validation.constraints.NotBlank
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
public
class
WeCustomerTrajectoryServiceImpl
extends
ServiceImpl
<
WeCustomerTrajectoryMapper
,
WeCustomerTrajectory
>
implements
IWeCustomerTrajectoryService
{
@Autowired
private
WeMessagePushClient
weMessagePushClient
;
@Autowired
private
IWeCustomerService
iWeCustomerService
;
/**
* 待办理处理通知
*/
@Override
public
void
waitHandleMsg
(
String
url
)
{
//获取所有满足时间的通知
List
<
WeCustomerTrajectory
>
trajectories
=
this
.
list
(
new
LambdaQueryWrapper
<
WeCustomerTrajectory
>()
.
ne
(
WeCustomerTrajectory:
:
getStatus
,
Constants
.
DELETE_CODE
)
.
last
(
" AND concat_ws(' ',create_date,start_time) <= DATE_FORMAT(NOW(),'%Y-%m-%d %H:%i:%s')"
+
" AND concat_ws(' ',create_date,end_time) >= DATE_FORMAT(NOW(),'%Y-%m-%d %H:%i:%s')"
));
if
(
CollectionUtil
.
isNotEmpty
(
trajectories
)){
List
<
WeCustomer
>
weCustomers
=
iWeCustomerService
.
listByIds
(
trajectories
.
stream
().
map
(
WeCustomerTrajectory:
:
getExternalUserid
).
collect
(
Collectors
.
toList
())
);
Map
<
String
,
WeCustomer
>
weCustomerMap
=
weCustomers
.
stream
().
collect
(
Collectors
.
toMap
(
WeCustomer:
:
getExternalUserid
,
a
->
a
,
(
k1
,
k2
)
->
k1
));
//给员工发送通知
trajectories
.
stream
().
forEach
(
k
->{
weMessagePushClient
.
sendMessageToUser
(
WeMessagePushDto
.
builder
()
.
touser
(
k
.
getUserId
())
.
msgtype
(
MessageType
.
TEXT
.
getMessageType
())
.
agentid
(
Integer
.
parseInt
(
k
.
getAgentId
()))
.
text
(
TextMessageDto
.
builder
()
.
content
(
"您有一项关于客户"
+
weCustomerMap
.
get
(
k
.
getExternalUserid
()).
getName
()+
"的待办任务提醒,请尽快处理,\n<a href="
+
url
+
">点击查看客户详情。</a>"
)
.
build
())
.
build
(),
String
.
valueOf
(
1000012
)
);
});
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMemberServiceImpl.java
View file @
912bc59
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.wecom.domain.WeGroupMember
;
import
com.linkwechat.wecom.domain.dto.WeGroupMemberDto
;
...
...
@@ -29,5 +30,12 @@ public class WeGroupMemberServiceImpl extends ServiceImpl<WeGroupMemberMapper,We
return
this
.
baseMapper
.
selectWeGroupMemberListByChatId
(
chatId
);
}
@Override
public
WeGroupMember
selectWeGroupMemberByUnionId
(
String
chatId
,
String
unionId
)
{
return
this
.
getOne
(
new
LambdaQueryWrapper
<
WeGroupMember
>()
.
eq
(
WeGroupMember:
:
getChatId
,
chatId
)
.
eq
(
WeGroupMember:
:
getUnionId
,
unionId
));
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionCompleteRecordServiceImpl.java
View file @
912bc59
...
...
@@ -9,7 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
/**
* 裂变任务完成记录Service业务层处理
...
...
@@ -96,4 +98,23 @@ public class WeTaskFissionCompleteRecordServiceImpl extends ServiceImpl<WeTaskFi
orderByAsc
(
WeTaskFissionCompleteRecord:
:
getCreateTime
);
return
weTaskFissionCompleteRecordMapper
.
selectList
(
wrapper
);
}
/**
* 根据任务id查询裂变任务完成记录列表
* @param taskFissionIds 任务id
* @return
*/
@Override
public
List
<
WeTaskFissionCompleteRecord
>
getListByTaskIds
(
Set
<
Long
>
taskFissionIds
)
{
return
this
.
list
(
new
LambdaQueryWrapper
<
WeTaskFissionCompleteRecord
>()
.
in
(
WeTaskFissionCompleteRecord:
:
getTaskFissionId
,
taskFissionIds
)
.
eq
(
WeTaskFissionCompleteRecord:
:
getStatus
,
1
));
}
@Override
public
List
<
WeTaskFissionCompleteRecord
>
getCompleteListByTaskId
(
Long
taskFissionId
)
{
return
this
.
list
(
new
LambdaQueryWrapper
<
WeTaskFissionCompleteRecord
>()
.
eq
(
WeTaskFissionCompleteRecord:
:
getTaskFissionId
,
taskFissionId
)
.
eq
(
WeTaskFissionCompleteRecord:
:
getStatus
,
0
));
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionRewardServiceImpl.java
View file @
912bc59
...
...
@@ -108,11 +108,8 @@ public class WeTaskFissionRewardServiceImpl implements IWeTaskFissionRewardServi
@Override
public
WeTaskFissionRewardVo
getRewardByFissionId
(
String
fissionId
,
String
unionId
)
{
WeTaskFissionRewardVo
weTaskFissionRewardVo
=
new
WeTaskFissionRewardVo
();
WeCustomer
weCustomer
=
weCustomerService
.
getOne
(
new
LambdaQueryWrapper
<
WeCustomer
>().
eq
(
WeCustomer:
:
getUnionid
,
unionId
));
String
customerUnionId
=
Optional
.
ofNullable
(
weCustomer
).
map
(
WeCustomer:
:
getUnionid
)
.
orElseThrow
(()
->
new
WeComException
(
"用户信息不存在"
));
WeTaskFissionRecord
record
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordByIdAndCustomerId
(
Long
.
valueOf
(
fissionId
),
customerU
nionId
);
WeTaskFissionRecord
record
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordByIdAndCustomerId
(
Long
.
valueOf
(
fissionId
),
u
nionId
);
if
(
record
==
null
){
throw
new
WeComException
(
"任务信息不存在"
);
}
...
...
@@ -128,7 +125,7 @@ public class WeTaskFissionRewardServiceImpl implements IWeTaskFissionRewardServi
});
WeTaskFissionReward
fissionReward
=
weTaskFissionRewardMapper
.
selectOne
(
new
LambdaQueryWrapper
<
WeTaskFissionReward
>()
.
eq
(
WeTaskFissionReward:
:
getTaskFissionId
,
fissionId
)
.
eq
(
WeTaskFissionReward:
:
getRewardUserId
,
customerU
nionId
));
.
eq
(
WeTaskFissionReward:
:
getRewardUserId
,
u
nionId
));
weTaskFissionRewardVo
.
setWeTaskFissionReward
(
fissionReward
);
//发放兑奖码之后,置为已使用
Optional
.
ofNullable
(
fissionReward
).
ifPresent
(
reward
->
weTaskFissionRewardMapper
.
update
(
reward
,
new
LambdaUpdateWrapper
<
WeTaskFissionReward
>()
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionServiceImpl.java
View file @
912bc59
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.google.common.collect.Lists
;
import
com.linkwechat.common.config.CosConfig
;
...
...
@@ -52,7 +53,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Service
public
class
WeTaskFissionServiceImpl
implements
IWeTaskFissionService
{
public
class
WeTaskFissionServiceImpl
extends
ServiceImpl
<
WeTaskFissionMapper
,
WeTaskFission
>
implements
IWeTaskFissionService
{
@Autowired
private
WeTaskFissionMapper
weTaskFissionMapper
;
@Autowired
...
...
@@ -77,10 +78,13 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
private
IWeFlowerCustomerRelService
weFlowerCustomerRelService
;
@Autowired
private
IWeTaskFissionCompleteRecordService
weTaskFissionCompleteRecordService
;
@Autowired
private
CosConfig
cosConfig
;
@Value
(
"${H5.
u
rl}"
)
@Value
(
"${H5.
fissionU
rl}"
)
private
String
pageUrl
;
@Value
(
"${H5.fissionGroupUrl}"
)
private
String
pageGroupUrl
;
/**
* 查询任务宝
...
...
@@ -154,7 +158,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
int
updateResult
=
weTaskFissionMapper
.
updateWeTaskFission
(
weTaskFission
);
if
(
updateResult
>
0
)
{
if
(
CollectionUtils
.
isNotEmpty
(
weTaskFission
.
getTaskFissionStaffs
()))
{
log
.
info
(
"发起成员信息:【{}】"
,
JSONObject
.
toJSONString
(
weTaskFission
.
getTaskFissionStaffs
()));
log
.
info
(
"发起成员信息:【{}】"
,
JSONObject
.
toJSONString
(
weTaskFission
.
getTaskFissionStaffs
()));
List
<
WeTaskFissionStaff
>
staffList
=
weTaskFissionStaffService
.
selectWeTaskFissionStaffByTaskId
(
weTaskFission
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
staffList
))
{
weTaskFissionStaffService
.
deleteWeTaskFissionStaffByIds
(
staffList
.
stream
().
map
(
WeTaskFissionStaff:
:
getId
).
toArray
(
Long
[]::
new
));
...
...
@@ -206,7 +210,6 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
.
append
(
"fissionTargetId="
).
append
(
fissStaffId
)
.
append
(
"&"
)
.
append
(
"posterId="
).
append
(
weTaskFission
.
getPostersId
());
LinkMessageDto
linkMessageDto
=
new
LinkMessageDto
();
linkMessageDto
.
setPicurl
(
postersPath
);
linkMessageDto
.
setDesc
(
weTaskFission
.
getFissInfo
());
...
...
@@ -214,7 +217,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
linkMessageDto
.
setUrl
(
pageUrlBuilder
.
toString
());
CustomerMessagePushDto
customerMessagePushDto
=
new
CustomerMessagePushDto
();
if
(
weTaskFission
.
getStartTime
()
!=
null
){
if
(
weTaskFission
.
getStartTime
()
!=
null
)
{
customerMessagePushDto
.
setSettingTime
(
DateUtil
.
formatDateTime
(
weTaskFission
.
getStartTime
()));
}
customerMessagePushDto
.
setLinkMessage
(
linkMessageDto
);
...
...
@@ -284,12 +287,12 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
WeTaskFissionCompleteRecord
wfcr
=
new
WeTaskFissionCompleteRecord
();
wfcr
.
setTaskFissionId
(
taskFissionId
);
wfcr
.
setFissionRecordId
(
taskFissionRecordId
);
String
userId
=
StringUtils
.
isBlank
(
weChatUserDTO
.
getUserid
())
?
weChatUserDTO
.
getUnionid
()
:
weChatUserDTO
.
getUserid
();
wfcr
.
setCustomerId
(
userId
);
wfcr
.
setCustomerId
(
weChatUserDTO
.
getUnionid
());
wfcr
.
setCustomerName
(
weChatUserDTO
.
getName
());
List
<
WeTaskFissionCompleteRecord
>
list
=
weTaskFissionCompleteRecordService
.
selectWeTaskFissionCompleteRecordList
(
wfcr
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
wfcr
.
setCreateTime
(
new
Date
());
wfcr
.
setCustomerAvatar
(
weChatUserDTO
.
getAvatar
());
weTaskFissionCompleteRecordService
.
insertWeTaskFissionCompleteRecord
(
wfcr
);
}
}
...
...
@@ -311,9 +314,9 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
.
eq
(
WeFlowerCustomerRel:
:
getState
,
WeConstans
.
FISSION_PREFIX
+
weTaskFissionRecord
.
getId
()));
List
<
String
>
eidList
=
Optional
.
ofNullable
(
list
).
orElseGet
(
ArrayList:
:
new
).
stream
()
.
map
(
WeFlowerCustomerRel:
:
getExternalUserid
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
eidList
)){
if
(
CollectionUtil
.
isNotEmpty
(
eidList
))
{
return
weCustomerService
.
listByIds
(
eidList
);
}
else
{
}
else
{
return
null
;
}
}
...
...
@@ -333,7 +336,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
Map
<
String
,
List
<
WeTaskFissionCompleteRecord
>>
completeRecordsMap
=
weTaskFissionCompleteRecordService
.
statisticCompleteRecords
(
taskFissionId
,
startTime
,
endTime
).
parallelStream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
groupingBy
(
item
->
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
item
.
getCreateTime
())));
Map
<
String
,
List
<
WeTaskFissionRecord
>>
recordsMap
=
weTaskFissionRecordService
.
statisticRecords
(
taskFissionId
,
startTime
,
endTime
).
parallelStream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
groupingBy
(
item
->
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
item
.
getCreateTime
())));
List
<
WeTaskFissionDailyDataVO
>
dailyDataList
=
Lists
.
newArrayList
();
DateUtils
.
findDates
(
startTime
,
endTime
).
parallelS
tream
().
map
(
d
->
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
d
))
DateUtils
.
findDates
(
startTime
,
endTime
).
s
tream
().
map
(
d
->
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
d
))
.
forEach
(
date
->
{
WeTaskFissionDailyDataVO
v
=
new
WeTaskFissionDailyDataVO
();
v
.
setDay
(
date
);
...
...
@@ -355,19 +358,28 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
@Override
public
WeTaskFissionProgressVO
getCustomerTaskProgress
(
WeTaskFission
taskFission
,
String
unionId
)
{
long
complete
=
0L
;
long
total
=
taskFission
.
getFissNum
();
List
<
WeCustomer
>
list
=
getCustomerListById
(
unionId
,
String
.
valueOf
(
taskFission
.
getId
())
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)
)
{
complete
=
list
.
size
(
);
List
<
WeCustomer
>
list
=
new
ArrayList
<>(
);
if
(
taskFission
.
getFissionType
()
==
1
)
{
list
.
addAll
(
getCustomerListById
(
unionId
,
String
.
valueOf
(
taskFission
.
getId
()))
);
}
else
{
list
=
new
ArrayList
<>();
List
<
WeTaskFissionCompleteRecord
>
completeRecordList
=
weTaskFissionCompleteRecordService
.
getCompleteListByTaskId
(
taskFission
.
getId
());
if
(
CollectionUtil
.
isNotEmpty
(
completeRecordList
))
{
completeRecordList
.
forEach
(
completeRecord
->
{
WeCustomer
weCustomer
=
new
WeCustomer
();
weCustomer
.
setAvatar
(
completeRecord
.
getCustomerAvatar
());
weCustomer
.
setUnionid
(
completeRecord
.
getCustomerId
());
weCustomer
.
setName
(
completeRecord
.
getCustomerName
());
list
.
add
(
weCustomer
);
});
}
return
WeTaskFissionProgressVO
.
builder
().
total
(
total
).
completed
(
complete
).
customers
(
list
).
build
();
}
return
WeTaskFissionProgressVO
.
builder
().
total
(
total
).
completed
(
new
Long
(
list
.
size
())).
customers
(
list
).
build
();
}
/**
* 更新过期任务
*
* @return
*/
@Override
...
...
@@ -375,6 +387,21 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
weTaskFissionMapper
.
updateExpiredWeTaskFission
();
}
/**
* 根据群活码id 查询任务列表
*
* @param groupCodeId 群活码id
* @return
*/
@Override
public
List
<
WeTaskFission
>
getTaskFissionListByGroupCodeId
(
Long
groupCodeId
)
{
return
this
.
list
(
new
LambdaQueryWrapper
<
WeTaskFission
>()
.
eq
(
WeTaskFission:
:
getFissionTargetId
,
groupCodeId
)
.
eq
(
WeTaskFission:
:
getFissionType
,
2
)
.
eq
(
WeTaskFission:
:
getFissStatus
,
1
));
}
/*************************************** private functions **************************************/
private
String
getPosterQRCode
(
String
fissionTargetId
,
WeTaskFissionRecord
record
,
WeCustomer
weCustomer
)
{
...
...
@@ -408,11 +435,14 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
private
String
getGroupFissionQrcode
(
Long
taskFissionId
,
WeTaskFissionRecord
record
,
WeCustomer
weCustomer
)
{
String
qrCode
=
null
;
if
(
weCustomer
!=
null
)
{
String
avatar
=
weCustomer
.
getAvatar
();
WeMaterial
file
=
weMaterialService
.
findWeMaterialById
(
Long
.
parseLong
(
avatar
));
String
avatarUrl
=
StringUtils
.
isEmpty
(
avatar
)
?
file
.
getMaterialUrl
()
:
avatar
;
String
content
=
"/wecom/fission/complete/"
+
taskFissionId
+
"/records/"
+
record
.
getId
();
BufferedImage
bufferedImage
=
QREncode
.
crateQRCode
(
content
,
avatarUrl
);
String
avatarUrl
=
weCustomer
.
getAvatar
();
StringBuilder
contentBuilder
=
new
StringBuilder
(
pageGroupUrl
);
contentBuilder
.
append
(
"?"
)
.
append
(
"fissionId="
)
.
append
(
taskFissionId
)
.
append
(
"&recordId="
)
.
append
(
record
.
getId
());
BufferedImage
bufferedImage
=
QREncode
.
crateQRCode
(
contentBuilder
.
toString
(),
avatarUrl
);
if
(
bufferedImage
!=
null
)
{
try
(
ByteArrayOutputStream
byteArrayOutputStream
=
new
ByteArrayOutputStream
())
{
ImageIO
.
write
(
bufferedImage
,
"png"
,
byteArrayOutputStream
);
...
...
@@ -423,7 +453,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
throw
new
WeComException
(
"生成二维码异常"
);
}
}
return
qrCode
;
return
cosConfig
.
getImgUrlPrefix
()
+
qrCode
;
}
else
{
throw
new
WeComException
(
"生成二维码异常,用户信息不存在"
);
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeUserServiceImpl.java
View file @
912bc59
...
...
@@ -20,6 +20,7 @@ import com.linkwechat.wecom.service.IWeGroupService;
import
com.linkwechat.wecom.service.IWeUserService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -102,7 +103,7 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
{
if
(
this
.
save
(
weUser
)
){
if
(
this
.
insertWeUserNoToWeCom
(
weUser
)
>
0
){
weUserClient
.
createUser
(
weUser
.
transformWeUserDto
()
);
...
...
@@ -215,6 +216,7 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
*/
@Override
@Transactional
@Async
public
void
synchWeUser
(){
//同步部门
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCategoryMapper.xml
View file @
912bc59
...
...
@@ -3,92 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeCategoryMapper"
>
<resultMap
id=
"categoryMap"
type=
"com.linkwechat.wecom.domain.WeCategory"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"mediaType"
column=
"media_type"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"parentId"
column=
"parent_id"
/>
</resultMap>
<insert
id=
"insertWeCategory"
>
INSERT INTO we_category
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"mediaType != null"
>
media_type,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"parentId != null"
>
parent_id,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
<if
test=
"mediaType != null"
>
#{mediaType},
</if>
<if
test=
"name != null"
>
#{name},
</if>
<if
test=
"parentId != null"
>
#{parentId},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
</trim>
</insert>
<update
id=
"updateWeCategory"
>
UPDATE we_category
<trim
prefix=
"set"
suffixOverrides=
","
>
<if
test=
"mediaType != null"
>
media_type=#{mediaType},
</if>
<if
test=
"name != null"
>
name=#{name},
</if>
<if
test=
"parentId != null"
>
parent_id=#{parentId},
</if>
<if
test=
"createBy != null"
>
create_by=#{createBy},
</if>
<if
test=
"createTime != null"
>
create_time=#{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by=#{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time=#{updateTime},
</if>
</trim>
<where>
id=#{id}
</where>
</update>
<delete
id=
"deleteWeCategoryById"
>
UPDATE we_category
set del_flag=1
<where>
id=#{id}
</where>
</delete>
<delete
id=
"deleteWeCategoryByIds"
>
UPDATE we_category
set del_flag=1
<where>
id in
<foreach
collection=
"array"
open=
"("
close=
")"
item=
"item"
separator=
","
>
#{item}
</foreach>
</where>
</delete>
<select
id=
"findWeCategoryByMediaType"
resultType=
"com.linkwechat.wecom.domain.WeCategory"
>
SELECT
<include
refid=
"categoryVo"
/>
FROM we_category
<where>
media_type=#{mediaType} and del_flag=0
</where>
</select>
<select
id=
"findWeCategoryById"
resultType=
"com.linkwechat.wecom.domain.WeCategory"
>
SELECT
<include
refid=
"categoryVo"
/>
FROM we_category
<where>
id=#{id} and del_flag=0
</where>
</select>
<select
id=
"findWeCategoryByMediaTypeAndName"
resultType=
"com.linkwechat.wecom.domain.WeCategory"
>
SELECT
<include
refid=
"categoryVo"
/>
FROM we_category
<where>
media_type=#{mediaType} and del_flag=0 and `name`=#{name}
</where>
</select>
<sql
id=
"categoryVo"
>
id,media_type,parent_id,`name`
</sql>
</mapper>
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeCorpAccountMapper.xml
View file @
912bc59
...
...
@@ -4,124 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeCorpAccountMapper"
>
<resultMap
type=
"WeCorpAccount"
id=
"WeCorpAccountResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"companyName"
column=
"company_name"
/>
<result
property=
"corpId"
column=
"corp_id"
/>
<result
property=
"corpSecret"
column=
"corp_secret"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"contactSecret"
column=
"contact_secret"
/>
<result
property=
"agentId"
column=
"agent_id"
/>
<result
property=
"agentSecret"
column=
"agent_secret"
/>
<result
property=
"chatSecret"
column=
"chat_secret"
/>
<result
property=
"providerSecret"
column=
"provider_secret"
/>
<result
property=
"customerChurnNoticeSwitch"
column=
"customer_churn_notice_switch"
/>
<result
property=
"wxQrLoginRedirectUri"
column=
"wx_qr_login_redirect_uri"
/>
<result
property=
"corpAccount"
column=
"corp_account"
/>
</resultMap>
<sql
id=
"selectWeCorpAccountVo"
>
select id,chat_secret,provider_secret,company_name, corp_id, corp_secret,agent_id, agent_secret, status, del_flag, create_by, create_time, update_by, update_time,contact_secret, customer_churn_notice_switch,wx_qr_login_redirect_uri,
corp_account
from we_corp_account
</sql>
<select
id=
"selectWeCorpAccountList"
parameterType=
"WeCorpAccount"
resultMap=
"WeCorpAccountResult"
>
<include
refid=
"selectWeCorpAccountVo"
/>
<where>
<if
test=
"companyName != null and companyName != ''"
>
and company_name like concat('%', #{companyName}, '%')
</if>
<if
test=
"corpId != null and corpId != ''"
>
and corp_id = #{corpId}
</if>
<if
test=
"corpSecret != null and corpSecret != ''"
>
and corp_secret = #{corpSecret}
</if>
<if
test=
"status != null and status != ''"
>
and status = #{status}
</if>
</where>
</select>
<select
id=
"selectWeCorpAccountById"
parameterType=
"Long"
resultMap=
"WeCorpAccountResult"
>
<include
refid=
"selectWeCorpAccountVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWeCorpAccount"
parameterType=
"WeCorpAccount"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into we_corp_account
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"companyName != null"
>
company_name,
</if>
<if
test=
"corpId != null"
>
corp_id,
</if>
<if
test=
"corpSecret != null"
>
corp_secret,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"delFlag != null"
>
del_flag,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"contactSecret != null "
>
contact_secret,
</if>
<if
test=
"chatSecret != null "
>
chat_secret,
</if>
<if
test=
"agentId != null "
>
agent_id,
</if>
<if
test=
"agentSecret != null "
>
agent_secret,
</if>
<if
test=
"customerChurnNoticeSwitch != null "
>
customer_churn_notice_switch,
</if>
<if
test=
"providerSecret != null "
>
provider_secret,
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
wx_qr_login_redirect_uri,
</if>
<if
test=
"corpAccount != null "
>
corp_account,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"companyName != null"
>
#{companyName},
</if>
<if
test=
"corpId != null"
>
#{corpId},
</if>
<if
test=
"corpSecret != null"
>
#{corpSecret},
</if>
<if
test=
"status != null"
>
#{status},
</if>
<if
test=
"delFlag != null"
>
#{delFlag},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"contactSecret != null "
>
#{contactSecret},
</if>
<if
test=
"chatSecret != null "
>
#{chatSecret},
</if>
<if
test=
"agentId != null "
>
#{agentId},
</if>
<if
test=
"agentSecret != null "
>
#{agentSecret},
</if>
<if
test=
"customerChurnNoticeSwitch != null "
>
#{customerChurnNoticeSwitch},
</if>
<if
test=
"providerSecret != null "
>
#{providerSecret},
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
#{wxQrLoginRedirectUri},
</if>
<if
test=
"corpAccount != null "
>
#{corpAccount},
</if>
</trim>
</insert>
<update
id=
"updateWeCorpAccount"
parameterType=
"WeCorpAccount"
>
update we_corp_account
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"companyName != null"
>
company_name = #{companyName},
</if>
<if
test=
"corpId != null"
>
corp_id = #{corpId},
</if>
<if
test=
"corpSecret != null"
>
corp_secret = #{corpSecret},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"delFlag != null"
>
del_flag = #{delFlag},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"contactSecret != null "
>
contact_secret = #{contactSecret},
</if>
<if
test=
"chatSecret != null "
>
chat_secret = #{chatSecret},
</if>
<if
test=
"agentId != null "
>
agent_id = #{agentId},
</if>
<if
test=
"agentSecret != null "
>
agent_secret =#{agentSecret},
</if>
<if
test=
"customerChurnNoticeSwitch != null "
>
customer_churn_notice_switch = #{customerChurnNoticeSwitch},
</if>
<if
test=
"providerSecret != null "
>
provider_secret = #{providerSecret},
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
wx_qr_login_redirect_uri = #{wxQrLoginRedirectUri},
</if>
<if
test=
"corpAccount != null "
>
crop_account = #{corpAccount},
</if>
</trim>
where id = #{id}
</update>
<select
id=
"findValidWeCorpAccount"
resultMap=
"WeCorpAccountResult"
>
<include
refid=
"selectWeCorpAccountVo"
/>
WHERE
del_flag = 0
AND STATUS = 0
</select>
<update
id=
"startVailWeCorpAccount"
>
...
...
@@ -131,12 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"findWeCorpByAccount"
resultMap=
"WeCorpAccountResult"
>
<include
refid=
"selectWeCorpAccountVo"
/>
WHERE
del_flag = 0
AND corp_account = #{corpAccount}
</select>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
912bc59
...
...
@@ -129,9 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND date_format(wfcr.create_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
</if>
<if
test=
"status != null and status !=''"
>
AND wfcr.status = #{status}
</if>
<if
test=
"tagIds != null and tagIds !=''"
>
<if
test=
"tagIds.indexOf(',') != -1"
>
AND wt.tag_id in
...
...
@@ -154,7 +152,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
OR wu.department=#{departmentIds}
</if>
</if>
<if
test=
"status !=null and status !=''"
>
AND wfcr.status=#{status}
</if>
...
...
@@ -317,7 +314,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcr.remark_corp_name,
wfcr.description,
wfcr.id as flowerCustomerRelId,
wfcr.user_id
wfcr.user_id,
wc.avatar,
wfcr.external_userid,
wc.gender
FROM
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr on wc.external_userid=wfcr.external_userid
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeEmpleCodeMapper.xml
View file @
912bc59
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupStatisticMapper.xml
View file @
912bc59
...
...
@@ -150,11 +150,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum(ifnull(wgs.msg_total, 0)) msg_total,
date_format(wgs.stat_time, '%Y-%m') as finish_date
from we_group_statistic wgs
where
str_to_date(date_format(wgs.stat_time, '%Y-%m'), '%Y-%m')
>
=
str_to_date(date_format(date_sub(current_date, interval #{few} month), '%Y-%m'), '%Y-%m')
and str_to_date(date_format(wgs.stat_time, '%Y-%m'), '%Y-%m')
<
=
str_to_date(date_format(current_date, '%Y-%m'), '%Y-%m')
group by finish_date
order by finish_date
) as tbr on tbl._date = tbr.finish_date
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeTaskFissionCompleteRecordMapper.xml
View file @
912bc59
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.
ruoyi.syste
m.mapper.WeTaskFissionCompleteRecordMapper"
>
<mapper
namespace=
"com.
linkwechat.weco
m.mapper.WeTaskFissionCompleteRecordMapper"
>
<resultMap
type=
"WeTaskFissionCompleteRecord"
id=
"WeTaskFissionCompleteRecordResult"
>
<result
property=
"id"
column=
"id"
/>
...
...
@@ -11,10 +11,12 @@
<result
property=
"customerId"
column=
"customer_id"
/>
<result
property=
"customerName"
column=
"customer_name"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"customerAvatar"
column=
"customer_avatar"
/>
</resultMap>
<sql
id=
"selectWeTaskFissionCompleteRecordVo"
>
select id, task_fission_id, fission_record_id, customer_id, customer_name, create_time from
select id, task_fission_id, fission_record_id, customer_id, customer_name, create_time
, status, customer_avatar
from
we_task_fission_complete_record
</sql>
...
...
@@ -25,6 +27,7 @@
<if
test=
"taskFissionId != null "
>
and task_fission_id = #{taskFissionId}
</if>
<if
test=
"fissionRecordId != null "
>
and fission_record_id = #{fissionRecordId}
</if>
<if
test=
"customerId != null and customerId != ''"
>
and customer_id = #{customerId}
</if>
<if
test=
"status != null"
>
and status = #{status}
</if>
<if
test=
"customerName != null and customerName != ''"
>
and customer_name like concat('%', #{customerName},
'%')
</if>
...
...
@@ -46,6 +49,8 @@
<if
test=
"customerId != null and customerId != ''"
>
customer_id,
</if>
<if
test=
"customerName != null"
>
customer_name,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"customerAvatar != null"
>
customer_avatar,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"taskFissionId != null"
>
#{taskFissionId},
</if>
...
...
@@ -53,6 +58,8 @@
<if
test=
"customerId != null and customerId != ''"
>
#{customerId},
</if>
<if
test=
"customerName != null"
>
#{customerName},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"status != null"
>
#{status},
</if>
<if
test=
"customerAvatar != null"
>
#{customerAvatar},
</if>
</trim>
</insert>
...
...
@@ -64,6 +71,8 @@
<if
test=
"customerId != null and customerId != ''"
>
customer_id = #{customerId},
</if>
<if
test=
"customerName != null"
>
customer_name = #{customerName},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"customerAvatar != null"
>
customer_avatar = #{customerAvatar},
</if>
</trim>
where id = #{id}
</update>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeUserBehaviorDataMapper.xml
View file @
912bc59
...
...
@@ -149,11 +149,6 @@
sum(ifnull(wubd.negative_feedback_cnt, 0)) negative_feedback_cnt,
date_format(wubd.stat_time, '%Y-%m') as finish_date
from we_user_behavior_data wubd
where
str_to_date(date_format(wubd.stat_time, '%Y-%m'), '%Y-%m')
>
=
str_to_date(date_format(date_sub(current_date, interval #{few} month), '%Y-%m'), '%Y-%m')
and str_to_date(date_format(wubd.stat_time, '%Y-%m'), '%Y-%m')
<
=
str_to_date(date_format(current_date, '%Y-%m'), '%Y-%m')
group by finish_date
order by finish_date
) as tbr on tbl._date = tbr.finish_date
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
View file @
912bc59
...
...
@@ -47,7 +47,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"departmentStr != null and departmentStr != '' "
>
and FIND_IN_SET(#{departmentStr},department)
</if>
<if
test=
"position != null and position != ''"
>
and position = #{position}
</if>
<if
test=
"isLeaderInDept != null "
>
and is_leader_in_dept = #{isLeaderInDept}
</if>
<if
test=
"joinTime != null "
>
and join_time = #{joinTime}
</if>
<if
test=
"beginTime != null and beginTime !='' and endTime !=null and endTime !=''"
>
and DATE_FORMAT(join_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
</if>
<if
test=
"idCard != null and idCard != ''"
>
and id_card = #{idCard}
</if>
<if
test=
"qqAccount != null and qqAccount != ''"
>
and qq_account = #{qqAccount}
</if>
<if
test=
"telephone != null and telephone != ''"
>
and telephone = #{telephone}
</if>
...
...
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