Browse Source

1、修复职位发布数权益数据计算问题

rayson 8 tháng trước cách đây
mục cha
commit
e3a4151199

+ 5 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/aop/VipEntitlementCheckAspect.java

@@ -60,6 +60,11 @@ public class VipEntitlementCheckAspect {
         validate(null != enterpriseId, enterpriseId, LoginUserContext.getUserId(), type, null);
     }
 
+    public void validate(String type, VipEntitlementCheck.OperationType operator) {
+        Long enterpriseId = LoginUserContext.getEnterpriseId3();
+        validate(null != enterpriseId, enterpriseId, LoginUserContext.getUserId(), type, operator);
+    }
+
     public void validate(String type, boolean isTrigger) {
         if (!isTrigger) {
             // 如果为false则不执行

+ 6 - 2
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/service/job/JobAdvertisedServiceImpl.java

@@ -475,7 +475,6 @@ public class JobAdvertisedServiceImpl implements JobAdvertisedService {
 
     @Override
     @DSTransactional
-    @VipEntitlementCheck(type = VipEntitlementCheck.OPERATE_PUBLISH_JOB, operate = VipEntitlementCheck.OperationType.DEDUCT)
     public void enable(List<Long> ids) {
         for (Long id : ids) {
             JobAdvertisedDO job = get(id);
@@ -483,15 +482,17 @@ public class JobAdvertisedServiceImpl implements JobAdvertisedService {
                 // 已经是开启状态
                 throw exception(MDE_JOB_ADVERTISED_STATUS_ENABLE_ERROR);
             }
+            vipEntitlementCheckAspect.validate(VipEntitlementCheck.OPERATE_PUBLISH_JOB,VipEntitlementCheck.OperationType.DEDUCT);
             job.setStatus(JobStatusEnum.ENABLE.getStatus());
             mapper.updateById(job);
             jobDataSync(job, SyncConstants.UPDATE);
+            vipEntitlementCheckAspect
+                    .process(VipEntitlementCheck.OPERATE_PUBLISH_JOB, VipEntitlementCheck.OperationType.DEDUCT);
         }
     }
 
     @Override
     @DSTransactional
-    @VipEntitlementCheck(type = VipEntitlementCheck.OPERATE_PUBLISH_JOB, operate = VipEntitlementCheck.OperationType.ADD)
     public void disable(List<Long> ids) {
         for (Long id : ids) {
             JobAdvertisedDO job = get(id);
@@ -499,9 +500,12 @@ public class JobAdvertisedServiceImpl implements JobAdvertisedService {
                 // 已经是关闭状态
                 throw exception(MDE_JOB_ADVERTISED_STATUS_CLOSE_ERROR);
             }
+            vipEntitlementCheckAspect.validate(VipEntitlementCheck.OPERATE_PUBLISH_JOB,VipEntitlementCheck.OperationType.ADD);
             job.setStatus(JobStatusEnum.DISABLE.getStatus());
             mapper.updateById(job);
             jobDataSync(job, SyncConstants.UPDATE);
+            vipEntitlementCheckAspect
+                    .process(VipEntitlementCheck.OPERATE_PUBLISH_JOB, VipEntitlementCheck.OperationType.ADD);
         }
     }