Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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
base_platform_enterprise
gic-store
Commits
1585234a
Commit
1585234a
authored
Nov 08, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志操作
parent
212324f7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
111 additions
and
117 deletions
+111
-117
StoreFieldApiServiceImpl.java
...ic/store/service/outer/impl/StoreFieldApiServiceImpl.java
+14
-6
StoreFieldSelectApiServiceImpl.java
...re/service/outer/impl/StoreFieldSelectApiServiceImpl.java
+20
-8
StoreGroupApiServiceImpl.java
...ic/store/service/outer/impl/StoreGroupApiServiceImpl.java
+10
-9
StoreStrategyApiServiceImpl.java
...store/service/outer/impl/StoreStrategyApiServiceImpl.java
+12
-11
StoreFieldController.java
...va/com/gic/store/web/controller/StoreFieldController.java
+22
-42
StoreGroupController.java
...va/com/gic/store/web/controller/StoreGroupController.java
+19
-13
StoreStrategyController.java
...com/gic/store/web/controller/StoreStrategyController.java
+14
-28
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreFieldApiServiceImpl.java
View file @
1585234a
...
...
@@ -2,6 +2,7 @@ package com.gic.store.service.outer.impl;
import
java.util.*
;
import
com.gic.auth.constant.SignConstants
;
import
org.apache.commons.lang.math.NumberUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -148,17 +149,17 @@ public class StoreFieldApiServiceImpl implements StoreFieldApiService {
}
@Override
public
ServiceResponse
<
Integer
>
setStoreFieldSort
(
int
storeFieldId
,
int
setValue
,
Integer
enterpriseId
)
{
public
ServiceResponse
<
String
>
setStoreFieldSort
(
int
storeFieldId
,
int
setValue
,
Integer
enterpriseId
)
{
TabStoreField
storeField
=
storeFieldService
.
getStoreFieldById
(
storeFieldId
);
if
(
storeField
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键错误,查询不到数据"
);
}
storeFieldService
.
setStoreFieldSort
(
storeFieldId
,
enterpriseId
,
setValue
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
storeField
.
getStoreFieldName
()
);
}
@Override
public
ServiceResponse
<
Integer
>
delete
(
int
storeFieldId
)
{
public
ServiceResponse
<
String
>
delete
(
int
storeFieldId
)
{
TabStoreField
storeField
=
storeFieldService
.
getStoreFieldById
(
storeFieldId
);
if
(
storeField
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键错误,查询不到数据"
);
...
...
@@ -168,7 +169,8 @@ public class StoreFieldApiServiceImpl implements StoreFieldApiService {
"属性 "
+
storeField
.
getStoreFieldName
()
+
" 在使用中,不允许删除"
);
}
storeFieldRegionRelService
.
deleteByStoreFieldId
(
storeFieldId
);
return
ServiceResponse
.
success
(
storeFieldService
.
delete
(
storeFieldId
));
storeFieldService
.
delete
(
storeFieldId
);
return
ServiceResponse
.
success
(
storeField
.
getStoreFieldName
());
}
@Override
...
...
@@ -190,10 +192,13 @@ public class StoreFieldApiServiceImpl implements StoreFieldApiService {
}
@Override
public
ServiceResponse
<
Integer
>
deleteBatch
(
List
<
Integer
>
storeFieldIds
)
{
public
ServiceResponse
<
String
>
deleteBatch
(
List
<
Integer
>
storeFieldIds
)
{
StringBuilder
string
=
new
StringBuilder
();
List
<
TabStoreField
>
fieldList
=
storeFieldService
.
listByBatchId
(
storeFieldIds
);
StringBuilder
resultMessage
=
new
StringBuilder
();
for
(
TabStoreField
field
:
fieldList
)
{
string
.
append
(
field
.
getStoreFieldName
()).
append
(
SignConstants
.
COMMA
);
if
(
storeExtendService
.
storeExtendHasStoreField
(
field
.
getStoreFieldId
()))
{
resultMessage
.
append
(
"属性 "
).
append
(
field
.
getStoreFieldName
()).
append
(
" 在使用中,不允许删除;"
);
}
...
...
@@ -202,7 +207,10 @@ public class StoreFieldApiServiceImpl implements StoreFieldApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
resultMessage
.
toString
());
}
storeFieldRegionRelService
.
deleteFetchByStoreFieldIds
(
storeFieldIds
);
return
ServiceResponse
.
success
(
storeFieldService
.
deleteBatch
(
storeFieldIds
));
storeFieldService
.
deleteBatch
(
storeFieldIds
);
return
ServiceResponse
.
success
(
string
.
toString
());
}
@Override
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreFieldSelectApiServiceImpl.java
View file @
1585234a
...
...
@@ -2,6 +2,7 @@ package com.gic.store.service.outer.impl;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.constant.SignConstants
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.error.ErrorCode
;
...
...
@@ -15,6 +16,7 @@ import com.gic.store.service.StoreFieldSelectApiService;
import
com.gic.store.service.StoreFieldSelectService
;
import
com.gic.store.service.StoreFieldService
;
import
com.gic.store.utils.valid.ValidUtil
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -57,8 +59,8 @@ public class StoreFieldSelectApiServiceImpl implements StoreFieldSelectApiServic
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"属性参数有误"
);
}
int
storeFieldType
=
storeField
.
getStoreFieldType
().
intValue
();
if
(
storeFieldType
!=
StoreFieldTypeEnum
.
RADIO
.
getCode
()
&&
storeFieldType
!=
StoreFieldTypeEnum
.
CHECK
.
getCode
())
{
if
(
storeFieldType
!=
StoreFieldTypeEnum
.
RADIO
.
getCode
()
&&
storeFieldType
!=
StoreFieldTypeEnum
.
CHECK
.
getCode
())
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"属性类型有误"
);
}
...
...
@@ -95,25 +97,34 @@ public class StoreFieldSelectApiServiceImpl implements StoreFieldSelectApiServic
}
@Override
public
ServiceResponse
<
Integer
>
setStoreFieldSelectSort
(
int
storeFieldSelectId
,
int
setValue
)
{
public
ServiceResponse
<
String
>
setStoreFieldSelectSort
(
int
storeFieldSelectId
,
int
setValue
)
{
TabStoreFieldSelect
tabStoreFieldSelect
=
storeFieldSelectService
.
getStoreFieldSelectById
(
storeFieldSelectId
);
if
(
tabStoreFieldSelect
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键错误,查询不到数据"
);
}
storeFieldSelectService
.
setStoreFieldSelectSort
(
storeFieldSelectId
,
tabStoreFieldSelect
.
getStoreFieldId
(),
setValue
);
return
ServiceResponse
.
success
(
1
);
return
ServiceResponse
.
success
(
tabStoreFieldSelect
.
getStoreFieldSelectName
()
);
}
@Override
public
ServiceResponse
<
Integer
>
delete
(
String
storeFieldSelectIds
)
{
public
ServiceResponse
<
String
>
delete
(
String
storeFieldSelectIds
)
{
String
[]
storeFieldSelectArr
=
storeFieldSelectIds
.
split
(
","
);
ServiceResponse
validResult
=
validDelete
(
storeFieldSelectArr
);
if
(!
validResult
.
isSuccess
())
{
return
validResult
;
}
return
ServiceResponse
.
success
(
storeFieldSelectService
.
deleteBatch
(
transferStringToInteger
(
storeFieldSelectArr
)));
storeFieldSelectService
.
deleteBatch
(
transferStringToInteger
(
storeFieldSelectArr
));
List
<
TabStoreFieldSelect
>
selectList
=
storeFieldSelectService
.
listStoreFieldSelectByIds
(
transferStringToInteger
(
storeFieldSelectArr
));
StringBuilder
string
=
new
StringBuilder
();
if
(
CollectionUtils
.
isNotEmpty
(
selectList
))
{
for
(
TabStoreFieldSelect
select
:
selectList
)
{
string
.
append
(
select
.
getStoreFieldSelectName
()).
append
(
SignConstants
.
COMMA
);
}
}
return
ServiceResponse
.
success
(
string
.
toString
());
}
@Override
...
...
@@ -188,7 +199,8 @@ public class StoreFieldSelectApiServiceImpl implements StoreFieldSelectApiServic
@Override
public
ServiceResponse
<
List
<
StoreFieldSelectDTO
>>
listStoreFieldSelectByIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeFileIdSelectIdList
)
{
List
<
TabStoreFieldSelect
>
list
=
this
.
storeFieldSelectService
.
listStoreFieldSelectByIds
(
storeFileIdSelectIdList
);
List
<
TabStoreFieldSelect
>
list
=
this
.
storeFieldSelectService
.
listStoreFieldSelectByIds
(
storeFileIdSelectIdList
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreFieldSelectDTO
.
class
,
list
));
}
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreGroupApiServiceImpl.java
View file @
1585234a
...
...
@@ -93,7 +93,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
}
@Override
public
ServiceResponse
<
Integer
>
update
(
StoreGroupDTO
storeGroupDTO
)
{
public
ServiceResponse
<
String
>
update
(
StoreGroupDTO
storeGroupDTO
)
{
if
(
storeGroupDTO
.
getStoreGroupId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键不能为空"
);
}
...
...
@@ -153,7 +153,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
}
else
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"一级分组不需要修改上级分组"
);
}
return
ServiceResponse
.
success
(
SUCCESS
);
return
ServiceResponse
.
success
(
oldStoreGroup
.
getStoreGroupName
()
);
}
@Override
...
...
@@ -182,7 +182,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
}
@Override
public
ServiceResponse
<
Integer
>
sort
(
StoreGroupDTO
storeGroupDTO
,
boolean
isUp
)
{
public
ServiceResponse
<
String
>
sort
(
StoreGroupDTO
storeGroupDTO
,
boolean
isUp
)
{
TabStoreGroup
tabStoreGroup
=
storeGroupService
.
getStoreGroupById
(
storeGroupDTO
.
getStoreGroupId
());
if
(
tabStoreGroup
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"门店分组主键有误"
);
...
...
@@ -205,7 +205,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
}
updateSort
(
needUpdateSortStoreGroup
.
getStoreGroupId
(),
sort
);
updateSort
(
storeGroupDTO
.
getStoreGroupId
(),
needUpdateSortStoreGroup
.
getSort
());
return
ServiceResponse
.
success
(
SUCCESS
);
return
ServiceResponse
.
success
(
tabStoreGroup
.
getStoreGroupName
()
);
}
@Override
...
...
@@ -236,8 +236,9 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
}
@Override
public
ServiceResponse
<
Integer
>
remove
(
int
storeGroupId
)
{
if
(
storeGroupService
.
getStoreGroupById
(
storeGroupId
)
==
null
)
{
public
ServiceResponse
<
String
>
remove
(
int
storeGroupId
)
{
TabStoreGroup
record
=
storeGroupService
.
getStoreGroupById
(
storeGroupId
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"门店分组主键有误"
);
}
if
(
isContainStore
(
storeGroupId
))
{
...
...
@@ -249,7 +250,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
storeGroupService
.
update
(
tabStoreGroup
);
refreshRedisCache
(
storeGroupId
);
return
ServiceResponse
.
success
(
SUCCESS
);
return
ServiceResponse
.
success
(
record
.
getStoreGroupName
()
);
}
@Override
...
...
@@ -263,7 +264,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
}
@Override
public
ServiceResponse
<
Integer
>
dragSort
(
Integer
storeGroupId
,
Integer
setSortValue
)
{
public
ServiceResponse
<
String
>
dragSort
(
Integer
storeGroupId
,
Integer
setSortValue
)
{
TabStoreGroup
tabStoreGroup
=
storeGroupService
.
getStoreGroupById
(
storeGroupId
);
if
(
tabStoreGroup
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键错误,查询不到数据"
);
...
...
@@ -273,7 +274,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"拖拽排序值不能为空"
);
}
storeGroupService
.
dragSort
(
tabStoreGroup
,
setSortValue
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
tabStoreGroup
.
getStoreGroupName
()
);
}
@Override
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreStrategyApiServiceImpl.java
View file @
1585234a
...
...
@@ -76,12 +76,13 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
}
@Override
public
ServiceResponse
<
Integer
>
deleteStoreStrategy
(
int
strategyId
)
{
public
ServiceResponse
<
String
>
deleteStoreStrategy
(
int
strategyId
)
{
TabStoreStrategy
storeStrategy
=
storeStrategyService
.
getStoreStrategyById
(
strategyId
);
if
(
storeStrategy
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"策略主键ID错误,查询不到数据"
);
}
return
ServiceResponse
.
success
(
storeStrategyService
.
deleteStoreGroupStrategy
(
strategyId
));
storeStrategyService
.
deleteStoreGroupStrategy
(
strategyId
);
return
ServiceResponse
.
success
(
storeStrategy
.
getStrategyName
());
}
@Override
...
...
@@ -131,27 +132,27 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
}
@Override
public
ServiceResponse
<
Integer
>
sortBottom
(
int
strategyId
)
{
public
ServiceResponse
<
String
>
sortBottom
(
int
strategyId
)
{
TabStoreStrategy
storeStrategy
=
storeStrategyService
.
getStoreStrategyById
(
strategyId
);
if
(
storeStrategy
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"策略主键ID错误,查询不到数据"
);
}
storeStrategyService
.
sortBottom
(
storeStrategy
.
getEnterpriseId
(),
strategyId
,
storeStrategy
.
getStrategyType
());
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
storeStrategy
.
getStrategyName
()
);
}
@Override
public
ServiceResponse
<
Integer
>
sortTopping
(
int
strategyId
)
{
public
ServiceResponse
<
String
>
sortTopping
(
int
strategyId
)
{
TabStoreStrategy
storeStrategy
=
storeStrategyService
.
getStoreStrategyById
(
strategyId
);
if
(
storeStrategy
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"策略主键ID错误,查询不到数据"
);
}
storeStrategyService
.
sortTopping
(
storeStrategy
.
getEnterpriseId
(),
strategyId
,
storeStrategy
.
getStrategyType
());
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
storeStrategy
.
getStrategyName
()
);
}
@Override
public
ServiceResponse
<
Integer
>
upOrDown
(
int
strategyId
,
boolean
isUp
)
{
public
ServiceResponse
<
String
>
upOrDown
(
int
strategyId
,
boolean
isUp
)
{
TabStoreStrategy
storeStrategy
=
storeStrategyService
.
getStoreStrategyById
(
strategyId
);
if
(
storeStrategy
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"策略主键ID错误,查询不到数据"
);
...
...
@@ -170,17 +171,17 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
}
storeStrategyService
.
updateSortById
(
needUpdateSort
.
getStrategyId
(),
storeStrategy
.
getSort
());
storeStrategyService
.
updateSortById
(
storeStrategy
.
getStrategyId
(),
needUpdateSort
.
getSort
());
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
storeStrategy
.
getStrategyName
()
);
}
@Override
public
ServiceResponse
<
Integer
>
setStoreStrategySort
(
int
strategyId
,
int
setValue
)
{
public
ServiceResponse
<
String
>
setStoreStrategySort
(
int
strategyId
,
int
setValue
)
{
TabStoreStrategy
storeStrategy
=
storeStrategyService
.
getStoreStrategyById
(
strategyId
);
if
(
storeStrategy
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"策略主键ID错误,查询不到数据"
);
}
storeStrategyService
.
setStoreStrategySort
(
strategyId
,
storeStrategy
.
getEnterpriseId
(),
setValue
,
storeStrategy
.
getStrategyType
());
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
storeStrategy
.
getStrategyName
()
);
}
@Override
...
...
@@ -212,7 +213,7 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
@Override
public
ServiceResponse
resetStoreGroupStrategy
(
List
<
Integer
>
regionIdList
,
List
<
Integer
>
storeStatusList
)
{
public
ServiceResponse
<
String
>
resetStoreGroupStrategy
(
List
<
Integer
>
regionIdList
,
List
<
Integer
>
storeStatusList
)
{
StoreSearchDBDTO
searchDBDTO
=
new
StoreSearchDBDTO
();
searchDBDTO
.
setRegionIdList
(
regionIdList
);
searchDBDTO
.
setStatusList
(
storeStatusList
);
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreFieldController.java
View file @
1585234a
...
...
@@ -5,7 +5,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -18,8 +17,9 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.download.utils.OperationResultUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.
utils.ResultControllerUtils
;
import
com.gic.enterprise.
response.EnterpriseRestResponse
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.store.constant.StoreFieldDateEnum
;
import
com.gic.store.constant.StoreFieldTextEnum
;
...
...
@@ -112,10 +112,8 @@ public class StoreFieldController {
}
storeFieldQO
.
setStoreRegionId
(
region
.
toString
());
ServiceResponse
result
=
storeFieldApiService
.
save
(
transferQoToDTO
(
storeFieldQO
));
if
(!
result
.
isSuccess
())
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
RestResponse
.
success
(
result
.
getResult
());
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_NEW
+
"自定义属性字段"
,
storeFieldQO
.
getStoreFieldName
());
}
@RequestMapping
(
"/edit-store-field"
)
...
...
@@ -130,10 +128,8 @@ public class StoreFieldController {
}
storeFieldQO
.
setStoreRegionId
(
region
.
toString
());
ServiceResponse
result
=
storeFieldApiService
.
edit
(
transferQoToDTO
(
storeFieldQO
));
if
(!
result
.
isSuccess
())
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
RestResponse
.
success
(
result
.
getResult
());
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_EDIT
+
"自定义属性字段"
,
storeFieldQO
.
getStoreFieldName
());
}
@RequestMapping
(
"/get-store-field"
)
...
...
@@ -159,11 +155,8 @@ public class StoreFieldController {
@RequestMapping
(
"/remove-store-field"
)
public
RestResponse
removeStoreField
(
@Validated
({
StoreFieldQO
.
RemoveValidView
.
class
})
StoreFieldQO
storeFieldQO
)
{
ServiceResponse
result
=
storeFieldApiService
.
delete
(
storeFieldQO
.
getStoreFieldId
());
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_DELETE
+
"自定义属性字段"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/list-store-field-by-region-id"
)
...
...
@@ -198,11 +191,8 @@ public class StoreFieldController {
storeFieldIdList
.
add
(
Integer
.
parseInt
(
id
));
}
ServiceResponse
result
=
storeFieldApiService
.
deleteBatch
(
storeFieldIdList
);
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
"批量删除自定义属性字段"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
}
...
...
@@ -224,8 +214,8 @@ public class StoreFieldController {
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
search
,
pageQO
.
getCurrentPage
(),
pageQO
.
getPageSize
());
if
(
result
.
isSuccess
())
{
ServiceResponse
<
List
<
StoreRegionDTO
>>
serviceResponse
=
storeRegionApiService
.
listStoreRegion
(
enterpriseId
,
null
);
ServiceResponse
<
List
<
StoreRegionDTO
>>
serviceResponse
=
storeRegionApiService
.
listStoreRegion
(
enterpriseId
,
null
);
List
<
StoreRegionDTO
>
regionDTOList
=
serviceResponse
.
getResult
();
Map
<
Integer
,
String
>
regionMap
=
new
HashMap
<>(
16
);
for
(
StoreRegionDTO
regionDTO
:
regionDTOList
)
{
...
...
@@ -300,11 +290,8 @@ public class StoreFieldController {
StoreFieldQO
.
RemoveValidView
.
class
})
StoreFieldQO
storeFieldQO
)
{
ServiceResponse
result
=
storeFieldApiService
.
setStoreFieldSort
(
storeFieldQO
.
getStoreFieldId
(),
storeFieldQO
.
getSortValue
(),
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
"排序自定义属性字段"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/save-store-field-select"
)
...
...
@@ -313,18 +300,16 @@ public class StoreFieldController {
dto
.
setStoreFieldSelectCode
(
storeFieldSelectCode
);
dto
.
setStoreFieldSelectName
(
storeFieldSelectName
);
dto
.
setStoreFieldId
(
storeFieldId
);
return
ResultControllerUtils
.
commonResult
(
storeFieldSelectApiService
.
save
(
dto
));
return
OperationResultUtils
.
operationResult
(
storeFieldSelectApiService
.
save
(
dto
),
OperationResultUtils
.
LOG_NEW
+
"自定义属性值"
,
storeFieldSelectName
);
}
@RequestMapping
(
"/edit-store-field-select"
)
public
RestResponse
editStoreFieldSelect
(
@Validated
({
StoreFieldSelectQO
.
EditValidView
.
class
})
StoreFieldSelectQO
storeFieldSelectQO
)
{
ServiceResponse
result
=
storeFieldSelectApiService
.
edit
(
transferSelectQoToDTO
(
storeFieldSelectQO
));
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_EDIT
+
"自定义属性值"
,
storeFieldSelectQO
.
getStoreFieldSelectName
());
}
@RequestMapping
(
"/swap-store-field-select"
)
...
...
@@ -374,11 +359,8 @@ public class StoreFieldController {
StoreFieldSelectQO
.
RemoveValidView
.
class
})
StoreFieldSelectQO
storeFieldSelectQO
)
{
ServiceResponse
result
=
storeFieldSelectApiService
.
setStoreFieldSelectSort
(
storeFieldSelectQO
.
getStoreFieldSelectId
(),
storeFieldSelectQO
.
getSortValue
());
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
"排序自定义属性值"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/delete-store-field-select"
)
...
...
@@ -387,10 +369,8 @@ public class StoreFieldController {
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"storeFieldSelectIds:不能为空"
);
}
ServiceResponse
result
=
storeFieldSelectApiService
.
delete
(
storeFieldSelectIds
);
if
(!
result
.
isSuccess
())
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
RestResponse
.
success
();
return
OperationResultUtils
.
operationResult
(
result
,
"批量删除自定义属性值"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
private
StoreFieldDTO
transferQoToDTO
(
StoreFieldQO
storeFieldQO
)
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreGroupController.java
View file @
1585234a
...
...
@@ -2,6 +2,7 @@ package com.gic.store.web.controller;
import
java.util.List
;
import
com.gic.download.utils.OperationResultUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -39,7 +40,8 @@ public class StoreGroupController {
@RequestMapping
(
"/list"
)
public
RestResponse
listStoreGroup
(
StoreGroupQO
storeGroupQO
)
{
ServiceResponse
<
List
<
StoreGroupDTO
>>
result
=
storeGroupApiService
.
listStoreGroup
(
transferQoToDTO
(
storeGroupQO
));
ServiceResponse
<
List
<
StoreGroupDTO
>>
result
=
storeGroupApiService
.
listStoreGroup
(
transferQoToDTO
(
storeGroupQO
));
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
ChangeListToTree
.
changeListToTree
(
StoreGroupConstant
.
ALL_STORE_LEVEL
,
result
.
getResult
()));
...
...
@@ -49,41 +51,45 @@ public class StoreGroupController {
@RequestMapping
(
"/save"
)
public
RestResponse
save
(
@Validated
({
StoreGroupQO
.
SaveValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
return
RestResponse
.
success
(
CommonResultControllerUtils
.
commonResult
(
storeGroupApiService
.
save
(
transferQoToDTO
(
storeGroupQO
))
));
return
OperationResultUtils
.
operationResult
(
storeGroupApiService
.
save
(
transferQoToDTO
(
storeGroupQO
)),
OperationResultUtils
.
LOG_NEW
+
"门店分组"
,
storeGroupQO
.
getStoreGroupName
(
));
}
@RequestMapping
(
"/edit-store-group-name"
)
public
RestResponse
editName
(
@Validated
({
StoreGroupQO
.
EditNameValidView
.
class
,
StoreGroupQO
.
RemoveValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
return
RestResponse
.
success
(
CommonResultControllerUtils
.
commonResult
(
storeGroupApiService
.
updateStoreGroupName
(
transferQoToDTO
(
storeGroupQO
))));
return
OperationResultUtils
.
operationResult
(
storeGroupApiService
.
updateStoreGroupName
(
transferQoToDTO
(
storeGroupQO
)),
OperationResultUtils
.
LOG_EDIT
+
"门店分组"
,
storeGroupQO
.
getStoreGroupName
());
}
@RequestMapping
(
"/edit-parent-store-group-id"
)
public
RestResponse
edit
(
@Validated
({
StoreGroupQO
.
EditParentIdValidView
.
class
,
StoreGroupQO
.
RemoveValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
return
RestResponse
.
success
(
CommonResultControllerUtils
.
commonResult
(
storeGroupApiService
.
update
(
transferQoToDTO
(
storeGroupQO
))
));
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
update
(
transferQoToDTO
(
storeGroupQO
));
return
OperationResultUtils
.
operationResult
(
result
,
"修改上级分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/drag-sort"
)
public
RestResponse
dragSort
(
@Validated
({
StoreGroupQO
.
RemoveValidView
.
class
,
StoreGroupQO
.
SetSortValueValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
return
RestResponse
.
success
(
CommonResultControllerUtils
.
commonResult
(
storeGroupApiService
.
dragSort
(
storeGroupQO
.
getStoreGroupId
(),
storeGroupQO
.
getSortValue
())));
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
dragSort
(
storeGroupQO
.
getStoreGroupId
(),
storeGroupQO
.
getSortValue
());
return
OperationResultUtils
.
operationResult
(
result
,
"拖拽排序门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/sort"
)
public
RestResponse
sort
(
@Validated
({
StoreGroupQO
.
SortValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
return
RestResponse
.
success
(
CommonResultControllerUtils
.
commonResult
(
storeGroupApiService
.
sort
(
transferQoToDTO
(
storeGroupQO
),
storeGroupQO
.
isUp
())));
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
sort
(
transferQoToDTO
(
storeGroupQO
),
storeGroupQO
.
isUp
());
return
OperationResultUtils
.
operationResult
(
result
,
"上下排序门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/remove"
)
public
RestResponse
remove
(
@Validated
({
StoreGroupQO
.
RemoveValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
return
RestResponse
.
success
(
CommonResultControllerUtils
.
commonResult
(
storeGroupApiService
.
remove
(
storeGroupQO
.
getStoreGroupId
())));
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
remove
(
storeGroupQO
.
getStoreGroupId
());
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_DELETE
+
"门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
private
StoreGroupDTO
transferQoToDTO
(
StoreGroupQO
storeGroupQO
)
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreStrategyController.java
View file @
1585234a
...
...
@@ -5,6 +5,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.gic.download.utils.OperationResultUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -113,10 +114,8 @@ public class StoreStrategyController {
public
RestResponse
saveStoreStrategy
(
@Validated
({
StoreStrategyQO
.
SaveValidView
.
class
,
StoreStrategyQO
.
StoreStrategyTypeValidView
.
class
})
StoreStrategyQO
storeStrategyQO
)
{
ServiceResponse
result
=
storeStrategyApiService
.
saveStoreStrategy
(
transferQoToDTO
(
storeStrategyQO
));
if
(!
result
.
isSuccess
())
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
RestResponse
.
success
(
result
.
getResult
());
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_NEW
+
"策略"
,
storeStrategyQO
.
getStrategyName
());
}
@RequestMapping
(
"/list-store-create-type"
)
...
...
@@ -143,9 +142,7 @@ public class StoreStrategyController {
ServiceResponse
result
=
storeStrategyApiService
.
resetStoreGroupStrategy
(
transferStringArrToList
(
regionIds
),
transferStringArrToList
(
status
));
if
(!
result
.
isSuccess
())
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
"重置门店策略"
,
"门店策略"
);
}
return
RestResponse
.
success
();
...
...
@@ -155,10 +152,8 @@ public class StoreStrategyController {
public
RestResponse
editStoreStrategy
(
@Validated
({
StoreStrategyQO
.
SaveValidView
.
class
,
StoreStrategyQO
.
RemoveValidView
.
class
})
StoreStrategyQO
storeStrategyQO
)
{
ServiceResponse
result
=
storeStrategyApiService
.
editStoreStrategy
(
transferQoToDTO
(
storeStrategyQO
));
if
(!
result
.
isSuccess
())
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
RestResponse
.
success
(
result
.
getResult
());
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_EDIT
+
"策略"
,
storeStrategyQO
.
getStrategyName
());
}
@RequestMapping
(
"/get-store-strategy"
)
...
...
@@ -174,18 +169,16 @@ public class StoreStrategyController {
@RequestMapping
(
"/delete-store-strategy"
)
public
RestResponse
deleteStoreStrategy
(
@Validated
({
StoreStrategyQO
.
RemoveValidView
.
class
})
StoreStrategyQO
storeStrategyQO
)
{
ServiceResponse
result
=
storeStrategyApiService
.
deleteStoreStrategy
(
storeStrategyQO
.
getStrategyId
());
if
(!
result
.
isSuccess
())
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
RestResponse
.
success
(
result
.
getResult
());
ServiceResponse
<
String
>
result
=
storeStrategyApiService
.
deleteStoreStrategy
(
storeStrategyQO
.
getStrategyId
());
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_DELETE
+
"策略"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/swap-store-strategy"
)
public
RestResponse
swapStoreStrategy
(
@Validated
({
StoreStrategyQO
.
SwapValidView
.
class
,
StoreStrategyQO
.
RemoveValidView
.
class
})
StoreStrategyQO
storeStrategyQO
)
{
int
upOrDown
=
storeStrategyQO
.
getUpOrDown
();
ServiceResponse
result
;
ServiceResponse
<
String
>
result
;
switch
(
upOrDown
)
{
case
StoreGroupConstant
.
SORT_UP
:
result
=
storeStrategyApiService
.
upOrDown
(
storeStrategyQO
.
getStrategyId
(),
true
);
...
...
@@ -202,11 +195,7 @@ public class StoreStrategyController {
default
:
result
=
null
;
}
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
"排序策略"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/set-store-strategy-sort-value"
)
...
...
@@ -214,11 +203,7 @@ public class StoreStrategyController {
StoreStrategyQO
.
RemoveValidView
.
class
})
StoreStrategyQO
storeStrategyQO
)
{
ServiceResponse
result
=
storeStrategyApiService
.
setStoreStrategySort
(
storeStrategyQO
.
getStrategyId
(),
storeStrategyQO
.
getSortValue
());
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
result
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
return
OperationResultUtils
.
operationResult
(
result
,
"拖拽排序策略"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/list-store-strategy"
)
...
...
@@ -244,7 +229,8 @@ public class StoreStrategyController {
}
ServiceResponse
result
=
storeStrategyApiService
.
setStoreGroupStrategyWeight
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
weight
);
return
RestResponse
.
success
(
result
.
getResult
());
return
OperationResultUtils
.
operationResult
(
result
,
"设置门店分组策略权重"
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
());
}
@RequestMapping
(
"/get-store-strategy-weights"
)
...
...
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