收银点改动
This commit is contained in:
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DJH
|
* @author DJH
|
||||||
@@ -35,7 +36,9 @@ public class MerchantCashPlaceController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<Object> add(@RequestBody MerchantCashPlace merchantCashPlace) {
|
public Result<Object> add(@RequestBody MerchantCashPlace merchantCashPlace) {
|
||||||
//判定字符位数
|
//判定字符位数
|
||||||
size(merchantCashPlace.getAddress());
|
if (Objects.equals(merchantCashPlace.getAddress(), null) || Objects.equals(merchantCashPlace.getName(), null)){
|
||||||
|
throw new MsgException("地址或收银点名称不能为空");
|
||||||
|
}
|
||||||
size(merchantCashPlace.getName());
|
size(merchantCashPlace.getName());
|
||||||
cashPlaceService.saveOrUpdate(merchantCashPlace);
|
cashPlaceService.saveOrUpdate(merchantCashPlace);
|
||||||
return ResultGenerator.genSuccessResult("保存成功", merchantCashPlace);
|
return ResultGenerator.genSuccessResult("保存成功", merchantCashPlace);
|
||||||
@@ -106,9 +109,6 @@ public class MerchantCashPlaceController {
|
|||||||
return ResultGenerator.genSuccessResult(pageData);
|
return ResultGenerator.genSuccessResult(pageData);
|
||||||
}
|
}
|
||||||
private void size(String character){
|
private void size(String character){
|
||||||
if (character.isEmpty()){
|
|
||||||
throw new MsgException("地址或收银点名称不能为空");
|
|
||||||
}
|
|
||||||
if (character.length() >= 50){
|
if (character.length() >= 50){
|
||||||
throw new MsgException("输入内容过长");
|
throw new MsgException("输入内容过长");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user