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
5965ed24
Commit
5965ed24
authored
Mar 19, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
78360498
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
0 deletions
+137
-0
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
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+70
-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 @
5965ed24
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 @
5965ed24
...
...
@@ -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 @
5965ed24
...
...
@@ -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-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
5965ed24
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
...
...
@@ -26,10 +27,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 +60,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 +170,67 @@ 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 枚举变量的使用
getStoreDTO
(
store
,
changeField
,
oldValue
,
newValue
);
storeService
.
saveOrUpdateStore
(
store
);
}
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
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
try
{
date2
=
sdf
.
parse
(
closeTime
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
store
.
setOpenTime
(
date1
);
store
.
setCloseTime
(
date2
);
}
else
if
(
StoreFieldEnum
.
CONACTS_PHONE
.
getValue
().
equals
(
changeField
)){
//联系电话
}
else
if
(
StoreFieldEnum
.
STORE_ADDRESS
.
getValue
().
equals
(
changeField
)){
//门店地址
}
else
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
changeField
)){
//门店面积
}
else
if
(
StoreFieldEnum
.
STORE_NAME
.
getValue
().
equals
(
changeField
)){
//门店名字
}
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 @
5965ed24
...
...
@@ -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