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
1
Merge Requests
1
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
da93d7c3
Commit
da93d7c3
authored
Mar 19, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0.git
into developer
parents
78a3511a
06c0a8f7
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
178 additions
and
9 deletions
+178
-9
StoreFieldEnum.java
.../java/com/gic/haoban/manage/api/enums/StoreFieldEnum.java
+34
-0
AuditApiService.java
...va/com/gic/haoban/manage/api/service/AuditApiService.java
+2
-0
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+28
-0
BindApiServiceImpl.java
...n/manage/service/service/out/impl/BindApiServiceImpl.java
+5
-5
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+17
-2
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+1
-1
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+0
-1
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+6
-0
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+82
-0
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+3
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/StoreFieldEnum.java
0 → 100644
View file @
da93d7c3
package
com
.
gic
.
haoban
.
manage
.
api
.
enums
;
/**
* 门店枚举
*
* @author huang
*/
public
enum
StoreFieldEnum
{
//门店名称
STORE_NAME
(
1
),
//门店面积
STORE_AREA
(
2
),
//联系电话
CONACTS_PHONE
(
3
),
//营业时间
BUSINESS_TIME_STRING
(
4
),
//门店地址
STORE_ADDRESS
(
5
),
//门店图片
STORE_IMAG
(
6
);
/**
* 类型
*/
private
Integer
value
;
StoreFieldEnum
(
Integer
value
)
{
this
.
value
=
value
;
}
public
Integer
getValue
()
{
return
value
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/AuditApiService.java
View file @
da93d7c3
...
...
@@ -15,4 +15,6 @@ public interface AuditApiService {
void
audit
(
String
auditId
);
void
refuse
(
String
auditId
,
String
auditReason
);
int
save
(
Integer
auditType
,
String
enterpriseId
,
String
commitStaffId
,
String
commitStoreId
,
String
changeField
,
String
oldValue
,
String
newValue
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
da93d7c3
...
...
@@ -14,6 +14,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.service.dao.mapper.DepartmentMapper
;
...
...
@@ -71,4 +72,31 @@ public class AuditApiServiceImpl implements AuditApiService{
tab
.
setAuditReason
(
auditReason
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
}
@Override
public
int
save
(
Integer
auditType
,
String
enterpriseId
,
String
commitStaffId
,
String
commitStoreId
,
String
changeField
,
String
oldValue
,
String
newValue
)
{
TabHaobanStaff
staff
=
staffMapper
.
selectByPrimaryKey
(
commitStaffId
);
if
(
staff
==
null
){
return
0
;
}
TabHaobanAudit
tab
=
new
TabHaobanAudit
();
tab
.
setAuditId
(
UuidUtil
.
randomUUID
());
tab
.
setAuditStatus
(
0
);
tab
.
setAuditType
(
auditType
);
tab
.
setChangeField
(
changeField
);
tab
.
setCommitName
(
null
);
tab
.
setCommitStaffId
(
commitStaffId
);
tab
.
setCommitStaffImg
(
staff
.
getHeadImg
());
tab
.
setCommitStaffName
(
staff
.
getStaffName
());
tab
.
setCommitStoreId
(
commitStoreId
);
tab
.
setCommitTime
(
new
Date
());
tab
.
setCreateTime
(
new
Date
());
tab
.
setEnterpriseId
(
enterpriseId
);
tab
.
setNewValue
(
newValue
);
tab
.
setOldValue
(
oldValue
);
tab
.
setStatusFlag
(
1
);
tab
.
setUpdateTime
(
new
Date
());
return
auditMapper
.
insertSelective
(
tab
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/BindApiServiceImpl.java
View file @
da93d7c3
...
...
@@ -72,7 +72,7 @@ public class BindApiServiceImpl implements BindApiService {
List
<
ClerkDTO
>
list
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
true
);
for
(
ClerkDTO
clerkDTO
:
list
){
clerkDTO
.
setPhoneNumber
(
"--"
);
clerkDTO
.
setClerkName
(
"--
"
);
clerkDTO
.
setClerkName
(
clerkDTO
.
getClerkName
()+
"(已解绑)
"
);
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
...
...
@@ -134,7 +134,7 @@ public class BindApiServiceImpl implements BindApiService {
List
<
ClerkDTO
>
oldList
=
clerkService
.
listClerk
(
storeId
,
oldClerkCodes
,
true
);
for
(
ClerkDTO
clerkDTO
:
oldList
){
clerkDTO
.
setPhoneNumber
(
"--"
);
clerkDTO
.
setClerkName
(
"--
"
);
clerkDTO
.
setClerkName
(
clerkDTO
.
getClerkName
()+
"(已解绑)
"
);
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
...
...
@@ -180,7 +180,7 @@ public class BindApiServiceImpl implements BindApiService {
logger
.
info
(
"oldList====================>{}"
,
JSONObject
.
toJSONString
(
oldList
));
for
(
ClerkDTO
clerkDTO
:
oldList
){
clerkDTO
.
setPhoneNumber
(
"--"
);
clerkDTO
.
setClerkName
(
"--
"
);
clerkDTO
.
setClerkName
(
clerkDTO
.
getClerkName
()+
"(已解绑)
"
);
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
...
...
@@ -205,7 +205,7 @@ public class BindApiServiceImpl implements BindApiService {
List
<
ClerkDTO
>
list
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
true
);
for
(
ClerkDTO
clerkDTO
:
list
){
clerkDTO
.
setPhoneNumber
(
"--"
);
clerkDTO
.
setClerkName
(
"--
"
);
clerkDTO
.
setClerkName
(
clerkDTO
.
getClerkName
()+
"(已解绑)
"
);
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
...
...
@@ -226,7 +226,7 @@ public class BindApiServiceImpl implements BindApiService {
List
<
ClerkDTO
>
list
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
true
);
for
(
ClerkDTO
clerkDTO
:
list
){
clerkDTO
.
setPhoneNumber
(
"--"
);
clerkDTO
.
setClerkName
(
"--
"
);
clerkDTO
.
setClerkName
(
clerkDTO
.
getClerkName
()+
"(已解绑)
"
);
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
da93d7c3
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfig
;
import
com.gic.haoban.common.utils.GlobalVar
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.ApplicationSettingApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
...
...
@@ -15,6 +16,8 @@ import com.gic.haoban.manage.web.config.Config;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -41,14 +44,26 @@ public class ApplicationController extends WebBaseController{
private
Config
config
;
@Autowired
private
DepartmentApiService
departmentApiService
;
@Autowired
private
ApplicationSettingApiService
applicationSettingApiService
;
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
();
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
@RequestMapping
(
"open-or-close"
)
public
HaobanResponse
applicationList
(
String
wxEnterpriseId
,
String
applicationId
,
Integer
openFlag
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
applicationId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
openFlag
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
applicationSettingApiService
.
saveSetting
(
wxEnterpriseId
,
applicationId
,
openFlag
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"has-bind-contract"
)
@IgnoreLogin
public
HaobanResponse
hasBindContract
(){
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
da93d7c3
...
...
@@ -120,7 +120,7 @@ public class ClerkController extends WebBaseController{
List
<
ClerkDTO
>
oldList
=
clerkService
.
listClerk
(
storeId
,
oldClerkCodes
,
true
);
for
(
ClerkDTO
clerkDTO
:
oldList
){
clerkDTO
.
setPhoneNumber
(
"--"
);
clerkDTO
.
setClerkName
(
"--
"
);
clerkDTO
.
setClerkName
(
clerkDTO
.
getClerkName
()+
"(已解绑)
"
);
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
da93d7c3
...
...
@@ -87,7 +87,6 @@ public class WxEnterpriseController extends WebBaseController{
}
//微信企业绑定接口
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-bind"
)
public
HaobanResponse
wxEnterpriseBind
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
version
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
enterpriseId
,
version
)){
...
...
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
da93d7c3
...
...
@@ -45,4 +45,10 @@
<dubbo:reference
interface=
"com.gic.haoban.communicate.api.service.valid.ValidationCodeService"
id=
"validationCodeService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.ApplicationSettingApiService"
id=
"applicationSettingApiService"
/>
<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.haoban.manage.api.service.DictApiService"
id=
"dictApiService"
/>
</beans>
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
da93d7c3
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
...
...
@@ -17,6 +18,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.dubbo.common.utils.CollectionUtils
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -26,10 +28,14 @@ import com.gic.enterprise.api.service.StoreService;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.data.api.dto.HaobanDataDTO
;
import
com.gic.haoban.data.api.service.HaobanDataApiService
;
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.StaffDTO
;
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
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
...
...
@@ -55,6 +61,10 @@ public class StoreController extends WebBaseController{
private
HaobanDataApiService
haobanDataApiService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
AuditApiService
auditApiService
;
@Autowired
private
AuditSettingApiService
auditSettingApiService
;
//门店列表
@RequestMapping
(
"/store-list"
)
public
HaobanResponse
storeList
(
String
staffId
,
String
wxEnterpriseId
)
{
...
...
@@ -161,6 +171,78 @@ public class StoreController extends WebBaseController{
HaobanDataDTO
HaobanDataDTO
=
haobanDataApiService
.
getSaleDataByDate
(
enterpriseId
,
storeId
,
date
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
HaobanDataDTO
);
}
//获取首页销售数据
@RequestMapping
(
"/change-store-detail"
)
public
HaobanResponse
saleDate
(
String
wxEnterpriseId
,
String
storeId
,
String
staffId
,
String
changeField
,
String
oldValue
,
String
newValue
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
storeId
,
changeField
,
oldValue
,
newValue
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
String
enterpriseId
=
store
.
getEnterpriseId
();
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
//默认不审核
int
auditFlag
=
0
;
if
(
auditSettingDTO
!=
null
){
auditFlag
=
auditSettingDTO
.
getAuditFlag
();
}
if
(
auditFlag
==
1
){
//要审核
int
i
=
auditApiService
.
save
(
1
,
enterpriseId
,
staffId
,
storeId
,
changeField
,
oldValue
,
newValue
);
}
else
{
//TODO 枚举变量的使用
if
(!
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
//非门店图片修改
getStoreDTO
(
store
,
changeField
,
oldValue
,
newValue
);
storeService
.
saveOrUpdateStore
(
store
);
}
else
{
//门店图片修改
List
<
StorePhotoDTO
>
oldStorePhoto
=
JSONObject
.
parseArray
(
oldValue
,
StorePhotoDTO
.
class
);
List
<
StorePhotoDTO
>
newStorePhoto
=
JSONObject
.
parseArray
(
newValue
,
StorePhotoDTO
.
class
);
List
<
String
>
delPhotos
=
new
ArrayList
<>();
// storeService.editStoreImage( storeId, newStorePhoto, delPhotos);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
void
getStoreDTO
(
StoreDTO
store
,
String
changeField
,
String
oldValue
,
String
newValue
){
if
(
StoreFieldEnum
.
BUSINESS_TIME_STRING
.
getValue
().
equals
(
changeField
)){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
//营业时间
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
);
}
else
if
(
StoreFieldEnum
.
CONACTS_PHONE
.
getValue
().
equals
(
changeField
)){
//联系电话
store
.
setConactsPhone
(
newValue
);
}
else
if
(
StoreFieldEnum
.
STORE_ADDRESS
.
getValue
().
equals
(
changeField
)){
//门店地址
store
.
setConactsPhone
(
newValue
);
}
else
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
changeField
)){
//门店面积
store
.
setConactsPhone
(
newValue
);
}
else
if
(
StoreFieldEnum
.
STORE_NAME
.
getValue
().
equals
(
changeField
)){
//门店名字
store
.
setConactsPhone
(
newValue
);
}
else
if
(
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
//门店图片
}
}
//获取门店详情
@RequestMapping
(
"/store-detail"
)
public
HaobanResponse
storeDetail
(
String
storeId
,
String
staffDepartmentRelatedId
)
{
...
...
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
da93d7c3
...
...
@@ -29,6 +29,9 @@
<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.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.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