记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
806f4d06
Commit
806f4d06
authored
Mar 04, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~API:完善逻辑校验;
parent
2e749112
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
8 deletions
+28
-8
GoblinStoreMgtCategoryController.java
...n/controller/manage/GoblinStoreMgtCategoryController.java
+5
-2
GoblinStoreMgtCouponController.java
...lin/controller/manage/GoblinStoreMgtCouponController.java
+16
-3
GoblinStoreMgtCategoryServiceImpl.java
...ervice/impl/manage/GoblinStoreMgtCategoryServiceImpl.java
+6
-2
GoblinStoreMgtGoodsServiceImpl.java
...n/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
+1
-1
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtCategoryController.java
View file @
806f4d06
...
@@ -176,7 +176,9 @@ public class GoblinStoreMgtCategoryController {
...
@@ -176,7 +176,9 @@ public class GoblinStoreMgtCategoryController {
updateStoreGoodsCategoryVo
.
setSort
(
null
==
sort
?
1
:
sort
);
updateStoreGoodsCategoryVo
.
setSort
(
null
==
sort
?
1
:
sort
);
updateStoreGoodsCategoryVo
.
setUpdatedBy
(
currentUid
);
updateStoreGoodsCategoryVo
.
setUpdatedBy
(
currentUid
);
updateStoreGoodsCategoryVo
.
setUpdatedAt
(
LocalDateTime
.
now
());
updateStoreGoodsCategoryVo
.
setUpdatedAt
(
LocalDateTime
.
now
());
return
ResponseDto
.
success
(
goblinStoreMgtCategoryService
.
edit
(
updateStoreGoodsCategoryVo
,
storeGoodsCategoryVosCache
));
boolean
result
=
goblinStoreMgtCategoryService
.
edit
(
updateStoreGoodsCategoryVo
,
storeGoodsCategoryVosCache
);
return
result
?
ResponseDto
.
success
(
result
)
:
ResponseDto
.
failure
();
}
}
@ApiOperationSupport
(
order
=
4
)
@ApiOperationSupport
(
order
=
4
)
...
@@ -192,6 +194,7 @@ public class GoblinStoreMgtCategoryController {
...
@@ -192,6 +194,7 @@ public class GoblinStoreMgtCategoryController {
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
}
return
ResponseDto
.
success
(
goblinStoreMgtCategoryService
.
del
(
currentUid
,
storeId
,
cateid
));
boolean
resultFlg
=
goblinStoreMgtCategoryService
.
del
(
currentUid
,
storeId
,
cateid
);
return
resultFlg
?
ResponseDto
.
success
()
:
ResponseDto
.
failure
();
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtCouponController.java
View file @
806f4d06
...
@@ -123,8 +123,8 @@ public class GoblinStoreMgtCouponController {
...
@@ -123,8 +123,8 @@ public class GoblinStoreMgtCouponController {
@ApiOperation
(
value
=
"优惠券管理"
)
@ApiOperation
(
value
=
"优惠券管理"
)
@PostMapping
(
"action"
)
@PostMapping
(
"action"
)
public
ResponseDto
<
Object
>
action
(
@Valid
@RequestBody
GoblinStoreMgtCouponActionParam
mgtCouponActionParam
)
{
public
ResponseDto
<
Object
>
action
(
@Valid
@RequestBody
GoblinStoreMgtCouponActionParam
mgtCouponActionParam
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
()
,
storeId
=
mgtCouponActionParam
.
getStoreId
()
;
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
mgtCouponActionParam
.
getStoreId
()
))
{
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
}
List
<
String
>
storeCouponIdList
=
mgtCouponActionParam
.
getStoreCouponIdList
();
List
<
String
>
storeCouponIdList
=
mgtCouponActionParam
.
getStoreCouponIdList
();
...
@@ -142,6 +142,10 @@ public class GoblinStoreMgtCouponController {
...
@@ -142,6 +142,10 @@ public class GoblinStoreMgtCouponController {
if
(
null
==
storeCouponVo
)
{
if
(
null
==
storeCouponVo
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数有误:优惠券不存在"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数有误:优惠券不存在"
);
}
}
if
(!
storeCouponVo
.
getStoreId
().
equals
(
storeId
))
{
log
.
warn
(
"商铺活动:优惠券管理:启用警告:非本店铺活动,无权操作[UID={},storeCouponId={}]"
,
currentUid
,
storeCouponId
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"非本店铺活动,无权操作"
);
}
if
(!
storeCouponVo
.
getState
().
equals
(
"3"
))
{
// 只针对停用的优惠券
if
(!
storeCouponVo
.
getState
().
equals
(
"3"
))
{
// 只针对停用的优惠券
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"只限已停用状态执行该操作"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"只限已停用状态执行该操作"
);
}
}
...
@@ -154,6 +158,10 @@ public class GoblinStoreMgtCouponController {
...
@@ -154,6 +158,10 @@ public class GoblinStoreMgtCouponController {
if
(
null
==
storeCouponVo
)
{
if
(
null
==
storeCouponVo
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数有误:优惠券不存在"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数有误:优惠券不存在"
);
}
}
if
(!
storeCouponVo
.
getStoreId
().
equals
(
storeId
))
{
log
.
warn
(
"商铺活动:优惠券管理:停用警告:非本店铺活动,无权操作[UID={},storeCouponId={}]"
,
currentUid
,
storeCouponId
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"非本店铺活动,无权操作"
);
}
// if (storeCouponVo.getState().equals("1")) {// 该优惠券活动中
// if (storeCouponVo.getState().equals("1")) {// 该优惠券活动中
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "该优惠券活动中不可停用");
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "该优惠券活动中不可停用");
// }
// }
...
@@ -169,6 +177,10 @@ public class GoblinStoreMgtCouponController {
...
@@ -169,6 +177,10 @@ public class GoblinStoreMgtCouponController {
if
(
null
==
storeCouponVo
)
{
if
(
null
==
storeCouponVo
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数有误:优惠券不存在"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数有误:优惠券不存在"
);
}
}
if
(!
storeCouponVo
.
getStoreId
().
equals
(
storeId
))
{
log
.
warn
(
"商铺活动:优惠券管理:删除警告:非本店铺活动,无权操作[UID={},storeCouponId={}]"
,
currentUid
,
storeCouponId
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"非本店铺活动,无权操作"
);
}
if
(
storeCouponVo
.
getState
().
equals
(
"1"
))
{
// 活动中不可删除
if
(
storeCouponVo
.
getState
().
equals
(
"1"
))
{
// 活动中不可删除
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"活动中不允许删除,请停用或活动结束后操作"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"活动中不允许删除,请停用或活动结束后操作"
);
}
}
...
@@ -273,7 +285,8 @@ public class GoblinStoreMgtCouponController {
...
@@ -273,7 +285,8 @@ public class GoblinStoreMgtCouponController {
String
storeCouponId
=
mgtCouponEditParam
.
getStoreCouponId
();
String
storeCouponId
=
mgtCouponEditParam
.
getStoreCouponId
();
GoblinStoreCouponVo
storeCouponVo
;
GoblinStoreCouponVo
storeCouponVo
;
if
(
StringUtils
.
isBlank
(
storeCouponId
)
if
(
StringUtils
.
isBlank
(
storeCouponId
)
||
null
==
(
storeCouponVo
=
goblinRedisUtils
.
getStoreCouponVo
(
storeCouponId
))
||
!
storeId
.
equals
(
storeCouponVo
.
getStoreId
()))
{
||
null
==
(
storeCouponVo
=
goblinRedisUtils
.
getStoreCouponVo
(
storeCouponId
))
||
!
storeId
.
equals
(
storeCouponVo
.
getStoreId
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数无效:优惠券ID"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"参数无效:优惠券ID"
);
}
}
if
(!
storeCouponVo
.
getType
().
equals
(
mgtCouponEditParam
.
getType
()))
{
if
(!
storeCouponVo
.
getType
().
equals
(
mgtCouponEditParam
.
getType
()))
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtCategoryServiceImpl.java
View file @
806f4d06
...
@@ -8,6 +8,7 @@ import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtCategoryServic
...
@@ -8,6 +8,7 @@ import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtCategoryServic
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -15,8 +16,8 @@ import org.springframework.util.CollectionUtils;
...
@@ -15,8 +16,8 @@ import org.springframework.util.CollectionUtils;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
@Slf4j
@Service
@Service
public
class
GoblinStoreMgtCategoryServiceImpl
implements
IGoblinStoreMgtCategoryService
{
public
class
GoblinStoreMgtCategoryServiceImpl
implements
IGoblinStoreMgtCategoryService
{
@Autowired
@Autowired
...
@@ -89,8 +90,11 @@ public class GoblinStoreMgtCategoryServiceImpl implements IGoblinStoreMgtCategor
...
@@ -89,8 +90,11 @@ public class GoblinStoreMgtCategoryServiceImpl implements IGoblinStoreMgtCategor
SqlMapping
.
get
(
"goblin_store_goods_category.remove"
,
SqlMapping
.
get
(
"goblin_store_goods_category.remove"
,
uid
,
now
,
uid
,
now
,
storeId
,
cateId
)
uid
,
now
,
uid
,
now
,
storeId
,
cateId
)
);
);
return
true
;
}
}
}
else
{
log
.
warn
(
"###店铺商品分类管理:删除:分类不存在[uid={},storeId={},cateId={}]"
,
uid
,
storeId
,
cateId
);
}
}
return
tru
e
;
return
fals
e
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
View file @
806f4d06
...
@@ -225,7 +225,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
...
@@ -225,7 +225,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
public
GoblinStoreMgtGoodsInfoVo
goodsInfo
(
String
storeId
,
String
spuId
)
{
public
GoblinStoreMgtGoodsInfoVo
goodsInfo
(
String
storeId
,
String
spuId
)
{
GoblinStoreMgtGoodsInfoVo
vo
=
GoblinStoreMgtGoodsInfoVo
.
getNew
();
GoblinStoreMgtGoodsInfoVo
vo
=
GoblinStoreMgtGoodsInfoVo
.
getNew
();
GoblinGoodsInfoVo
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
);
GoblinGoodsInfoVo
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
);
if
(
null
!=
goodsInfoVo
&&
goodsInfoVo
.
getDelFlg
().
equals
(
"0"
))
{
if
(
null
!=
goodsInfoVo
&&
goodsInfoVo
.
get
StoreId
().
equals
(
storeId
)
&&
goodsInfoVo
.
get
DelFlg
().
equals
(
"0"
))
{
vo
.
setGoodsInfoVo
(
goodsInfoVo
);
vo
.
setGoodsInfoVo
(
goodsInfoVo
);
List
<
String
>
skuIdList
=
goodsInfoVo
.
getSkuIdList
();
List
<
String
>
skuIdList
=
goodsInfoVo
.
getSkuIdList
();
if
(!
CollectionUtils
.
isEmpty
(
skuIdList
))
{
if
(!
CollectionUtils
.
isEmpty
(
skuIdList
))
{
...
...
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