zoujiajian пре 2 година
родитељ
комит
c5f1072038

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/corp/CorpCustomerAcquisitionLinkService.java

@@ -3,8 +3,6 @@ package com.cyksj.service.corp;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.cyksj.model.entity.CorpCustomerAcquisitionLink;
 
-import java.util.List;
-
 /**
  * @author chan
  * @date 2023-11-28 15:10
@@ -19,4 +17,6 @@ public interface CorpCustomerAcquisitionLinkService extends IService<CorpCustome
     void up(CorpCustomerAcquisitionLink corpCustomerAcquisitionLink) throws Exception;
 
     void del(Long id) throws Exception;
+
+    void handleCorpLinkSchedulerJob() throws Exception;
 }

+ 1 - 0
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpCustomerAcquisitionLinkServiceImpl.java

@@ -127,6 +127,7 @@ public class CorpCustomerAcquisitionLinkServiceImpl extends ServiceImpl<CorpCust
         removeById(id);
     }
 
+    @Override
     public void handleCorpLinkSchedulerJob() throws Exception {
         //立即执行客服值班定时任务
         XxlJobUtil.executeMarkDynamicRuleTagJob(XxlJobInfo.getExecuteTaskInstance(Constant.CORP_LINK_JOB_ID, StrUtil.EMPTY).toString());

+ 13 - 7
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpCustomerAcquistionLinkController.java

@@ -134,18 +134,20 @@ public class CorpCustomerAcquistionLinkController {
      * 针对获客链接添加额外客服
      */
     @PostMapping("/add/extra/service")
-    public Result<String> addExtraService(@RequestBody @Validated CorpCustomerAcquisitionLinkExtraCustomer extraCustomer) {
+    public Result<String> addExtraService(@RequestBody @Validated CorpCustomerAcquisitionLinkExtraCustomer extraCustomer) throws Exception {
 	    corpCustomerAcquisitionLinkExtraCustomerMapper.insert(extraCustomer);
-		return GatewayResponse.SUCCESS.newBuilder().toResult();
+        corpCustomerAcquisitionLinkService.handleCorpLinkSchedulerJob();
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 
     /**
      * 修改获客链接添加额外客服
      */
     @PutMapping("/update/extra/service")
-    public Result<String> updateExtraService(@RequestBody @Validated CorpCustomerAcquisitionLinkExtraCustomer extraCustomer) {
+    public Result<String> updateExtraService(@RequestBody @Validated CorpCustomerAcquisitionLinkExtraCustomer extraCustomer) throws Exception {
 	    corpCustomerAcquisitionLinkExtraCustomerMapper.updateById(extraCustomer);
-		return GatewayResponse.SUCCESS.newBuilder().toResult();
+        corpCustomerAcquisitionLinkService.handleCorpLinkSchedulerJob();
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 
     /**
@@ -156,9 +158,13 @@ public class CorpCustomerAcquistionLinkController {
 	    Optional.ofNullable(corpCustomerAcquisitionLinkExtraCustomerMapper.selectById(id))
 			    .ifPresent(e -> {
 				    if (e.getDeleted()) {
-					    e.setDeleted(false);
-					    corpCustomerAcquisitionLinkExtraCustomerMapper.updateById(e);
-				    }
+                        try {
+                            e.setDeleted(false);
+                            corpCustomerAcquisitionLinkExtraCustomerMapper.updateById(e);
+                            corpCustomerAcquisitionLinkService.handleCorpLinkSchedulerJob();
+                        } catch (Exception ex) {
+                        }
+                    }
 			    });
 	    return GatewayResponse.SUCCESS.newBuilder().toResult();
     }