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
918fe75a
Commit
918fe75a
authored
Nov 15, 2023
by
王祖波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-content5' into 'test_branch'
Feature content5 See merge request
!1518
parents
8959930e
ee3d4f0b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
10 deletions
+85
-10
MaterialServiceImpl.java
...oban/manage/service/service/impl/MaterialServiceImpl.java
+13
-5
ContentAccountController.java
...nage/web/controller/content/ContentAccountController.java
+27
-5
ClerkStoreAdaptor.java
...age/web/controller/content/adaptor/ClerkStoreAdaptor.java
+22
-0
AccountInfoQo.java
...c/haoban/manage/web/qo/content/account/AccountInfoQo.java
+23
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/MaterialServiceImpl.java
View file @
918fe75a
...
...
@@ -2,12 +2,10 @@ package com.gic.haoban.manage.service.service.impl;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.gic.commons.util.HttpClient
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.slf4j.Logger
;
...
...
@@ -222,8 +220,18 @@ public class MaterialServiceImpl implements MaterialService {
if
(
url
.
contains
(
"?"
))
{
logger
.
info
(
"url有参数={}"
,
url
);
url
=
url
.
split
(
"\\?"
)[
0
]
;
url
+=
"?imageView2/2/w/1440/h/1080"
;
}
else
{
String
imageInfoUrl
=
url
+
"?imageInfo"
;
Map
<
String
,
Object
>
map
=
HttpClient
.
getHttpByGet
(
imageInfoUrl
);
String
width
=
(
String
)
map
.
get
(
"width"
);
String
height
=
(
String
)
map
.
get
(
"height"
);
String
size
=
(
String
)
map
.
get
(
"size"
);
//图片宽高超过限制 或 大小大于1m 处理图片
if
(
Integer
.
parseInt
(
size
)
/
1000
>
1000
||
Integer
.
parseInt
(
width
)
>
1440
||
Integer
.
parseInt
(
height
)
>
1080
)
{
url
+=
"?imageView2/2/w/1440/h/1080"
;
}
}
url
+=
"?imageView2/2/w/1440/h/1080"
;
logger
.
info
(
"url={}"
,
url
);
}
jp
=
qywxSuiteApiService
.
uploadAttachment
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
url
,
arr
[
count
-
1
],
fileType
.
getCode
()
,
selfFlag
,
qwDTO
.
getUrlHost
());
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentAccountController.java
View file @
918fe75a
...
...
@@ -13,6 +13,8 @@ import com.gic.content.api.qdto.account.AccountGenerateQrCodeQDTO;
import
com.gic.content.api.qdto.account.AccountScanQrCodeResultQDTO
;
import
com.gic.content.api.qdto.account.ContentAccountQDTO
;
import
com.gic.content.api.service.ContentAccountApiService
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor
;
import
com.gic.haoban.manage.web.qo.content.account.AccountGenerateQrCodeQo
;
import
com.gic.haoban.manage.web.qo.content.account.AccountInfoQo
;
...
...
@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -55,15 +58,34 @@ public class ContentAccountController {
@RequestMapping
(
path
=
"/list"
)
private
RestResponse
<
List
<
ContentAccountInfoVo
>>
queryAccountList
(
AccountInfoQo
accountInfoQo
)
{
ClerkDTO
clerkDTO
=
clerkStoreAdaptor
.
queryClerkInfo
(
accountInfoQo
.
getEnterpriseId
(),
accountInfoQo
.
getClerkId
());
if
(
clerkDTO
==
null
)
{
return
RestResponse
.
successResult
(
Collections
.
emptyList
());
// 查询成员
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
clerkStoreAdaptor
.
queryStaffClerkRelationInfo
(
accountInfoQo
.
getEnterpriseId
(),
accountInfoQo
.
getStaffId
());
if
(
CollectionUtils
.
isEmpty
(
staffClerkRelationDTOS
))
{
return
RestResponse
.
successResult
();
}
List
<
String
>
clerkIds
=
staffClerkRelationDTOS
.
stream
()
.
map
(
StaffClerkRelationDTO:
:
getClerkId
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
List
<
String
>
storeIds
=
new
ArrayList
<>();
List
<
String
>
clerkCodes
=
new
ArrayList
<>();
List
<
ClerkDTO
>
clerkDTOS
=
clerkStoreAdaptor
.
queryClerkInfos
(
clerkIds
);
if
(
CollectionUtils
.
isEmpty
(
clerkDTOS
))
{
return
RestResponse
.
successResult
();
}
for
(
ClerkDTO
clerkDTO
:
clerkDTOS
)
{
clerkCodes
.
add
(
clerkDTO
.
getClerkCode
());
if
(
new
Integer
(
1
).
equals
(
clerkDTO
.
getClerkType
()))
{
storeIds
.
add
(
clerkDTO
.
getStoreId
());
}
}
ContentAccountQDTO
contentAccountQDTO
=
new
ContentAccountQDTO
();
contentAccountQDTO
.
setEnterpriseId
(
accountInfoQo
.
getEnterpriseId
());
contentAccountQDTO
.
setQueryForClerk
(
Boolean
.
TRUE
);
contentAccountQDTO
.
setUserCodes
(
Collections
.
singletonList
(
clerkDTO
.
getClerkCode
())
);
contentAccountQDTO
.
setStoreIds
(
Collections
.
singletonList
(
clerkDTO
.
getStoreId
())
);
contentAccountQDTO
.
setUserCodes
(
clerkCodes
);
contentAccountQDTO
.
setStoreIds
(
storeIds
);
ServiceResponse
<
Page
<
ContentAccountInfoDTO
>>
serviceResponse
=
contentAccountApiService
.
queryAccountList
(
contentAccountQDTO
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getResult
()))
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/adaptor/ClerkStoreAdaptor.java
View file @
918fe75a
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller.content.adaptor;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.role.StoreRoleDTO
;
...
...
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.List
;
/**
...
...
@@ -81,4 +83,24 @@ public class ClerkStoreAdaptor {
return
clerkService
.
getClerkByClerkId
(
clerkId
);
}
public
List
<
StaffClerkRelationDTO
>
queryStaffClerkRelationInfo
(
String
enterpriseId
,
String
staffId
)
{
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationApiService
.
listBindCodeByStaffId
(
Collections
.
singletonList
(
enterpriseId
),
staffId
);
if
(
CollectionUtils
.
isEmpty
(
staffClerkRelationDTOS
))
{
return
Collections
.
emptyList
();
}
return
staffClerkRelationDTOS
;
}
public
List
<
ClerkDTO
>
queryClerkInfos
(
List
<
String
>
clerkIds
)
{
if
(
CollectionUtils
.
isEmpty
(
clerkIds
))
{
return
Collections
.
emptyList
();
}
List
<
ClerkDTO
>
clerkDTOS
=
clerkService
.
getClerkByClerkIds
(
new
HashSet
<>(
clerkIds
));
if
(
CollectionUtils
.
isEmpty
(
clerkDTOS
))
{
return
Collections
.
emptyList
();
}
return
clerkDTOS
;
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/content/account/AccountInfoQo.java
View file @
918fe75a
...
...
@@ -24,6 +24,13 @@ public class AccountInfoQo implements Serializable {
*/
private
String
storeId
;
/**
* 成员id
*/
private
String
staffId
;
private
String
wxEnterpriseId
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
...
...
@@ -47,4 +54,20 @@ public class AccountInfoQo implements Serializable {
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
}
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