Commit b6d19be8 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 8bfb1277 121e1fd7
......@@ -400,6 +400,11 @@ public class InsurancesConstants {
*/
public static final String INSURANCE_BUY_STATUS_TWO_ERROR = "商险投保中,无法减员";
/**
* 商险投保退回,无法减员
*/
public static final String INSURANCE_BUY_STATUS_FOUR_ERROR = "商险投保退回,无法减员";
/**
* 商险无效,无法减员
*/
......@@ -674,6 +679,74 @@ public class InsurancesConstants {
*/
public static final String MONTH_CHANGE = "变更结算月";
/**
* 新增的保险公司信息为空
*/
public static final String NEW_COMPANY_IS_EMPTY = "新增的保险公司信息为空";
/**
* 计费方式格式不正确
*/
public static final String COMPANY_BILLING_TYPE_IS_ERROR = "计费方式格式不正确";
/**
* 保险公司名称格式不正确
*/
public static final String COMPANY_NAME_IS_ERROR = "保险公司名称格式不正确";
/**
* 保险公司地址格式不正确
*/
public static final String COMPANY_ADDRESS_IS_ERROR = "保险公司地址格式不正确";
/**
* 保险公司名称不能重复添加
*/
public static final String COMPANY_NAME_IS_USE = "保险公司名称不能重复添加";
/**
* 新增保险公司成功
*/
public static final String NEW_COMPANY_SUCCESS = "新增保险公司成功";
/**
* 修改保险信息公司成功
*/
public static final String UPDATE_COMPANY_SUCCESS = "修改保险信息公司成功";
/**
* 要修改的保险公司id为空
*/
public static final String UPDATE_COMPANY_ID_IS_EMPTY = "要修改的保险公司id为空";
/**
* 要修改的保险公司不存在或已被删除
*/
public static final String COMPANY_IS_DELETE = "要修改的保险公司不存在或已被删除";
/**
* 要修改的保险公司名称格式不正确
*/
public static final String CHANGE_COMPANY_NAME_IS_ERROR = "要修改的保险公司名称格式不正确";
/**
* 当前保险公司的名称已存在对应的商险信息,不能进行修改
*/
public static final String COMPANY_IS_USED = "当前保险公司的名称已存在对应的商险信息,不能进行修改";
......
......@@ -67,18 +67,18 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
@Override
public R saveInsuranceCompany(TInsuranceCompany insuranceCompany) {
if(Common.isEmpty(insuranceCompany)){
return R.failed("新增的信息为空");
return R.failed(InsurancesConstants.NEW_COMPANY_IS_EMPTY);
}
YifuUser user = SecurityUtils.getUser();
String billingType = insuranceCompany.getBillingType();
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
return R.failed(InsurancesConstants.COMPANY_BILLING_TYPE_IS_ERROR);
}
if (!ValidityUtil.validate60(insuranceCompany.getCompanyName())){
return R.failed("保险公司名称格式不正确");
return R.failed(InsurancesConstants.COMPANY_NAME_IS_ERROR);
}
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
return R.failed(InsurancesConstants.COMPANY_ADDRESS_IS_ERROR);
}
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if (!b){
......@@ -88,9 +88,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
insuranceCompany.setDeleteFlag(CommonConstants.ZERO_INT);
save(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("新增成功");
return R.ok(InsurancesConstants.NEW_COMPANY_SUCCESS);
}else{
return R.failed("保险公司名称不能重复添加");
return R.failed(InsurancesConstants.COMPANY_NAME_IS_USE);
}
}
......@@ -106,25 +106,25 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
YifuUser user = SecurityUtils.getUser();
String id = insuranceCompany.getId();
if (StringUtils.isEmpty(id)){
return R.failed("要修改的保险公司id为空");
return R.failed(InsurancesConstants.UPDATE_COMPANY_ID_IS_EMPTY);
}
String billingType = insuranceCompany.getBillingType();
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
return R.failed(InsurancesConstants.COMPANY_BILLING_TYPE_IS_ERROR);
}
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
return R.failed(InsurancesConstants.COMPANY_ADDRESS_IS_ERROR);
}
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper);
if (Common.isEmpty(one)){
return R.failed("要修改的保险公司不存在或已被删除");
return R.failed(InsurancesConstants.COMPANY_IS_DELETE);
}
String companyName = one.getCompanyName();
String newCompanyName = insuranceCompany.getCompanyName();
if (!ValidityUtil.validate60(newCompanyName)){
return R.failed("要修改的保险公司名称格式不正确");
return R.failed(InsurancesConstants.CHANGE_COMPANY_NAME_IS_ERROR);
}
//如果当前保险公司名称和修改后的名称不同
if (!companyName.equals(insuranceCompany.getCompanyName())){
......@@ -134,24 +134,26 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = tInsuranceDetailService.list(detailQueryWrapper);
if (Common.isNotEmpty(list)){
return R.failed("当前保险公司的名称已存在对应的商险信息,不能进行修改");
return R.failed(InsurancesConstants.COMPANY_IS_USED);
}else{
//校验新的保险公司名称在数据库中是否存在
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if(b){
return R.failed("保险公司名称不能重复");
return R.failed(InsurancesConstants.COMPANY_NAME_IS_USE);
}else {
insuranceCompany.setUpdateBy(user.getId());
insuranceCompany.setUpdateTime(LocalDateTime.now());
updateById(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
return R.ok(InsurancesConstants.UPDATE_COMPANY_SUCCESS);
}
}
}else{
insuranceCompany.setUpdateBy(user.getId());
insuranceCompany.setUpdateTime(LocalDateTime.now());
updateById(insuranceCompany);
addOperate(one,user, InsurancesConstants.UPDATE_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
addOperate(insuranceCompany,user, InsurancesConstants.UPDATE_INSURANCE_COMPANY);
return R.ok(InsurancesConstants.UPDATE_COMPANY_SUCCESS);
}
}
/**
......
......@@ -3222,6 +3222,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//商险投保退回,无法减员
if (CommonConstants.FOUR_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_FOUR_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = one.getReduceHandleStatus();
if ( null != reduceHandleStatus){
//当前保单信息的减员状态不为空且不为减员退回时时不能进行导入
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment