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
aa1ada8b
Commit
aa1ada8b
authored
May 11, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审批查询
parent
593cf22d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
242 deletions
+38
-242
TabHaobanAuditMapper.java
...aoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
+1
-8
TabHaobanAudit.java
.../com/gic/haoban/manage/service/entity/TabHaobanAudit.java
+9
-0
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+17
-62
TabHaobanAuditMapper.xml
...ervice/src/main/resources/mapper/TabHaobanAuditMapper.xml
+11
-172
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
View file @
aa1ada8b
...
@@ -8,21 +8,14 @@ import com.gic.haoban.manage.service.entity.TabHaobanAudit;
...
@@ -8,21 +8,14 @@ import com.gic.haoban.manage.service.entity.TabHaobanAudit;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
public
interface
TabHaobanAuditMapper
{
public
interface
TabHaobanAuditMapper
{
int
deleteByPrimaryKey
(
String
auditId
);
int
insert
(
TabHaobanAudit
record
);
int
insert
(
TabHaobanAudit
record
);
int
insertSelective
(
TabHaobanAudit
record
);
TabHaobanAudit
selectByPrimaryKey
(
String
auditId
);
TabHaobanAudit
selectByPrimaryKey
(
String
auditId
);
int
updateByPrimaryKeySelective
(
TabHaobanAudit
record
);
int
updateByPrimaryKeySelective
(
TabHaobanAudit
record
);
int
updateByPrimaryKey
(
TabHaobanAudit
record
);
Page
<
TabHaobanAudit
>
page
(
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"storeIds"
)
List
<
String
>
storeIds
,
@Param
(
"searchParams"
)
String
search
,
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"auditStatus"
)
Integer
auditStatus
,
@Param
(
"auditFlag"
)
Integer
auditFlag
);
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
);
List
<
TabHaobanAudit
>
listByStoreId
(
String
storeId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanAudit.java
View file @
aa1ada8b
...
@@ -45,9 +45,18 @@ public class TabHaobanAudit implements Serializable {
...
@@ -45,9 +45,18 @@ public class TabHaobanAudit implements Serializable {
private
String
relatedId
;
private
String
relatedId
;
private
String
auditStaffId
;
private
String
auditStaffId
;
private
String
commitStoreName
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getCommitStoreName
()
{
return
commitStoreName
;
}
public
void
setCommitStoreName
(
String
commitStoreName
)
{
this
.
commitStoreName
=
commitStoreName
;
}
public
String
getAuditStaffId
()
{
public
String
getAuditStaffId
()
{
return
auditStaffId
;
return
auditStaffId
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
aa1ada8b
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -10,12 +9,13 @@ import java.util.stream.Collectors;
...
@@ -10,12 +9,13 @@ import java.util.stream.Collectors;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.
slf4j.Log
ger
;
import
org.
apache.logging.log4j.LogMana
ger
;
import
org.
slf4j.LoggerFactory
;
import
org.
apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
...
@@ -26,7 +26,6 @@ import com.gic.enterprise.api.dto.EnterpriseDTO;
...
@@ -26,7 +26,6 @@ import com.gic.enterprise.api.dto.EnterpriseDTO;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDetailDTO
;
import
com.gic.enterprise.api.dto.StoreDetailDTO
;
import
com.gic.enterprise.api.dto.StoreVo
;
import
com.gic.enterprise.api.dto.StoreWidgetDTO
;
import
com.gic.enterprise.api.dto.StoreWidgetDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreService
;
...
@@ -38,7 +37,6 @@ import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
...
@@ -38,7 +37,6 @@ import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.AuditStaffDTO
;
import
com.gic.haoban.manage.api.dto.AuditStaffDTO
;
import
com.gic.haoban.manage.api.dto.BatchAuditLogDTO
;
import
com.gic.haoban.manage.api.dto.BatchAuditLogDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StoreAddressDTO
;
import
com.gic.haoban.manage.api.dto.StoreAddressDTO
;
import
com.gic.haoban.manage.api.enums.AuditRsultType
;
import
com.gic.haoban.manage.api.enums.AuditRsultType
;
...
@@ -50,7 +48,6 @@ import com.gic.haoban.manage.api.enums.StoreFieldEnum;
...
@@ -50,7 +48,6 @@ import com.gic.haoban.manage.api.enums.StoreFieldEnum;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanAuditMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanAuditMapper
;
...
@@ -67,7 +64,8 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -67,7 +64,8 @@ import cn.hutool.core.collection.CollectionUtil;
*/
*/
@Service
@Service
public
class
AuditApiServiceImpl
implements
AuditApiService
{
public
class
AuditApiServiceImpl
implements
AuditApiService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AuditApiServiceImpl
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
AuditApiService
.
class
);
@Autowired
@Autowired
private
TabHaobanAuditMapper
auditMapper
;
private
TabHaobanAuditMapper
auditMapper
;
...
@@ -88,8 +86,6 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -88,8 +86,6 @@ public class AuditApiServiceImpl implements AuditApiService {
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Autowired
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
PowerService
powerService
;
private
PowerService
powerService
;
@Autowired
@Autowired
private
StoreWidgetService
storeWidgetService
;
private
StoreWidgetService
storeWidgetService
;
...
@@ -97,52 +93,13 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -97,52 +93,13 @@ public class AuditApiServiceImpl implements AuditApiService {
@Override
@Override
public
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
public
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
,
Integer
auditFlag
,
BasePageInfo
pageInfo
,
String
clerkId
)
{
String
enterpriseId
,
Integer
auditStatus
,
Integer
auditFlag
,
BasePageInfo
pageInfo
,
String
clerkId
)
{
//部门关联表修改,服务层调整
List
<
String
>
storeIdList
=
this
.
getStoreIdList
(
enterpriseId
,
clerkId
)
;
List
<
String
>
staffIds
=
new
ArrayList
<>();
List
<
String
>
storeIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
search
))
{
//获取企业列表
List
<
String
>
enterpriseIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
List
<
EnterpriseDetailDTO
>
enterprises
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtil
.
isNotEmpty
(
enterprises
))
{
List
<
String
>
searchEnterpriseIds
=
enterprises
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
enterpriseIds
.
addAll
(
searchEnterpriseIds
);
}
}
else
{
enterpriseIds
.
add
(
enterpriseId
);
}
//调gic接口查storeIds
String
[]
strArray
=
new
String
[
enterpriseIds
.
size
()];
enterpriseIds
.
toArray
(
strArray
);
List
<
StoreVo
>
list
=
storeService
.
queryStoreByName
(
strArray
,
search
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
List
<
String
>
storeIds1
=
list
.
stream
().
map
(
s
->
s
.
getStoreId
()).
collect
(
Collectors
.
toList
());
storeIds
.
addAll
(
storeIds1
);
}
//模糊查staffName
List
<
TabHaobanStaff
>
staffList
=
staffMapper
.
listLikeName
(
search
,
wxEnterpriseId
);
if
(
CollectionUtil
.
isNotEmpty
(
staffList
))
{
List
<
String
>
staffIds2
=
staffList
.
stream
().
map
(
s
->
s
.
getStaffId
()).
collect
(
Collectors
.
toList
());
staffIds
.
addAll
(
staffIds2
);
}
if
(
CollectionUtil
.
isEmpty
(
staffIds
))
{
staffIds
.
add
(
"-999"
);
}
if
(
CollectionUtil
.
isEmpty
(
storeIds
))
{
storeIds
.
add
(
"-999"
);
}
}
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>
page
=
new
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>();
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>
page
=
new
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>();
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
)
&&
CollectionUtil
.
isNotEmpty
(
staffIds
))
{
page
=
auditMapper
.
page
(
auditType
,
storeIdList
,
search
,
enterpriseId
,
auditStatus
,
auditFlag
);
page
=
auditMapper
.
pageForStoreIdsAndstaffIds
(
auditType
,
storeIds
,
staffIds
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
,
auditFlag
);
}
else
{
page
=
auditMapper
.
page
(
auditType
,
storeIds
,
staffIds
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
,
auditFlag
);
}
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getResult
()))
{
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getResult
()))
{
List
<
String
>
commitStaffIds
=
page
.
getResult
().
stream
().
map
(
s
->
s
.
getCommitStaffId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
commitStaffIds
=
page
.
getResult
().
stream
().
filter
(
item
->
StringUtils
.
isBlank
(
item
.
getCommitStaffName
())).
map
(
s
->
s
.
getCommitStaffId
()).
collect
(
Collectors
.
toList
());
logger
.
info
(
JSON
.
toJSONString
(
commitStaffIds
));
if
(
CollectionUtil
.
isNotEmpty
(
commitStaffIds
))
{
if
(
CollectionUtil
.
isNotEmpty
(
commitStaffIds
))
{
List
<
TabHaobanStaff
>
staffList
=
staffMapper
.
listByIds
(
commitStaffIds
);
List
<
TabHaobanStaff
>
staffList
=
staffMapper
.
listByIds
(
commitStaffIds
);
Map
<
String
,
TabHaobanStaff
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
staffList
,
"staffId"
);
Map
<
String
,
TabHaobanStaff
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
staffList
,
"staffId"
);
...
@@ -180,7 +137,6 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -180,7 +137,6 @@ public class AuditApiServiceImpl implements AuditApiService {
}
}
this
.
editStoreInfo
(
storeId
,
changeField
,
oldValue
,
newValue
);
this
.
editStoreInfo
(
storeId
,
changeField
,
oldValue
,
newValue
);
//发送消息
//发送消息
String
title
=
"门店信息修改通知"
;
String
content
=
StoreFieldEnum
.
getValueName
(
changeField
);
String
content
=
StoreFieldEnum
.
getValueName
(
changeField
);
content
=
"["
+
content
+
"]"
+
"修改审核通过"
;
content
=
"["
+
content
+
"]"
+
"修改审核通过"
;
TabHaobanAudit
tab2
=
auditMapper
.
selectByPrimaryKey
(
auditId
);
TabHaobanAudit
tab2
=
auditMapper
.
selectByPrimaryKey
(
auditId
);
...
@@ -299,23 +255,17 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -299,23 +255,17 @@ public class AuditApiServiceImpl implements AuditApiService {
TabHaobanAudit
tab2
=
auditMapper
.
selectByPrimaryKey
(
auditId
);
TabHaobanAudit
tab2
=
auditMapper
.
selectByPrimaryKey
(
auditId
);
int
auditType
=
tab2
.
getAuditType
();
int
auditType
=
tab2
.
getAuditType
();
String
oldValue
=
tab2
.
getOldValue
();
String
oldValue
=
tab2
.
getOldValue
();
String
enterpriseId
=
tab2
.
getEnterpriseId
();
//发送消息
//发送消息
if
(
auditType
==
AuditType
.
STORE_CHANGE
.
getCode
())
{
if
(
auditType
==
AuditType
.
STORE_CHANGE
.
getCode
())
{
String
changeField
=
tab2
.
getChangeField
();
String
changeField
=
tab2
.
getChangeField
();
// String title = "门店信息修改通知";
String
content
=
StoreFieldEnum
.
getValueName
(
changeField
);
String
content
=
StoreFieldEnum
.
getValueName
(
changeField
);
// content = "["+content+"]"+"被拒绝。拒绝理由:"+auditReason;
String
staffId
=
tab2
.
getCommitStaffId
();
String
staffId
=
tab2
.
getCommitStaffId
();
String
storeId
=
tab2
.
getCommitStoreId
();
String
storeId
=
tab2
.
getCommitStoreId
();
this
.
sendMessageByStaffId
(
staffId
,
storeId
,
true
,
content
,
auditReason
);
this
.
sendMessageByStaffId
(
staffId
,
storeId
,
true
,
content
,
auditReason
);
}
else
if
(
auditType
==
AuditType
.
CLERK_BIND
.
getCode
())
{
}
else
if
(
auditType
==
AuditType
.
CLERK_BIND
.
getCode
())
{
AuditStaffDTO
obj
=
JSONObject
.
parseObject
(
oldValue
,
AuditStaffDTO
.
class
);
AuditStaffDTO
obj
=
JSONObject
.
parseObject
(
oldValue
,
AuditStaffDTO
.
class
);
String
staffId
=
tab2
.
getCommitStaffId
();
String
staffId
=
tab2
.
getCommitStaffId
();
staffDepartmentRelatedApiService
.
sendBindAuditMessage
(
auditId
,
staffId
,
obj
.
getClerkId
(),
auditReason
,
true
);
staffDepartmentRelatedApiService
.
sendBindAuditMessage
(
auditId
,
staffId
,
obj
.
getClerkId
(),
auditReason
,
true
);
// staffDepartmentRelatedApiService.sendStaffBind(obj.getStaffId(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
}
else
if
(
auditType
==
AuditType
.
CLERK_ADD
.
getCode
())
{
}
else
if
(
auditType
==
AuditType
.
CLERK_ADD
.
getCode
())
{
AuditStaffDTO
obj
=
JSONObject
.
parseObject
(
oldValue
,
AuditStaffDTO
.
class
);
AuditStaffDTO
obj
=
JSONObject
.
parseObject
(
oldValue
,
AuditStaffDTO
.
class
);
staffDepartmentRelatedApiService
.
sendClerkAdd
(
obj
.
getClerkName
(),
obj
.
getClerkCode
(),
tab2
.
getCommitStoreId
(),
2
,
auditReason
);
staffDepartmentRelatedApiService
.
sendClerkAdd
(
obj
.
getClerkName
(),
obj
.
getClerkCode
(),
tab2
.
getCommitStoreId
(),
2
,
auditReason
);
...
@@ -343,6 +293,10 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -343,6 +293,10 @@ public class AuditApiServiceImpl implements AuditApiService {
tab
.
setCommitStaffImg
(
staff
.
getHeadImg
());
tab
.
setCommitStaffImg
(
staff
.
getHeadImg
());
tab
.
setCommitStaffName
(
staff
.
getStaffName
());
tab
.
setCommitStaffName
(
staff
.
getStaffName
());
tab
.
setCommitStoreId
(
commitStoreId
);
tab
.
setCommitStoreId
(
commitStoreId
);
StoreDTO
store
=
this
.
storeService
.
getStore
(
commitStoreId
)
;
if
(
null
!=
store
)
{
tab
.
setCommitStoreName
(
store
.
getStoreName
());
}
tab
.
setCommitTime
(
new
Date
());
tab
.
setCommitTime
(
new
Date
());
tab
.
setCreateTime
(
new
Date
());
tab
.
setCreateTime
(
new
Date
());
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
...
@@ -351,7 +305,7 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -351,7 +305,7 @@ public class AuditApiServiceImpl implements AuditApiService {
tab
.
setOldValue
(
oldValue
);
tab
.
setOldValue
(
oldValue
);
tab
.
setStatusFlag
(
1
);
tab
.
setStatusFlag
(
1
);
tab
.
setUpdateTime
(
new
Date
());
tab
.
setUpdateTime
(
new
Date
());
return
auditMapper
.
insert
Selective
(
tab
);
return
auditMapper
.
insert
(
tab
);
}
}
@Override
@Override
...
@@ -383,7 +337,6 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -383,7 +337,6 @@ public class AuditApiServiceImpl implements AuditApiService {
private
void
getStoreDTO
(
StoreDetailDTO
store
,
String
changeField
,
String
oldValue
,
String
newValue
)
{
private
void
getStoreDTO
(
StoreDetailDTO
store
,
String
changeField
,
String
oldValue
,
String
newValue
)
{
logger
.
info
(
"==========================>changeField={}"
,
changeField
);
logger
.
info
(
"==========================>changeField={}"
,
changeField
);
if
(
StoreFieldEnum
.
BUSINESS_TIME_STRING
.
getValue
().
equals
(
changeField
))
{
if
(
StoreFieldEnum
.
BUSINESS_TIME_STRING
.
getValue
().
equals
(
changeField
))
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
//营业时间
//营业时间
String
[]
newValues
=
newValue
.
split
(
"-"
);
String
[]
newValues
=
newValue
.
split
(
"-"
);
String
openTime
=
newValues
[
0
];
String
openTime
=
newValues
[
0
];
...
@@ -463,7 +416,7 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -463,7 +416,7 @@ public class AuditApiServiceImpl implements AuditApiService {
audit
.
setAuditId
(
com
.
gic
.
haoban
.
common
.
utils
.
StringUtil
.
randomUUID
());
audit
.
setAuditId
(
com
.
gic
.
haoban
.
common
.
utils
.
StringUtil
.
randomUUID
());
audit
.
setCreateTime
(
new
Date
());
audit
.
setCreateTime
(
new
Date
());
audit
.
setUpdateTime
(
new
Date
());
audit
.
setUpdateTime
(
new
Date
());
auditMapper
.
insert
Selective
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanAudit
.
class
,
audit
));
auditMapper
.
insert
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanAudit
.
class
,
audit
));
}
}
@Override
@Override
...
@@ -528,10 +481,12 @@ public class AuditApiServiceImpl implements AuditApiService {
...
@@ -528,10 +481,12 @@ public class AuditApiServiceImpl implements AuditApiService {
}
}
public
int
getAuditCount
(
String
enterpriseId
,
String
clerkId
)
{
public
int
getAuditCount
(
String
enterpriseId
,
String
clerkId
)
{
// 如果null,说明是所有门店
List
<
String
>
storeIdList
=
this
.
getStoreIdList
(
enterpriseId
,
clerkId
)
;
List
<
String
>
storeIdList
=
this
.
getStoreIdList
(
enterpriseId
,
clerkId
)
;
return
this
.
auditMapper
.
getAuditCount
(
enterpriseId
,
storeIdList
)
;
return
this
.
auditMapper
.
getAuditCount
(
enterpriseId
,
storeIdList
)
;
}
}
@SuppressWarnings
(
"unchecked"
)
public
List
<
String
>
getStoreIdList
(
String
enterpriseId
,
String
clerkId
)
{
public
List
<
String
>
getStoreIdList
(
String
enterpriseId
,
String
clerkId
)
{
EnterpriseSettingDTO
enterpriseSetting
=
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
)
;
EnterpriseSettingDTO
enterpriseSetting
=
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
)
;
if
(
enterpriseSetting
.
getEnableAccessControl
()
!=
null
&&
enterpriseSetting
.
getEnableAccessControl
()
==
1
)
{
if
(
enterpriseSetting
.
getEnableAccessControl
()
!=
null
&&
enterpriseSetting
.
getEnableAccessControl
()
==
1
)
{
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanAuditMapper.xml
View file @
aa1ada8b
...
@@ -23,11 +23,12 @@
...
@@ -23,11 +23,12 @@
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"related_id"
property=
"relatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"related_id"
property=
"relatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"audit_staff_id"
property=
"auditStaffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"audit_staff_id"
property=
"auditStaffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"commit_store_name"
property=
"commitStoreName"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
audit_id, audit_type, commit_name, commit_staff_id, commit_staff_name, commit_staff_img,
audit_id, audit_type, commit_name, commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, old_value, new_value, commit_time, enterprise_id,
commit_store_id, change_field, old_value, new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason, create_time, update_time, status_flag, wx_enterprise_id,related_id,audit_staff_id
audit_name, audit_status, audit_reason, create_time, update_time, status_flag, wx_enterprise_id,related_id,audit_staff_id
, commit_store_name
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
...
@@ -35,17 +36,14 @@
...
@@ -35,17 +36,14 @@
from tab_haoban_audit
from tab_haoban_audit
where audit_id = #{auditId,jdbcType=VARCHAR}
where audit_id = #{auditId,jdbcType=VARCHAR}
</select>
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_haoban_audit
where audit_id = #{auditId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
insert into tab_haoban_audit (audit_id, audit_type, commit_name,
insert into tab_haoban_audit (audit_id, audit_type, commit_name,
commit_staff_id, commit_staff_name, commit_staff_img,
commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, old_value,
commit_store_id, change_field, old_value,
new_value, commit_time, enterprise_id,
new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason,
audit_name, audit_status, audit_reason,
create_time, update_time, status_flag,
create_time, update_time, status_flag,
commit_store_name
wx_enterprise_id,related_id,audit_staff_id)
wx_enterprise_id,related_id,audit_staff_id)
values (#{auditId,jdbcType=VARCHAR}, #{auditType,jdbcType=INTEGER}, #{commitName,jdbcType=VARCHAR},
values (#{auditId,jdbcType=VARCHAR}, #{auditType,jdbcType=INTEGER}, #{commitName,jdbcType=VARCHAR},
#{commitStaffId,jdbcType=VARCHAR}, #{commitStaffName,jdbcType=VARCHAR}, #{commitStaffImg,jdbcType=VARCHAR},
#{commitStaffId,jdbcType=VARCHAR}, #{commitStaffName,jdbcType=VARCHAR}, #{commitStaffImg,jdbcType=VARCHAR},
...
@@ -53,141 +51,9 @@
...
@@ -53,141 +51,9 @@
#{newValue,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=VARCHAR},
#{newValue,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=VARCHAR},
#{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{auditReason,jdbcType=VARCHAR},
#{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{auditReason,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER},
#{wxEnterpriseId,jdbcType=VARCHAR},#{relatedId,jdbcType=VARCHAR},#{auditStaffId,jdbcType=VARCHAR})
#{wxEnterpriseId,jdbcType=VARCHAR},#{relatedId,jdbcType=VARCHAR},#{auditStaffId,jdbcType=VARCHAR}) , #{commitStoreName}
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
insert into tab_haoban_audit
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"auditId != null"
>
audit_id,
</if>
<if
test=
"auditType != null"
>
audit_type,
</if>
<if
test=
"commitName != null"
>
commit_name,
</if>
<if
test=
"commitStaffId != null"
>
commit_staff_id,
</if>
<if
test=
"commitStaffName != null"
>
commit_staff_name,
</if>
<if
test=
"commitStaffImg != null"
>
commit_staff_img,
</if>
<if
test=
"commitStoreId != null"
>
commit_store_id,
</if>
<if
test=
"changeField != null"
>
change_field,
</if>
<if
test=
"oldValue != null"
>
old_value,
</if>
<if
test=
"newValue != null"
>
new_value,
</if>
<if
test=
"commitTime != null"
>
commit_time,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"auditName != null"
>
audit_name,
</if>
<if
test=
"auditStatus != null"
>
audit_status,
</if>
<if
test=
"auditReason != null"
>
audit_reason,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"statusFlag != null"
>
status_flag,
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
<if
test=
"relatedId != null"
>
related_id,
</if>
<if
test=
"auditStaffId != null"
>
audit_staff_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"auditId != null"
>
#{auditId,jdbcType=VARCHAR},
</if>
<if
test=
"auditType != null"
>
#{auditType,jdbcType=INTEGER},
</if>
<if
test=
"commitName != null"
>
#{commitName,jdbcType=VARCHAR},
</if>
<if
test=
"commitStaffId != null"
>
#{commitStaffId,jdbcType=VARCHAR},
</if>
<if
test=
"commitStaffName != null"
>
#{commitStaffName,jdbcType=VARCHAR},
</if>
<if
test=
"commitStaffImg != null"
>
#{commitStaffImg,jdbcType=VARCHAR},
</if>
<if
test=
"commitStoreId != null"
>
#{commitStoreId,jdbcType=VARCHAR},
</if>
<if
test=
"changeField != null"
>
#{changeField,jdbcType=VARCHAR},
</if>
<if
test=
"oldValue != null"
>
#{oldValue,jdbcType=VARCHAR},
</if>
<if
test=
"newValue != null"
>
#{newValue,jdbcType=VARCHAR},
</if>
<if
test=
"commitTime != null"
>
#{commitTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"auditName != null"
>
#{auditName,jdbcType=VARCHAR},
</if>
<if
test=
"auditStatus != null"
>
#{auditStatus,jdbcType=INTEGER},
</if>
<if
test=
"auditReason != null"
>
#{auditReason,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"relatedId != null"
>
#{relatedId,jdbcType=VARCHAR},
</if>
<if
test=
"auditStaffId != null"
>
#{auditStaffId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
update tab_haoban_audit
update tab_haoban_audit
<set
>
<set
>
...
@@ -254,30 +120,7 @@
...
@@ -254,30 +120,7 @@
</set>
</set>
where audit_id = #{auditId,jdbcType=VARCHAR}
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
update tab_haoban_audit
set audit_type = #{auditType,jdbcType=INTEGER},
commit_name = #{commitName,jdbcType=VARCHAR},
commit_staff_id = #{commitStaffId,jdbcType=VARCHAR},
commit_staff_name = #{commitStaffName,jdbcType=VARCHAR},
commit_staff_img = #{commitStaffImg,jdbcType=VARCHAR},
commit_store_id = #{commitStoreId,jdbcType=VARCHAR},
change_field = #{changeField,jdbcType=VARCHAR},
old_value = #{oldValue,jdbcType=VARCHAR},
new_value = #{newValue,jdbcType=VARCHAR},
commit_time = #{commitTime,jdbcType=TIMESTAMP},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
audit_name = #{auditName,jdbcType=VARCHAR},
audit_status = #{auditStatus,jdbcType=INTEGER},
audit_reason = #{auditReason,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status_flag = #{statusFlag,jdbcType=INTEGER},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
related_id = #{relatedId,jdbcType=VARCHAR},
audit_staff_id = #{auditStaffId,jdbcType=VARCHAR}
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
<sql
id=
"storeSql"
>
<sql
id=
"storeSql"
>
<if
test=
"null != storeIds and storeIds.size gt 0"
>
<if
test=
"null != storeIds and storeIds.size gt 0"
>
and commit_store_id in
and commit_store_id in
...
@@ -298,13 +141,7 @@
...
@@ -298,13 +141,7 @@
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_audit
from tab_haoban_audit
where 1=1
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
<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"
>
<if
test =
"auditType != null"
>
and audit_type = #{auditType,jdbcType=INTEGER}
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
</if>
...
@@ -317,8 +154,10 @@
...
@@ -317,8 +154,10 @@
<if
test =
"auditStatus != null"
>
<if
test =
"auditStatus != null"
>
and audit_status = #{auditStatus,jdbcType=INTEGER}
and audit_status = #{auditStatus,jdbcType=INTEGER}
</if>
</if>
<if
test=
" null != searchParams"
>
and (commit_staff_name like '%${searchParams}%' or commit_store_name like '%${searchParams}%')
</if>
<include
refid=
"storeSql"
/>
<include
refid=
"storeSql"
/>
<include
refid=
"staffSql"
/>
order by commit_time desc
order by commit_time desc
</select>
</select>
...
...
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