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

Commit 61410a88 authored by 张国柄's avatar 张国柄

~API:商品名称重复校验调整,由单店铺商品名称不可重复调整为所有店铺内商品名称不可重复;

~OPT:参数验证、逻辑校验;
parent 5631b960
...@@ -45,9 +45,9 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable { ...@@ -45,9 +45,9 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
* ---------------------------- 基本信息 ---------------------------- * ---------------------------- 基本信息 ----------------------------
**/ **/
@ApiModelProperty(position = 12, required = true, value = "商品名称[128]") @ApiModelProperty(position = 12, required = true, value = "商品名称[36]")
@NotBlank(message = "商品名称不能为空") @NotBlank(message = "商品名称不能为空")
@Size(max = 128, message = "商品名称长度超限") @Size(max = 36, message = "商品名称长度超限")
private String name; private String name;
@ApiModelProperty(position = 13, required = false, value = "商品名称[128]") @ApiModelProperty(position = 13, required = false, value = "商品名称[128]")
@Size(max = 128, message = "商品副名称长度超限") @Size(max = 128, message = "商品副名称长度超限")
......
...@@ -40,15 +40,15 @@ public class TestAdam { ...@@ -40,15 +40,15 @@ public class TestAdam {
"adam:info:member:code:GMRGBUQB30", "adam:info:member:code:GMRGBUQB30",
"adam:info:certification:1141181199209160192", "adam:info:certification:1141181199209160192",
"adam:identity:mobile:18548596019", "adam:identity:mobile:15124771442",
"adam:identity:sso:882883", "adam:identity:sso:882883",
"adam:info:user:809406", "adam:info:user:809406",
"adam:info:user:922833055536291845022973", "adam:info:user:926221815868989446709775",
"adam:morder:2283655", "adam:morder:2283655",
"adam:info:umember:1957341", "adam:info:umember:1957341",
"adam:info:umember:926221815868989446709775",
"adam:info:umember:926280978917662724119825", "adam:info:umember:926280978917662724119825",
"adam:info:umember:926280978917662724119825", "adam:info:morder:926221815868989446709775",
"adam:info:morder:331587681810022407979836",
"adam:info:member:simple", "adam:info:member:simple",
"adam:info:member:joinus", "adam:info:member:joinus",
...@@ -62,7 +62,7 @@ public class TestAdam { ...@@ -62,7 +62,7 @@ public class TestAdam {
"adam:info:morder:2292617", "adam:info:morder:2292617",
"adam:info:certification_junk:1510827199912020821", "adam:info:certification_junk:1510827199912020821",
"kylin:member:uid:926280978917662724119825", "kylin:member:uid:926221815868989446709775",
"kylin:member:uid:925802662655180800214832", "kylin:member:uid:925802662655180800214832",
"candy:basic:coupon_code:0Jxko0wLWQdoTTF4", "candy:basic:coupon_code:0Jxko0wLWQdoTTF4",
......
...@@ -259,8 +259,8 @@ public class GoblinStoreMgtGoodsController { ...@@ -259,8 +259,8 @@ public class GoblinStoreMgtGoodsController {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品三级分类无效"); // return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品三级分类无效");
// } // }
} }
GoblinGoodsInfoVo mgtGoodsInfoVo = goblinMongoUtils.getMgtGoodsInfoVo(storeId, storeMgtGoodsAddParam.getName()); // GoblinGoodsInfoVo mgtGoodsInfoVo = goblinMongoUtils.getMgtGoodsInfoVo(storeId, storeMgtGoodsAddParam.getName());
if (null != mgtGoodsInfoVo) { if (goblinMongoUtils.countMgtGoodsInfoVo(storeMgtGoodsAddParam.getName()) > 0) {
return ResponseDto.failure(ErrorMapping.get("149007")); return ResponseDto.failure(ErrorMapping.get("149007"));
} }
if (storeMgtGoodsAddParam.getShelvesHandle().equals("3") && null == storeMgtGoodsAddParam.getShelvesTime()) { if (storeMgtGoodsAddParam.getShelvesHandle().equals("3") && null == storeMgtGoodsAddParam.getShelvesTime()) {
...@@ -364,12 +364,14 @@ public class GoblinStoreMgtGoodsController { ...@@ -364,12 +364,14 @@ public class GoblinStoreMgtGoodsController {
return ResponseDto.failure(ErrorMapping.get("149010")); return ResponseDto.failure(ErrorMapping.get("149010"));
} }
if (!mgtGoodsInfoVo.getName().equals(mgtGoodsAddParam.getName()) if (!mgtGoodsInfoVo.getName().equals(mgtGoodsAddParam.getName())
&& null != goblinMongoUtils.getMgtGoodsInfoVo(storeId, mgtGoodsAddParam.getName())) { // && null != goblinMongoUtils.getMgtGoodsInfoVo(storeId, mgtGoodsAddParam.getName())) {
&& goblinMongoUtils.countMgtGoodsInfoVo(mgtGoodsAddParam.getName()) > 0) {
return ResponseDto.failure(ErrorMapping.get("149007")); return ResponseDto.failure(ErrorMapping.get("149007"));
} }
if (!mgtGoodsAddParam.getShelvesHandle().equals(mgtGoodsInfoVo.getShelvesHandle()) if (!mgtGoodsAddParam.getShelvesHandle().equals(mgtGoodsInfoVo.getShelvesHandle())
&& mgtGoodsInfoVo.getShelvesStatus().equals("3")) { && mgtGoodsInfoVo.getShelvesStatus().equals("3")) {
return ResponseDto.failure(ErrorMapping.get("149016")); // return ResponseDto.failure(ErrorMapping.get("149016"));
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "上架处理方式只限商品未上架时变更");
} }
List<String> skuIdList = mgtGoodsInfoVo.getSkuIdList(); List<String> skuIdList = mgtGoodsInfoVo.getSkuIdList();
......
...@@ -74,7 +74,6 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -74,7 +74,6 @@ public class GoblinCouponImpl implements GoblinCouponService {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
GoblinUserCouponBasicVo receiveUserCouponBasicVo = GoblinUserCouponBasicVo.getNew().initByStoreCouponVo(storeCouponVo); GoblinUserCouponBasicVo receiveUserCouponBasicVo = GoblinUserCouponBasicVo.getNew().initByStoreCouponVo(storeCouponVo);
receiveUserCouponBasicVo.setUid(uid); receiveUserCouponBasicVo.setUid(uid);
receiveUserCouponBasicVo.setStoreId(storeCouponVo.getStoreId());
receiveUserCouponBasicVo.setBindAt(now); receiveUserCouponBasicVo.setBindAt(now);
receiveUserCouponBasicVo.setOperator(uid); receiveUserCouponBasicVo.setOperator(uid);
receiveUserCouponBasicVo.setCreatedAt(now); receiveUserCouponBasicVo.setCreatedAt(now);
......
...@@ -445,6 +445,10 @@ public class GoblinMongoUtils { ...@@ -445,6 +445,10 @@ public class GoblinMongoUtils {
return mongoTemplate.findOne(Query.query(Criteria.where("storeId").is(storeId).and("name").is(name).and("delFlg").is("0")), return mongoTemplate.findOne(Query.query(Criteria.where("storeId").is(storeId).and("name").is(name).and("delFlg").is("0")),
GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
} }
public long countMgtGoodsInfoVo(String name) {
return mongoTemplate.count(Query.query(Criteria.where("name").is(name).and("delFlg").is("0")),
GoblinGoodsInfoVo.class.getSimpleName());
}
// SPU信息 // SPU信息
public boolean updateGoodsInfoVo(GoblinGoodsInfoVo vo) { public boolean updateGoodsInfoVo(GoblinGoodsInfoVo vo) {
......
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