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
78aec1c9
Commit
78aec1c9
authored
Nov 08, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店模块添加日志
parent
e49f0488
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
157 additions
and
29 deletions
+157
-29
ClerkApiService.java
.../src/main/java/com/gic/store/service/ClerkApiService.java
+14
-1
StoreBrandApiService.java
...main/java/com/gic/store/service/StoreBrandApiService.java
+20
-5
TabClerkMapper.java
...rc/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
+3
-0
TabStoreBrandMapper.java
...in/java/com/gic/store/dao/mapper/TabStoreBrandMapper.java
+1
-3
ClerkService.java
...ice/src/main/java/com/gic/store/service/ClerkService.java
+1
-0
StoreBrandService.java
...rc/main/java/com/gic/store/service/StoreBrandService.java
+3
-1
ClerkServiceImpl.java
...ain/java/com/gic/store/service/impl/ClerkServiceImpl.java
+13
-1
StoreBrandServiceImpl.java
...ava/com/gic/store/service/impl/StoreBrandServiceImpl.java
+8
-3
ClerkApiServiceImpl.java
...com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
+10
-0
StoreBrandApiServiceImpl.java
...ic/store/service/outer/impl/StoreBrandApiServiceImpl.java
+9
-3
TabClerkMapper.xml
...tore-service/src/main/resources/mapper/TabClerkMapper.xml
+15
-0
TabStoreBrandMapper.xml
...service/src/main/resources/mapper/TabStoreBrandMapper.xml
+0
-6
ClerkController.java
...in/java/com/gic/store/web/controller/ClerkController.java
+21
-0
ClerkImportController.java
...a/com/gic/store/web/controller/ClerkImportController.java
+2
-0
StoreBrandController.java
...va/com/gic/store/web/controller/StoreBrandController.java
+27
-3
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+2
-0
StoreImportController.java
...a/com/gic/store/web/controller/StoreImportController.java
+3
-0
StoreRegionController.java
...a/com/gic/store/web/controller/StoreRegionController.java
+2
-0
ClerkQO.java
...web/src/main/java/com/gic/store/web/qo/clerk/ClerkQO.java
+3
-3
No files found.
gic-store-api/src/main/java/com/gic/store/service/ClerkApiService.java
View file @
78aec1c9
...
...
@@ -6,6 +6,8 @@ import com.gic.store.dto.ClerkDTO;
import
com.gic.store.dto.ClerkSearchDTO
;
import
com.gic.store.dto.ClerkStoreListDTO
;
import
java.util.List
;
/**
* @ClassName: ClerkApiService
* @Description: 导购service
...
...
@@ -38,6 +40,7 @@ public interface ClerkApiService {
ServiceResponse
<
Page
<
ClerkStoreListDTO
>>
listClerk
(
Integer
enterpriseId
,
ClerkSearchDTO
clerkSearchDTO
,
Integer
pageNum
,
Integer
pageSize
);
/**
* 批量修改状态
* @Title: updateClerkStatus
* @Description: 批量修改导购状态
* @author zhiwj
...
...
@@ -49,5 +52,15 @@ public interface ClerkApiService {
*/
ServiceResponse
<
Void
>
updateClerkStatus
(
Integer
enterpriseId
,
String
clerkIds
,
Integer
status
);
/**
* 查询list通过id
* @Title: listClerkByIds
* @Description:
* @author zhiwj
* @param enterpriseId
* @param clerkIds
* @return java.util.List<com.gic.store.dto.ClerkDTO>
* @throws
*/
ServiceResponse
<
List
<
ClerkDTO
>>
listClerkByIds
(
Integer
enterpriseId
,
String
clerkIds
);
}
gic-store-api/src/main/java/com/gic/store/service/StoreBrandApiService.java
View file @
78aec1c9
...
...
@@ -4,7 +4,6 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.store.dto.StoreBrandDTO
;
import
javax.xml.ws.Service
;
import
java.util.List
;
/**
...
...
@@ -44,12 +43,10 @@ public interface StoreBrandApiService {
* @author zhiwj
* @param enterpriseId 企业id
* @param search 品牌name or 品牌code
* @param storeSupport 门店适用
* @param goodsSupport 商品适用
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.store.dto.StoreBrandDTO>>
* @throws
*/
ServiceResponse
<
List
<
StoreBrandDTO
>>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
,
Integer
storeSupport
,
Integer
goodsSupport
);
ServiceResponse
<
List
<
StoreBrandDTO
>>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
);
/**
* @Title: deleteAll
...
...
@@ -96,7 +93,25 @@ public interface StoreBrandApiService {
*/
ServiceResponse
<
Void
>
setStoreBrandSort
(
Integer
enterpriseId
,
Integer
storeBrandId
,
Integer
seq
);
/**
* 查询list
* @Title: listStoreBrandByIds
* @Description:
* @author zhiwj
* @param brandIdList
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.store.dto.StoreBrandDTO>>
* @throws
*/
ServiceResponse
<
List
<
StoreBrandDTO
>>
listStoreBrandByIds
(
List
<
Integer
>
brandIdList
);
/**
* 查详情
* @Title: getById
* @Description:
* @author zhiwj
* @param storeBrandId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.store.dto.StoreBrandDTO>
* @throws
*/
ServiceResponse
<
StoreBrandDTO
>
getById
(
Integer
storeBrandId
);
}
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
View file @
78aec1c9
...
...
@@ -65,4 +65,6 @@ public interface TabClerkMapper {
Integer
updateClerkStatus
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"clerkIds"
)
List
<
Integer
>
clerkIds
,
@Param
(
"status"
)
Integer
status
);
TabClerk
getBySelective
(
TabClerk
tabClerk
);
List
<
TabClerk
>
listClerkByIds
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"ids"
)
List
<
Integer
>
clerkIdList
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreBrandMapper.java
View file @
78aec1c9
...
...
@@ -81,11 +81,9 @@ public interface TabStoreBrandMapper {
* 查列表
* @param enterpriseId
* @param search
* @param storeSupport
* @param goodsSupport
* @return
*/
List
<
TabStoreBrand
>
listStoreBrand
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"search"
)
String
search
,
@Param
(
"storeSupport"
)
Integer
storeSupport
,
@Param
(
"goodsSupport"
)
Integer
goodsSupport
);
List
<
TabStoreBrand
>
listStoreBrand
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"search"
)
String
search
);
/**
* 查询比传入sort小的sort中最大的
...
...
gic-store-service/src/main/java/com/gic/store/service/ClerkService.java
View file @
78aec1c9
...
...
@@ -103,4 +103,5 @@ public interface ClerkService {
*/
Integer
updateClerkStatus
(
Integer
enterpriseId
,
String
clerkIds
,
Integer
status
);
List
<
TabClerk
>
listClerkByIds
(
Integer
enterpriseId
,
String
clerkIds
);
}
gic-store-service/src/main/java/com/gic/store/service/StoreBrandService.java
View file @
78aec1c9
...
...
@@ -21,7 +21,7 @@ public interface StoreBrandService {
Page
<
TabStoreBrand
>
listStoreBrand
(
Integer
enterpriseId
,
String
search
,
Integer
pageNum
,
Integer
pageSize
);
List
<
TabStoreBrand
>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
,
Integer
storeSupport
,
Integer
goodsSupport
);
List
<
TabStoreBrand
>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
);
void
sortMoveUp
(
Integer
enterpriseId
,
Integer
storeBrandId
);
...
...
@@ -38,4 +38,6 @@ public interface StoreBrandService {
List
<
TabStoreBrand
>
listStoreBrandByIds
(
String
brandIds
);
List
<
TabStoreBrand
>
listStoreBrandByIds
(
List
<
Integer
>
brandIdList
);
TabStoreBrand
getById
(
Integer
storeBrandId
);
}
gic-store-service/src/main/java/com/gic/store/service/impl/ClerkServiceImpl.java
View file @
78aec1c9
...
...
@@ -100,9 +100,21 @@ public class ClerkServiceImpl implements ClerkService {
String
[]
split
=
clerkIds
.
split
(
GlobalInfo
.
FLAG_COMMA
);
clerkIdList
=
Stream
.
of
(
split
).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
}
else
{
clerkIdList
=
Collections
.
emptyList
()
;
return
0
;
}
return
tabClerkMapper
.
updateClerkStatus
(
enterpriseId
,
clerkIdList
,
status
);
}
@Override
public
List
<
TabClerk
>
listClerkByIds
(
Integer
enterpriseId
,
String
clerkIds
)
{
if
(
StringUtils
.
isNotBlank
(
clerkIds
))
{
List
<
Integer
>
clerkIdList
;
String
[]
split
=
clerkIds
.
split
(
GlobalInfo
.
FLAG_COMMA
);
clerkIdList
=
Stream
.
of
(
split
).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
return
tabClerkMapper
.
listClerkByIds
(
enterpriseId
,
clerkIdList
);
}
else
{
return
Collections
.
emptyList
();
}
}
}
gic-store-service/src/main/java/com/gic/store/service/impl/StoreBrandServiceImpl.java
View file @
78aec1c9
...
...
@@ -68,13 +68,13 @@ public class StoreBrandServiceImpl implements StoreBrandService {
@Override
public
Page
<
TabStoreBrand
>
listStoreBrand
(
Integer
enterpriseId
,
String
search
,
Integer
pageNum
,
Integer
pageSize
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
TabStoreBrand
>
storeBrandList
=
tabStoreBrandMapper
.
listStoreBrand
(
enterpriseId
,
search
,
null
,
null
);
List
<
TabStoreBrand
>
storeBrandList
=
tabStoreBrandMapper
.
listStoreBrand
(
enterpriseId
,
search
);
return
(
Page
<
TabStoreBrand
>)
storeBrandList
;
}
@Override
public
List
<
TabStoreBrand
>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
,
Integer
storeSupport
,
Integer
goodsSupport
)
{
return
tabStoreBrandMapper
.
listStoreBrand
(
enterpriseId
,
search
,
storeSupport
,
goodsSupport
);
public
List
<
TabStoreBrand
>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
)
{
return
tabStoreBrandMapper
.
listStoreBrand
(
enterpriseId
,
search
);
}
@Override
...
...
@@ -178,4 +178,9 @@ public class StoreBrandServiceImpl implements StoreBrandService {
}
return
null
;
}
@Override
public
TabStoreBrand
getById
(
Integer
storeBrandId
)
{
return
tabStoreBrandMapper
.
selectByPrimaryKey
(
storeBrandId
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
View file @
78aec1c9
...
...
@@ -5,6 +5,7 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.commons.util.CollectionUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.store.constant.StoreOwnTypeEnum
;
import
com.gic.store.dto.*
;
import
com.gic.store.entity.TabClerk
;
...
...
@@ -149,4 +150,12 @@ public class ClerkApiServiceImpl implements ClerkApiService {
public
ServiceResponse
updateClerkStatus
(
Integer
enterpriseId
,
String
clerkIds
,
Integer
status
)
{
return
ServiceResponse
.
success
(
clerkService
.
updateClerkStatus
(
enterpriseId
,
clerkIds
,
status
));
}
@Override
public
ServiceResponse
<
List
<
ClerkDTO
>>
listClerkByIds
(
Integer
enterpriseId
,
String
clerkIds
)
{
List
<
TabClerk
>
clerkList
=
clerkService
.
listClerkByIds
(
enterpriseId
,
clerkIds
);
List
<
ClerkDTO
>
clerkDTOList
=
EntityUtil
.
changeEntityListByJSON
(
ClerkDTO
.
class
,
clerkList
);
return
EnterpriseServiceResponse
.
success
(
clerkDTOList
);
}
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreBrandApiServiceImpl.java
View file @
78aec1c9
...
...
@@ -88,15 +88,15 @@ public class StoreBrandApiServiceImpl implements StoreBrandApiService {
}
@Override
public
ServiceResponse
<
List
<
StoreBrandDTO
>>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
,
Integer
storeSupport
,
Integer
goodsSupport
)
{
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listAllStoreBrand
(
enterpriseId
,
search
,
storeSupport
,
goodsSupport
);
public
ServiceResponse
<
List
<
StoreBrandDTO
>>
listAllStoreBrand
(
Integer
enterpriseId
,
String
search
)
{
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listAllStoreBrand
(
enterpriseId
,
search
);
List
<
StoreBrandDTO
>
brandDTOList
=
EntityUtil
.
changeEntityListByOrika
(
StoreBrandDTO
.
class
,
storeBrandList
);
return
ServiceResponse
.
success
(
brandDTOList
);
}
@Override
public
ServiceResponse
deleteAll
(
Integer
enterpriseId
)
{
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listAllStoreBrand
(
enterpriseId
,
null
,
null
,
null
);
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listAllStoreBrand
(
enterpriseId
,
null
);
if
(
CollectionUtils
.
isEmpty
(
storeBrandList
))
{
return
ServiceResponse
.
success
();
}
...
...
@@ -167,6 +167,12 @@ public class StoreBrandApiServiceImpl implements StoreBrandApiService {
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreBrandDTO
.
class
,
tabStoreBrands
));
}
@Override
public
ServiceResponse
<
StoreBrandDTO
>
getById
(
Integer
storeBrandId
)
{
TabStoreBrand
storeBrand
=
this
.
storeBrandService
.
getById
(
storeBrandId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByJSON
(
StoreBrandDTO
.
class
,
storeBrand
));
}
private
void
addRef
(
StoreBrandDTO
storeBrandDTO
)
{
ServiceResponse
<
Integer
>
serviceResponse
=
platformBrandApiService
.
addRef
(
storeBrandDTO
.
getEnterpriseId
(),
storeBrandDTO
.
getStoreBrandId
(),
storeBrandDTO
.
getStoreBrandName
(),
storeBrandDTO
.
getStoreBrandCode
(),
storeBrandDTO
.
getStoreBrandCategoryCode
());
if
(
serviceResponse
.
isSuccess
()
&&
serviceResponse
.
getResult
()
!=
null
)
{
...
...
gic-store-service/src/main/resources/mapper/TabClerkMapper.xml
View file @
78aec1c9
...
...
@@ -260,4 +260,18 @@
</where>
limit 1
</select>
<select
id=
"listClerkByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_clerk
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"null != ids and ids.size > 0"
>
and clerk_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
gic-store-service/src/main/resources/mapper/TabStoreBrandMapper.xml
View file @
78aec1c9
...
...
@@ -186,12 +186,6 @@
<if
test=
"search != null and search != '' "
>
and ( store_brand_code like concat('%', #{search}, '%') or store_brand_name like concat('%', #{search}, '%') )
</if>
<if
test=
"storeSupport != null "
>
and store_support = #{storeSupport}
</if>
<if
test=
"goodsSupport != null "
>
and goods_support = #{goodsSupport}
</if>
order by sort
</select>
<select
id=
"getPrevSort"
resultMap=
"BaseResultMap"
>
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/ClerkController.java
View file @
78aec1c9
package
com
.
gic
.
store
.
web
.
controller
;
import
com.alibaba.fastjson.JSON
;
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.log.LogUtils
;
import
com.gic.enterprise.constants.Constants
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.store.dto.ClerkDTO
;
import
com.gic.store.dto.ClerkSearchDTO
;
import
com.gic.store.service.ClerkApiService
;
import
com.gic.store.web.qo.clerk.ClerkQO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @author zhiwj
* @date 2019/7/16
...
...
@@ -24,6 +30,13 @@ public class ClerkController {
@Autowired
private
ClerkApiService
clerkApiService
;
@RequestMapping
(
"/list-clerk-field"
)
public
RestResponse
listClerkField
()
{
//language=JSON
String
json
=
"[{\"fliedName\":\"店员名称\",\"fliedCode\":\"clerkName\"},{\"fliedName\":\"店员唯一关联主键\",\"fliedCode\":\"clerkCode\"},{\"fliedName\":\"职位\",\"fliedCode\":\"positionName\"},{\"fliedName\":\"性别\",\"fliedCode\":\"clerkGender\"},{\"fliedName\":\"国际码\",\"fliedCode\":\"nationcode\"},{\"fliedName\":\"手机号\",\"fliedCode\":\"phoneNumber\"},{\"fliedName\":\"好办状态\",\"fliedCode\":\"haobanStatus\"},{\"fliedName\":\"启用状态\",\"fliedCode\":\"status\"}]"
;
return
RestResponse
.
success
(
JSON
.
parseArray
(
json
));
}
@RequestMapping
(
"/save-clerk"
)
public
RestResponse
save
(
@Validated
(
ClerkQO
.
SaveValidView
.
class
)
ClerkQO
clerkQO
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
...
...
@@ -31,6 +44,7 @@ public class ClerkController {
clerkDTO
.
setEnterpriseId
(
enterpriseId
);
ServiceResponse
serviceResponse
=
clerkApiService
.
saveOrUpdate
(
clerkDTO
);
if
(
serviceResponse
.
isSuccess
())
{
LogUtils
.
createLog
((
clerkQO
.
getClerkId
()
==
null
?
"新增"
:
"修改"
)
+
"导购"
,
clerkQO
.
getClerkName
());
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
...
@@ -52,8 +66,15 @@ public class ClerkController {
@RequestMapping
(
"/update-clerk-status"
)
public
RestResponse
updateClerkStatus
(
String
clerkIds
,
Integer
status
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
List
<
ClerkDTO
>>
listClerkByIds
=
clerkApiService
.
listClerkByIds
(
enterpriseId
,
clerkIds
);
ServiceResponse
serviceResponse
=
clerkApiService
.
updateClerkStatus
(
enterpriseId
,
clerkIds
,
status
);
if
(
serviceResponse
.
isSuccess
())
{
List
<
ClerkDTO
>
clerkList
=
listClerkByIds
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
clerkList
))
{
String
clerkNames
=
clerkList
.
stream
().
map
(
ClerkDTO:
:
getClerkName
).
reduce
((
x
,
y
)
->
x
+
","
+
y
).
orElse
(
""
);
String
statusName
=
(
Constants
.
NORMAL_STATUS
.
equals
(
status
))
?
"启用"
:
"禁用"
;
LogUtils
.
createLog
(
"修改状态为"
+
statusName
,
clerkNames
);
}
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/ClerkImportController.java
View file @
78aec1c9
...
...
@@ -3,6 +3,7 @@ package com.gic.store.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.download.utils.log.LogUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.store.constant.GenderEnum
;
...
...
@@ -149,6 +150,7 @@ public class ClerkImportController {
}
else
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"选择xlsx格式文件上传"
);
}
LogUtils
.
createLog
(
"导入导购"
,
"导购"
);
return
RestResponse
.
success
();
}
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreBrandController.java
View file @
78aec1c9
...
...
@@ -3,7 +3,9 @@ package com.gic.store.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.download.utils.log.LogUtils
;
import
com.gic.enterprise.dto.PlatformBrandDTO
;
import
com.gic.enterprise.service.PlatformBrandApiService
;
import
com.gic.enterprise.utils.UserDetailUtils
;
...
...
@@ -11,12 +13,17 @@ import com.gic.store.dto.StoreBrandDTO;
import
com.gic.store.service.StoreBrandApiService
;
import
com.gic.store.web.qo.PageQO
;
import
com.gic.store.web.qo.storeBrand.StoreBrandQO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* @author zhiwj
...
...
@@ -48,6 +55,7 @@ public class StoreBrandController {
storeBrandDTO
.
setEnterpriseId
(
enterpriseId
);
ServiceResponse
<
Integer
>
serviceResponse
=
storeBrandApiService
.
saveOrUpdateStoreBrand
(
storeBrandDTO
);
if
(
serviceResponse
.
isSuccess
())
{
LogUtils
.
createLog
((
storeBrandQO
.
getStoreBrandId
()
==
null
?
"新增"
:
"修改"
)
+
"门店品牌"
,
storeBrandQO
.
getStoreBrandName
());
return
RestResponse
.
success
();
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
...
@@ -66,9 +74,9 @@ public class StoreBrandController {
}
@RequestMapping
(
"/list-store-brand"
)
public
RestResponse
listStoreBrand
(
String
search
,
Integer
storeSupport
,
Integer
goodsSupport
)
{
public
RestResponse
listStoreBrand
(
String
search
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
List
<
StoreBrandDTO
>>
serviceResponse
=
storeBrandApiService
.
listAllStoreBrand
(
enterpriseId
,
search
,
storeSupport
,
goodsSupport
);
ServiceResponse
<
List
<
StoreBrandDTO
>>
serviceResponse
=
storeBrandApiService
.
listAllStoreBrand
(
enterpriseId
,
search
);
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
...
...
@@ -81,6 +89,16 @@ public class StoreBrandController {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
serviceResponse
=
storeBrandApiService
.
deleteByIds
(
enterpriseId
,
ids
);
if
(
serviceResponse
.
isSuccess
())
{
if
(
StringUtils
.
isNotBlank
(
ids
))
{
ServiceResponse
<
List
<
StoreBrandDTO
>>
response
=
storeBrandApiService
.
listStoreBrandByIds
(
Stream
.
of
(
ids
.
split
(
GlobalInfo
.
FLAG_COMMA
)).
map
(
Integer:
:
valueOf
).
collect
(
Collectors
.
toList
()));
String
logName
=
Optional
.
ofNullable
(
response
.
getResult
())
.
orElse
(
Collections
.
emptyList
())
.
stream
()
.
map
(
StoreBrandDTO:
:
getStoreBrandName
)
.
reduce
((
x
,
y
)
->
x
+
","
+
y
)
.
orElse
(
""
);
LogUtils
.
createLog
(
"删除门店品牌"
,
logName
);
}
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
(),
serviceResponse
.
getResult
());
...
...
@@ -91,18 +109,21 @@ public class StoreBrandController {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
serviceResponse
=
storeBrandApiService
.
deleteAll
(
enterpriseId
);
if
(
serviceResponse
.
isSuccess
())
{
LogUtils
.
createLog
(
"删除所有"
,
"门店品牌"
);
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
(),
serviceResponse
.
getResult
());
}
}
@RequestMapping
(
"/move-store-brand"
)
public
RestResponse
moveStoreBrand
(
@Validated
(
StoreBrandQO
.
MoveValidView
.
class
)
StoreBrandQO
storeBrandQO
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
serviceResponse
=
storeBrandApiService
.
moveStoreBrand
(
enterpriseId
,
storeBrandQO
.
getStoreBrandId
(),
storeBrandQO
.
getMoveType
());
if
(
serviceResponse
.
isSuccess
())
{
ServiceResponse
<
StoreBrandDTO
>
service
=
storeBrandApiService
.
getById
(
storeBrandQO
.
getStoreBrandId
());
StoreBrandDTO
result
=
service
.
getResult
();
LogUtils
.
createLog
(
"设定序号"
,
result
.
getStoreBrandName
());
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
...
@@ -114,6 +135,9 @@ public class StoreBrandController {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
serviceResponse
=
storeBrandApiService
.
setStoreBrandSort
(
enterpriseId
,
storeBrandQO
.
getStoreBrandId
(),
storeBrandQO
.
getSeq
());
if
(
serviceResponse
.
isSuccess
())
{
ServiceResponse
<
StoreBrandDTO
>
service
=
storeBrandApiService
.
getById
(
storeBrandQO
.
getStoreBrandId
());
StoreBrandDTO
result
=
service
.
getResult
();
LogUtils
.
createLog
(
"设定序号"
,
result
.
getStoreBrandName
());
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
78aec1c9
...
...
@@ -5,6 +5,7 @@ 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.log.LogUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
com.gic.enterprise.utils.UserDetailUtils
;
...
...
@@ -79,6 +80,7 @@ public class StoreController {
storeDTO
.
setIsEditStoreGroup
(
isEditGroup
);
ServiceResponse
<
Integer
>
serviceResponse
=
storeApiService
.
saveOrUpdate
(
storeDTO
);
if
(
serviceResponse
.
isSuccess
())
{
LogUtils
.
createLog
((
storeQO
.
getStoreId
()
==
null
?
"新增"
:
"修改"
)
+
"门店"
,
storeQO
.
getStoreName
());
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreImportController.java
View file @
78aec1c9
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.download.utils.log.LogUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.store.constant.StoreImportEnum
;
...
...
@@ -178,6 +179,7 @@ public class StoreImportController {
}
else
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"选择xlsx格式文件上传"
);
}
LogUtils
.
createLog
(
"导入门店"
,
"门店"
);
return
RestResponse
.
success
();
}
...
...
@@ -279,6 +281,7 @@ public class StoreImportController {
OutputStream
out
=
response
.
getOutputStream
();
workbook
.
write
(
out
);
out
.
close
();
LogUtils
.
createLog
(
"导出错误日志"
,
"门店"
);
return
RestResponse
.
success
();
}
else
{
return
RestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"没有错误日志"
);
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreRegionController.java
View file @
78aec1c9
...
...
@@ -3,6 +3,7 @@ package com.gic.store.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.download.utils.log.LogUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.store.constant.StoreOwnTypeEnum
;
import
com.gic.store.dto.StoreRegionDTO
;
...
...
@@ -31,6 +32,7 @@ public class StoreRegionController {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
Integer
>
serviceResponse
=
storeRegionApiService
.
saveOrUpdateStoreRegion
(
enterpriseId
,
storeRegionQO
.
getRegionCode
(),
storeRegionQO
.
getRegionName
(),
storeRegionQO
.
getRegionId
());
if
(
serviceResponse
.
isSuccess
())
{
LogUtils
.
createLog
((
storeRegionQO
.
getRegionId
()
==
null
?
"新增"
:
"修改"
)
+
"门店域"
,
storeRegionQO
.
getRegionName
());
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
...
gic-store-web/src/main/java/com/gic/store/web/qo/clerk/ClerkQO.java
View file @
78aec1c9
...
...
@@ -23,7 +23,7 @@ public class ClerkQO implements Serializable {
* 店员id
*/
@NotNull
(
message
=
"导购id不能为空"
,
groups
=
{
EditValidView
.
class
})
private
String
clerkId
;
private
Integer
clerkId
;
/**
* 店员名称
*/
...
...
@@ -65,11 +65,11 @@ public class ClerkQO implements Serializable {
*/
private
Integer
status
;
public
String
getClerkId
()
{
public
Integer
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
public
void
setClerkId
(
Integer
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
...
...
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