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
e19520c8
Commit
e19520c8
authored
Jun 01, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
b398bded
e1e6e6e2
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
596 additions
and
144 deletions
+596
-144
AuditDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/AuditDTO.java
+12
-1
BatchAuditLogDTO.java
.../java/com/gic/haoban/manage/api/dto/BatchAuditLogDTO.java
+119
-0
AuditApiService.java
...va/com/gic/haoban/manage/api/service/AuditApiService.java
+4
-1
StaffClerkRelationApiService.java
...oban/manage/api/service/StaffClerkRelationApiService.java
+12
-0
MaidianDictController.java
...c/haoban/manage/web/controller/MaidianDictController.java
+2
-2
TabHaobanAuditMapper.java
...aoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
+2
-1
TabHaobanBatchAuditLogMapper.java
...nage/service/dao/mapper/TabHaobanBatchAuditLogMapper.java
+5
-0
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+10
-1
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+9
-3
AuditSettingApiServiceImpl.java
.../service/service/out/impl/AuditSettingApiServiceImpl.java
+5
-1
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+22
-1
StaffDepartmentRelatedApiServiceImpl.java
...ervice/out/impl/StaffDepartmentRelatedApiServiceImpl.java
+4
-1
TabHaobanAuditMapper.xml
...ervice/src/main/resources/mapper/TabHaobanAuditMapper.xml
+9
-1
TabHaobanBatchAuditLogMapper.xml
...rc/main/resources/mapper/TabHaobanBatchAuditLogMapper.xml
+10
-0
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+36
-4
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+11
-0
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+15
-8
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+167
-114
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+1
-0
AuditVO.java
...x/src/main/java/com/gic/haoban/manage/web/vo/AuditVO.java
+6
-5
ClerkStoreVO.java
.../main/java/com/gic/haoban/manage/web/vo/ClerkStoreVO.java
+41
-0
StaffStoreVO.java
.../main/java/com/gic/haoban/manage/web/vo/StaffStoreVO.java
+94
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/AuditDTO.java
View file @
e19520c8
...
...
@@ -43,10 +43,21 @@ public class AuditDTO implements Serializable {
private
Integer
statusFlag
;
private
String
detail
;
private
String
wxEnterpriseId
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getCommitStoreName
()
{
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCommitStoreName
()
{
return
commitStoreName
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/BatchAuditLogDTO.java
0 → 100644
View file @
e19520c8
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
BatchAuditLogDTO
implements
Serializable
{
private
String
batchAuditLogId
;
private
String
auditId
;
private
String
batchId
;
private
String
enterpriseName
;
private
String
commitName
;
private
Date
commitTime
;
private
Integer
auditResult
;
private
Integer
auditType
;
private
Date
createTime
;
private
Date
updateTime
;
private
Integer
status
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getBatchAuditLogId
()
{
return
batchAuditLogId
;
}
public
void
setBatchAuditLogId
(
String
batchAuditLogId
)
{
this
.
batchAuditLogId
=
batchAuditLogId
==
null
?
null
:
batchAuditLogId
.
trim
();
}
public
String
getAuditId
()
{
return
auditId
;
}
public
void
setAuditId
(
String
auditId
)
{
this
.
auditId
=
auditId
==
null
?
null
:
auditId
.
trim
();
}
public
String
getBatchId
()
{
return
batchId
;
}
public
void
setBatchId
(
String
batchId
)
{
this
.
batchId
=
batchId
==
null
?
null
:
batchId
.
trim
();
}
public
String
getEnterpriseName
()
{
return
enterpriseName
;
}
public
void
setEnterpriseName
(
String
enterpriseName
)
{
this
.
enterpriseName
=
enterpriseName
==
null
?
null
:
enterpriseName
.
trim
();
}
public
String
getCommitName
()
{
return
commitName
;
}
public
void
setCommitName
(
String
commitName
)
{
this
.
commitName
=
commitName
==
null
?
null
:
commitName
.
trim
();
}
public
Date
getCommitTime
()
{
return
commitTime
;
}
public
void
setCommitTime
(
Date
commitTime
)
{
this
.
commitTime
=
commitTime
;
}
public
Integer
getAuditResult
()
{
return
auditResult
;
}
public
void
setAuditResult
(
Integer
auditResult
)
{
this
.
auditResult
=
auditResult
;
}
public
Integer
getAuditType
()
{
return
auditType
;
}
public
void
setAuditType
(
Integer
auditType
)
{
this
.
auditType
=
auditType
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/AuditApiService.java
View file @
e19520c8
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.BatchAuditLogDTO
;
/**
...
...
@@ -28,11 +29,13 @@ public interface AuditApiService {
void
insert
(
AuditDTO
audit
);
Page
<
AuditDTO
>
listByStaffId
(
String
staffId
,
BasePageInfo
pageInfo
);
Page
<
AuditDTO
>
listByStaffId
(
String
staffId
,
Integer
auditType
,
Integer
auditStatus
,
BasePageInfo
pageInfo
);
Page
<
AuditDTO
>
pageStoreListByParams
(
String
storeId
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
);
AuditDTO
findById
(
String
auditId
);
void
update
(
AuditDTO
audit
);
List
<
BatchAuditLogDTO
>
listBatchLog
(
String
batchId
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffClerkRelationApiService.java
View file @
e19520c8
...
...
@@ -30,4 +30,16 @@ public interface StaffClerkRelationApiService {
String
insert
(
StaffClerkRelationDTO
staffClerkRelation
);
/**
* 解绑
* @param storeId
* @param clerkCode
* @return
*/
String
delByStoreIdAndCode
(
String
storeId
,
String
clerkCode
);
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkIds
);
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/MaidianDictController.java
View file @
e19520c8
...
...
@@ -2,13 +2,13 @@ package com.gic.haoban.manage.web.controller;
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.csp.sentinel.util.StringUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.MaidianDictDTO
;
import
com.gic.haoban.manage.api.dto.MaidianDictModuleDTO
;
...
...
@@ -35,7 +35,7 @@ public class MaidianDictController extends WebBaseController{
//保存字典
@RequestMapping
(
"save-page"
)
public
HaobanResponse
savePage
(
MaidianDictDTO
dto
)
{
if
(
StringUtil
.
isEmpty
(
dto
.
getModuleId
())){
if
(
StringUtil
s
.
isEmpty
(
dto
.
getModuleId
())){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
maidianDictApiService
.
savePage
(
dto
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
View file @
e19520c8
...
...
@@ -29,7 +29,7 @@ public interface TabHaobanAuditMapper {
TabHaobanAudit
findByStoreIdAndChangeField
(
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"changeField"
)
String
changeField
);
com
.
github
.
pagehelper
.
Page
listByStaffId
(
@Param
(
"staffId"
)
String
staffId
);
com
.
github
.
pagehelper
.
Page
listByStaffId
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"auditStatus"
)
Integer
auditStatus
);
com
.
github
.
pagehelper
.
Page
pageStoreListByParams
(
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"auditStatus"
)
Integer
auditStatus
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanBatchAuditLogMapper.java
View file @
e19520c8
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog
;
public
interface
TabHaobanBatchAuditLogMapper
{
...
...
@@ -14,4 +16,6 @@ public interface TabHaobanBatchAuditLogMapper {
int
updateByPrimaryKeySelective
(
TabHaobanBatchAuditLog
record
);
int
updateByPrimaryKey
(
TabHaobanBatchAuditLog
record
);
List
<
TabHaobanBatchAuditLog
>
listByBatchId
(
String
batchId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
e19520c8
...
...
@@ -23,7 +23,8 @@ public interface TabHaobanStaffClerkRelationMapper {
List
<
TabHaobanStaffClerkRelation
>
listBindCode
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"clerkCodeList"
)
Set
<
String
>
clerkCodeList
);
List
<
TabHaobanStaffClerkRelation
>
listBindCodeByStaffId
(
@Param
(
"enterpriseIdList"
)
List
<
String
>
enterpriseIdList
,
@Param
(
"staffId"
)
String
staffId
);
TabHaobanStaffClerkRelation
getOneByClerkId
(
@Param
(
"clerkId"
)
String
clerkId
);
/**
* 改变状态 格局clerkId
* @param clerkId
...
...
@@ -49,4 +50,11 @@ public interface TabHaobanStaffClerkRelationMapper {
TabHaobanStaffClerkRelation
getBindByClerkId
(
@Param
(
"clerkId"
)
String
clerkId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
TabHaobanStaffClerkRelation
getByCodeAndEnterpriseId
(
@Param
(
"clerkCode"
)
String
clerkCode
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 解绑
*/
void
delByStoreIdAndCode
(
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"clerkCode"
)
String
clerkCode
);
List
<
TabHaobanStaffClerkRelation
>
listByClerkIds
(
@Param
(
"clerkIds"
)
List
<
String
>
clerkIds
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
e19520c8
...
...
@@ -31,6 +31,7 @@ import com.gic.haoban.common.utils.UuidUtil;
import
com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.AuditStaffDTO
;
import
com.gic.haoban.manage.api.dto.BatchAuditLogDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StoreAddressDTO
;
import
com.gic.haoban.manage.api.enums.AppPageType
;
...
...
@@ -403,9 +404,9 @@ public class AuditApiServiceImpl implements AuditApiService{
auditMapper
.
insertSelective
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanAudit
.
class
,
audit
));
}
@Override
public
Page
<
AuditDTO
>
listByStaffId
(
String
staffId
,
BasePageInfo
pageInfo
)
{
public
Page
<
AuditDTO
>
listByStaffId
(
String
staffId
,
Integer
auditType
,
Integer
auditStatus
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
return
PageUtil
.
changePageHelperToCurrentPage
(
auditMapper
.
listByStaffId
(
staffId
),
AuditDTO
.
class
);
return
PageUtil
.
changePageHelperToCurrentPage
(
auditMapper
.
listByStaffId
(
staffId
,
auditType
,
auditStatus
),
AuditDTO
.
class
);
}
@Override
public
Page
<
AuditDTO
>
pageStoreListByParams
(
String
storeId
,
BasePageInfo
pageInfo
,
Integer
auditType
,
...
...
@@ -422,7 +423,7 @@ public class AuditApiServiceImpl implements AuditApiService{
batTab
.
setAuditType
(
tab
.
getAuditType
());
batTab
.
setAuditResult
(
auditResult
);
batTab
.
setBatchId
(
batchId
);
batTab
.
setCommitName
(
tab
.
getCommitName
());
batTab
.
setCommitName
(
tab
.
getCommit
Staff
Name
());
batTab
.
setCommitTime
(
tab
.
getCommitTime
());
batTab
.
setCreateTime
(
new
Date
());
batTab
.
setEnterpriseName
(
enterprise
==
null
?
""
:
enterprise
.
getEnterpriseName
());
...
...
@@ -440,5 +441,10 @@ public class AuditApiServiceImpl implements AuditApiService{
audit
.
setUpdateTime
(
new
Date
());
auditMapper
.
updateByPrimaryKeySelective
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanAudit
.
class
,
audit
));
}
@Override
public
List
<
BatchAuditLogDTO
>
listBatchLog
(
String
batchId
)
{
List
<
TabHaobanBatchAuditLog
>
list
=
tabHaobanBatchAuditLogMapper
.
listByBatchId
(
batchId
);
return
EntityUtil
.
changeEntityListByJSON
(
BatchAuditLogDTO
.
class
,
list
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditSettingApiServiceImpl.java
View file @
e19520c8
...
...
@@ -47,7 +47,11 @@ public class AuditSettingApiServiceImpl implements AuditSettingApiService{
String
wxEnterpriseId
)
{
TabHaobanAuditSetting
tab
=
auditSettingMapper
.
findSetting
(
wxEnterpriseId
);
if
(
tab
==
null
){
return
null
;
AuditSettingDTO
dto
=
new
AuditSettingDTO
();
dto
.
setWxEnterpriseId
(
wxEnterpriseId
);
dto
.
setAuditFlag
(
1
);
dto
.
setClerkChangeFlag
(
0
);
return
dto
;
}
AuditSettingDTO
dto
=
EntityUtil
.
changeEntity
(
AuditSettingDTO
.
class
,
tab
);
return
dto
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
e19520c8
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -14,12 +17,15 @@ import com.gic.enterprise.api.service.EnterpriseService;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
@Service
...
...
@@ -36,7 +42,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Autowired
private
StoreService
storeService
;
@Autowired
private
TabHaobanStaffClerkRelationMapper
tabHaobanStaffClerkRelationMapper
;
@Override
public
List
<
StaffClerkRelationDTO
>
listBindCode
(
String
enterpriseId
,
Set
<
String
>
clerkCodeList
)
{
return
staffClerkRelatinService
.
listBindCode
(
enterpriseId
,
clerkCodeList
);
...
...
@@ -113,4 +120,18 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
public
String
insert
(
StaffClerkRelationDTO
staffClerkRelation
)
{
return
staffClerkRelatinService
.
insert
(
staffClerkRelation
);
}
@Override
public
String
delByStoreIdAndCode
(
String
storeId
,
String
clerkCode
)
{
tabHaobanStaffClerkRelationMapper
.
delByStoreIdAndCode
(
storeId
,
clerkCode
);
return
null
;
}
@Override
public
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkIds
)
{
List
<
TabHaobanStaffClerkRelation
>
list
=
tabHaobanStaffClerkRelationMapper
.
listByClerkIds
(
clerkIds
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
new
ArrayList
<
StaffClerkRelationDTO
>();
}
List
<
StaffClerkRelationDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
StaffClerkRelationDTO
.
class
,
list
);
return
result
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffDepartmentRelatedApiServiceImpl.java
View file @
e19520c8
...
...
@@ -27,10 +27,12 @@ import com.gic.haoban.manage.api.service.ApplicationApiService;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanApplication
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
...
...
@@ -63,6 +65,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private
DepartmentService
departmentService
;
@Autowired
private
Config
config
;
@Autowired
private
TabHaobanStaffClerkRelationMapper
tabHaobanStaffClerkRelationMapper
;
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentId
(
...
...
@@ -227,6 +231,5 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
url
=
url
+
encodeData
;
return
url
;
}
}
haoban-manage3-service/src/main/resources/mapper/TabHaobanAuditMapper.xml
View file @
e19520c8
...
...
@@ -362,7 +362,15 @@
where 1=1
and commit_staff_id = #{staffId,jdbcType=VARCHAR}
and status_flag = 1
and audit_type in (2,3,4,5)
<if
test=
"auditType == null"
>
and audit_type in (2,3,4,5)
</if>
<if
test=
"auditType != null"
>
and audit_type = #{auditType}
</if>
<if
test=
"auditStatus != null"
>
and audit_status = #{auditStatus}
</if>
order by create_time desc
</select>
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanBatchAuditLogMapper.xml
View file @
e19520c8
...
...
@@ -161,4 +161,13 @@
status = #{status,jdbcType=INTEGER}
where batch_audit_log_id = #{batchAuditLogId,jdbcType=VARCHAR}
</update>
<select
id=
"listByBatchId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_batch_audit_log
where batch_id = #{batchId,jdbcType=VARCHAR}
and status = 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
e19520c8
...
...
@@ -187,12 +187,21 @@
</if>
</select>
<select
id=
"getOneByClerkId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_clerk_relation
where
status_flag = 1
and clerk_id = #{clerkId}
</select>
<update
id=
"changeStatusByClerkId"
>
update tab_haoban_staff_clerk_relation
set
status_flag = #{status},
update_time = now()
where clerk_id = #{clerkId,jdbcType=VARCHAR} and status!=#{status}
where clerk_id = #{clerkId,jdbcType=VARCHAR} and status
_flag
!=#{status}
</update>
<update
id=
"updateByClerkId"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation"
>
...
...
@@ -209,16 +218,38 @@
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_clerk_relation
where clerk_id = #{clerkId,jdbcType=VARCHAR} and wx_enterprise_id=#{wxEnterpriseId} and status=1
where clerk_id = #{clerkId,jdbcType=VARCHAR} and wx_enterprise_id=#{wxEnterpriseId} and status
_flag
=1
</select>
<select
id=
"getByCodeAndEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_clerk_relation
where
staff_id = #{staffId,jdbcType=VARCHAR}
and
status_flag = 1
where
status_flag = 1
and enterprise_id = #{enterpriseId}
and clerk_code = #{clerkCode}
</select>
<update
id=
"delByStoreIdAndCode"
>
update tab_haoban_staff_clerk_relation
set
status_flag = 0,
update_time = now()
where clerk_code = #{clerkCode,jdbcType=VARCHAR}
and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag =1
</update>
<select
id=
"listByClerkIds"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_clerk_relation
where status_flag=1
and clerk_id in
<foreach
collection=
"clerkIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
e19520c8
...
...
@@ -200,4 +200,15 @@ public class AuditController extends WebBaseController{
auditApiService
.
audit
(
""
,
auditId
,
auditName
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//批量审核详情
@HttpLimit
@RequestMapping
(
"audit-detail-list"
)
public
HaobanResponse
auditDetailList
(
String
batchId
)
{
if
(
StringUtils
.
isAnyBlank
(
batchId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
BatchAuditLogDTO
>
list
=
auditApiService
.
listBatchLog
(
batchId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
e19520c8
...
...
@@ -23,6 +23,7 @@ import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.enums.AuditType
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
...
...
@@ -46,14 +47,14 @@ public class AuditController extends WebBaseController{
@Autowired
private
SyncHaobanToGicServiceApi
syncHaobanToGicServiceApi
;
//关联记录列表
@RequestMapping
(
"clerk-apply-list"
)
public
HaobanResponse
staffStoreList
(
String
staffId
,
String
wxEnterpriseId
,
BasePageInfo
pageInfo
){
public
HaobanResponse
staffStoreList
(
String
staffId
,
Integer
auditType
,
Integer
auditStatus
,
String
wxEnterpriseId
,
BasePageInfo
pageInfo
){
if
(
StringUtils
.
isAnyBlank
(
staffId
,
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
Page
<
AuditDTO
>
page
=
auditApiService
.
listByStaffId
(
staffId
,
pageInfo
);
Page
<
AuditDTO
>
page
=
auditApiService
.
listByStaffId
(
staffId
,
auditType
,
auditStatus
,
pageInfo
);
List
<
AuditDTO
>
list
=
page
.
getResult
();
List
<
AuditVO
>
voList
=
new
ArrayList
<
AuditVO
>();
for
(
AuditDTO
auditDTO
:
list
)
{
...
...
@@ -83,7 +84,7 @@ public class AuditController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageResult2
);
}
//门店记录列表
@RequestMapping
(
"store-apply-list"
)
public
HaobanResponse
storeApplyList
(
String
storeId
,
String
wxEnterpriseId
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
){
if
(
StringUtils
.
isAnyBlank
(
storeId
,
wxEnterpriseId
)){
...
...
@@ -122,7 +123,7 @@ public class AuditController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageResult2
);
}
//审核,1同意,2拒绝,3取消审核
@RequestMapping
(
"clerk-audit"
)
public
HaobanResponse
clerkAudit
(
String
auditId
,
String
auditReason
,
Integer
auditStatus
,
String
wxEnterpriseId
,
String
staffId
){
if
(
StringUtils
.
isAnyBlank
(
auditId
,
wxEnterpriseId
)){
...
...
@@ -142,6 +143,7 @@ public class AuditController extends WebBaseController{
audit
.
setAuditName
(
staff
.
getStaffName
());
}
if
(
auditStatus
==
1
){
//审核同意
String
oldValue
=
audit
.
getOldValue
();
String
clerkCode
=
""
;
String
enterpriseId
=
""
;
...
...
@@ -159,7 +161,8 @@ public class AuditController extends WebBaseController{
phoneNumber
=
json
.
getString
(
"phoneNumber"
);
nationCode
=
json
.
getString
(
"nationCode"
);
String
storeId
=
audit
.
getCommitStoreId
();
if
(
audit
.
getAuditType
()
==
2
){
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_BIND
.
getCode
()){
//导购绑定
StaffClerkRelationDTO
staffClerkRelation
=
staffClerkRelationApiService
.
getByCodeAndEnterpriseId
(
clerkCode
,
enterpriseId
);
if
(
staffClerkRelation
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_111117
);
...
...
@@ -175,21 +178,25 @@ public class AuditController extends WebBaseController{
audit
.
setAuditStatus
(
1
);
}
}
if
(
audit
.
getAuditType
()
==
3
){
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_ADD
.
getCode
()){
//导购新增
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staff
.
getStaffName
(),
phoneNumber
,
nationCode
,
null
);
if
(!
flag
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
}
audit
.
setAuditStatus
(
1
);
}
if
(
audit
.
getAuditType
()
==
4
){
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_DEL
.
getCode
()){
//导购删除
syncHaobanToGicServiceApi
.
delGicClerk
(
clerkId
);
audit
.
setAuditStatus
(
1
);
}
}
else
if
(
auditStatus
==
2
){
//审核拒绝
audit
.
setAuditReason
(
auditReason
);
audit
.
setAuditStatus
(
2
);
}
else
if
(
auditStatus
==
3
){
//取消审核
audit
.
setAuditStatus
(
3
);
}
auditApiService
.
update
(
audit
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
e19520c8
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
...
...
@@ -35,6 +36,8 @@ import com.gic.haoban.common.utils.GooglePhoneNumberUtil;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.AuditSettingDTO
;
import
com.gic.haoban.manage.api.dto.ClerkMainStoreRelatedDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
...
...
@@ -43,6 +46,7 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.AuditSettingApiService
;
import
com.gic.haoban.manage.api.service.BindApiService
;
import
com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
...
...
@@ -58,6 +62,7 @@ import com.gic.haoban.manage.web.interceptor.WebInterceptor;
import
com.gic.haoban.manage.web.vo.BindClerkVO
;
import
com.gic.haoban.manage.web.vo.ClerkStoreVO
;
import
com.gic.haoban.manage.web.vo.ClerkVo
;
import
com.gic.haoban.manage.web.vo.StaffStoreVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.google.i18n.phonenumbers.PhoneNumberUtil
;
...
...
@@ -96,6 +101,8 @@ public class ClerkController extends WebBaseController{
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
ClerkNewService
clerkNewService
;
@Autowired
private
AuditSettingApiService
auditSettingApiService
;
//导购列表
@RequestMapping
(
"/clerk-list"
)
...
...
@@ -287,7 +294,6 @@ public class ClerkController extends WebBaseController{
String
nationcode
=
staffDTO
.
getNationCode
();
String
postion
=
staffDTO
.
getPostion
();
Integer
sex
=
staffDTO
.
getSex
();
staffDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
if
(
StringUtils
.
isBlank
(
staffName
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10004
);
}
...
...
@@ -306,69 +312,57 @@ public class ClerkController extends WebBaseController{
com
.
gic
.
enterprise
.
api
.
dto
.
StoreDTO
store
=
storeService
.
getStoreByIdNoStatus
(
storeId
);
//校验手机是否唯一
if
(
store
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_
400001
);
return
resultResponse
(
HaoBanErrCode
.
ERR_
10009
);
}
ClerkDTO
clerk
=
clerkService
.
getClerkByCodeNoDel
(
store
.
getEnterpriseId
(),
clerkCode
);
logger
.
info
(
"【新增店员】clerk={}"
,
JSON
.
toJSONString
(
clerk
));
if
(
clerk
!=
null
){
DepartmentDTO
department
=
departmentApiService
.
selectByRelatedId
(
storeId
);
if
(
department
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_400001
);
}
//StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndCode(department.getDepartmentId(), clerkCode);
if
(
null
!=
clerk
&&
StringUtils
.
isNotBlank
(
clerk
.
getPhoneNumber
())
&&
!
"--"
.
equals
(
clerk
.
getPhoneNumber
())){
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
}
if
(
version
==
1
){
boolean
needAudit
=
true
;
if
(
needAudit
){
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
dto
.
getClerkChangeFlag
()
==
1
){
//需要审核
StaffDTO
staff
=
staffApiService
.
selectById
(
staffDTO
.
getStaffId
());
//是否需要审核
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommit
Name
(
clerk
.
getClerkName
()
);
audit
.
setCommit
StaffName
(
staffName
);
audit
.
setCommitStaffId
(
staffDTO
.
getStaffId
());
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
clerk
.
getStoreId
()
);
audit
.
setCommitStoreId
(
storeId
);
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkCode"
,
clerkCode
);
json
.
put
(
"clerkName"
,
clerk
.
getClerkName
()
);
json
.
put
(
"clerkName"
,
staffName
);
json
.
put
(
"headPic"
,
staff
.
getHeadImg
());
json
.
put
(
"sex"
,
sex
);
json
.
put
(
"postion"
,
postion
);
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
3
);
auditApiService
.
insert
(
audit
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
// if(clerk != null && StringUtils.isNotBlank(clerk.getPhoneNumber())){
// syncHaobanToGicServiceApi.syncHaobanClerkPhoneNumberToGic(clerk.getClerkId(), phoneNumber);
// }else{
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staffName
,
phoneNumber
,
nationcode
,
postion
);
if
(!
flag
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
}
// }
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//删除店员
@HttpLimit
@RequestMapping
(
"/staff-del"
)
public
HaobanResponse
staffDel
(
String
staffDepartmentRelatedIds
,
String
storeId
,
Integer
version
,
String
clerkIds
,
String
staffId
)
{
boolean
needAudit
=
true
;
//是否需要审核
public
HaobanResponse
staffDel
(
String
staffDepartmentRelatedIds
,
String
wxEnterpriseId
,
String
storeId
,
Integer
version
,
String
clerkIds
,
String
staffId
)
{
if
(
version
!=
null
&&
version
==
1
){
if
(
needAudit
){
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
dto
.
getClerkChangeFlag
()
==
1
){
//需要审核
com
.
gic
.
enterprise
.
api
.
dto
.
StoreDTO
store
=
storeService
.
getStoreByIdNoStatus
(
storeId
);
//校验手机是否唯一
if
(
store
==
null
)
{
...
...
@@ -378,12 +372,15 @@ public class ClerkController extends WebBaseController{
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitName
(
staff
.
getStaffName
());
audit
.
setCommit
Staff
Name
(
staff
.
getStaffName
());
audit
.
setCommitStaffId
(
staffId
);
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
storeId
);
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
...
...
@@ -401,37 +398,37 @@ public class ClerkController extends WebBaseController{
}
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectByRelatedId
(
storeId
);
if
(
departmentDTO
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
}
if
(
StringUtils
.
isBlank
(
staffDepartmentRelatedIds
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
String
[]
staffDepartmentRelatedIdArr
=
staffDepartmentRelatedIds
.
split
(
","
);
boolean
flag
=
false
;
for
(
String
staffDepartmentRelatedId
:
staffDepartmentRelatedIdArr
)
{
StaffDepartmentRelatedDTO
related
=
staffDepartmentRelatedApiService
.
getByStaffDepartmentRelatedId
(
staffDepartmentRelatedId
);
if
(
related
==
null
){
flag
=
true
;
continue
;
}
if
(
StringUtils
.
isBlank
(
related
.
getClerkCode
())){
staffApiService
.
del
(
staffDepartmentRelatedId
);
}
else
{
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
departmentDTO
.
getEnterpriseId
(),
related
.
getClerkCode
());
if
(
clerk
!=
null
&&
distributeApiService
.
getClerkMemberCount
(
departmentDTO
.
getEnterpriseId
(),
clerk
.
getClerkId
(),
storeId
)
==
0
){
if
(
clerk
.
getClerkType
()
==
1
){
continue
;
}
syncHaobanToGicServiceApi
.
delGicClerk
(
clerk
.
getClerkId
());
staffApiService
.
del
(
staffDepartmentRelatedId
);
}
}
}
if
(
flag
){
return
resultResponse
(
HaoBanErrCode
.
ERR_999
);
}
//
DepartmentDTO departmentDTO = departmentApiService.selectByRelatedId(storeId);
//
if(departmentDTO == null){
//
return resultResponse(HaoBanErrCode.ERR_10009);
//
}
//
if(StringUtils.isBlank(staffDepartmentRelatedIds)){
//
return resultResponse(HaoBanErrCode.ERR_2);
//
}
//
String[] staffDepartmentRelatedIdArr = staffDepartmentRelatedIds.split(",");
//
boolean flag = false;
//
for (String staffDepartmentRelatedId : staffDepartmentRelatedIdArr) {
//
StaffDepartmentRelatedDTO related = staffDepartmentRelatedApiService.getByStaffDepartmentRelatedId(staffDepartmentRelatedId);
//
if(related == null){
//
flag = true;
//
continue;
//
}
//
if(StringUtils.isBlank(related.getClerkCode())){
//
staffApiService.del(staffDepartmentRelatedId);
//
}else{
//
ClerkDTO clerk = clerkService.getClerkByClerkCode(departmentDTO.getEnterpriseId(), related.getClerkCode());
//
if(clerk != null && distributeApiService.getClerkMemberCount(departmentDTO.getEnterpriseId(), clerk.getClerkId(), storeId) == 0){
//
if(clerk.getClerkType() == 1){
//
continue;
//
}
//
syncHaobanToGicServiceApi.delGicClerk(clerk.getClerkId());
//
staffApiService.del(staffDepartmentRelatedId);
//
}
//
}
//
}
//
if(flag){
//
return resultResponse(HaoBanErrCode.ERR_999);
//
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
@@ -493,10 +490,17 @@ public class ClerkController extends WebBaseController{
}
List
<
EnterpriseDTO
>
enterpriselist
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIdList
);
Map
<
String
,
EnterpriseDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
enterpriselist
,
"enterpriseId"
);
List
<
String
>
clerkIds
=
clerkList
.
stream
().
map
(
s
->
s
.
getClerkId
()).
collect
(
Collectors
.
toList
());
List
<
StaffClerkRelationDTO
>
clerkRelations
=
staffClerkRelationApiService
.
listByClerkIds
(
clerkIds
);
Map
<
String
,
StaffClerkRelationDTO
>
clerkBindMap
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
clerkRelations
,
"clerkId"
);
for
(
ClerkDTO
clerk
:
clerkList
)
{
String
enterpriseId
=
clerk
.
getEnterpriseId
();
EnterpriseDTO
enterpriseDTO
=
map
.
get
(
enterpriseId
);
StaffClerkRelationDTO
staffClerkRelationDTO
=
clerkBindMap
.
get
(
clerk
.
getClerkId
());
ClerkStoreVO
vo
=
new
ClerkStoreVO
();
vo
.
setClerkId
(
clerk
.
getClerkId
());
vo
.
setClerkCode
(
clerk
.
getClerkCode
());
vo
.
setClerkName
(
clerk
.
getClerkName
());
vo
.
setClerkType
(
clerk
.
getClerkType
());
...
...
@@ -506,17 +510,20 @@ public class ClerkController extends WebBaseController{
vo
.
setNationCode
(
clerk
.
getNationcode
());
StoreDTO
store
=
storeService
.
getStore
(
clerk
.
getStoreId
());
vo
.
setStoreName
(
store
==
null
?
""
:
store
.
getStoreName
());
vo
.
setStoreAddress
(
store
==
null
?
""
:
store
.
getStoreAddress
());
vo
.
setBindFlag
(
staffClerkRelationDTO
==
null
?
0
:
1
);
vo
.
setStaffId
(
staffClerkRelationDTO
==
null
?
""
:
staffClerkRelationDTO
.
getStaffId
());
clerkStoreList
.
add
(
vo
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
clerkStoreList
);
}
//绑定
@RequestMapping
(
"bind-staff"
)
public
HaobanResponse
bindStaff
(
String
clerkId
,
String
clerkCode
,
String
staffId
,
String
wxUserId
,
String
wxEnterpriseId
,
Integer
auditType
,
Integer
comm
itType
){
if
(
StringUtils
.
isAnyBlank
(
clerkId
,
clerkCode
,
staffId
,
wxUserId
,
wxEnterprise
Id
)){
public
HaobanResponse
bindStaff
(
String
clerkId
,
String
staffId
,
Integer
aud
itType
){
if
(
StringUtils
.
isAnyBlank
(
clerkId
,
staff
Id
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
auditType
==
null
||
commitType
==
null
){
if
(
auditType
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
ClerkDTO
clerk
=
clerkService
.
getclerkById
(
clerkId
);
...
...
@@ -528,39 +535,57 @@ public class ClerkController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
StoreDTO
store
=
storeService
.
getStore
(
clerk
.
getStoreId
());
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitName
(
clerk
.
getClerkName
());
audit
.
setCommitStaffId
(
staffId
);
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
clerk
.
getStoreId
());
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
json
.
put
(
"clerkCode"
,
clerkCode
);
json
.
put
(
"clerkName"
,
clerk
.
getClerkName
());
json
.
put
(
"staffName"
,
staff
.
getStaffName
());
json
.
put
(
"staffId"
,
staffId
);
json
.
put
(
"wxUserId"
,
wxUserId
);
json
.
put
(
"headPic"
,
staff
.
getHeadImg
());
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
2
);
auditApiService
.
insert
(
audit
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"clerk-bind-staff"
)
public
HaobanResponse
clerkBindStaff
(
String
clerkId
,
String
clerkCode
,
String
staffId
,
String
wxUserId
,
String
wxEnterpriseId
,
Integer
auditType
,
Integer
commitType
){
if
(
StringUtils
.
isAnyBlank
(
clerkId
,
clerkCode
,
staffId
,
wxUserId
,
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
String
clerkCode
=
clerk
.
getClerkCode
();
String
wxEnterpriseId
=
staff
.
getWxEnterpriseId
();
String
wxUserId
=
staff
.
getWxUserId
();
StaffClerkRelationDTO
staffClerkRelation
=
staffClerkRelationApiService
.
getByCodeAndEnterpriseId
(
clerkCode
,
store
.
getEnterpriseId
());
if
(
staffClerkRelation
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_111117
);
}
if
(
auditType
==
null
||
commitType
==
null
){
if
(
auditType
==
2
){
//无需审核
staffClerkRelation
=
new
StaffClerkRelationDTO
();
staffClerkRelation
.
setClerkId
(
clerkId
);
staffClerkRelation
.
setClerkCode
(
clerkCode
);
staffClerkRelation
.
setStoreId
(
clerk
.
getStoreId
());
staffClerkRelation
.
setEnterpriseId
(
clerk
.
getEnterpriseId
());
staffClerkRelation
.
setWxEnterpriseId
(
wxEnterpriseId
);
staffClerkRelation
.
setWxUserId
(
wxUserId
);
staffClerkRelation
.
setStaffId
(
staffId
);
staffClerkRelationApiService
.
insert
(
staffClerkRelation
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
else
{
//需要审核
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitStaffName
(
clerk
.
getClerkName
());
audit
.
setCommitStaffId
(
staffId
);
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
clerk
.
getStoreId
());
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
json
.
put
(
"clerkCode"
,
clerkCode
);
json
.
put
(
"clerkName"
,
clerk
.
getClerkName
());
json
.
put
(
"staffName"
,
staff
.
getStaffName
());
json
.
put
(
"staffId"
,
staffId
);
json
.
put
(
"wxUserId"
,
wxUserId
);
json
.
put
(
"headPic"
,
staff
.
getHeadImg
());
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
2
);
auditApiService
.
insert
(
audit
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
//解绑
@RequestMapping
(
"unbind-staff"
)
public
HaobanResponse
unBindStaff
(
String
clerkId
,
String
clerkCode
,
String
staffId
,
String
storeId
){
if
(
StringUtils
.
isAnyBlank
(
clerkId
,
clerkCode
,
staffId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
ClerkDTO
clerk
=
clerkService
.
getclerkById
(
clerkId
);
...
...
@@ -572,18 +597,22 @@ public class ClerkController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
StoreDTO
store
=
storeService
.
getStore
(
clerk
.
getStoreId
());
StaffClerkRelationDTO
staffClerkRelation
=
staffClerkRelationApiService
.
getByCodeAndEnterpriseId
(
clerkCode
,
store
.
getEnterpriseId
());
if
(
staffClerkRelation
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_111145
);
}
//解绑无需审核,只插入记录即可
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitName
(
clerk
.
getClerkName
());
audit
.
setCommit
Staff
Name
(
clerk
.
getClerkName
());
audit
.
setCommitStaffId
(
staffId
);
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
clerk
.
getStoreId
());
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
StaffClerkRelationDTO
staffClerkRelation
=
staffClerkRelationApiService
.
getByCodeAndEnterpriseId
(
clerkCode
,
store
.
getEnterpriseId
());
if
(
staffClerkRelation
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_111117
);
}
audit
.
setAuditStatus
(
1
);
audit
.
setWxEnterpriseId
(
staffClerkRelation
.
getWxEnterpriseId
());
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
...
...
@@ -591,19 +620,18 @@ public class ClerkController extends WebBaseController{
json
.
put
(
"clerkName"
,
clerk
.
getClerkName
());
json
.
put
(
"staffName"
,
staff
.
getStaffName
());
json
.
put
(
"staffId"
,
staffId
);
json
.
put
(
"wxUserId"
,
wxUserId
);
json
.
put
(
"headPic"
,
staff
.
getHeadImg
());
json
.
put
(
"enterpriseId"
,
clerk
.
getEnterpriseId
());
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
2
);
audit
.
setAuditName
(
staff
.
getStaffName
());
audit
.
setAuditType
(
5
);
auditApiService
.
insert
(
audit
);
staffClerkRelationApiService
.
delByStoreIdAndCode
(
storeId
,
clerkCode
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//门店导购列表
@RequestMapping
(
"store-clerk-list"
)
public
HaobanResponse
storeClerkList
(
String
storeId
,
String
wxEnterpriseId
){
if
(
StringUtils
.
isAnyBlank
(
storeId
,
wxEnterpriseId
)){
...
...
@@ -611,7 +639,7 @@ public class ClerkController extends WebBaseController{
}
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_
2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_
10009
);
}
List
<
ClerkListDTO
>
list
=
clerkService
.
getClerkByStoreId
(
store
.
getEnterpriseId
(),
storeId
);
Set
<
String
>
clerkCodeList
=
list
.
stream
().
map
(
ClerkListDTO:
:
getClerkCode
).
collect
(
Collectors
.
toSet
());
...
...
@@ -628,27 +656,52 @@ public class ClerkController extends WebBaseController{
unBindList
.
add
(
vo
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bindList"
,
bindList
);
map
.
put
(
"unBindList"
,
unBindList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
map
);
}
//门店列表
@RequestMapping
(
"staff-store-list"
)
public
HaobanResponse
staffStoreList
(
String
staffId
,
String
wxEnterpriseId
){
if
(
StringUtils
.
isAnyBlank
(
staffId
,
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
StaffStoreVO
>
list
=
new
ArrayList
<>();
List
<
EnterpriseDetailDTO
>
enterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
String
>
enterpriseIdList
=
enterpriseList
.
stream
().
map
(
EnterpriseDetailDTO:
:
getEnterpriseId
).
collect
(
Collectors
.
toList
());
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCodeByStaffId
(
enterpriseIdList
,
staffId
);
//主门店
ClerkMainStoreRelatedDTO
mainDTO
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staffId
);
String
storeId
=
mainDTO
.
getStoreId
();
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
bindRelationList
)
{
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getClerkCode
());
if
(
clerk
!=
null
){
StoreDTO
store
=
storeService
.
getStore
(
clerk
.
getStoreId
());
//主门店标志
int
mainStoreFlag
=
0
;
if
(
storeId
.
equals
(
store
.
getStoreId
())){
mainStoreFlag
=
1
;
}
staffDepartmentRelatedApiService
.
listByStaffId
(
staffId
);
StaffStoreVO
vo
=
new
StaffStoreVO
();
vo
.
setClerkCode
(
clerk
.
getClerkCode
());
vo
.
setClerkId
(
clerk
.
getClerkId
());
vo
.
setClerkType
(
clerk
.
getClerkType
());
vo
.
setEnterpriseId
(
clerk
.
getEnterpriseId
());
vo
.
setMainStoreFlag
(
mainStoreFlag
);
vo
.
setPhoneNumber
(
clerk
.
getPhoneNumber
());
vo
.
setStaffId
(
staffId
);
vo
.
setStoreId
(
clerk
.
getStoreId
());
vo
.
setStoreImg
(
store
.
getStoreImage
());
vo
.
setStoreName
(
store
.
getStoreName
());
vo
.
setWxEnterpriseId
(
wxEnterpriseId
);
list
.
add
(
vo
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
e19520c8
...
...
@@ -177,6 +177,7 @@ public enum HaoBanErrCode {
ERR_111143
(
111143
,
"code或者手机号码已存在"
),
ERR_111144
(
111144
,
"该企业或品牌已关联"
),
ERR_111145
(
111145
,
"已经解绑过了"
),
// 企业设置
ERR_200001
(
200001
,
"员工不存在"
),
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/AuditVO.java
View file @
e19520c8
...
...
@@ -9,7 +9,7 @@ public class AuditVO implements Serializable{
private
String
auditReason
;
private
Integer
a
pply
Status
;
private
Integer
a
udit
Status
;
private
Date
commitTime
;
...
...
@@ -50,12 +50,13 @@ public class AuditVO implements Serializable{
this
.
auditReason
=
auditReason
;
}
public
Integer
getApplyStatus
()
{
return
applyStatus
;
public
Integer
getAuditStatus
()
{
return
auditStatus
;
}
public
void
setA
pplyStatus
(
Integer
apply
Status
)
{
this
.
a
pplyStatus
=
apply
Status
;
public
void
setA
uditStatus
(
Integer
audit
Status
)
{
this
.
a
uditStatus
=
audit
Status
;
}
public
Date
getCommitTime
()
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/ClerkStoreVO.java
View file @
e19520c8
...
...
@@ -4,6 +4,8 @@ import java.io.Serializable;
public
class
ClerkStoreVO
implements
Serializable
{
private
String
clerkId
;
private
String
clerkName
;
private
String
clerkCode
;
...
...
@@ -20,8 +22,47 @@ public class ClerkStoreVO implements Serializable{
private
Integer
clerkType
;
private
String
staffId
;
private
String
headImg
;
private
String
storeAddress
;
private
Integer
bindFlag
;
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getStoreAddress
()
{
return
storeAddress
;
}
public
void
setStoreAddress
(
String
storeAddress
)
{
this
.
storeAddress
=
storeAddress
;
}
public
Integer
getBindFlag
()
{
return
bindFlag
;
}
public
void
setBindFlag
(
Integer
bindFlag
)
{
this
.
bindFlag
=
bindFlag
;
}
public
String
getClerkName
()
{
return
clerkName
;
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/StaffStoreVO.java
0 → 100644
View file @
e19520c8
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created 2018/10/22.
*
* @author hua
*/
public
class
StaffStoreVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
storeId
;
private
String
staffId
;
private
String
storeName
;
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
String
clerkCode
;
private
String
clerkId
;
private
String
storeImg
;
private
int
clerkType
;
private
Integer
mainStoreFlag
;
private
String
phoneNumber
;
public
String
getPhoneNumber
()
{
return
phoneNumber
;
}
public
void
setPhoneNumber
(
String
phoneNumber
)
{
this
.
phoneNumber
=
phoneNumber
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getStoreName
()
{
return
storeName
;
}
public
void
setStoreName
(
String
storeName
)
{
this
.
storeName
=
storeName
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getClerkCode
()
{
return
clerkCode
;
}
public
void
setClerkCode
(
String
clerkCode
)
{
this
.
clerkCode
=
clerkCode
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getStoreImg
()
{
return
storeImg
;
}
public
void
setStoreImg
(
String
storeImg
)
{
this
.
storeImg
=
storeImg
;
}
public
int
getClerkType
()
{
return
clerkType
;
}
public
void
setClerkType
(
int
clerkType
)
{
this
.
clerkType
=
clerkType
;
}
public
Integer
getMainStoreFlag
()
{
return
mainStoreFlag
;
}
public
void
setMainStoreFlag
(
Integer
mainStoreFlag
)
{
this
.
mainStoreFlag
=
mainStoreFlag
;
}
}
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