记得上下班打卡 | git大法好,push需谨慎

Commit b842a542 authored by 张国柄's avatar 张国柄

~API:完善逻辑校验;

parent 806f4d06
......@@ -95,8 +95,9 @@ public interface IGoblinstoreMgtGoodsService {
* @param uid UID
* @param shelvesFlg true:上架|false:下架
* @param spuNoList 操作SPUID对应SPUNO列表
* @return boolean
*/
void goodsShelvesProcessing(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, boolean shelvesFlg, List<String> spuNoList);
boolean goodsShelvesProcessing(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, boolean shelvesFlg, List<String> spuNoList);
/**
* 商品管理:删除商品
......@@ -104,6 +105,7 @@ public interface IGoblinstoreMgtGoodsService {
* @param mgtGoodsActionParam GoblinStoreMgtGoodsActionParam
* @param uid UID
* @param spuNoList 操作SPUID对应SPUNO列表
* @return boolean
*/
void goodsRemove(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, List<String> spuNoList);
boolean goodsRemove(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, List<String> spuNoList);
}
......@@ -88,7 +88,8 @@ public class GoblinStoreMgtCertificationController {
if (log.isDebugEnabled()) {
log.debug("店铺认证[UID={},GoblinStoreMgtCompleteParam:{}]", currentUid, JsonUtils.toJson(completeParam));
}
return ResponseDto.success(goblinStoreMgtCertificationService.certificationCompleteProcessing(completeParam, storeInfoVo));
boolean resultFlg = goblinStoreMgtCertificationService.certificationCompleteProcessing(completeParam, storeInfoVo);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 3)
......@@ -122,6 +123,7 @@ public class GoblinStoreMgtCertificationController {
return ResponseDto.success();// 店铺认证通过后不允许删除
}
log.info("删除店铺[UID={},storeId={}]", currentUid, storeId);
return ResponseDto.success(goblinStoreMgtCertificationService.certificationCancelProcessing(storeId, currentUid));
boolean resultFlg = goblinStoreMgtCertificationService.certificationCancelProcessing(storeId, currentUid);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
}
......@@ -186,7 +186,8 @@ public class GoblinStoreMgtController {
log.warn("店铺管理:店铺设置:编辑[UID={},param={}],无效操作:无效配置", currentUid, JsonUtils.toJson(param));
return ResponseDto.failure(ErrorMapping.get("149001"));
}
return ResponseDto.success(goblinStoreMgtService.updateStoreMgtConfig(currentUid, storeId, updateConfMap));
boolean resultFlg = goblinStoreMgtService.updateStoreMgtConfig(currentUid, storeId, updateConfMap);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 7)
......@@ -275,7 +276,9 @@ public class GoblinStoreMgtController {
updateStoreNoticeVo.setStatus(updateStoreNoticeVo.getReleaseTime().compareTo(now) > 0 ? "0" : "1");
updateStoreNoticeVo.setUpdatedBy(currentUid);
updateStoreNoticeVo.setUpdatedAt(now);
return ResponseDto.success(goblinStoreMgtNoticeService.editSave(updateStoreNoticeVo));
boolean resultFlg = goblinStoreMgtNoticeService.editSave(updateStoreNoticeVo);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 10)
......
......@@ -113,7 +113,7 @@ public class GoblinStoreMgtCouponController {
if (null != servletOutputStream) {
try {
servletOutputStream.close();
} catch (Exception e) {
} catch (Exception ignored) {
}
}
}
......
......@@ -70,6 +70,7 @@ public class GoblinStoreMgtGoodsController {
public ResponseDto<PagedResult<GoblinStoreMgtGoodsListVo>> list(@Valid @RequestBody GoblinStoreMgtGoodsFilterParam storeMgtGoodsFilterParam) {
String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsFilterParam.getStoreId())) {
log.warn("商品管理:SPU列表:无权操作该店铺,请核实[UID={},GoblinStoreMgtGoodsFilterParam={}]", currentUid, JsonUtils.toJson(storeMgtGoodsFilterParam));
return ResponseDto.success();
}
if (log.isDebugEnabled()) {
......@@ -112,7 +113,7 @@ public class GoblinStoreMgtGoodsController {
if (null != servletOutputStream) {
try {
servletOutputStream.close();
} catch (Exception e) {
} catch (Exception ignored) {
}
}
}
......@@ -133,6 +134,7 @@ public class GoblinStoreMgtGoodsController {
if (log.isDebugEnabled()) {
log.debug("商品管理:SPU管理:[UID={},GoblinStoreMgtGoodsActionParam={}]", currentUid, JsonUtils.toJson(mgtGoodsActionParam));
}
boolean resultFlg;
List<String> spuNoList = CollectionUtil.arrayListString();
switch (mgtGoodsActionParam.getAction()) {
case "ONSHELVES":
......@@ -152,7 +154,7 @@ public class GoblinStoreMgtGoodsController {
}
spuNoList.add(goodsInfoVo.getSpuNo());
}
goblinstoreMgtGoodsService.goodsShelvesProcessing(mgtGoodsActionParam, currentUid, true, spuNoList);
resultFlg = goblinstoreMgtGoodsService.goodsShelvesProcessing(mgtGoodsActionParam, currentUid, true, spuNoList);
break;
case "UNSHELVE":
for (String spuId : spuIdList) {
......@@ -171,7 +173,7 @@ public class GoblinStoreMgtGoodsController {
}
spuNoList.add(goodsInfoVo.getSpuNo());
}
goblinstoreMgtGoodsService.goodsShelvesProcessing(mgtGoodsActionParam, currentUid, false, spuNoList);
resultFlg = goblinstoreMgtGoodsService.goodsShelvesProcessing(mgtGoodsActionParam, currentUid, false, spuNoList);
break;
case "REMOVE":
for (String spuId : spuIdList) {
......@@ -190,13 +192,13 @@ public class GoblinStoreMgtGoodsController {
}
spuNoList.add(goodsInfoVo.getSpuNo());
}
goblinstoreMgtGoodsService.goodsRemove(mgtGoodsActionParam, currentUid, spuNoList);
resultFlg = goblinstoreMgtGoodsService.goodsRemove(mgtGoodsActionParam, currentUid, spuNoList);
break;
default:
log.warn("商品管理:SPU管理:Invalid operation[UID={},mgtGoodsActionParam={}]", currentUid, JsonUtils.toJson(mgtGoodsActionParam));
return ResponseDto.failure(ErrorMapping.get("149001"));
}
return ResponseDto.success();
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 4)
......@@ -412,7 +414,8 @@ public class GoblinStoreMgtGoodsController {
if (log.isDebugEnabled()) {
log.debug("商品管理:商品编辑:SPU编辑:[GoblinStoreMgtGoodsAddParam={}]", JsonUtils.toJson(mgtGoodsAddParam));
}
return ResponseDto.success(goblinstoreMgtGoodsService.goodsEditSpu(currentUid, mgtGoodsAddParam, mgtGoodsInfoVo));
boolean resultFlg = goblinstoreMgtGoodsService.goodsEditSpu(currentUid, mgtGoodsAddParam, mgtGoodsInfoVo);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 7)
......@@ -745,6 +748,7 @@ public class GoblinStoreMgtGoodsController {
// if (!goblinRedisUtils.hasStoreId(CurrentUtil.getCurrentUid(), storeId)) {
// return ResponseDto.failure(ErrorMapping.get("149002"));
// }
// return ResponseDto.success(goblinstoreMgtGoodsService.goodsEditSkuBat(spuId, batField, batFieldVal));
// goblinstoreMgtGoodsService.goodsEditSkuBat(spuId, batField, batFieldVal)
// return ResponseDto.success();
// }
}
......@@ -76,7 +76,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
});
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.gets(toMqSqls, initStoreInfoObjs, initStoreCertificationObjs));
return storeInfoVo;
} else {
storeInfoVo.setStatus("0");
storeInfoVo.setStoreType("0");
......@@ -108,7 +107,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
});
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.gets(toMqSqls, updateStoreInfoObjs, updateStoreCertificationObjs));
return storeInfoVo;
}
}
return storeInfoVo;
......
......@@ -875,7 +875,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
// }
@Override
public void goodsShelvesProcessing(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, boolean shelvesFlg, List<String> spuNoList) {
public boolean goodsShelvesProcessing(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, boolean shelvesFlg, List<String> spuNoList) {
LocalDateTime now = LocalDateTime.now();
String storeId = mgtGoodsActionParam.getStoreId();
List<String> spuIdList = mgtGoodsActionParam.getSpuIdList();
......@@ -889,7 +889,6 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
spuIdList.addAll(goblinMongoUtils.getMgtSpuIdsForMarketBySpuNos(spuNoList, "3"));
}
if (goblinMongoUtils.updateGoodsInfoVoByShelves(storeId, spuIdList, shelvesFlg, uid, now)) {
if (goblinMongoUtils.updateGoodsSkuInfoVoByShelves(storeId, spuIdList, shelvesFlg, uid, now)) {
goblinRedisUtils.deleteKeyForSelectGoods();// 精选商品:商品上架、下架、删除 调用的方法
......@@ -915,14 +914,16 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, updateGoodsObjs, updateGoodsSkuObjs));
return true;
} else {
goblinMongoUtils.updateGoodsInfoVoByShelves(storeId, spuIdList, !shelvesFlg, uid, now);
}
}
return false;
}
@Override
public void goodsRemove(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, List<String> spuNoList) {
public boolean goodsRemove(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, List<String> spuNoList) {
LocalDateTime now = LocalDateTime.now();
String storeId = mgtGoodsActionParam.getStoreId();
List<String> spuIdList = mgtGoodsActionParam.getSpuIdList();
......@@ -953,6 +954,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, updateGoodsObjs, updateGoodsSkuObjs));
return true;
}
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment