收银点改动

This commit is contained in:
liuyingfang 2023-06-15 10:33:22 +08:00
parent 0e926adf3d
commit 766351e0f6
1 changed files with 4 additions and 4 deletions

View File

@ -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("输入内容过长");
}