收银点改动
This commit is contained in:
parent
0e926adf3d
commit
766351e0f6
|
|
@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author DJH
|
||||
|
|
@ -35,7 +36,9 @@ public class MerchantCashPlaceController {
|
|||
@PostMapping
|
||||
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());
|
||||
cashPlaceService.saveOrUpdate(merchantCashPlace);
|
||||
return ResultGenerator.genSuccessResult("保存成功", merchantCashPlace);
|
||||
|
|
@ -106,9 +109,6 @@ public class MerchantCashPlaceController {
|
|||
return ResultGenerator.genSuccessResult(pageData);
|
||||
}
|
||||
private void size(String character){
|
||||
if (character.isEmpty()){
|
||||
throw new MsgException("地址或收银点名称不能为空");
|
||||
}
|
||||
if (character.length() >= 50){
|
||||
throw new MsgException("输入内容过长");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue