|
|
@@ -1,17 +1,22 @@
|
|
|
package com.ytpm.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.ytpm.agent.model.YtApp;
|
|
|
import com.ytpm.agent.model.YtDitch;
|
|
|
+import com.ytpm.agent.model.YtPlatformUserApp;
|
|
|
import com.ytpm.agent.param.DitchListParam;
|
|
|
import com.ytpm.agent.view.AgentDitchView;
|
|
|
+import com.ytpm.dao.AgentAppMapper;
|
|
|
import com.ytpm.dao.AgentDitchMapper;
|
|
|
import com.ytpm.dao.AppMapper;
|
|
|
import com.ytpm.general.RepMessage;
|
|
|
import com.ytpm.general.Result;
|
|
|
import com.ytpm.general.ResultTable;
|
|
|
import com.ytpm.service.AgentDitchService;
|
|
|
+import com.ytpm.utils.FeignClientInvoker;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -20,15 +25,18 @@ import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class AgentDitchServiceImpl implements AgentDitchService {
|
|
|
|
|
|
@Resource
|
|
|
private AgentDitchMapper agentDitchMapper;
|
|
|
-
|
|
|
@Resource
|
|
|
private AppMapper appMapper;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private FeignClientInvoker feignInvoker;
|
|
|
+ @Resource
|
|
|
+ private AgentAppMapper agentAppMapper;
|
|
|
|
|
|
@Override
|
|
|
public ResultTable<AgentDitchView> ditchList(DitchListParam param) {
|
|
|
@@ -74,6 +82,17 @@ public class AgentDitchServiceImpl implements AgentDitchService {
|
|
|
List<String> ids = Collections.singletonList(ytApp.getAppId());
|
|
|
appMapper.deleteAppIds(ids);
|
|
|
appMapper.deleteRisks(ids);
|
|
|
+ // ios应用 feign调用更新子库 记录
|
|
|
+ if (ytApp.getAppType() == 2 && StrUtil.isNotEmpty(ytApp.getSuperiorId())) {
|
|
|
+ try {
|
|
|
+ YtPlatformUserApp superior = agentAppMapper.selectByPrimaryKey(ytApp.getSuperiorId());
|
|
|
+ if (superior != null) {
|
|
|
+ feignInvoker.invoke(superior.getServiceName(), "delDitchByAppId", ytApp.getAppId());
|
|
|
+ }
|
|
|
+ }catch (Exception ignored){
|
|
|
+ log.error("同步 ditch删除失败, appId:{}", ytApp.getAppId());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return Result.resultOk(RepMessage.DELETE_SUCCESS);
|
|
|
}
|