Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
32cf4f7c
Commit
32cf4f7c
authored
May 13, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
eb593ce4
0b92514b
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
353 additions
and
36 deletions
+353
-36
MaterialCategoryDTO.java
...va/com/gic/haoban/manage/api/dto/MaterialCategoryDTO.java
+2
-1
MaterialDTO.java
.../main/java/com/gic/haoban/manage/api/dto/MaterialDTO.java
+6
-5
MaterialApiService.java
...com/gic/haoban/manage/api/service/MaterialApiService.java
+2
-0
MemberUnionidRelatedApiService.java
...an/manage/api/service/MemberUnionidRelatedApiService.java
+10
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
MemberUnionidRelatedMapper.java
...manage/service/dao/mapper/MemberUnionidRelatedMapper.java
+5
-0
TabHaobanMaterial.java
...m/gic/haoban/manage/service/entity/TabHaobanMaterial.java
+9
-8
MemberUnionRelatedService.java
...ban/manage/service/service/MemberUnionRelatedService.java
+4
-0
MemberUnionRelatedServiceImpl.java
...e/service/service/impl/MemberUnionRelatedServiceImpl.java
+7
-0
MaidianDictApiServiceImpl.java
...e/service/service/out/impl/MaidianDictApiServiceImpl.java
+3
-3
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+50
-3
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+78
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+12
-0
MemberUnionidRelatedMapper.xml
.../src/main/resources/mapper/MemberUnionidRelatedMapper.xml
+17
-0
TabHaobanMaterialMapper.xml
...ice/src/main/resources/mapper/TabHaobanMaterialMapper.xml
+16
-6
MaterialController.java
.../gic/haoban/manage/web/controller/MaterialController.java
+2
-2
UploadController.java
...om/gic/haoban/manage/web/controller/UploadController.java
+67
-0
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+17
-0
MyApplicationContextAware.java
...gic/haoban/manage/web/init/MyApplicationContextAware.java
+17
-3
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+2
-0
MaterialController.java
.../gic/haoban/manage/web/controller/MaterialController.java
+21
-5
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+4
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/MaterialCategoryDTO.java
View file @
32cf4f7c
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
MaterialCategoryDTO
{
public
class
MaterialCategoryDTO
implements
Serializable
{
private
String
categoryId
;
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/MaterialDTO.java
View file @
32cf4f7c
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
MaterialDTO
{
public
class
MaterialDTO
implements
Serializable
{
private
String
materialId
;
...
...
@@ -14,7 +15,7 @@ public class MaterialDTO {
private
String
materialContent
;
private
String
wxLastUploadTime
;
private
Date
wxLastUploadTime
;
private
String
mediaId
;
...
...
@@ -78,12 +79,12 @@ public class MaterialDTO {
this
.
materialContent
=
materialContent
==
null
?
null
:
materialContent
.
trim
();
}
public
String
getWxLastUploadTime
()
{
public
Date
getWxLastUploadTime
()
{
return
wxLastUploadTime
;
}
public
void
setWxLastUploadTime
(
String
wxLastUploadTime
)
{
this
.
wxLastUploadTime
=
wxLastUploadTime
==
null
?
null
:
wxLastUploadTime
.
trim
()
;
public
void
setWxLastUploadTime
(
Date
wxLastUploadTime
)
{
this
.
wxLastUploadTime
=
wxLastUploadTime
;
}
public
String
getMediaId
()
{
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MaterialApiService.java
View file @
32cf4f7c
...
...
@@ -29,4 +29,6 @@ public interface MaterialApiService {
Page
<
MaterialDTO
>
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
,
BasePageInfo
pageInfo
);
String
reUpdalodMetail
(
String
materialId
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MemberUnionidRelatedApiService.java
View file @
32cf4f7c
...
...
@@ -3,6 +3,9 @@ package com.gic.haoban.manage.api.service;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.MemberStoreDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
...
...
@@ -28,4 +31,11 @@ public interface MemberUnionidRelatedApiService {
public
void
cleanByCid
(
String
cid
);
Page
<
MemberUnionidRelatedDTO
>
pageMemberUnionByParams
(
List
<
String
>
userIdList
,
List
<
String
>
sendMemberIds
,
String
enterpriseId
,
BasePageInfo
pageInfo
);
String
sendMessage
(
String
wxEnterpriseId
,
String
userId
,
List
<
String
>
extendUserList
,
String
materialId
);
JSONResponse
getMessageStatus
(
String
wxEnterpriseId
,
String
wxMessageId
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
32cf4f7c
...
...
@@ -80,4 +80,6 @@ public interface StaffApiService {
public
ServiceResponse
<
String
>
getStaffQrcode
(
String
clerkCode
,
String
storeId
);
void
wxFristAdd
(
String
userJson
,
String
wxEnterpriseId
);
List
<
String
>
listBindClerkUserId
(
String
storeId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/MemberUnionidRelatedMapper.java
View file @
32cf4f7c
...
...
@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
com.gic.haoban.manage.service.entity.MemberUnionidRelated
;
import
com.github.pagehelper.Page
;
public
interface
MemberUnionidRelatedMapper
{
int
deleteByPrimaryKey
(
String
memberUnionidRelatedId
);
...
...
@@ -35,4 +36,7 @@ public interface MemberUnionidRelatedMapper {
@Param
(
"externalName"
)
String
name
,
@Param
(
"addCreateTime"
)
String
createTime
);
List
<
MemberUnionidRelated
>
listByExTernalUseridAndWxUserId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"wxUserId"
)
String
wxUserId
);
Page
<
MemberUnionidRelated
>
pageMemberUnionByParams
(
@Param
(
"userIdList"
)
List
<
String
>
userIdList
,
@Param
(
"sendMemberIds"
)
List
<
String
>
sendMemberIds
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanMaterial.java
View file @
32cf4f7c
...
...
@@ -14,7 +14,7 @@ public class TabHaobanMaterial implements Serializable {
private
String
materialContent
;
private
String
wxLastUploadTime
;
private
Date
wxLastUploadTime
;
private
String
mediaId
;
...
...
@@ -78,15 +78,16 @@ public class TabHaobanMaterial implements Serializable {
this
.
materialContent
=
materialContent
==
null
?
null
:
materialContent
.
trim
();
}
public
String
getWxLastUploadTime
()
{
return
wxLastUploadTime
;
}
public
void
setWxLastUploadTime
(
String
wxLastUploadTime
)
{
this
.
wxLastUploadTime
=
wxLastUploadTime
==
null
?
null
:
wxLastUploadTime
.
trim
();
}
public
Date
getWxLastUploadTime
()
{
return
wxLastUploadTime
;
}
public
void
setWxLastUploadTime
(
Date
wxLastUploadTime
)
{
this
.
wxLastUploadTime
=
wxLastUploadTime
;
}
public
String
getMediaId
()
{
public
String
getMediaId
()
{
return
mediaId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/MemberUnionRelatedService.java
View file @
32cf4f7c
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
com.gic.haoban.manage.service.entity.MemberUnionidRelated
;
public
interface
MemberUnionRelatedService
{
...
...
@@ -19,4 +20,7 @@ public interface MemberUnionRelatedService {
void
update
(
MemberUnionidRelatedDTO
exsitDTO
);
void
clean
(
String
cid
);
com
.
github
.
pagehelper
.
Page
<
MemberUnionidRelated
>
pageMemberUnionByParams
(
List
<
String
>
userIdList
,
List
<
String
>
sendMemberIds
,
String
enterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/MemberUnionRelatedServiceImpl.java
View file @
32cf4f7c
...
...
@@ -13,6 +13,7 @@ import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import
com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper
;
import
com.gic.haoban.manage.service.entity.MemberUnionidRelated
;
import
com.gic.haoban.manage.service.service.MemberUnionRelatedService
;
import
com.github.pagehelper.Page
;
@Service
public
class
MemberUnionRelatedServiceImpl
implements
MemberUnionRelatedService
{
...
...
@@ -60,4 +61,10 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
public
void
clean
(
String
cid
)
{
mapper
.
cleanByCid
(
cid
);
}
@Override
public
Page
<
MemberUnionidRelated
>
pageMemberUnionByParams
(
List
<
String
>
userIdList
,
List
<
String
>
sendMemberIds
,
String
enterpriseId
)
{
return
mapper
.
pageMemberUnionByParams
(
userIdList
,
sendMemberIds
,
enterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaidianDictApiServiceImpl.java
View file @
32cf4f7c
...
...
@@ -42,7 +42,7 @@ public class MaidianDictApiServiceImpl implements MaidianDictApiService{
}
else
{
//更新
tab
.
setUpdateTime
(
new
Date
());
tabHaobanMaidianDictModuleMapper
.
updateByPrimaryKey
(
tab
);
tabHaobanMaidianDictModuleMapper
.
updateByPrimaryKey
Selective
(
tab
);
}
}
@Override
...
...
@@ -53,12 +53,12 @@ public class MaidianDictApiServiceImpl implements MaidianDictApiService{
tab
.
setCreateTime
(
new
Date
());
tab
.
setUpdateTime
(
new
Date
());
tab
.
setStatus
(
1
);
tab
.
set
Module
Id
(
UuidUtil
.
randomUUID
());
tab
.
set
Dict
Id
(
UuidUtil
.
randomUUID
());
tabHaobanMaidianDictMapper
.
insert
(
tab
);
}
else
{
//更新
tab
.
setUpdateTime
(
new
Date
());
tabHaobanMaidianDictMapper
.
updateByPrimaryKey
(
tab
);
tabHaobanMaidianDictMapper
.
updateByPrimaryKey
Selective
(
tab
);
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
32cf4f7c
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.io.IOUtils
;
...
...
@@ -11,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.GlobalInfo
;
...
...
@@ -23,6 +25,7 @@ import com.gic.haoban.manage.api.dto.MaterialDTO;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.MaterialApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.entity.TabHaobanMaterial
;
import
com.gic.haoban.manage.service.service.MaterialCategoryService
;
import
com.gic.haoban.manage.service.service.MaterialService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
...
...
@@ -121,6 +124,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if
(
fileType
!=
null
){
JSONResponse
jp
=
qywxSuiteApiService
.
uploadMedia
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
getFileByte
(
url
),
fileType
.
getCode
());
if
(
jp
.
getErrorCode
()
==
0
){
materialDTO
.
setWxLastUploadTime
(
new
Date
());
materialDTO
.
setMediaId
(
jp
.
getResult
().
toString
());
materialService
.
insertMaterial
(
materialDTO
);
}
...
...
@@ -168,6 +172,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if
(
fileType
!=
null
&&
!
url
.
equals
(
oldUrl
)){
JSONResponse
jp
=
qywxSuiteApiService
.
uploadMedia
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
getFileByte
(
url
),
fileType
.
getCode
());
if
(
jp
.
getErrorCode
()
==
0
){
materialDTO
.
setWxLastUploadTime
(
new
Date
());
materialDTO
.
setMediaId
(
jp
.
getResult
().
toString
());
materialService
.
edit
(
materialDTO
);
}
...
...
@@ -176,22 +181,64 @@ public class MaterialApiServiceImpl implements MaterialApiService {
}
}
@Override
public
String
reUpdalodMetail
(
String
materialId
){
MaterialDTO
old
=
materialService
.
selectMaterialById
(
materialId
);
Integer
type
=
old
.
getMaterialType
();
if
(
type
==
null
){
return
""
;
}
String
wxEnterpriseId
=
old
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
enterprise
==
null
){
return
""
;
}
String
url
=
""
;
String
oldUrl
=
""
;
QywxMediaTypeEnum
fileType
=
null
;
if
(
type
==
2
){
fileType
=
QywxMediaTypeEnum
.
IMAGE
;
url
=
old
.
getImgUrl
();
}
if
(
type
==
4
){
fileType
=
QywxMediaTypeEnum
.
VIDEO
;
url
=
old
.
getLink
();
}
if
(
type
==
5
){
fileType
=
QywxMediaTypeEnum
.
FILE
;
url
=
old
.
getLink
();
}
JSONResponse
jp
=
qywxSuiteApiService
.
uploadMedia
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
getFileByte
(
url
),
fileType
.
getCode
());
if
(
jp
.
getErrorCode
()
==
0
){
old
.
setWxLastUploadTime
(
new
Date
());
old
.
setMediaId
(
jp
.
getResult
().
toString
());
materialService
.
edit
(
old
);
}
return
old
.
getMediaId
();
}
@Override
public
Page
<
MaterialDTO
>
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
return
PageUtil
.
changePageHelperToCurrentPage
(
materialService
.
listMaterial
(
wxEnterpriseId
,
keyword
,
categoryId
,
materialType
),
MaterialDTO
.
class
);
com
.
github
.
pagehelper
.
Page
<
TabHaobanMaterial
>
page
=
materialService
.
listMaterial
(
wxEnterpriseId
,
keyword
,
categoryId
,
materialType
);
return
PageUtil
.
changePageHelperToCurrentPage
(
page
,
MaterialDTO
.
class
);
}
public
static
void
main
(
String
[]
args
)
{
String
str
=
"{errcode=0, errmsg=ok, media_id=3ymUzyvUwcIohAXb1lbrL-6Fa-yD3njQpgFCYrEDUHpDaja_ZThd-6XW95NEVjY1l, created_at=1589335350, type=image}"
;
JSON
.
parseObject
(
str
);
}
private
byte
[]
getFileByte
(
String
url
)
{
private
static
byte
[]
getFileByte
(
String
url
)
{
try
{
InputStream
in
=
new
URL
(
url
).
openStream
();
byte
[]
data
=
IOUtils
.
toByteArray
(
in
);
return
data
;
}
catch
(
Exception
e
){
logger
.
info
(
"【异常】"
+
e
.
getMessage
(),
e
);
}
return
null
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
32cf4f7c
...
...
@@ -6,7 +6,12 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.wechat.api.dto.qywx.QywxIinkExternalMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxImageExternalMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxTextExternalMessageDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.github.pagehelper.PageHelper
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -20,21 +25,28 @@ import org.apache.logging.log4j.Logger;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.MD5Utils
;
import
com.gic.commons.util.Md5Util
;
import
com.gic.commons.util.StringUtil
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.contacts.manage.api.dto.SearchDataDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.dto.MemberStoreDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.MaterialApiService
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
...
...
@@ -109,6 +121,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private
StoreService
storeService
;
@Autowired
private
Config
config
;
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
private
MaterialApiService
materialApiService
;
@Override
public
List
<
MemberStoreDTO
>
listByExTernalUseridAndWxUserId
(
String
externalUserid
,
String
wxUserId
)
{
...
...
@@ -658,4 +674,66 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
memberUnionRelatedService
.
clean
(
null
);
}
}
@Override
public
Page
<
MemberUnionidRelatedDTO
>
pageMemberUnionByParams
(
List
<
String
>
userIdList
,
List
<
String
>
sendMemberIds
,
String
enterpriseId
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
return
PageUtil
.
changePageHelperToCurrentPage
(
memberUnionRelatedService
.
pageMemberUnionByParams
(
userIdList
,
sendMemberIds
,
enterpriseId
),
MemberUnionidRelatedDTO
.
class
);
}
@Override
public
String
sendMessage
(
String
wxEnterpriseId
,
String
userId
,
List
<
String
>
extendUserList
,
String
materialId
){
WxEnterpriseDTO
enterprise
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
MaterialDTO
material
=
materialApiService
.
selectMaterialById
(
materialId
);
if
(
material
==
null
){
return
""
;
}
JSONResponse
jp
=
null
;
if
(
material
.
getMaterialType
()
==
2
||
material
.
getMaterialType
()
==
4
||
material
.
getMaterialType
()
==
5
){
Date
wxLastTime
=
material
.
getWxLastUploadTime
();
String
maerialId
=
material
.
getMaterialId
();
if
(
DateUtil
.
addDay
(
wxLastTime
,
3
).
getTime
()
<
System
.
currentTimeMillis
()){
maerialId
=
materialApiService
.
reUpdalodMetail
(
materialId
);
}
QywxImageExternalMessageDTO
dto
=
new
QywxImageExternalMessageDTO
();
dto
.
setMediaId
(
maerialId
);
dto
.
setChatType
(
"single"
);
dto
.
setExternalUserid
(
extendUserList
);
dto
.
setSenderUserId
(
userId
);
log
.
info
(
"【发送消息】dto = {}"
,
JSON
.
toJSONString
(
dto
));
jp
=
qywxSuiteApiService
.
sendExternalMessage
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
dto
);
}
else
if
(
material
.
getMaterialType
()
==
1
){
QywxTextExternalMessageDTO
dto
=
new
QywxTextExternalMessageDTO
();
dto
.
setChatType
(
"single"
);
dto
.
setExternalUserid
(
extendUserList
);
dto
.
setSenderUserId
(
userId
);
dto
.
setText
(
material
.
getMaterialContent
());
log
.
info
(
"【发送消息】dto = {}"
,
JSON
.
toJSONString
(
dto
));
jp
=
qywxSuiteApiService
.
sendExternalMessage
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
dto
);
}
else
if
(
material
.
getMaterialType
()
==
3
){
QywxIinkExternalMessageDTO
dto
=
new
QywxIinkExternalMessageDTO
();
dto
.
setChatType
(
"single"
);
dto
.
setExternalUserid
(
extendUserList
);
dto
.
setSenderUserId
(
userId
);
dto
.
setDesc
(
material
.
getMaterialDesc
());
dto
.
setPicurl
(
material
.
getImgUrl
());
dto
.
setTitle
(
material
.
getMaterialTitle
());
dto
.
setUrl
(
material
.
getLink
());
log
.
info
(
"【发送消息】dto = {}"
,
JSON
.
toJSONString
(
dto
));
jp
=
qywxSuiteApiService
.
sendExternalMessage
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
dto
);
}
log
.
info
(
"【发送消息】jp = {}"
,
JSON
.
toJSONString
(
jp
));
String
josnStr
=
jp
.
getReturnMap
().
toString
();
JSONObject
json
=
JSONObject
.
parseObject
(
josnStr
);
return
json
.
getString
(
"msgid"
);
}
@Override
public
JSONResponse
getMessageStatus
(
String
wxEnterpriseId
,
String
wxMessageId
)
{
WxEnterpriseDTO
enterprise
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
enterprise
==
null
){
return
null
;
}
JSONResponse
jp
=
qywxSuiteApiService
.
resultExternalMessage
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
wxMessageId
);
return
jp
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
32cf4f7c
...
...
@@ -1226,6 +1226,18 @@ public class StaffApiServiceImpl implements StaffApiService {
List
<
TabHaobanStaff
>
list
=
staffMapper
.
listByWxUserId
(
wxUserId
);
return
EntityUtil
.
changeEntityListByJSON
(
StaffDTO
.
class
,
list
);
}
@Override
public
List
<
String
>
listBindClerkUserId
(
String
storeId
)
{
TabHaobanDepartment
department
=
departmentService
.
selectByRelatedId
(
storeId
);
if
(
department
==
null
){
return
Collections
.
EMPTY_LIST
;
}
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentId
(
department
.
getDepartmentId
());
List
<
String
>
userIdList
=
list
.
stream
().
filter
(
s
->
s
.
getClerkCode
()!=
null
).
map
(
s
->
s
.
getWxUserId
()).
collect
(
Collectors
.
toList
());
return
userIdList
;
}
// private String getMobile(String phoneNumber,String nationcode){
// String mobile = nationcode + phoneNumber;
...
...
haoban-manage3-service/src/main/resources/mapper/MemberUnionidRelatedMapper.xml
View file @
32cf4f7c
...
...
@@ -250,4 +250,20 @@
and external_name = #{externalName}
and add_create_time = #{addCreateTime}
</select>
<select
id=
"pageMemberUnionByParams"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_member_unionid_related
where enterprise_id = #{enterpriseId}
and status_flag = 1
and member_id in
<foreach
item=
"memberId"
index=
"index"
collection=
"sendMemberIds"
open=
"("
separator=
","
close=
")"
>
#{memberId, jdbcType=CHAR}
</foreach>
and wx_user_id in
<foreach
item=
"wxUserId"
index=
"index"
collection=
"userIdList"
open=
"("
separator=
","
close=
")"
>
#{wxUserId, jdbcType=CHAR}
</foreach>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanMaterialMapper.xml
View file @
32cf4f7c
...
...
@@ -7,7 +7,7 @@
<result
column=
"material_type"
property=
"materialType"
jdbcType=
"INTEGER"
/>
<result
column=
"category_id"
property=
"categoryId"
jdbcType=
"VARCHAR"
/>
<result
column=
"material_content"
property=
"materialContent"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_last_upload_time"
property=
"wxLastUploadTime"
jdbcType=
"
VARCHAR
"
/>
<result
column=
"wx_last_upload_time"
property=
"wxLastUploadTime"
jdbcType=
"
TIMESTAMP
"
/>
<result
column=
"media_id"
property=
"mediaId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
...
...
@@ -42,7 +42,7 @@
status_flag, link, create_time,
update_time)
values (#{materialId,jdbcType=VARCHAR}, #{materialTitle,jdbcType=VARCHAR}, #{materialType,jdbcType=INTEGER},
#{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=
VARCHAR
},
#{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=
TIMESTAMP
},
#{mediaId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{link,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
...
...
@@ -117,7 +117,7 @@
#{materialContent,jdbcType=VARCHAR},
</if>
<if
test=
"wxLastUploadTime != null"
>
#{wxLastUploadTime,jdbcType=
VARCHAR
},
#{wxLastUploadTime,jdbcType=
TIMESTAMP
},
</if>
<if
test=
"mediaId != null"
>
#{mediaId,jdbcType=VARCHAR},
...
...
@@ -167,7 +167,7 @@
material_content = #{materialContent,jdbcType=VARCHAR},
</if>
<if
test=
"wxLastUploadTime != null"
>
wx_last_upload_time = #{wxLastUploadTime,jdbcType=
VARCHAR
},
wx_last_upload_time = #{wxLastUploadTime,jdbcType=
TIMESTAMP
},
</if>
<if
test=
"mediaId != null"
>
media_id = #{mediaId,jdbcType=VARCHAR},
...
...
@@ -208,7 +208,7 @@
material_type = #{materialType,jdbcType=INTEGER},
category_id = #{categoryId,jdbcType=VARCHAR},
material_content = #{materialContent,jdbcType=VARCHAR},
wx_last_upload_time = #{wxLastUploadTime,jdbcType=
VARCHAR
},
wx_last_upload_time = #{wxLastUploadTime,jdbcType=
TIMESTAMP
},
media_id = #{mediaId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
staff_id = #{staffId,jdbcType=VARCHAR},
...
...
@@ -235,6 +235,15 @@
<include
refid=
"Base_Column_List"
/>
from tab_haoban_material
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
<if
test=
"keyword != null and keyword != ''"
>
and keyword like CONCAT('%',#{keyWord},'%')
</if>
<if
test=
"materialType != null"
>
and material_type = #{materialType}
</if>
<if
test=
"categoryId != null"
>
and category_id = #{categoryId}
</if>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/MaterialController.java
View file @
32cf4f7c
...
...
@@ -94,7 +94,7 @@ public class MaterialController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10016
);
}
List
<
MaterialDTO
>
list
=
materialApiService
.
listMaterialByCategoryId
(
categoryId
);
if
(!
list
.
isEmpty
()){
if
(
list
!=
null
&&
!
list
.
isEmpty
()){
return
resultResponse
(
HaoBanErrCode
.
ERR_10017
);
}
dto
.
setStatusFlag
(
0
);
...
...
@@ -142,7 +142,7 @@ public class MaterialController extends WebBaseController{
* 素材修改
* @return
*/
@RequestMapping
(
"/material-e
id
t"
)
@RequestMapping
(
"/material-e
di
t"
)
public
HaobanResponse
materialEdit
(
MaterialDTO
materialDTO
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/UploadController.java
0 → 100644
View file @
32cf4f7c
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.io.File
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.HashSet
;
import
java.util.Set
;
import
org.apache.commons.io.FileUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.qcloud.BucketNameEnum
;
import
com.gic.qcloud.FileUploadUtil
;
@RestController
public
class
UploadController
extends
WebBaseController
{
private
static
Set
<
String
>
FILE_TYPE
=
new
HashSet
<>(
);
static
{
for
(
BucketNameEnum
value:
BucketNameEnum
.
values
()){
FILE_TYPE
.
add
(
value
.
getName
()
);
}
}
@RequestMapping
(
"/upload-file"
)
@ResponseBody
public
HaobanResponse
upload
(
@RequestParam
MultipartFile
file
,
@RequestParam
String
fileType
)
throws
Exception
{
if
(
file
==
null
||
file
.
isEmpty
()){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
String
name
=
file
.
getOriginalFilename
();
String
suffix
=
name
.
substring
(
name
.
lastIndexOf
(
"."
)
+
1
);
String
location
=
System
.
getProperty
(
"user.dir"
)+
"/data/tmp/"
;
//b
long
len
=
file
.
getSize
();
File
templateFile
=
new
File
(
location
+
name
);
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
templateFile
);
// 2.上传腾讯云
String
dayFilePath
=
LocalDateTime
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
DateUtil
.
FORMAT_DATETIME_14
)
);
String
key
=
"haoban/"
+
dayFilePath
+
"/"
+
name
;
fileType
=
FILE_TYPE
.
contains
(
fileType
)?
fileType:
BucketNameEnum
.
OTHER_90000
.
getName
();
String
url
=
FileUploadUtil
.
simpleUploadFileFromLocal
(
templateFile
,
key
,
fileType
);
if
(
templateFile
!=
null
){
templateFile
.
delete
();
}
JSONObject
res
=
new
JSONObject
(
);
res
.
put
(
"name"
,
name
);
res
.
put
(
"ext"
,
suffix
);
res
.
put
(
"size"
,
len
);
res
.
put
(
"key"
,
key
);
res
.
put
(
"url"
,
"https://"
+
url
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
res
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
32cf4f7c
...
...
@@ -313,5 +313,22 @@ public class WxEnterpriseController extends WebBaseController{
}
//企业信息
@RequestMapping
(
"enterprise-is-over"
)
public
HaobanResponse
enterpriseIsOver
(
String
enterpriseId
)
{
if
(
StringUtils
.
isEmpty
(
enterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseByEid
(
enterpriseId
);
if
(
enterprise
==
null
||
enterprise
.
getExpireTime
()
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
if
(
enterprise
.
getExpireTime
().
getTime
()
>
System
.
currentTimeMillis
()){
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/init/MyApplicationContextAware.java
View file @
32cf4f7c
package
com
.
gic
.
haoban
.
manage
.
web
.
init
;
import
com.gic.dict.api.dto.GlobalDictMap
;
import
com.gic.dict.api.service.ManagerDictService
;
import
com.gic.quartz.api.dto.QuartzTaskDTO
;
import
com.gic.quartz.api.service.QuartzService
;
...
...
@@ -18,12 +16,28 @@ public class MyApplicationContextAware implements ApplicationContextAware {
private
Logger
log
=
LogManager
.
getLogger
(
MyApplicationContextAware
.
class
);
private
static
ApplicationContext
applicationContext
;
@Autowired
private
QuartzService
quartzService
;
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
// TODO Auto-generated method stub
QuartzTaskDTO
taskDTO
=
buildQuartzMessageDTO
(
"haoban-message-status-time"
);
taskDTO
.
setTaskParam
(
""
);
taskDTO
.
setTaskStatus
(
1
);
taskDTO
.
setTaskTimeInfo
(
"0 30 0 * * *"
);
// taskDTO.setTaskTimeInfo("0 0/1 * * * *");
quartzService
.
addOrUpdateQuartzTask
(
taskDTO
);
}
private
QuartzTaskDTO
buildQuartzMessageDTO
(
String
id
)
{
QuartzTaskDTO
taskDTO
=
new
QuartzTaskDTO
();
taskDTO
.
setReferId
(
id
);
taskDTO
.
setTaskMethod
(
"quartzUpdateMessageStatus"
);
taskDTO
.
setTaskService
(
"com.gic.haoban.app.customer.service.api.service.messageLogApiService"
);
return
taskDTO
;
}
}
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
32cf4f7c
...
...
@@ -60,5 +60,7 @@
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.DealSyncOperationApiService"
id=
"dealSyncOperationApiService"
/>
<dubbo:reference
id=
"quartzService"
interface=
"com.gic.quartz.api.service.QuartzService"
timeout=
"10000"
/>
</beans>
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/MaterialController.java
View file @
32cf4f7c
...
...
@@ -5,14 +5,19 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.PageResult2
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.MaterialCategoryDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.service.MaterialApiService
;
...
...
@@ -22,6 +27,8 @@ import com.gic.haoban.manage.web.vo.MaterialVO;
@RestController
public
class
MaterialController
extends
WebBaseController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MaterialController
.
class
);
@Autowired
private
MaterialApiService
materialApiService
;
/**
...
...
@@ -31,7 +38,9 @@ public class MaterialController extends WebBaseController{
@RequestMapping
(
"/material-list"
)
public
HaobanResponse
materialList
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
,
BasePageInfo
pageInfo
)
{
Page
<
MaterialDTO
>
page
=
materialApiService
.
listMaterial
(
wxEnterpriseId
,
keyword
,
categoryId
,
materialType
,
pageInfo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
//暂时转换
PageResult2
pageResult2
=
PageUtil
.
getPageInfo
(
page
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageResult2
);
}
/**
...
...
@@ -42,6 +51,12 @@ public class MaterialController extends WebBaseController{
public
HaobanResponse
materialType
(
String
wxEnterpriseId
)
{
List
<
MaterialCategoryDTO
>
list
=
materialApiService
.
listCategory
(
wxEnterpriseId
);
List
<
MaterialVO
>
handerList
=
new
ArrayList
<
MaterialVO
>();
MaterialVO
vo
=
new
MaterialVO
();
vo
.
setCategoryId
(
"-1"
);
vo
.
setCategoryName
(
"未分组"
);
vo
.
setCategoryParentId
(
"0"
);
vo
.
setWxEnterpriseId
(
wxEnterpriseId
);
handerList
.
add
(
vo
);
for
(
MaterialCategoryDTO
materialCategoryDTO
:
list
)
{
if
(
"0"
.
equals
(
materialCategoryDTO
.
getCategoryParentId
())){
handerList
.
add
(
EntityUtil
.
changeEntityByJSON
(
MaterialVO
.
class
,
materialCategoryDTO
));
...
...
@@ -54,12 +69,13 @@ public class MaterialController extends WebBaseController{
private
void
handerSonMaterial
(
List
<
MaterialVO
>
handerList
,
Map
<
String
,
List
<
MaterialCategoryDTO
>>
map
){
for
(
MaterialVO
materialVO
:
handerList
)
{
List
<
MaterialCategoryDTO
>
sonList
=
map
.
get
(
materialVO
.
getCategory
Parent
Id
());
List
<
MaterialCategoryDTO
>
sonList
=
map
.
get
(
materialVO
.
getCategoryId
());
List
<
MaterialVO
>
sonVoList
=
EntityUtil
.
changeEntityListByJSON
(
MaterialVO
.
class
,
sonList
);
materialVO
.
setList
(
sonVoList
);
while
(
sonList
!=
null
){
handerSonMaterial
(
sonVoList
,
map
);
}
// logger.info("map={},handerList={},categoryId={},sonVoList={}",JSON.toJSONString(map),JSON.toJSONString(handerList),materialVO.getCategoryId(),JSON.toJSONString(sonVoList));
// while(sonVoList != null && sonVoList.size() > 0){
// handerSonMaterial(sonVoList, map);
// }
}
}
...
...
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
32cf4f7c
...
...
@@ -52,5 +52,9 @@
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.MaidianLogApiService"
id=
"maidianLogApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService"
id=
"staffMemberRelationApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.MaterialApiService"
id=
"materialApiService"
/>
</beans>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment