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
9ee1e64c
Commit
9ee1e64c
authored
Mar 19, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
7a7bd91c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
49 deletions
+105
-49
StoreAddressDTO.java
...n/java/com/gic/haoban/manage/api/dto/StoreAddressDTO.java
+31
-0
AuditApiService.java
...va/com/gic/haoban/manage/api/service/AuditApiService.java
+2
-0
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+70
-0
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+2
-49
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StoreAddressDTO.java
0 → 100644
View file @
9ee1e64c
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
StoreAddressDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
areaId
;
private
String
storeAddress
;
public
String
getAreaId
()
{
return
areaId
;
}
public
void
setAreaId
(
String
areaId
)
{
this
.
areaId
=
areaId
;
}
public
String
getStoreAddress
()
{
return
storeAddress
;
}
public
void
setStoreAddress
(
String
storeAddress
)
{
this
.
storeAddress
=
storeAddress
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/AuditApiService.java
View file @
9ee1e64c
...
@@ -17,4 +17,6 @@ public interface AuditApiService {
...
@@ -17,4 +17,6 @@ public interface AuditApiService {
void
refuse
(
String
auditId
,
String
auditReason
);
void
refuse
(
String
auditId
,
String
auditReason
);
int
save
(
Integer
auditType
,
String
enterpriseId
,
String
commitStaffId
,
String
commitStoreId
,
String
changeField
,
String
oldValue
,
String
newValue
);
int
save
(
Integer
auditType
,
String
enterpriseId
,
String
commitStaffId
,
String
commitStoreId
,
String
changeField
,
String
oldValue
,
String
newValue
);
void
editStoreInfo
(
String
storeId
,
String
changeField
,
String
oldValue
,
String
newValue
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
9ee1e64c
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -11,11 +13,17 @@ import org.springframework.stereotype.Service;
...
@@ -11,11 +13,17 @@ import org.springframework.stereotype.Service;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StorePhotoDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.StoreAddressDTO
;
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.service.dao.mapper.DepartmentMapper
;
import
com.gic.haoban.manage.service.dao.mapper.DepartmentMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
...
@@ -36,6 +44,9 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -36,6 +44,9 @@ public class AuditApiServiceImpl implements AuditApiService{
private
DepartmentMapper
departmentMapper
;
private
DepartmentMapper
departmentMapper
;
@Autowired
@Autowired
private
StaffMapper
staffMapper
;
private
StaffMapper
staffMapper
;
@Autowired
private
StoreService
storeService
;
@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
,
BasePageInfo
pageInfo
)
{
String
enterpriseId
,
Integer
auditStatus
,
BasePageInfo
pageInfo
)
{
...
@@ -99,4 +110,63 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -99,4 +110,63 @@ public class AuditApiServiceImpl implements AuditApiService{
tab
.
setUpdateTime
(
new
Date
());
tab
.
setUpdateTime
(
new
Date
());
return
auditMapper
.
insertSelective
(
tab
);
return
auditMapper
.
insertSelective
(
tab
);
}
}
@Override
public
void
editStoreInfo
(
String
storeId
,
String
changeField
,
String
oldValue
,
String
newValue
)
{
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
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
=
oldStorePhoto
.
stream
().
map
(
s
->
s
.
getImageFiledCode
()).
collect
(
Collectors
.
toList
());
storeService
.
editStoreImage
(
storeId
,
newStorePhoto
,
delPhotos
);
}
}
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
)){
//门店地址
StoreAddressDTO
obj
=
JSONObject
.
parseObject
(
newValue
,
StoreAddressDTO
.
class
);
String
areaId
=
obj
.
getAreaId
();
String
storeAddress
=
obj
.
getStoreAddress
();
String
arr
[]
=
storeAddress
.
split
(
" "
);
store
.
setAreaId
(
areaId
);
store
.
setFullArea
(
arr
[
0
]);
store
.
setStoreAddress
(
arr
[
1
]);
}
else
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
changeField
)){
//门店面积
store
.
setStoreArea
(
Double
.
parseDouble
(
newValue
));
}
else
if
(
StoreFieldEnum
.
STORE_NAME
.
getValue
().
equals
(
changeField
)){
//门店名字
store
.
setStoreName
(
newValue
);
}
else
if
(
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
//门店图片
}
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
9ee1e64c
...
@@ -39,6 +39,7 @@ import com.gic.haoban.manage.api.dto.DepartmentDTO;
...
@@ -39,6 +39,7 @@ import com.gic.haoban.manage.api.dto.DepartmentDTO;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.StoreAddressDTO
;
import
com.gic.haoban.manage.api.enums.StoreFieldEnum
;
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.AuditSettingApiService
;
import
com.gic.haoban.manage.api.service.AuditSettingApiService
;
...
@@ -244,58 +245,10 @@ public class StoreController extends WebBaseController{
...
@@ -244,58 +245,10 @@ public class StoreController extends WebBaseController{
//要审核
//要审核
int
i
=
auditApiService
.
save
(
1
,
enterpriseId
,
staffId
,
storeId
,
changeField
,
oldValue
,
newValue
);
int
i
=
auditApiService
.
save
(
1
,
enterpriseId
,
staffId
,
storeId
,
changeField
,
oldValue
,
newValue
);
}
else
{
}
else
{
//TODO 枚举变量的使用
auditApiService
.
editStoreInfo
(
storeId
,
changeField
,
oldValue
,
newValue
);
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
);
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"
)
@RequestMapping
(
"/store-detail"
)
...
...
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