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

Commit 8a5d9b29 authored by 胡佳晨's avatar 胡佳晨

增加接口 查看活动名称是否重复

parent 568db638
...@@ -26,4 +26,6 @@ public interface IGoblinMixService { ...@@ -26,4 +26,6 @@ public interface IGoblinMixService {
ResponseDto<Boolean> mixUpdate(GoblinMixUpdateParam param); ResponseDto<Boolean> mixUpdate(GoblinMixUpdateParam param);
ResponseDto<Boolean> mixLine(String mixId, Integer status); ResponseDto<Boolean> mixLine(String mixId, Integer status);
ResponseDto<Boolean> nameCount(String name);
} }
...@@ -84,4 +84,13 @@ public class GoblinMixController { ...@@ -84,4 +84,13 @@ public class GoblinMixController {
return goblinMixService.mixLine(mixId, status); return goblinMixService.mixLine(mixId, status);
} }
@ApiOperation(value = "查看活动名称是否重复")
@PostMapping("nameCount")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "name", value = "活动名称"),
})
public ResponseDto<Boolean> create(@NotBlank(message = "活动名称不能为空") @RequestParam String name) {
return goblinMixService.nameCount(name);
}
} }
...@@ -153,7 +153,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -153,7 +153,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
//判断活动名称 //判断活动名称
int count = (int) mongoUtils.getMixNameCount(param.getName()); int count = (int) mongoUtils.getMixNameCount(param.getName());
if(count>0){ if (count > 0) {
return ResponseDto.failure("活动名称重复"); return ResponseDto.failure("活动名称重复");
} }
...@@ -266,6 +266,17 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -266,6 +266,17 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
return ResponseDto.success(); return ResponseDto.success();
} }
@Override
public ResponseDto<Boolean> nameCount(String name) {
//判断活动名称
int count = (int) mongoUtils.getMixNameCount(name);
if (count > 0) {
return ResponseDto.success(true);
} else {
return ResponseDto.success(false);
}
}
//库存管理 //库存管理
private List<String> initStock(List<GoblinMixDetailsItemParam> data, String mixId, int stock) { private List<String> initStock(List<GoblinMixDetailsItemParam> data, String mixId, int stock) {
List<String> errorNameList = CollectionUtil.linkedListString();//库存异常的 sku名称 List<String> errorNameList = CollectionUtil.linkedListString();//库存异常的 sku名称
......
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