修复客户导入时出错的提示问题

master
river 4 years ago
parent f8998225b8
commit 8fd3cbb140
  1. 6
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  2. 6
      dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java

@ -370,7 +370,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
} }
} }
if (customerPersonalTOI.getManager() == null) { if (customerPersonalTOI.getManager() == null) {
return new ResponseResult<String>().SUCCESS("导入数据失败,员工" + manager.getManager() + "不存在"); return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在");
} }
} }
this.saveCustomerPersonal(customerPersonalTOI); this.saveCustomerPersonal(customerPersonalTOI);
@ -390,14 +390,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
} }
} }
if (customerCompanyTOI.getManager() == null) { if (customerCompanyTOI.getManager() == null) {
return new ResponseResult<String>().SUCCESS("导入数据失败,员工" + manager.getManager() + "不存在"); return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在");
} }
} }
this.saveCustomerCompany(customerCompanyTOI); this.saveCustomerCompany(customerCompanyTOI);
} }
return ResponseResult.SUCCESS(); return ResponseResult.SUCCESS();
} catch (Exception e) { } catch (Exception e) {
return new ResponseResult<String>().SUCCESS("导入数据失败,请检查文件和数据格式或稍后再试"); return new ResponseResult<String>().FAIL("导入数据失败,请检查文件和数据格式或稍后再试");
} }
} }

@ -53,7 +53,11 @@ public class ResponseResult<T> {
} }
public static ResponseResult SUCCESS(Object t) { public static ResponseResult SUCCESS(Object t) {
return new ResponseResult<>(true, 10000, t, "操作成功!"); return new ResponseResult<>(true, 10000, t, "操作成功!");
}
public static ResponseResult FAIL(Object t) {
return new ResponseResult<>(false, 99999, t, "操作失败!");
} }
public ResponseResult SUCCESS_DATA(T t){ public ResponseResult SUCCESS_DATA(T t){

Loading…
Cancel
Save