|
|
@@ -1706,9 +1706,19 @@ public class AdminCustomerApiController extends BaseApiController{
|
|
|
@PostMapping("/updateAndReceiveCustomer")
|
|
|
public Result updateAndReceiveCustomer(InputUpdateAndReceiveCustomer in) {
|
|
|
Result res = new Result();
|
|
|
+ if (in.getOrgCode()!=null){
|
|
|
+ in.setOrgCode(in.getOrgCode().trim());
|
|
|
+ if (customerService.checkOrgCode(in.getOrgCode())){
|
|
|
+ res.getError().add(buildError("","统一信用代码已存在"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Result result = receiveCustomer(in.getId(), null);
|
|
|
+ res.getError().addAll(result.getError());
|
|
|
+ if (!res.getError().isEmpty()){
|
|
|
+ return res;
|
|
|
+ }
|
|
|
customerService.updateAndReceiveCustomer(in);
|
|
|
- receiveCustomer( in.getId(), null);
|
|
|
- res.setData(1);
|
|
|
return res;
|
|
|
}
|
|
|
}
|