Commit cc91c630 by guojuxing

达摩情报销商户黑名单

parent 6764defc
......@@ -6,13 +6,13 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.constant.ProductMarketTypeEnum;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.qo.ProductMarketQO;
import com.gic.enterprise.service.BlackListApiService;
import com.gic.enterprise.service.ProductMarketApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
......@@ -32,10 +32,11 @@ import java.util.Map;
public class ProductMarketController {
@Autowired
private ProductMarketApiService productMarketApiService;
@Autowired
private BlackListApiService blackListApiService;
@RequestMapping("query-product-market")
@ResponseBody
public RestResponse queryProductMarket(Integer showCount) {
Map<String, List<ProductMarketDTO>> result = new HashMap<>(8);
//功能更新
......@@ -77,13 +78,22 @@ public class ProductMarketController {
* @return
*/
@RequestMapping("is-need-to-popup")
@ResponseBody
public RestResponse isNeedToPopup() {
return ResultControllerUtils.commonResult(productMarketApiService
.isNeedToPopup(UserDetailUtils.getUserDetail().getEnterpriseId(),
UserDetailUtils.getUserDetail().getUserId()));
}
/**
* 是否在黑名单
* @return
*/
@RequestMapping("is-in-black-list")
public RestResponse isInBlackList() {
List<Integer> list = blackListApiService.getBlankListEnterprise().getResult();
return RestResponse.success(list.contains(UserDetailUtils.getUserDetail().getEnterpriseId()));
}
private boolean isNotEmptyList(ServiceResponse<Page<ProductMarketDTO>> response) {
return response.isSuccess() && response.getResult() != null && CollectionUtils.isNotEmpty(response.getResult().getResult());
}
......
......@@ -155,4 +155,5 @@
<!--短信签名-->
<dubbo:reference interface="com.gic.marketing.api.service.sms.SmsApiService" id="smsApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.ProductMarketApiService" id="productMarketApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.BlackListApiService" id="blackListApiService" timeout="6000" />
</beans>
......@@ -3,6 +3,7 @@ package com.gic.operation.web.controller;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.qo.ProductMarketQO;
import com.gic.enterprise.service.BlackListApiService;
import com.gic.enterprise.service.ProductMarketApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
public class ProductMarketController {
@Autowired
private ProductMarketApiService productMarketApiService;
@Autowired
private BlackListApiService blackListApiService;
/**
* 新增情报
......@@ -50,4 +53,24 @@ public class ProductMarketController {
public RestResponse pageProductMarket(ProductMarketQO params) {
return ResultControllerUtils.commonResult(productMarketApiService.pageProductMarket(params));
}
/**
* 新增黑名单
* @param enterpriseId
* @return
*/
@RequestMapping("save-black-list")
public RestResponse saveBlackList(Integer enterpriseId) {
return ResultControllerUtils.commonResult(blackListApiService.saveBlackList(enterpriseId));
}
@RequestMapping("delete-black-list")
public RestResponse deleteBlackList(Integer blackListId) {
return ResultControllerUtils.commonResult(blackListApiService.deleteBlackList(blackListId));
}
@RequestMapping("page-black-list")
public RestResponse pageBlackList(String search, Integer pageNum, Integer pageSize) {
return ResultControllerUtils.commonResult(blackListApiService.pageBlackList(search, pageNum, pageSize));
}
}
......@@ -95,4 +95,5 @@
<dubbo:reference interface="com.gic.open.api.service.EnterpriseLicenseApiService" id="enterpriseLicenseApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.ProductMarketApiService" id="productMarketApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.BlackListApiService" id="blackListApiService" timeout="6000" />
</beans>
\ No newline at end of file
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