Commit b2e90766 by guojuxing

卡券展架接口调整:查询小程序下面的

parent 3d73b361
......@@ -10,6 +10,9 @@ import com.gic.download.utils.OperationResultUtils;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.web.vo.ShelfCouponVO;
import com.gic.marketing.api.service.coupon.CouponShelfApiService;
import com.gic.member.config.api.dto.AppletsConfigSimpleOutputDTO;
import com.gic.member.config.api.service.AppletsConfigApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -42,6 +45,8 @@ public class CustomPageController {
private AppletCustomPageApiService appletCustomPageApiService;
@Autowired
private CouponShelfApiService couponShelfApiService;
@Autowired
private AppletsConfigApiService appletsConfigApiService;
@RequestMapping("/save-page")
public RestResponse savePage(String param, Integer pageId, Integer saveType, Integer appType, String appId) {
......@@ -88,15 +93,26 @@ public class CustomPageController {
}
@RequestMapping("/list-shelf-coupon")
public RestResponse listShelfCoupon(String memberCardId) {
if (StringUtils.isBlank(memberCardId)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "会员卡ID不能为空");
public RestResponse listShelfCoupon(String memberCardId, String appId) {
if (StringUtils.isBlank(appId)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "参数不能为空");
}
if (!StringUtils.isNumeric(memberCardId)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "会员卡ID值非法");
ServiceResponse<List<AppletsConfigSimpleOutputDTO>> result = appletsConfigApiService
.listAppletConfigAppIdContainDel(UserDetailUtils.getUserDetail().getEnterpriseId());
Long appletAreaId = 0L;
if (result.isSuccess()) {
List<AppletsConfigSimpleOutputDTO> list = result.getResult();
if (CollectionUtils.isNotEmpty(list)) {
for (AppletsConfigSimpleOutputDTO dto : list) {
if (appId.equals(dto.getAppId())) {
appletAreaId = dto.getAppletConfigId();
break;
}
}
}
}
return ResultControllerUtils.commonResult(couponShelfApiService
.listShelf(UserDetailUtils.getUserDetail().getEnterpriseId(), Long.parseLong(memberCardId)), ShelfCouponVO.class);
.listShelf(UserDetailUtils.getUserDetail().getEnterpriseId(), appletAreaId), ShelfCouponVO.class);
}
/**
......
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