|
|
@@ -619,6 +619,13 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|
|
|
|
|
// 使用员工 // 积分的使用
|
|
|
if (companyVO.getIntegral() != null && companyVO.getIntegral() > 0) {
|
|
|
+ // 公司积分--查询
|
|
|
+ IntegralResponse integralResponse = integralMapper.selectById(companyVO.getCpId());
|
|
|
+ if (integralResponse!=null && integralResponse.getIntegral() < companyVO.getIntegral()){
|
|
|
+ // 积分不足,不允许进行该操作!
|
|
|
+ throw new BaseBusinessException(ErrorCodeEnum.INTEGRAL_MAX.getCode(),
|
|
|
+ ErrorCodeEnum.INTEGRAL_MAX.getMessage());
|
|
|
+ }
|
|
|
// 积分明细
|
|
|
IntegralItem integralItem = new IntegralItem();
|
|
|
integralItem.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_USE.getName());
|
|
|
@@ -701,6 +708,14 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|
|
|
|
|
// 使用员工 // 积分的使用
|
|
|
if (companyVO.getIntegral() != null && companyVO.getIntegral() > 0) {
|
|
|
+ // 公司积分--查询
|
|
|
+ IntegralResponse integralResponse = integralMapper.selectById(companyVO.getCpId());
|
|
|
+ if (integralResponse!=null && integralResponse.getIntegral() < companyVO.getIntegral()){
|
|
|
+ // 积分不足,不允许进行该操作!
|
|
|
+ throw new BaseBusinessException(ErrorCodeEnum.INTEGRAL_MAX.getCode(),
|
|
|
+ ErrorCodeEnum.INTEGRAL_MAX.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
// 积分明细
|
|
|
IntegralItem integralItem = new IntegralItem();
|
|
|
integralItem.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_USE.getName());
|