Commit 42f2530d by xugaojun

9月迭代: 关闭标签选项优化,检查是否有执行中任务

parent 3b2a41a2
...@@ -225,6 +225,11 @@ ...@@ -225,6 +225,11 @@
<artifactId>sharing-core-api</artifactId> <artifactId>sharing-core-api</artifactId>
<version>${sharing-core-api}</version> <version>${sharing-core-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-app-customer-api</artifactId>
<version>${haoban-app-customer-api}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -6,6 +6,7 @@ import java.util.stream.Collectors; ...@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -53,6 +54,8 @@ public class EnterpriseController extends WebBaseController { ...@@ -53,6 +54,8 @@ public class EnterpriseController extends WebBaseController {
private StoreService storeService; private StoreService storeService;
@Autowired @Autowired
private EnterpriseService enterpriseService; private EnterpriseService enterpriseService;
@Autowired
private QywxTagSyncApiService qywxTagSyncApiService;
// @Autowired // @Autowired
// private WxEnterpriseRelatedApiService wxEnterpriseRelllatedApiService; // private WxEnterpriseRelatedApiService wxEnterpriseRelllatedApiService;
...@@ -129,6 +132,9 @@ public class EnterpriseController extends WebBaseController { ...@@ -129,6 +132,9 @@ public class EnterpriseController extends WebBaseController {
if (StringUtils.isEmpty(wxEnterpriseId)) { if (StringUtils.isEmpty(wxEnterpriseId)) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
if (Objects.isNull(flag)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
// 操作缓存 // 操作缓存
String key = "qywx-tag-open"; String key = "qywx-tag-open";
String lockKey = "qywx-tag-open-lock"; String lockKey = "qywx-tag-open-lock";
...@@ -148,6 +154,15 @@ public class EnterpriseController extends WebBaseController { ...@@ -148,6 +154,15 @@ public class EnterpriseController extends WebBaseController {
RedisUtil.setCache(key, wxEntIdStr); RedisUtil.setCache(key, wxEntIdStr);
} }
if (flag == 0) {
// 关闭标签检查是否有任务在进行
boolean tagSync = qywxTagSyncApiService.checkQywxTagSync(wxEnterpriseId);
if (!tagSync) {
// 有同步任务
return resultResponse(HaoBanErrCode.ERR_30001);
}
}
if (flag == 0 && StringUtils.isNotEmpty(wxEntIdStr)) { if (flag == 0 && StringUtils.isNotEmpty(wxEntIdStr)) {
// 关闭标签同步,只有在字符串不为空时才能关 // 关闭标签同步,只有在字符串不为空时才能关
List<String> filterList = Arrays.stream(wxEntIdStr.split(",")) List<String> filterList = Arrays.stream(wxEntIdStr.split(","))
......
...@@ -77,6 +77,9 @@ public enum HaoBanErrCode { ...@@ -77,6 +77,9 @@ public enum HaoBanErrCode {
ERR_20002(20002,"门店不存在"), ERR_20002(20002,"门店不存在"),
ERR_30001(30001,"已存在同步任务, 无法关闭"),
ERR_DEFINE(-888, "自定义错误"), ERR_DEFINE(-888, "自定义错误"),
ERR_OTHER(-999, "未知错误code"); ERR_OTHER(-999, "未知错误code");
private int code; private int code;
......
...@@ -57,4 +57,7 @@ ...@@ -57,4 +57,7 @@
<dubbo:reference interface="com.gic.sharing.core.service.api.service.MqApiService" <dubbo:reference interface="com.gic.sharing.core.service.api.service.MqApiService"
id="mqApiService"/> id="mqApiService"/>
<dubbo:reference interface="com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService"
id="qywxTagSyncApiService"/>
</beans> </beans>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment