demand: TMS系统 - 提成管理 - 销售计提比例配置 - 新增/修改配置规则更改-一个销售支持可以对应多个销售顾问
committer: heyu
This commit is contained in:
parent
fdfbb11b9f
commit
90fb34aaff
@ -23,7 +23,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 根据主键ID查询销售计提比例配置
|
||||
*
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 配置实体
|
||||
*/
|
||||
@ -34,7 +34,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 查询销售计提比例配置列表
|
||||
*
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 配置列表
|
||||
*/
|
||||
@ -45,7 +45,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 新增销售计提比例配置
|
||||
*
|
||||
*
|
||||
* @param entity 配置实体
|
||||
* @return 影响行数
|
||||
* @throws IllegalArgumentException 占比校验不通过时抛出
|
||||
@ -67,7 +67,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 修改销售计提比例配置
|
||||
*
|
||||
*
|
||||
* @param entity 配置实体
|
||||
* @return 影响行数
|
||||
* @throws IllegalArgumentException 占比校验不通过时抛出
|
||||
@ -89,7 +89,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 批量删除销售计提比例配置
|
||||
*
|
||||
*
|
||||
* @param ids 主键ID数组
|
||||
* @return 影响行数
|
||||
*/
|
||||
@ -100,7 +100,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 删除单个销售计提比例配置
|
||||
*
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
@ -111,7 +111,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 校验销售计提比例总和是否有效(<=100%)
|
||||
*
|
||||
*
|
||||
* @param entity 配置实体
|
||||
* @return true-有效,false-无效
|
||||
*/
|
||||
@ -133,7 +133,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 验证一个销售联系人只能对应一个销售主管
|
||||
*
|
||||
*
|
||||
* @param entity 配置实体
|
||||
* @throws EmisBizError 如果销售联系人已经对应了其他销售主管
|
||||
*/
|
||||
@ -142,7 +142,7 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
&& entity.getSalesExecutive() != null && !entity.getSalesExecutive().trim().isEmpty()) {
|
||||
int count = emisSalesCommissionRatioMapper.countBySalesmenAndDifferentExecutive(entity);
|
||||
if (count > 0) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
|
||||
"销售联系人[" + entity.getSalesmen() + "]已经对应了其他销售主管,一个销售联系人只能对应一个销售主管");
|
||||
}
|
||||
}
|
||||
@ -150,24 +150,24 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
|
||||
|
||||
/**
|
||||
* 验证一个销售支持只能对应一个销售联系人、只能对应一个销售主管
|
||||
*
|
||||
*
|
||||
* @param entity 配置实体
|
||||
* @throws EmisBizError 如果销售支持已经对应了其他销售联系人或销售主管
|
||||
*/
|
||||
private void validateSalesSupport(EmisSalesCommissionRatio entity) throws EmisBizError {
|
||||
if (entity.getSalesSupport() != null && !entity.getSalesSupport().trim().isEmpty()) {
|
||||
// 检查销售支持是否已经对应了其他销售联系人
|
||||
int countSalesmen = emisSalesCommissionRatioMapper.countBySalesSupportAndDifferentSalesmen(entity);
|
||||
if (countSalesmen > 0) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
|
||||
"销售支持[" + entity.getSalesSupport() + "]已经对应了其他销售联系人,一个销售支持只能对应一个销售联系人");
|
||||
}
|
||||
// // 检查销售支持是否已经对应了其他销售联系人
|
||||
// int countSalesmen = emisSalesCommissionRatioMapper.countBySalesSupportAndDifferentSalesmen(entity);
|
||||
// if (countSalesmen > 0) {
|
||||
// throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
|
||||
// "销售支持[" + entity.getSalesSupport() + "]已经对应了其他销售联系人,一个销售支持只能对应一个销售联系人");
|
||||
// }
|
||||
// 检查销售支持是否已经对应了其他销售主管
|
||||
int countExecutive = emisSalesCommissionRatioMapper.countBySalesSupportAndDifferentExecutive(entity);
|
||||
if (countExecutive > 0) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR,
|
||||
"销售支持[" + entity.getSalesSupport() + "]已经对应了其他销售主管,一个销售支持只能对应一个销售主管");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user