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
9c537e00
Commit
9c537e00
authored
Apr 01, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
Developer See merge request
!19
parents
1346891d
a2e879fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
1205 additions
and
152 deletions
+1205
-152
AuditDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/AuditDTO.java
+21
-1
QywxCallBackDTO.java
...n/java/com/gic/haoban/manage/api/dto/QywxCallBackDTO.java
+12
-0
WxEnterpriseDTO.java
...n/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
+21
-1
ApplicationApiService.java
.../gic/haoban/manage/api/service/ApplicationApiService.java
+1
-1
ApplicationSettingApiService.java
...oban/manage/api/service/ApplicationSettingApiService.java
+3
-0
AuditApiService.java
...va/com/gic/haoban/manage/api/service/AuditApiService.java
+3
-3
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+9
-1
DictApiService.java
...ava/com/gic/haoban/manage/api/service/DictApiService.java
+1
-1
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
DictController.java
.../com/gic/haoban/manage/web/controller/DictController.java
+7
-1
EnterpriseController.java
...ic/haoban/manage/web/controller/EnterpriseController.java
+16
-7
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+2
-0
EnterpriseDetailVo.java
...java/com/gic/haoban/manage/web/vo/EnterpriseDetailVo.java
+8
-0
ApplicationMapper.java
...c/haoban/manage/service/dao/mapper/ApplicationMapper.java
+6
-0
ApplicationSettingMapper.java
...n/manage/service/dao/mapper/ApplicationSettingMapper.java
+5
-0
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+3
-0
DictMapper.java
.../com/gic/haoban/manage/service/dao/mapper/DictMapper.java
+5
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+3
-0
TabHaobanAuditMapper.java
...aoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
+8
-2
WxEnterpriseRelatedMapper.java
.../manage/service/dao/mapper/WxEnterpriseRelatedMapper.java
+4
-1
TabHaobanWxEnterprise.java
...c/haoban/manage/service/entity/TabHaobanWxEnterprise.java
+10
-0
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+2
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+4
-1
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+5
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+8
-0
ApplicationApiServiceImpl.java
...e/service/service/out/impl/ApplicationApiServiceImpl.java
+16
-1
ApplicationSettingApiServiceImpl.java
...ce/service/out/impl/ApplicationSettingApiServiceImpl.java
+14
-0
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+59
-23
AuditSettingApiServiceImpl.java
.../service/service/out/impl/AuditSettingApiServiceImpl.java
+4
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+20
-0
DictApiServiceImpl.java
...n/manage/service/service/out/impl/DictApiServiceImpl.java
+12
-3
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+0
-0
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+16
-2
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+32
-2
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+2
-1
EmojiFilterUtil.java
...a/com/gic/haoban/manage/service/util/EmojiFilterUtil.java
+77
-0
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+3
-0
ApplicationMapper.xml
...3-service/src/main/resources/mapper/ApplicationMapper.xml
+14
-0
ApplicationSettingMapper.xml
...ce/src/main/resources/mapper/ApplicationSettingMapper.xml
+20
-6
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+17
-2
DictMapper.xml
...-manage3-service/src/main/resources/mapper/DictMapper.xml
+17
-1
MemberUnionidRelatedMapper.xml
.../src/main/resources/mapper/MemberUnionidRelatedMapper.xml
+1
-0
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+16
-1
TabHaobanAuditMapper.xml
...ervice/src/main/resources/mapper/TabHaobanAuditMapper.xml
+45
-4
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+2
-0
pom.xml
haoban-manage3-web/pom.xml
+5
-0
AuthRequestUtil.java
.../java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
+14
-0
AdminController.java
...com/gic/haoban/manage/web/controller/AdminController.java
+88
-0
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+33
-0
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+86
-10
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+1
-11
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+3
-1
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+48
-2
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+2
-0
AdminRoleVO.java
...c/main/java/com/gic/haoban/manage/web/vo/AdminRoleVO.java
+39
-0
AdminVO.java
...b/src/main/java/com/gic/haoban/manage/web/vo/AdminVO.java
+40
-0
DepartmentVO.java
.../main/java/com/gic/haoban/manage/web/vo/DepartmentVO.java
+10
-0
StaffVO.java
...b/src/main/java/com/gic/haoban/manage/web/vo/StaffVO.java
+65
-0
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+1
-0
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+22
-1
InfoController.java
.../com/gic/haoban/manage/web/controller/InfoController.java
+129
-57
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+19
-4
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+1
-0
MemberLoginQo.java
...main/java/com/gic/haoban/manage/web/qo/MemberLoginQo.java
+41
-0
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+2
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/AuditDTO.java
View file @
9c537e00
...
...
@@ -18,6 +18,8 @@ public class AuditDTO implements Serializable {
private
String
commitStoreId
;
private
String
commitStoreName
;
private
String
changeField
;
private
String
oldValue
;
...
...
@@ -40,9 +42,27 @@ public class AuditDTO implements Serializable {
private
Integer
statusFlag
;
private
String
detail
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getAuditId
()
{
public
String
getCommitStoreName
()
{
return
commitStoreName
;
}
public
void
setCommitStoreName
(
String
commitStoreName
)
{
this
.
commitStoreName
=
commitStoreName
;
}
public
String
getDetail
()
{
return
detail
;
}
public
void
setDetail
(
String
detail
)
{
this
.
detail
=
detail
;
}
public
String
getAuditId
()
{
return
auditId
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/QywxCallBackDTO.java
View file @
9c537e00
...
...
@@ -27,9 +27,18 @@ public class QywxCallBackDTO implements Serializable{
private
String
departmentName
;
private
Integer
parentId
;
private
Integer
order
;
private
String
avatar
;
//头像
/**部门创建:create_party;部门修改:update_party;部门删除:delete_party*
* 成员创建:create_user;成员修改:update_user;成员删除:delete_user*/
private
String
changeType
;
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
public
String
getSuiteId
()
{
return
suiteId
;
...
...
@@ -190,4 +199,7 @@ public class QywxCallBackDTO implements Serializable{
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
View file @
9c537e00
...
...
@@ -59,13 +59,33 @@ public class WxEnterpriseDTO implements Serializable {
private
String
wxSecretKey
;
private
String
memberSecret
;
private
Date
createTime
;
private
Date
updateTime
;
//小程序版本
private
String
smallVersion
;
public
String
getMemberSecret
()
{
return
memberSecret
;
}
public
void
setMemberSecret
(
String
memberSecret
)
{
this
.
memberSecret
=
memberSecret
;
}
private
static
final
long
serialVersionUID
=
1L
;
public
String
getWxEnterpriseId
()
{
public
String
getSmallVersion
()
{
return
smallVersion
;
}
public
void
setSmallVersion
(
String
smallVersion
)
{
this
.
smallVersion
=
smallVersion
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ApplicationApiService.java
View file @
9c537e00
...
...
@@ -8,6 +8,6 @@ public interface ApplicationApiService {
List
<
ApplicationDTO
>
listApplication
();
List
<
ApplicationDTO
>
listByApplications
(
List
<
String
>
applicationIds
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ApplicationSettingApiService.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.ApplicationSettingDTO
;
/**
...
...
@@ -11,4 +13,5 @@ public interface ApplicationSettingApiService {
ApplicationSettingDTO
findSettingByWxEnterpriseIdAndApplicationId
(
String
wxEnterpriseId
,
String
applicationId
);
List
<
ApplicationSettingDTO
>
listOpenByWxEnterpriseIdAndApplicationIds
(
String
wxEnterpriseId
,
List
<
String
>
applicationIds
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/AuditApiService.java
View file @
9c537e00
...
...
@@ -12,11 +12,11 @@ import com.gic.haoban.manage.api.dto.AuditDTO;
*/
public
interface
AuditApiService
{
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
,
BasePageInfo
pageInfo
);
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
,
Integer
auditFlag
,
BasePageInfo
pageInfo
);
void
audit
(
String
auditId
);
void
audit
(
String
auditId
,
String
aduitName
);
void
refuse
(
String
auditId
,
String
auditReason
);
void
refuse
(
String
auditId
,
String
auditReason
,
String
aduitName
);
int
save
(
Integer
auditType
,
String
wxEnterpriseId
,
String
enterpriseId
,
String
commitStaffId
,
String
commitStoreId
,
String
changeField
,
String
oldValue
,
String
newValue
);
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
9c537e00
...
...
@@ -150,5 +150,13 @@ public interface DepartmentApiService {
* @param departmentId
*/
ServiceResponse
gicDel
(
String
departmentId
);
/**
* 查门店/部门列表
*
* @param
* @return
*/
ServiceResponse
<
List
<
DepartmentDTO
>>
listStoreListByStaffId
(
String
wxUserId
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DictApiService.java
View file @
9c537e00
...
...
@@ -10,7 +10,7 @@ import java.util.List;
* Created by tgs on 2020/2/9.
*/
public
interface
DictApiService
{
void
saveDict
(
DictDTO
dto
);
int
saveDict
(
DictDTO
dto
);
DictDTO
findOneDict
(
String
dictId
);
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
9c537e00
...
...
@@ -58,4 +58,6 @@ public interface StaffApiService {
public
int
countByDepartmentIds
(
List
<
String
>
departmentIds
);
public
List
<
StaffDTO
>
listByPhoneNumber
(
String
phoneNumber
);
public
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
);
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/DictController.java
View file @
9c537e00
...
...
@@ -29,7 +29,13 @@ public class DictController extends WebBaseController{
//保存字典
@RequestMapping
(
"save-dict"
)
public
HaobanResponse
saveDict
(
DictDTO
dto
)
{
dictApiService
.
saveDict
(
dto
);
int
i
=
dictApiService
.
saveDict
(
dto
);
if
(
i
==
8
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
if
(
i
==
9
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10007
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//查看字典详情
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/EnterpriseController.java
View file @
9c537e00
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -11,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -56,13 +58,18 @@ public class EnterpriseController extends WebBaseController{
//企业列表
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
(
BasePageInfo
pageInfo
,
String
keyword
,
String
gicEnterpriseName
,
Integer
gicContactHelper
,
String
version
)
{
List
<
EnterpriseDTO
>
enterpriseNames
=
enterpriseService
.
getEnterpriseByName
(
gicEnterpriseName
);
List
<
String
>
wxEnterpriseIds
=
new
ArrayList
<
String
>();
if
(
CollectionUtil
.
isNotEmpty
(
enterpriseNames
)){
List
<
String
>
enterpriseIds
=
enterpriseNames
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDetailDTO
>
wxEnterpriseIdDTOs
=
wxEnterpriseRelatedApiService
.
listEnterpriseByEnterpriseIds
(
enterpriseIds
);
if
(
CollectionUtil
.
isNotEmpty
(
wxEnterpriseIdDTOs
)){
wxEnterpriseIds
=
wxEnterpriseIdDTOs
.
stream
().
map
(
s
->
s
.
getWxEnterpriseId
()).
collect
(
Collectors
.
toList
());
if
(!
StringUtils
.
isEmpty
(
gicEnterpriseName
)){
List
<
EnterpriseDTO
>
enterpriseNames
=
enterpriseService
.
getEnterpriseByName
(
gicEnterpriseName
);
if
(
CollectionUtil
.
isNotEmpty
(
enterpriseNames
)){
List
<
String
>
enterpriseIds
=
enterpriseNames
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDetailDTO
>
wxEnterpriseIdDTOs
=
wxEnterpriseRelatedApiService
.
listEnterpriseByEnterpriseIds
(
enterpriseIds
);
if
(
CollectionUtil
.
isNotEmpty
(
wxEnterpriseIdDTOs
)){
wxEnterpriseIds
=
wxEnterpriseIdDTOs
.
stream
().
map
(
s
->
s
.
getWxEnterpriseId
()).
collect
(
Collectors
.
toList
());
}
}
if
(
CollectionUtil
.
isEmpty
(
wxEnterpriseIds
)){
wxEnterpriseIds
=
Arrays
.
asList
(
"-9999"
);
}
}
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
wxEnterpriseIds
,
gicContactHelper
,
version
);
...
...
@@ -97,7 +104,9 @@ public class EnterpriseController extends WebBaseController{
List
<
DepartmentDTO
>
countList
=
departmentApiService
.
listByRelatedIds
(
storeIds
);
vo
.
setStoreCount
(
countList
.
size
());
}
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
vo
.
getEnterpriseId
());
vo
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
vo
.
setEnterpriseLogo
(
enterpriseDTO
.
getQcloudImageUrl
());
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
result
);
}
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
9c537e00
...
...
@@ -67,6 +67,8 @@ public enum HaoBanErrCode {
ERR_10004
(
10004
,
"成员名称不能为空"
),
ERR_10005
(
10005
,
"成员已存在"
),
ERR_10006
(
10006
,
"字典key已存在"
),
ERR_10007
(
10007
,
"字典名称已存在"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/vo/EnterpriseDetailVo.java
View file @
9c537e00
...
...
@@ -14,7 +14,15 @@ public class EnterpriseDetailVo implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
String
enterpriseId
;
private
String
enterpriseName
;
private
String
EnterpriseLogo
;
private
Integer
storeCount
=
0
;
public
String
getEnterpriseLogo
()
{
return
EnterpriseLogo
;
}
public
void
setEnterpriseLogo
(
String
enterpriseLogo
)
{
EnterpriseLogo
=
enterpriseLogo
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/ApplicationMapper.java
View file @
9c537e00
...
...
@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.dao.mapper;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.TabHaobanApplication
;
public
interface
ApplicationMapper
{
...
...
@@ -18,4 +20,7 @@ public interface ApplicationMapper {
int
updateByPrimaryKey
(
TabHaobanApplication
record
);
List
<
TabHaobanApplication
>
listApplication
();
List
<
TabHaobanApplication
>
listByApplicationIds
(
@Param
(
"applicationIds"
)
List
<
String
>
applicationIds
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/ApplicationSettingMapper.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.TabHaobanApplicationSetting
;
...
...
@@ -20,4 +22,6 @@ public interface ApplicationSettingMapper {
void
saveSetting
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"applicationId"
)
String
applicationId
,
@Param
(
"openFlag"
)
int
openFlag
);
TabHaobanApplicationSetting
findSetting
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"applicationId"
)
String
applicationId
);
List
<
TabHaobanApplicationSetting
>
listOpenByWxEnterpriseIdAndApplicationIds
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"applicationIds"
)
List
<
String
>
applicationIds
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
9c537e00
...
...
@@ -60,4 +60,6 @@ public interface DepartmentMapper {
int
countByDepartment
(
@Param
(
"departmentId"
)
String
departmentId
);
TabHaobanDepartment
getByRelatedIdNotInRecycle
(
@Param
(
"relatedId"
)
String
relatedId
);
List
<
TabHaobanDepartment
>
listByIds
(
@Param
(
"departmentIds"
)
List
<
String
>
departmentIds
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DictMapper.java
View file @
9c537e00
...
...
@@ -23,4 +23,8 @@ public interface DictMapper {
List
<
TabHaobanDict
>
queryList
(
@Param
(
"keys"
)
List
<
String
>
keys
);
TabHaobanDict
selectByDictKey
(
String
dictKey
);
TabHaobanDict
selectByDictName
(
String
dictKey
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
9c537e00
...
...
@@ -34,4 +34,6 @@ public interface StaffMapper {
TabHaobanStaff
selectSuperByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanStaff
>
listByPhoneNumber
(
@Param
(
"phoneNumber"
)
String
phoneNumber
);
List
<
TabHaobanStaff
>
listByUserIdsAndWxEnterpriseId
(
@Param
(
"userIds"
)
List
<
String
>
userIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
View file @
9c537e00
...
...
@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.dao.mapper;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.TabHaobanAudit
;
import
com.github.pagehelper.Page
;
...
...
@@ -18,9 +20,12 @@ public interface TabHaobanAuditMapper {
int
updateByPrimaryKey
(
TabHaobanAudit
record
);
Page
<
TabHaobanAudit
>
page
(
Integer
auditType
,
List
<
String
>
storeIds
,
List
<
String
>
staffIds
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
);
Page
<
TabHaobanAudit
>
page
(
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"storeIds"
)
List
<
String
>
storeIds
,
@Param
(
"staffIds"
)
List
<
String
>
staffIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"auditStatus"
)
Integer
auditStatus
,
@Param
(
"auditFlag"
)
Integer
auditFlag
);
Page
<
TabHaobanAudit
>
pageForStoreIdsAndstaffIds
(
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"storeIds"
)
List
<
String
>
storeIds
,
@Param
(
"staffIds"
)
List
<
String
>
staffIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"auditStatus"
)
Integer
auditStatus
,
@Param
(
"auditFlag"
)
Integer
auditFlag
);
List
<
TabHaobanAudit
>
listByStoreId
(
String
storeId
);
TabHaobanAudit
findByStoreIdAndChangeField
(
String
storeId
,
String
changeField
);
TabHaobanAudit
findByStoreIdAndChangeField
(
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"changeField"
)
String
changeField
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseRelatedMapper.java
View file @
9c537e00
...
...
@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.dao.mapper;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
public
interface
WxEnterpriseRelatedMapper
{
...
...
@@ -23,6 +25,6 @@ public interface WxEnterpriseRelatedMapper {
List
<
TabHaobanWxEnterpriseRelated
>
queryAllHasGicEnterpriseId
();
List
<
TabHaobanWxEnterpriseRelated
>
listEnterpriseByEnterpriseIds
(
List
<
String
>
enterpriseIds
);
List
<
TabHaobanWxEnterpriseRelated
>
listEnterpriseByEnterpriseIds
(
@Param
(
"enterpriseIds"
)
List
<
String
>
enterpriseIds
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxEnterprise.java
View file @
9c537e00
...
...
@@ -58,12 +58,22 @@ public class TabHaobanWxEnterprise implements Serializable {
private
String
wxSecretKey
;
private
String
memberSecret
;
private
Date
createTime
;
private
Date
updateTime
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getMemberSecret
()
{
return
memberSecret
;
}
public
void
setMemberSecret
(
String
memberSecret
)
{
this
.
memberSecret
=
memberSecret
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
9c537e00
...
...
@@ -44,4 +44,6 @@ public interface DepartmentService {
DepartmentDTO
getByRelatedIdNotInRecycle
(
String
relatedId
);
List
<
DepartmentDTO
>
listByIds
(
List
<
String
>
departmentIds
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
java.util.List
;
import
java.util.Set
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.github.pagehelper.Page
;
public
interface
StaffService
{
...
...
@@ -22,4 +23,6 @@ public interface StaffService {
TabHaobanStaff
selectByUserIdAndEnterpriseId
(
String
userId
,
String
wxEnterpriseId
);
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
9c537e00
...
...
@@ -164,4 +164,9 @@ public class DepartmentServiceImpl implements DepartmentService {
return
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
mapper
.
getByRelatedIdNotInRecycle
(
relatedId
));
}
@Override
public
List
<
DepartmentDTO
>
listByIds
(
List
<
String
>
departmentIds
)
{
return
EntityUtil
.
changeEntityListByJSON
(
DepartmentDTO
.
class
,
mapper
.
listByIds
(
departmentIds
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.service.StaffService
;
...
...
@@ -71,4 +74,9 @@ public class StaffServiceImpl implements StaffService {
return
this
.
mapper
.
updateByPrimaryKeySelective
(
staff
);
}
@Override
public
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
)
{
return
EntityUtil
.
changeEntityListByJSON
(
StaffDTO
.
class
,
this
.
mapper
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ApplicationApiServiceImpl.java
View file @
9c537e00
...
...
@@ -4,11 +4,15 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.manage.api.dto.ApplicationDTO
;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
import
com.gic.haoban.manage.service.dao.mapper.ApplicationMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanApplication
;
import
com.gic.haoban.manage.service.service.ApplicationService
;
import
org.springframework.stereotype.Service
;
@Service
...
...
@@ -16,11 +20,22 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
@Autowired
private
ApplicationService
applicationService
;
@Autowired
private
ApplicationMapper
applicationMapper
;
@Override
public
List
<
ApplicationDTO
>
listApplication
()
{
List
<
TabHaobanApplication
>
list
=
applicationService
.
listApplication
();
return
EntityUtil
.
changeEntityListByJSON
(
ApplicationDTO
.
class
,
list
);
}
@Override
public
List
<
ApplicationDTO
>
listByApplications
(
List
<
String
>
applicationIds
)
{
List
<
TabHaobanApplication
>
list
=
applicationMapper
.
listByApplicationIds
(
applicationIds
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
null
;
}
List
<
ApplicationDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
ApplicationDTO
.
class
,
list
);
return
result
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ApplicationSettingApiServiceImpl.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.ApplicationSettingDTO
;
...
...
@@ -48,4 +51,15 @@ public class ApplicationSettingApiServiceImpl implements ApplicationSettingApiSe
ApplicationSettingDTO
dto
=
EntityUtil
.
changeEntity
(
ApplicationSettingDTO
.
class
,
tab
);
return
dto
;
}
@Override
public
List
<
ApplicationSettingDTO
>
listOpenByWxEnterpriseIdAndApplicationIds
(
String
wxEnterpriseId
,
List
<
String
>
applicationIds
)
{
List
<
TabHaobanApplicationSetting
>
list
=
applicationSettingMapper
.
listOpenByWxEnterpriseIdAndApplicationIds
(
wxEnterpriseId
,
applicationIds
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
null
;
}
List
<
ApplicationSettingDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
ApplicationSettingDTO
.
class
,
list
);
return
result
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
9c537e00
...
...
@@ -3,8 +3,10 @@ package com.gic.haoban.manage.service.service.out.impl;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -20,6 +22,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDetailDTO
;
import
com.gic.enterprise.api.dto.StorePhotoDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
...
@@ -55,26 +58,46 @@ public class AuditApiServiceImpl implements AuditApiService{
@Override
public
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
,
BasePageInfo
pageInfo
)
{
String
enterpriseId
,
Integer
auditStatus
,
Integer
auditFlag
,
BasePageInfo
pageInfo
)
{
List
<
String
>
storeIds
=
new
ArrayList
<>();
List
<
String
>
staffIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
search
)){
List
<
TabHaobanDepartment
>
storeList
=
departmentMapper
.
listStoreLikeName
(
search
);
if
(
CollectionUtil
.
isNotEmpty
(
storeList
)){
storeIds
=
storeList
.
stream
().
map
(
s
->
s
.
getRelatedId
()).
collect
(
Collectors
.
toList
());
}
else
{
storeIds
=
Arrays
.
asList
(
"-999"
);
}
List
<
TabHaobanStaff
>
staffList
=
staffMapper
.
listLikeName
(
search
);
if
(
CollectionUtil
.
isNotEmpty
(
staffList
)){
staffIds
=
staffList
.
stream
().
map
(
s
->
s
.
getStaffId
()).
collect
(
Collectors
.
toList
());
}
else
{
staffIds
=
Arrays
.
asList
(
"-999"
);
}
}
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>
page
=
auditMapper
.
page
(
auditType
,
storeIds
,
staffIds
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
);
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>
page
=
new
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>();
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
)&&
CollectionUtil
.
isNotEmpty
(
staffIds
)){
page
=
auditMapper
.
pageForStoreIdsAndstaffIds
(
auditType
,
storeIds
,
staffIds
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
,
auditFlag
);
}
else
{
page
=
auditMapper
.
page
(
auditType
,
storeIds
,
staffIds
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
,
auditFlag
);
}
// List<TabHaobanAudit> list = page.getResult();
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getResult
())){
List
<
String
>
commitStaffIds
=
page
.
getResult
().
stream
().
map
(
s
->
s
.
getCommitStaffId
()).
collect
(
Collectors
.
toList
());
List
<
TabHaobanStaff
>
staffList
=
staffMapper
.
listByIds
(
commitStaffIds
);
Map
<
String
,
TabHaobanStaff
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
staffList
,
"staffId"
);
for
(
TabHaobanAudit
tab:
page
.
getResult
()){
String
commitStaffId
=
tab
.
getCommitStaffId
();
map
.
get
(
commitStaffId
).
getStaffName
();
tab
.
setCommitStaffName
(
map
.
get
(
commitStaffId
)==
null
?
""
:
map
.
get
(
commitStaffId
).
getStaffName
());
}
}
return
PageUtil
.
changePageHelperToCurrentPage
(
page
,
AuditDTO
.
class
);
}
@Transactional
@Override
public
void
audit
(
String
auditId
)
{
public
void
audit
(
String
auditId
,
String
auditName
)
{
TabHaobanAudit
tab
=
auditMapper
.
selectByPrimaryKey
(
auditId
);
if
(
tab
==
null
){
return
;
...
...
@@ -82,6 +105,7 @@ public class AuditApiServiceImpl implements AuditApiService{
tab
.
setAuditId
(
auditId
);
tab
.
setAuditStatus
(
1
);
tab
.
setUpdateTime
(
new
Date
());
tab
.
setAuditName
(
auditName
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
String
storeId
=
tab
.
getCommitStoreId
();
String
oldValue
=
tab
.
getOldValue
();
...
...
@@ -90,12 +114,13 @@ public class AuditApiServiceImpl implements AuditApiService{
this
.
editStoreInfo
(
storeId
,
changeField
,
oldValue
,
newValue
);
}
@Override
public
void
refuse
(
String
auditId
,
String
auditReason
)
{
public
void
refuse
(
String
auditId
,
String
auditReason
,
String
auditName
)
{
TabHaobanAudit
tab
=
new
TabHaobanAudit
();
tab
.
setAuditId
(
auditId
);
tab
.
setAuditStatus
(
0
);
tab
.
setAuditStatus
(
2
);
tab
.
setUpdateTime
(
new
Date
());
tab
.
setAuditReason
(
auditReason
);
tab
.
setAuditName
(
auditName
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
}
@Override
...
...
@@ -134,15 +159,22 @@ public class AuditApiServiceImpl implements AuditApiService{
if
(!
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
//非门店图片修改
logger
.
info
(
"===================进222"
);
getStoreDTO
(
store
,
changeField
,
oldValue
,
newValue
);
storeService
.
saveOrUpdateStore
(
store
);
StoreDetailDTO
detailDTO
=
new
StoreDetailDTO
();
detailDTO
.
setStoreId
(
storeId
);
detailDTO
.
setEnterpriseId
(
store
.
getEnterpriseId
());
detailDTO
.
setStatus
(
2
);
getStoreDTO
(
detailDTO
,
changeField
,
oldValue
,
newValue
);
logger
.
info
(
"detailDTO====================>为{}"
,
JSONObject
.
toJSONString
(
detailDTO
));
storeService
.
saveStore
(
detailDTO
);
// storeService.saveOrUpdateStore(store);
}
else
{
//门店图片修改
logger
.
info
(
"===================进333"
);
storeService
.
updateStorePhotos
(
storeId
,
newValue
);
}
}
void
getStoreDTO
(
StoreDTO
store
,
String
changeField
,
String
oldValue
,
String
newValue
){
void
getStoreDTO
(
StoreD
etailD
TO
store
,
String
changeField
,
String
oldValue
,
String
newValue
){
logger
.
info
(
"==========================>changeField={}"
,
changeField
);
if
(
StoreFieldEnum
.
BUSINESS_TIME_STRING
.
getValue
().
equals
(
changeField
)){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
...
...
@@ -150,20 +182,20 @@ public class AuditApiServiceImpl implements AuditApiService{
String
[]
newValues
=
newValue
.
split
(
"-"
);
String
openTime
=
newValues
[
0
];
String
closeTime
=
newValues
[
1
];
Date
date1
=
null
;
Date
date2
=
null
;
try
{
date1
=
sdf
.
parse
(
openTime
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
try
{
date2
=
sdf
.
parse
(
closeTime
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
store
.
setOpenTime
(
date1
);
store
.
setCloseTime
(
date2
);
//
Date date1 = null;
//
Date date2 = null;
//
try {
//
date1 = sdf.parse(openTime);
//
} catch (ParseException e) {
//
e.printStackTrace();
//
}
//
try {
//
date2 = sdf.parse(closeTime);
//
} catch (ParseException e) {
//
e.printStackTrace();
//
}
store
.
setOpenTime
(
openTime
);
store
.
setCloseTime
(
closeTime
);
}
else
if
(
StoreFieldEnum
.
CONACTS_PHONE
.
getValue
().
equals
(
changeField
)){
//联系电话
store
.
setConactsPhone
(
newValue
);
...
...
@@ -177,13 +209,17 @@ public class AuditApiServiceImpl implements AuditApiService{
String
arr
[]
=
storeAddress
.
split
(
" "
);
store
.
setAreaId
(
areaId
);
store
.
setFullArea
(
arr
[
0
]);
store
.
setStoreAddress
(
arr
[
1
]);
//避免多个空格造成数据混乱
store
.
setStoreAddress
(
storeAddress
.
substring
(
storeAddress
.
indexOf
(
arr
[
0
])+
arr
[
0
].
length
()+
1
));
}
else
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
changeField
)){
//门店面积
store
.
setStoreArea
(
Double
.
parseDouble
(
newValue
));
}
else
if
(
StoreFieldEnum
.
STORE_NAME
.
getValue
().
equals
(
changeField
)){
//门店名字
store
.
setStoreName
(
newValue
);
TabHaobanDepartment
tab
=
departmentMapper
.
getByRelatedId
(
store
.
getStoreId
());
tab
.
setDepartmentName
(
newValue
);
departmentMapper
.
updateByPrimaryKey
(
tab
);
}
else
if
(
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
//门店图片
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditSettingApiServiceImpl.java
View file @
9c537e00
...
...
@@ -32,6 +32,10 @@ public class AuditSettingApiServiceImpl implements AuditSettingApiService{
tab
.
setStatusFlag
(
1
);
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
auditSettingMapper
.
insert
(
tab
);
}
else
{
tab
.
setAuditFlag
(
auditFlag
);
tab
.
setUpdateTime
(
new
Date
());
auditSettingMapper
.
updateByPrimaryKeySelective
(
tab
);
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
9c537e00
...
...
@@ -4,13 +4,16 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -70,6 +73,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
private
StoreGroupService
storeGroupService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Override
...
...
@@ -661,4 +667,18 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
ServiceResponse
<
List
<
DepartmentDTO
>>
listStoreListByStaffId
(
String
staffId
)
{
ServiceResponse
<
List
<
DepartmentDTO
>>
rer
=
new
ServiceResponse
<
List
<
DepartmentDTO
>>();
List
<
StaffDepartmentRelatedDTO
>
relateList
=
staffDepartmentRelatedApiService
.
listByStaffId
(
staffId
);
if
(
CollectionUtils
.
isEmpty
(
relateList
))
{
logger
.
info
(
"没有部分显示:{}"
,
staffId
);
return
rer
;
}
List
<
String
>
departmentIds
=
relateList
.
stream
().
map
(
dto
->
dto
.
getDepartmentId
()).
collect
(
Collectors
.
toList
());
List
<
DepartmentDTO
>
departmentList
=
listByDepartmentIds
(
departmentIds
,
1
);
rer
.
setResult
(
departmentList
);
return
rer
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DictApiServiceImpl.java
View file @
9c537e00
...
...
@@ -26,16 +26,25 @@ public class DictApiServiceImpl implements DictApiService{
@Autowired
private
DictMapper
dictMapper
;
@Override
public
void
saveDict
(
DictDTO
dto
)
{
public
int
saveDict
(
DictDTO
dto
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getDictId
())){
//空,则新增
dto
.
setDictId
(
UuidUtil
.
randomUUID
());
TabHaobanDict
tab
=
EntityUtil
.
changeEntity
(
TabHaobanDict
.
class
,
dto
);
dictMapper
.
insert
(
tab
);
TabHaobanDict
tab1
=
dictMapper
.
selectByDictKey
(
dto
.
getDictKey
());
if
(
tab1
!=
null
){
return
8
;
}
TabHaobanDict
tab2
=
dictMapper
.
selectByDictName
(
dto
.
getDictName
());
if
(
tab2
!=
null
){
return
9
;
}
dictMapper
.
insert
(
tab
);
}
else
{
TabHaobanDict
tab
=
EntityUtil
.
changeEntity
(
TabHaobanDict
.
class
,
dto
);
dictMapper
.
updateByPrimaryKeySelective
(
tab
);
}
}
return
1
;
}
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
9c537e00
This diff is collapsed.
Click to expand it.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
9c537e00
...
...
@@ -95,8 +95,20 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"【部门同步】dto={}"
,
JSON
.
toJSONString
(
dto
));
DepartmentDTO
parentDepartment
=
this
.
getParentDepartment
(
dto
.
getParentChain
(),
dto
.
getType
(),
enterprise
.
getWxEnterpriseId
());
if
(
parentDepartment
==
null
&&
(
dto
.
getChangeType
()
==
GicEditType
.
ADD
.
getCode
()
||
dto
.
getChangeType
()
==
GicEditType
.
UPDATE
.
getCode
())){
log
.
info
(
"【部门同步】父部门为空"
);
return
;
if
(
dto
.
getChangeType
()
==
GicEditType
.
UPDATE
.
getCode
()){
String
departmentId
=
dto
.
getId
();
DepartmentDTO
exsit
=
departmentApiService
.
selectByRelatedId
(
departmentId
);
if
(
exsit
==
null
){
log
.
info
(
"【部门同步】父部门为空"
);
return
;
}
else
{
parentDepartment
=
departmentApiService
.
selectById
(
exsit
.
getParentDepartmentId
());
}
}
if
(
parentDepartment
==
null
){
log
.
info
(
"【部门同步】父部门为空"
);
return
;
}
}
if
(
parentDepartment
!=
null
){
departmentDTO
.
setParentDepartmentId
(
parentDepartment
.
getDepartmentId
());
...
...
@@ -193,6 +205,7 @@ public class MessageApiServiceImpl implements MessageApiService {
String
response
=
this
.
departmentService
.
add
(
departmentDTO
);
log
.
info
(
"微信同步新增部门:{}"
,
JSON
.
toJSONString
(
response
));
}
else
{
departmentDTO
.
setIsStore
(
department
.
getIsStore
());
departmentDTO
.
setDepartmentId
(
department
.
getDepartmentId
());
this
.
departmentService
.
edit
(
departmentDTO
);
log
.
info
(
"企业微信更新同步完成"
);
...
...
@@ -224,6 +237,7 @@ public class MessageApiServiceImpl implements MessageApiService {
staff
.
setStaffName
(
qywxCallBackDTO
.
getUserName
());
staff
.
setWxUserId
(
qywxCallBackDTO
.
getUserid
());
staff
.
setPostion
(
qywxCallBackDTO
.
getPosition
());
staff
.
setHeadImg
(
qywxCallBackDTO
.
getAvatar
());
staff
.
setNationCode
(
"86"
);
//激活状态
if
(
qywxCallBackDTO
.
getStatus
()
!=
null
&&
qywxCallBackDTO
.
getStatus
()
==
1
){
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
9c537e00
...
...
@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.haoban.manage.api.dto.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.hibernate.hql.internal.CollectionSubqueryFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -447,10 +448,15 @@ public class StaffApiServiceImpl implements StaffApiService {
}
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByCodeNoStatus
(
enterpriseId
,
related
.
getClerkCode
());
//if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getStaffName().equals(clerkDTO.getStaffName())){
if
(
clerkDTO
!=
null
&&
(!
clerkDTO
.
getClerkName
().
equals
(
staffName
)
||
!
staffDTO
.
getPhoneNumber
().
equals
(
clerkDTO
.
getPhoneNumber
()))){
String
headPic
=
staffDTO
.
getHeadImg
();
if
(
clerkDTO
!=
null
&&
(!
clerkDTO
.
getClerkName
().
equals
(
staffName
)
||
!
staffDTO
.
getPhoneNumber
().
equals
(
clerkDTO
.
getPhoneNumber
()))
||
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
headPic
)
&&
!
headPic
.
equals
(
clerkDTO
.
getImageUrl
()))
||
!
staffDTO
.
getSex
().
equals
(
clerkDTO
.
getClerkGender
())){
logger
.
info
(
"【员工修改】clerkDTO={}"
,
JSON
.
toJSONString
(
clerkDTO
));
clerkDTO
.
setClerkName
(
staffDTO
.
getStaffName
());
clerkDTO
.
setPhoneNumber
(
staffDTO
.
getPhoneNumber
());
clerkDTO
.
setHeadImgUrl
(
staffDTO
.
getHeadImg
());
clerkDTO
.
setClerkGender
(
staffDTO
.
getSex
().
toString
());
clerkService
.
updateClerk
(
clerkDTO
);
}
//}
...
...
@@ -637,7 +643,10 @@ public class StaffApiServiceImpl implements StaffApiService {
String
nationcode
=
clerkDTO
.
getNationcode
();
Integer
sex
=
clerkDTO
.
getClerkGender
();
String
headPic
=
clerkDTO
.
getHeadImgUrl
();
Integer
status
=
1
;
Integer
status
=
clerkDTO
.
getStatus
();
if
(
status
==
null
){
status
=
1
;
}
String
postion
=
clerkDTO
.
getPostionName
();
String
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
...
...
@@ -691,10 +700,12 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
else
{
String
staffId
=
staff
.
getStaffId
();
logger
.
info
(
"【员工修改】staff={},status={}"
,
JSON
.
toJSONString
(
staff
),
status
);
//删除
if
(
status
==
0
){
StaffDepartmentRelatedDTO
staffRelated
=
this
.
getDepartmentIdAndStaffId
(
departmentId
,
staffId
);
if
(
staffRelated
!=
null
){
staffRelated
.
setUpdateTime
(
new
Date
());
staffRelated
.
setClerkCode
(
null
);
staffDepartmentRelatedMapper
.
updateByPrimaryKey
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
staffRelated
));
}
...
...
@@ -724,11 +735,13 @@ public class StaffApiServiceImpl implements StaffApiService {
StaffDepartmentRelatedDTO
isCodeExist
=
this
.
getDepartmentIdAndCode
(
departmentId
,
code
);
//如果这个人已经绑定了 先解绑
if
(
isCodeExist
!=
null
){
staffRelated
.
setUpdateTime
(
new
Date
());
isCodeExist
.
setClerkCode
(
null
);
staffDepartmentRelatedMapper
.
updateByPrimaryKey
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
isCodeExist
));
}
//如果这个人是未绑定的 则绑定clerk
if
(
staffRelated
!=
null
){
staffRelated
.
setUpdateTime
(
new
Date
());
staffRelated
.
setClerkCode
(
code
);
staffDepartmentRelatedMapper
.
updateByPrimaryKey
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
staffRelated
));
}
...
...
@@ -792,6 +805,23 @@ public class StaffApiServiceImpl implements StaffApiService {
}
return
staffDepartmentRelatedMapper
.
countByDepartmentIds
(
departmentIds
);
}
@Override
public
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
)
{
List
<
StaffDTO
>
list
=
staffService
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
);
if
(
list
==
null
){
return
Collections
.
EMPTY_LIST
;
}
for
(
StaffDTO
staffDTO
:
list
)
{
List
<
String
>
departmentIds
=
new
ArrayList
<>();
List
<
TabHaobanStaffDepartmentRelated
>
relatedList
=
staffDepartmentRelatedService
.
listStaffDepartmentByStaffId
(
staffDTO
.
getStaffId
());
for
(
TabHaobanStaffDepartmentRelated
tabHaobanStaffDepartmentRelated
:
relatedList
)
{
departmentIds
.
add
(
tabHaobanStaffDepartmentRelated
.
getDepartmentId
());
}
List
<
DepartmentDTO
>
departmentList
=
departmentService
.
listByIds
(
departmentIds
);
staffDTO
.
setDepartmentList
(
departmentList
);
}
return
list
;
}
// private String getMobile(String phoneNumber,String nationcode){
// String mobile = nationcode + phoneNumber;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
9c537e00
...
...
@@ -9,7 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.GicTreeDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
...
...
@@ -29,7 +31,6 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
private
WxEnterpriseRelatedMapper
wxEnterpriseRelatedMapper
;
@Autowired
private
WxEnterpriseRelatedService
wxEnterpriseRelatedService
;
@Autowired
private
StoreGroupService
storeGroupService
;
@Autowired
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/EmojiFilterUtil.java
0 → 100644
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
com.gic.commons.util.StringUtil
;
public
class
EmojiFilterUtil
{
/**
* @param isPharse 是否是短语 若是短语则 超过20字符编程*
*/
public
static
String
filterEmojiLast
(
String
content
,
boolean
isPhrase
)
{
byte
[]
conbyte
=
content
.
getBytes
();
for
(
int
i
=
0
;
i
<
conbyte
.
length
;
i
++)
{
if
((
conbyte
[
i
]
&
0xF8
)
==
0xF0
)
{
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
conbyte
[
i
+
j
]
=
0x30
;
}
i
+=
3
;
}
}
content
=
new
String
(
conbyte
);
return
filterEmoji
(
content
.
replaceAll
(
"0000"
,
""
),
isPhrase
);
}
private
static
String
filterEmoji
(
String
source
,
boolean
isPhrase
)
{
if
(!
containsEmoji
(
source
))
{
return
source
;
// 如果不包含,直接返回
}
// 到这里铁定包含
StringBuilder
buf
=
null
;
int
len
=
source
.
length
();
if
(
len
>
20
&&
isPhrase
)
{
return
"*"
;
}
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
codePoint
=
source
.
charAt
(
i
);
if
(
isEmojiCharacter
(
codePoint
))
{
if
(
buf
==
null
)
{
buf
=
new
StringBuilder
(
source
.
length
());
}
buf
.
append
(
codePoint
);
}
}
if
(
buf
==
null
)
{
return
source
;
// 如果没有找到 emoji表情,则返回源字符串
}
else
{
if
(
buf
.
length
()
==
len
)
{
// 这里的意义在于尽可能少的toString,因为会重新生成字符串
buf
=
null
;
return
source
;
}
else
{
return
buf
.
toString
();
}
}
}
private
static
boolean
isEmojiCharacter
(
char
codePoint
)
{
return
(
codePoint
==
0x0
)
||
(
codePoint
==
0x9
)
||
(
codePoint
==
0xA
)
||
(
codePoint
==
0xD
)
||
((
codePoint
>=
0x20
)
&&
(
codePoint
<=
0xD7FF
))
||
((
codePoint
>=
0xE000
)
&&
(
codePoint
<=
0xFFFD
))
||
((
codePoint
>=
0x10000
)
&&
(
codePoint
<=
0x10FFFF
));
}
// 判断表情符
private
static
boolean
containsEmoji
(
String
source
)
{
if
(
StringUtil
.
isBlank
(
source
))
{
return
false
;
}
source
=
source
.
replaceAll
(
"[\\ud800\\udc00-\\udbff\\udfff\\ud800-\\udfff]"
,
"*"
);
int
len
=
source
.
length
();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
codePoint
=
source
.
charAt
(
i
);
if
(
isEmojiCharacter
(
codePoint
))
{
// do nothing,判断到了这里表明,确认有表情字符
return
true
;
}
}
return
false
;
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
9c537e00
...
...
@@ -49,5 +49,7 @@
<dubbo:reference
interface=
"com.gic.enterprise.api.service.StoreService"
id=
"storeService"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.MemberOpenCardBusinessService"
id=
"memberOpenCardBusinessService"
/>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/ApplicationMapper.xml
View file @
9c537e00
...
...
@@ -145,4 +145,17 @@
from tab_haoban_application
where status_flag = 1
</select>
<select
id=
"listByApplicationIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_application
where status_flag = 1
<if
test=
"applicationIds != null and applicationIds.size() > 0"
>
and application_id IN
<foreach
collection=
"applicationIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/ApplicationSettingMapper.xml
View file @
9c537e00
...
...
@@ -117,14 +117,10 @@
</update>
<update
id=
"saveSetting"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanApplicationSetting"
>
update tab_haoban_application_setting
<set
>
set update_time = NOW(),
<if
test=
"openFlag != null"
>
open_flag = #{openFlag,jdbcType=INTEGER}
,
open_flag = #{openFlag,jdbcType=INTEGER}
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and application_id = #{applicationId,jdbcType=VARCHAR}
and status_flag = 1
...
...
@@ -138,4 +134,21 @@
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</select>
<select
id=
"listOpenByWxEnterpriseIdAndApplicationIds"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_application_setting
where
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and open_flag = 1
<if
test=
"applicationIds != null and applicationIds.size() > 0"
>
and application_id IN
<foreach
collection=
"applicationIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
9c537e00
...
...
@@ -248,7 +248,7 @@
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where department_name like
contact
('%',#{departmentName,jdbcType=VARCHAR},'%')
where department_name like
CONCAT
('%',#{departmentName,jdbcType=VARCHAR},'%')
and status_flag = 1
and is_store =1
</select>
...
...
@@ -317,7 +317,7 @@
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where status_flag = 1
and is_store =
#{storeFlag,jdbcType=INTEGER}
and is_store =
1
<if
test=
"relatedIds != null and relatedIds.size() > 0"
>
and related_id IN
<foreach
collection=
"relatedIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
...
...
@@ -462,4 +462,18 @@
and status_flag = 1
and recycle_flag != 1
</select>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where status_flag = 1
<if
test=
"departmentIds != null and departmentIds.size() > 0"
>
and department_id IN
<foreach
collection=
"departmentIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
order by sort desc
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/DictMapper.xml
View file @
9c537e00
...
...
@@ -28,7 +28,7 @@
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDict"
>
insert into tab_haoban_dict (dict_id, dict_name, dict_key,
dict_title, dict_desc, dict_content,opt_user_
name,opt_user_id
,create_time,update_time
dict_title, dict_desc, dict_content,opt_user_
id,opt_user_name
,create_time,update_time
)
values (#{dictId,jdbcType=VARCHAR}, #{dictName,jdbcType=VARCHAR}, #{dictKey,jdbcType=VARCHAR},
#{dictTitle,jdbcType=VARCHAR}, #{dictDesc,jdbcType=VARCHAR}, #{dictContent,jdbcType=VARCHAR}
...
...
@@ -133,4 +133,19 @@
#{item}
</foreach>
</select>
<select
id=
"selectByDictKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_dict
where dict_key = #{dictKey,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select
id=
"selectByDictName"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_dict
where dict_name = #{dictName,jdbcType=VARCHAR}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/MemberUnionidRelatedMapper.xml
View file @
9c537e00
...
...
@@ -180,6 +180,7 @@
where wx_user_id = #{wxUserId}
and status_flag = 1
and unionid = #{unionid}
limit 1
</select>
<update
id=
"deleteByUnionidAndUserId"
parameterType=
"com.gic.haoban.manage.service.entity.MemberUnionidRelated"
>
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
9c537e00
...
...
@@ -297,7 +297,7 @@
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where status_flag = 1
and staff_name like
contact
('%',#{staffName,jdbcType=VARCHAR},'%')
and staff_name like
CONCAT
('%',#{staffName,jdbcType=VARCHAR},'%')
</select>
<select
id=
"selectByUserIdAndEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
...
...
@@ -318,4 +318,18 @@
and super_manager_flag = 1
</select>
<select
id=
"listByUserIdsAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
<if
test=
"userIds != null and userIds.size() > 0"
>
and wx_user_id IN
<foreach
collection=
"userIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanAuditMapper.xml
View file @
9c537e00
...
...
@@ -280,22 +280,63 @@
<if
test =
"wxEnterpriseId != null"
>
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</if>
<if
test =
"enterpriseId != null"
>
<if
test =
"enterpriseId != null
and enterpriseId !=''
"
>
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
</if>
<if
test =
"audit
_t
ype != null"
>
<if
test =
"audit
T
ype != null"
>
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
<if
test =
"audit
_status != null and audit_status
== 0"
>
<if
test =
"audit
Flag != null and auditFlag
== 0"
>
and audit_status = 0
</if>
<if
test =
"audit
_status != null and audit_status
!= 0"
>
<if
test =
"audit
Flag != null and auditFlag
!= 0"
>
and audit_status in (1,2)
</if>
<if
test =
"auditStatus != null"
>
and audit_status = #{auditStatus,jdbcType=INTEGER}
</if>
<include
refid=
"storeSql"
/>
<include
refid=
"staffSql"
/>
order by commit_time desc
</select>
<select
id=
"pageForStoreIdsAndstaffIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_audit
where 1=1
<if
test =
"wxEnterpriseId != null"
>
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</if>
<if
test =
"enterpriseId != null and enterpriseId !=''"
>
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
</if>
<if
test =
"auditType != null"
>
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
<if
test =
"auditFlag != null and auditFlag == 0"
>
and audit_status = 0
</if>
<if
test =
"auditFlag != null and auditFlag != 0"
>
and audit_status in (1,2)
</if>
<if
test =
"auditStatus != null"
>
and audit_status = #{auditStatus,jdbcType=INTEGER}
</if>
and ( commit_store_id in
<foreach
collection=
"storeIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
or commit_staff_id in
<foreach
collection=
"staffIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)
order by commit_time desc
</select>
<select
id=
"listByStoreId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
9c537e00
...
...
@@ -25,6 +25,7 @@
<result
column=
"square_logo_url"
property=
"squareLogoUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"round_logo_url"
property=
"roundLogoUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_secret_key"
property=
"wxSecretKey"
jdbcType=
"VARCHAR"
/>
<result
column=
"member_secret"
property=
"memberSecret"
jdbcType=
"VARCHAR"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"INTEGER"
/>
<result
column=
"contact_flag"
property=
"contactFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"bind_flag"
property=
"bindFlag"
jdbcType=
"INTEGER"
/>
...
...
@@ -37,6 +38,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key
,member_secret
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
haoban-manage3-web/pom.xml
View file @
9c537e00
...
...
@@ -68,6 +68,11 @@
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-wechat-token-api
</artifactId>
<version>
${gic-wechat-token-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-commons
</artifactId>
<version>
${gic-commons}
</version>
<exclusions>
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
View file @
9c537e00
...
...
@@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.Cookie
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
...
...
@@ -142,4 +143,17 @@ public class AuthRequestUtil {
.
getRequestAttributes
();
return
attrs
.
getResponse
();
}
public
static
Object
getLoginUser
()
{
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
String
token
=
""
;
if
(
cookies
!=
null
){
for
(
Cookie
cookie
:
cookies
)
{
if
(
cookie
.
getName
().
equals
(
"token"
)){
token
=
cookie
.
getValue
();
}
}
}
return
getAppLoginUser
(
token
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AdminController.java
0 → 100644
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
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.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxApplicationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.AdminRoleVO
;
import
com.gic.haoban.manage.web.vo.AdminVO
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
@RestController
public
class
AdminController
extends
WebBaseController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AdminController
.
class
);
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Autowired
private
WxApplicationApiService
wxApplicationApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@RequestMapping
(
"admin-list"
)
public
HaobanResponse
adminList
()
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
1
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
logger
.
info
(
"【管理员查询】corpid={},siteId={},agentId={}"
,
enterprise
.
getCorpid
(),
application
.
getSiteId
(),
application
.
getAgentId
());
String
adminList
=
qywxSuiteApiService
.
getAdminList
(
enterprise
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
application
.
getAgentId
()));
logger
.
info
(
"【管理员查询】userIds={}"
,
JSON
.
toJSONString
(
adminList
));
List
<
String
>
userIds
=
new
ArrayList
<
String
>();
if
(
StringUtils
.
isNotBlank
(
adminList
)){
JSONArray
jsonArr
=
JSON
.
parseArray
(
adminList
);
for
(
Object
object
:
jsonArr
)
{
JSONObject
json
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
));
userIds
.
add
(
json
.
getString
(
"userid"
));
}
}
List
<
StaffDTO
>
list
=
new
ArrayList
<>();
List
<
AdminVO
>
resultList
=
new
ArrayList
<>();
if
(!
userIds
.
isEmpty
()){
list
=
staffApiService
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
);
for
(
StaffDTO
staffDTO
:
list
)
{
AdminVO
vo
=
new
AdminVO
();
vo
.
setRoleId
(
staffDTO
.
getStaffId
());
vo
.
setRoleName
(
"管理员"
);
List
<
AdminRoleVO
>
roleList
=
new
ArrayList
<>();
List
<
DepartmentDTO
>
departmentList
=
staffDTO
.
getDepartmentList
();
for
(
DepartmentDTO
departmentDTO
:
departmentList
)
{
AdminRoleVO
role
=
new
AdminRoleVO
();
role
.
setDepartmentName
(
departmentDTO
.
getDepartmentName
());
role
.
setUserName
(
staffDTO
.
getStaffName
());
role
.
setUserPhone
(
staffDTO
.
getPhoneNumber
());
roleList
.
add
(
role
);
}
vo
.
setRoleUser
(
roleList
);
resultList
.
add
(
vo
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultList
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfig
;
...
...
@@ -55,6 +61,33 @@ public class ApplicationController extends WebBaseController{
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
();
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
@IgnoreLogin
@RequestMapping
(
"application-open-close-list"
)
public
HaobanResponse
applicationList
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
();
List
<
String
>
applicationIds
=
list
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
List
<
ApplicationSettingDTO
>
result
=
applicationSettingApiService
.
listOpenByWxEnterpriseIdAndApplicationIds
(
wxEnterpriseId
,
applicationIds
);
//开启
List
<
ApplicationDTO
>
openList
=
new
ArrayList
<
ApplicationDTO
>();
List
<
String
>
openApplicationIds
=
new
ArrayList
<>();
if
(
CollectionUtil
.
isNotEmpty
(
result
)){
openApplicationIds
=
result
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
openList
=
applicationApiService
.
listByApplications
(
openApplicationIds
);
}
//关闭
List
<
ApplicationDTO
>
closeList
=
new
ArrayList
<
ApplicationDTO
>();
applicationIds
.
removeAll
(
openApplicationIds
);
if
(
CollectionUtil
.
isNotEmpty
(
applicationIds
)){
closeList
=
applicationApiService
.
listByApplications
(
applicationIds
);
}
map
.
put
(
"open"
,
openList
);
map
.
put
(
"close"
,
closeList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
map
);
}
@RequestMapping
(
"open-or-close"
)
public
HaobanResponse
applicationList
(
String
wxEnterpriseId
,
String
applicationId
,
Integer
openFlag
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfig
;
import
com.gic.api.base.commons.Page
;
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.GlobalVar
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.StoreFieldEnum
;
import
com.gic.haoban.manage.api.service.ApplicationSettingApiService
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.AuditSettingApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.anno.HttpLimit
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.StaffVO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
...
...
@@ -42,7 +53,13 @@ public class AuditController extends WebBaseController{
private
AuditSettingApiService
auditSettingApiService
;
@Autowired
private
AuditApiService
auditApiService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
StoreService
storeService
;
//设置保存
@HttpLimit
@RequestMapping
(
"open-or-close"
)
public
HaobanResponse
openOrClose
(
String
wxEnterpriseId
,
Integer
auditFlag
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
)){
...
...
@@ -60,34 +77,93 @@ public class AuditController extends WebBaseController{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
auditSettingDTO
==
null
){
auditSettingDTO
=
new
AuditSettingDTO
();
auditSettingDTO
.
setAuditFlag
(
1
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
auditSettingDTO
);
}
//分页查找
@RequestMapping
(
"find-page"
)
public
HaobanResponse
findPage
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
search
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
)
{
if
(
auditStatus
==
null
){
public
HaobanResponse
findPage
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
search
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
,
Integer
auditFlag
)
{
if
(
auditFlag
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
Page
<
AuditDTO
>
page
=
auditApiService
.
page
(
auditType
,
search
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
,
pageInfo
);
Page
<
AuditDTO
>
page
=
auditApiService
.
page
(
auditType
,
search
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
,
auditFlag
,
pageInfo
);
List
<
AuditDTO
>
list
=
page
.
getResult
();
List
<
String
>
storeIds
=
list
.
stream
().
map
(
s
->
s
.
getCommitStoreId
()).
collect
(
Collectors
.
toList
());
String
[]
array
=
storeIds
.
toArray
(
new
String
[
storeIds
.
size
()]);
List
<
StoreDTO
>
stores
=
storeService
.
getStores
(
array
);
Map
<
String
,
StoreDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
stores
,
"storeId"
);
for
(
AuditDTO
dto:
list
){
String
t
=
dto
.
getChangeField
();
String
detail
=
""
;
if
(
StoreFieldEnum
.
STORE_NAME
.
getValue
().
equals
(
t
)){
detail
=
"将"
+
"门店名称"
+
"\""
+
dto
.
getOldValue
()+
"\""
+
"修改为"
+
"\""
+
dto
.
getNewValue
()+
"\""
;
}
else
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
t
)){
detail
=
"将"
+
"门店面积"
+
"\""
+
dto
.
getOldValue
()+
"\""
+
"修改为"
+
"\""
+
dto
.
getNewValue
()+
"\""
;
}
else
if
(
StoreFieldEnum
.
CONACTS_PHONE
.
getValue
().
equals
(
t
)){
detail
=
"将"
+
"联系电话"
+
"\""
+
dto
.
getOldValue
()+
"\""
+
"修改为"
+
"\""
+
dto
.
getNewValue
()+
"\""
;
}
else
if
(
StoreFieldEnum
.
BUSINESS_TIME_STRING
.
getValue
().
equals
(
t
)){
detail
=
"将"
+
"营业时间"
+
"\""
+
dto
.
getOldValue
()+
"\""
+
"修改为"
+
"\""
+
dto
.
getNewValue
()+
"\""
;
}
else
if
(
StoreFieldEnum
.
STORE_ADDRESS
.
getValue
().
equals
(
t
)){
String
oldValue
=
dto
.
getOldValue
();
String
newValue
=
dto
.
getNewValue
();
JSONObject
oldJSONObject
=
JSONObject
.
parseObject
(
oldValue
);
String
oldAddress
=
oldJSONObject
.
get
(
"storeAddress"
).
toString
();
JSONObject
newJSONObject
=
JSONObject
.
parseObject
(
newValue
);
String
newAddress
=
newJSONObject
.
get
(
"storeAddress"
).
toString
();
detail
=
"将"
+
"门店地址"
+
"\""
+
oldAddress
+
"\""
+
"修改为"
+
"\""
+
newAddress
+
"\""
;
}
else
if
(
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
t
)){
detail
=
"门店图片变更"
;
}
dto
.
setDetail
(
detail
);
String
storeName
=
map
.
get
(
dto
.
getCommitStoreId
())==
null
?
""
:
map
.
get
(
dto
.
getCommitStoreId
()).
getStoreName
();
dto
.
setCommitStoreName
(
storeName
);
}
page
.
setResult
(
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
}
//获取详情
@RequestMapping
(
"get-staff-detail"
)
public
HaobanResponse
getStaffDetail
(
String
staffId
)
{
if
(
StringUtils
.
isAnyBlank
(
staffId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
// StaffVO staffVO = new StaffVO();
// staffVO.setPhoneNumber(phoneNumber);
// staffVO.setNationCode(nationCode);
// staffVO.setPostion(postion);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
staffDTO
);
}
//审核拒绝
@HttpLimit
@RequestMapping
(
"refuse"
)
public
HaobanResponse
refuse
(
String
auditId
,
String
auditReason
)
{
if
(
StringUtils
.
isAnyBlank
(
auditId
,
auditReason
)){
public
HaobanResponse
refuse
(
String
auditId
,
String
auditReason
,
String
auditName
)
{
if
(
StringUtils
.
isAnyBlank
(
auditId
,
auditReason
,
auditName
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
auditApiService
.
refuse
(
auditId
,
auditReason
);
auditApiService
.
refuse
(
auditId
,
auditReason
,
auditName
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//审核同意
@HttpLimit
@RequestMapping
(
"audit"
)
public
HaobanResponse
audit
(
String
auditId
)
{
public
HaobanResponse
audit
(
String
auditId
,
String
auditName
)
{
if
(
StringUtils
.
isAnyBlank
(
auditId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
auditApiService
.
audit
(
auditId
);
auditApiService
.
audit
(
auditId
,
auditName
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
9c537e00
...
...
@@ -119,17 +119,7 @@ public class LoginController extends WebBaseController{
@RequestMapping
(
"get-login-info"
)
public
HaobanResponse
getLoginInfo
(){
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
String
token
=
""
;
if
(
cookies
!=
null
){
for
(
Cookie
cookie
:
cookies
)
{
if
(
cookie
.
getName
().
equals
(
"token"
)){
token
=
cookie
.
getValue
();
}
}
}
LoginVO
loginVO
=
(
LoginVO
)
AuthRequestUtil
.
getAppLoginUser
(
token
);
LoginVO
loginVO
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
9c537e00
...
...
@@ -3,6 +3,8 @@ package com.gic.haoban.manage.web.controller;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.Cookie
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -52,7 +54,7 @@ public class StaffController extends WebBaseController{
@RequestMapping
(
"staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
){
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
Sessio
nUser
();
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
Logi
nUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
staffName
=
staffDTO
.
getStaffName
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collector
;
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
;
...
...
@@ -13,7 +16,9 @@ import org.springframework.web.bind.annotation.RestController;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.enterprise.api.dto.EnterpriseAndUserDTO
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
...
...
@@ -25,20 +30,28 @@ import com.gic.haoban.common.utils.EntityUtil;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO
;
import
com.gic.haoban.manage.api.dto.WxApplicationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.anno.HttpLimit
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.StoreVo
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.token.api.dto.QywxCorpInfoDTO
;
import
com.gic.wechat.token.api.service.QywxTokenManageService
;
@RestController
public
class
WxEnterpriseController
extends
WebBaseController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
WxEnterpriseController
.
class
);
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
...
...
@@ -49,9 +62,15 @@ public class WxEnterpriseController extends WebBaseController{
private
DepartmentApiService
departmentApiService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
QywxTokenManageService
qywxTokenManageService
;
@Autowired
private
WxApplicationApiService
wxApplicationApiService
;
@Autowired
private
Config
config
;
//授权企业列表
@HttpLimit
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
()
{
...
...
@@ -67,7 +86,7 @@ public class WxEnterpriseController extends WebBaseController{
EnterpriseDTO
enterpriseDTO
=
map
.
get
(
dto
.
getEnterpriseId
());
if
(
enterpriseDTO
!=
null
){
dto
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
dto
.
setEnterpriseLogo
(
enterpriseDTO
.
getImageUrl
());
dto
.
setEnterpriseLogo
(
enterpriseDTO
.
get
Qcloud
ImageUrl
());
}
}
}
...
...
@@ -83,6 +102,33 @@ public class WxEnterpriseController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
wxEnterpriseDTO
.
setSmallVersion
(
"免费版"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
wxEnterpriseDTO
);
}
//企业信息
@IgnoreLogin
@RequestMapping
(
"wxEnterprise-refresh"
)
public
HaobanResponse
enterpriseRefresh
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isEmpty
(
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
QywxCorpInfoDTO
dto
=
qywxTokenManageService
.
getCorpInfo
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getSuiteId
());
Long
verifiedEndTime
=
dto
.
getVerifiedEndTime
();
if
(
dto
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
logger
.
info
(
"【企业同步】dto={}"
,
JSON
.
toJSONString
(
dto
));
WxEnterpriseDTO
wxDTO
=
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
dto
);
if
(
verifiedEndTime
!=
null
){
wxDTO
.
setVerifiedEndTime
(
new
Date
(
verifiedEndTime
*
1000
));
}
wxDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
wxEnterpriseApiService
.
update
(
wxDTO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
wxEnterpriseDTO
);
}
//gic企业列表
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
9c537e00
...
...
@@ -80,6 +80,8 @@ public enum HaoBanErrCode {
ERR_10009
(
10009
,
"门店不存在"
),
ERR_10010
(
10010
,
"企业微信无关联的gic企业"
),
ERR_10011
(
10011
,
"正在同步中,请等待结束再操作"
),
ERR_10012
(
10012
,
"企业微信不存在"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_OTHER
(-
999
,
"未知错误code"
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/AdminRoleVO.java
0 → 100644
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
public
class
AdminRoleVO
implements
Serializable
{
private
String
userName
;
private
String
userPhone
;
private
String
DepartmentName
;
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getUserPhone
()
{
return
userPhone
;
}
public
void
setUserPhone
(
String
userPhone
)
{
this
.
userPhone
=
userPhone
;
}
public
String
getDepartmentName
()
{
return
DepartmentName
;
}
public
void
setDepartmentName
(
String
departmentName
)
{
DepartmentName
=
departmentName
;
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/AdminVO.java
0 → 100644
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
AdminVO
implements
Serializable
{
private
String
roleId
;
private
String
roleName
;
private
List
<
AdminRoleVO
>
roleUser
;
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getRoleName
()
{
return
roleName
;
}
public
void
setRoleName
(
String
roleName
)
{
this
.
roleName
=
roleName
;
}
public
List
<
AdminRoleVO
>
getRoleUser
()
{
return
roleUser
;
}
public
void
setRoleUser
(
List
<
AdminRoleVO
>
roleUser
)
{
this
.
roleUser
=
roleUser
;
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/DepartmentVO.java
View file @
9c537e00
...
...
@@ -32,6 +32,8 @@ public class DepartmentVO implements Serializable{
private
Boolean
hasSonNode
;
private
String
enterpriseId
;
private
String
relatedCode
;
public
String
getDepartmentId
()
{
return
departmentId
;
...
...
@@ -144,6 +146,14 @@ public class DepartmentVO implements Serializable{
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getRelatedCode
()
{
return
relatedCode
;
}
public
void
setRelatedCode
(
String
relatedCode
)
{
this
.
relatedCode
=
relatedCode
;
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/StaffVO.java
0 → 100644
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
public
class
StaffVO
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
String
staffName
;
private
String
phoneNumber
;
private
String
nationCode
;
private
String
postion
;
private
String
departmentName
;
public
String
getStaffName
()
{
return
staffName
;
}
public
void
setStaffName
(
String
staffName
)
{
this
.
staffName
=
staffName
;
}
public
String
getPhoneNumber
()
{
return
phoneNumber
;
}
public
void
setPhoneNumber
(
String
phoneNumber
)
{
this
.
phoneNumber
=
phoneNumber
;
}
public
String
getNationCode
()
{
return
nationCode
;
}
public
void
setNationCode
(
String
nationCode
)
{
this
.
nationCode
=
nationCode
;
}
public
String
getPostion
()
{
return
postion
;
}
public
void
setPostion
(
String
postion
)
{
this
.
postion
=
postion
;
}
public
String
getDepartmentName
()
{
return
departmentName
;
}
public
void
setDepartmentName
(
String
departmentName
)
{
this
.
departmentName
=
departmentName
;
}
}
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
9c537e00
...
...
@@ -50,5 +50,6 @@
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.AuditSettingApiService"
id=
"auditSettingApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.DictApiService"
id=
"dictApiService"
/>
<dubbo:reference
interface=
"com.gic.wechat.token.api.service.QywxTokenManageService"
id=
"qywxTokenManageService"
/>
</beans>
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.ApplicationDTO
;
import
com.gic.haoban.manage.api.dto.ApplicationSettingDTO
;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
import
com.gic.haoban.manage.api.service.ApplicationSettingApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
@RestController
...
...
@@ -18,18 +24,33 @@ public class ApplicationController extends WebBaseController{
@Autowired
private
ApplicationApiService
applicationApiService
;
@Autowired
private
ApplicationSettingApiService
applicationSettingApiService
;
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
public
HaobanResponse
applicationList
(
String
wxEnterpriseId
)
{
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
();
List
<
String
>
applicationIds
=
list
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
List
<
ApplicationSettingDTO
>
settings
=
applicationSettingApiService
.
listOpenByWxEnterpriseIdAndApplicationIds
(
wxEnterpriseId
,
applicationIds
);
List
<
String
>
openApplicationIds
=
new
ArrayList
<
String
>();
if
(
CollectionUtil
.
isNotEmpty
(
settings
)){
openApplicationIds
=
settings
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
}
Iterator
<
ApplicationDTO
>
it
=
list
.
listIterator
();
while
(
it
.
hasNext
()){
ApplicationDTO
app
=
it
.
next
();
if
(!
openApplicationIds
.
contains
(
app
.
getApplicationId
())){
it
.
remove
();
continue
;
}
if
(
"通讯录"
.
equals
(
app
.
getApplicationName
())){
it
.
remove
();
continue
;
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/InfoController.java
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
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
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.UserLoginLogDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO
;
import
com.gic.haoban.contacts.manage.api.service.StoreService
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.
interceptor.WebInterceptor
;
import
com.gic.haoban.manage.web.
qo.MemberLoginQo
;
import
com.gic.haoban.manage.web.vo.AppStaffVo
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.haoban.manage.web.vo.StoreVO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
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
java.util.*
;
import
java.util.stream.Collectors
;
@RestController
public
class
InfoController
extends
WebBaseController
{
...
...
@@ -42,49 +42,121 @@ public class InfoController extends WebBaseController{
private
StaffApiService
staffApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
DepartmentApiService
departmentApiService
;
@Autowired
private
com
.
gic
.
enterprise
.
api
.
service
.
StoreService
storeService
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
InfoController
.
class
);
@Autowired
private
Config
config
;
@RequestMapping
(
"get-info-by-code"
)
public
HaobanResponse
getInfoByCode
(
String
code
)
{
String
userDTOJson
=
qywxCorpApiService
.
getCodeSession
(
config
.
getWxSuiteid
(),
code
);
logger
.
info
(
"userDTOJson=============>{}"
,
userDTOJson
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
if
(
user
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
String
userId
=
user
.
getUserid
();
String
corpId
=
user
.
getCorpid
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
StaffDTO
loginStaff
=
null
;
if
(
enterprise
!=
null
){
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
}
if
(
loginStaff
==
null
){
if
(
enterprise
!=
null
){
staffApiService
.
wxGetAdd
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
}
}
if
(
loginStaff
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_600001
);
}
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
InfoVo
infoVo
=
new
InfoVo
();
infoVo
.
setAccessToken
(
accesstoken
);
infoVo
.
setStaffId
(
loginStaff
.
getStaffId
());
infoVo
.
setWxEnterpriseId
(
wxEnterpriseId
);
infoVo
.
setStaffName
(
loginStaff
.
getStaffName
());
infoVo
.
setPhoneNumber
(
loginStaff
.
getPhoneNumber
());
infoVo
.
setNationcode
(
loginStaff
.
getNationCode
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
infoVo
);
}
public
HaobanResponse
getInfoByCode
(
String
code
)
{
String
userDTOJson
=
qywxCorpApiService
.
getCodeSession
(
config
.
getWxSuiteid
(),
code
);
logger
.
info
(
"userDTOJson=============>{}"
,
userDTOJson
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
if
(
user
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
String
userId
=
user
.
getUserid
();
String
corpId
=
user
.
getCorpid
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
StaffDTO
loginStaff
=
null
;
if
(
enterprise
!=
null
){
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
}
if
(
loginStaff
==
null
){
if
(
enterprise
!=
null
){
staffApiService
.
wxGetAdd
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
}
}
if
(
loginStaff
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_600001
);
}
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
InfoVo
infoVo
=
new
InfoVo
();
infoVo
.
setAccessToken
(
accesstoken
);
infoVo
.
setStaffId
(
loginStaff
.
getStaffId
());
infoVo
.
setWxEnterpriseId
(
wxEnterpriseId
);
infoVo
.
setStaffName
(
loginStaff
.
getStaffName
());
infoVo
.
setPhoneNumber
(
loginStaff
.
getPhoneNumber
());
infoVo
.
setNationcode
(
loginStaff
.
getNationCode
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
infoVo
);
}
@RequestMapping
(
"get-user-by-member-code"
)
public
HaobanResponse
getInfoByMemberCode
(
String
code
,
String
gicEnterpriseId
,
String
userId
)
{
EnterpriseDetailDTO
enterpriseDetailDTO
=
wxEnterpriseRelatedApiService
.
getByEnterpriseId
(
gicEnterpriseId
);
if
(
enterpriseDetailDTO
==
null
)
{
logger
.
info
(
"改企业没有关系好办:{}"
,
gicEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_500001
);
}
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
enterpriseDetailDTO
.
getWxEnterpriseId
());
if
(
enterpriseDetailDTO
==
null
)
{
logger
.
info
(
"改企业不存在:{}"
,
gicEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_400002
);
}
MemberLoginQo
user
=
new
MemberLoginQo
();
if
(
StringUtils
.
isBlank
(
userId
))
{
String
userDTOJson
=
qywxUserApiService
.
getUserByCode
(
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getMemberSecret
(),
code
);
logger
.
info
(
"会员微信登录信息=============>{}"
,
userDTOJson
);
user
=
JSON
.
parseObject
(
userDTOJson
,
MemberLoginQo
.
class
);
if
(
user
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
}
else
{
user
.
setUserId
(
userId
);
}
StaffDTO
staffDTO
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
user
.
getUserId
(),
enterpriseDTO
.
getWxEnterpriseId
());
if
(
staffDTO
==
null
)
{
logger
.
info
(
"成员不存在"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
ServiceResponse
<
List
<
DepartmentDTO
>>
response
=
departmentApiService
.
listStoreListByStaffId
(
staffDTO
.
getStaffId
());
List
<
DepartmentDTO
>
result
=
response
.
getResult
();
List
<
StoreVO
>
retList
=
new
ArrayList
<>();
if
(
response
.
getCode
()
==
1
&&
CollectionUtils
.
isNotEmpty
(
result
))
{
result
.
stream
().
forEach
(
dto
->
{
StoreVO
VO
=
new
StoreVO
();
VO
.
setDepartmentId
(
dto
.
getDepartmentId
());
VO
.
setStoreId
(
dto
.
getRelatedId
());
//为空,则无该值
VO
.
setStoreName
(
dto
.
getDepartmentName
());
VO
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
VO
.
setStoreImg
(
""
);
//先置空
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
dto
.
getRelatedId
()))
{
StoreDTO
storeDTO
=
storeService
.
getStore
(
dto
.
getRelatedId
());
if
(
storeDTO
!=
null
)
{
VO
.
setEnterpriseId
(
storeDTO
.
getEnterpriseId
());
VO
.
setStoreImg
(
storeDTO
.
getImageUrl
());
//先置空
}
}
VO
.
setCreateTime
(
dto
.
getCreateTime
());
retList
.
add
(
VO
);
});
user
.
setStoreList
(
retList
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
user
);
}
@RequestMapping
(
"save-user-login-log"
)
public
HaobanResponse
saveUserLoginLog
(
UserLoginLogDTO
userLoginLogDTO
)
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
9c537e00
...
...
@@ -39,6 +39,7 @@ import com.gic.haoban.manage.api.dto.AuditSettingDTO;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.enums.StoreFieldEnum
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.AuditSettingApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
...
...
@@ -179,7 +180,7 @@ public class StoreController extends WebBaseController{
HaobanDataDTO
HaobanDataDTO
=
haobanDataApiService
.
getSaleDataByDate
(
enterpriseId
,
storeId
,
date
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
HaobanDataDTO
);
}
//获取
首页销售数据
//获取
省市区
@IgnoreLogin
@RequestMapping
(
"/get-area-list"
)
public
HaobanResponse
getArea
(
Integer
type
,
String
id
)
{
...
...
@@ -239,13 +240,24 @@ public class StoreController extends WebBaseController{
if
(
StringUtils
.
isBlank
(
newValue
)){
newValue
=
""
;
}
//增加判断是否是门店面积数字合法
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
changeField
)){
try
{
Double
.
parseDouble
(
newValue
);
}
catch
(
Exception
e
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400019
);
}
}
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
String
enterpriseId
=
store
.
getEnterpriseId
();
logger
.
info
(
"==================aaaa"
);
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
logger
.
info
(
"==================bbb"
);
//默认
不
审核
int
auditFlag
=
0
;
//默认
开启
审核
int
auditFlag
=
1
;
if
(
auditSettingDTO
!=
null
){
auditFlag
=
auditSettingDTO
.
getAuditFlag
();
}
...
...
@@ -281,7 +293,7 @@ public class StoreController extends WebBaseController{
List
<
String
>
imgList
=
imgDTOList
.
stream
().
map
(
s
->
s
.
getQcloudImageUrl
()).
collect
(
Collectors
.
toList
());
vo
.
setImgList
(
imgList
);
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm
:ss
"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
if
(
vo
.
getOpenTime
()!=
null
){
vo
.
setOpenTimeStr
(
sdf
.
format
(
vo
.
getOpenTime
()));
}
...
...
@@ -297,6 +309,9 @@ public class StoreController extends WebBaseController{
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
staffDepartmentRelatedDTO
.
getWxEnterpriseId
());
vo
.
setAuditFlag
(
auditSettingDTO
==
null
?
0
:
auditSettingDTO
.
getAuditFlag
());
if
(
vo
.
getStoreArea
()
==
null
||
vo
.
getStoreArea
()==-
1
){
vo
.
setStoreArea
(-
1
d
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
9c537e00
...
...
@@ -90,6 +90,7 @@ public enum HaoBanErrCode {
ERR_400016
(
400016
,
"提交人不存在"
),
ERR_400017
(
400017
,
"成员不存在"
),
ERR_400018
(
400018
,
"已有待审核的门店字段信息提交,请等待审核完再提交"
),
ERR_400019
(
400019
,
"门店面积不合法"
),
/**
* 文件不存在
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/MemberLoginQo.java
0 → 100644
View file @
9c537e00
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
;
import
com.gic.haoban.manage.web.vo.StoreVO
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* Created 2020/4/1.
*
* @author hua
*/
public
class
MemberLoginQo
implements
Serializable
{
private
String
userId
;
private
String
corpId
;
private
List
<
StoreVO
>
storeList
;
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getCorpId
()
{
return
corpId
;
}
public
void
setCorpId
(
String
corpId
)
{
this
.
corpId
=
corpId
;
}
public
List
<
StoreVO
>
getStoreList
()
{
return
storeList
;
}
public
void
setStoreList
(
List
<
StoreVO
>
storeList
)
{
this
.
storeList
=
storeList
;
}
}
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
9c537e00
...
...
@@ -28,10 +28,12 @@
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
id=
"wxEnterpriseApiService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.StoreService"
id=
"storeService"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxCorpApiService"
id=
"qywxCorpApiService"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxUserApiService"
id=
"qywxUserApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.BindApiService"
id=
"bindApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.AuditApiService"
id=
"auditApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.AuditSettingApiService"
id=
"auditSettingApiService"
/>
<dubbo:reference
interface=
"com.gic.dict.api.service.ManagerDictService"
id=
"managerDictService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.ApplicationSettingApiService"
id=
"applicationSettingApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.communicate.api.service.valid.ValidationCodeService"
id=
"validationCodeService"
/>
...
...
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