Commit 34deae0f by ping.wu

Merge branches 'feature/20210527_核销券问题修复_wuping' and 'master' of…

Merge branches 'feature/20210527_核销券问题修复_wuping' and 'master' of http://gitlab.freemud.com/order-group-application/order-group
parents 1c199194 b162d6bf
......@@ -152,8 +152,8 @@ public class BuriedPointServiceImpl implements BuriedPointService {
String strOptRequestDto = new Gson().toJson(optRequestDto);
dto.setOpt2(strOptRequestDto);
// log.debug("syncTxProductClient.BuriedPoint_BuriedPointPaymentbofore**" + dto);
String str = syncTxProductClient.BuriedPoint(dto);
LogUtil.info("syncTxProductClient.BuriedPoint_BuriedPointPayment after", dto, str);
// String str = syncTxProductClient.BuriedPoint(dto);
// LogUtil.info("syncTxProductClient.BuriedPoint_BuriedPointPayment after", dto, str);
}
} catch (Exception e) {
ApiLog.error("支付之后埋点报错,让交易继续下去","",e);
......@@ -192,7 +192,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
paySuccessBuridPointDto.setSkus(skus);
ApiLog.debug("paySuccessBuridPoint {}" + paySuccessBuridPointDto);
Integer str = buriedPointClient.returnSubmit(paySuccessBuridPointDto);
// Integer str = buriedPointClient.returnSubmit(paySuccessBuridPointDto);
} catch (Exception e) {
ApiLog.error("paySuccessBuridPoint error" ,"", e);
}
......
......@@ -614,7 +614,7 @@ public class OrderServiceImpl implements Orderservice {
requestDto.setWxAppId(wxappid);
requestDto.setSessionId(sessionId);
requestDto.setOpenId(orderExtInfoDto != null ? orderExtInfoDto.getOpenid() : "");
buriedPointService.BuriedPointPayment(requestDto, orderBean);
// buriedPointService.BuriedPointPayment(requestDto, orderBean);
// 开通会员卡
if (StringUtils.isNotBlank(ruleId)) {
......@@ -628,7 +628,7 @@ public class OrderServiceImpl implements Orderservice {
ApiLog.debug("调用券码结束==" + message.getTrans_id());
}
//支付成功后
buriedPointService.paySuccessBuridPoint(partnerId, storeId, orderBean);
// buriedPointService.paySuccessBuridPoint(partnerId, storeId, orderBean);
return sendPaySuccessNoticeMessage();
}
......
......@@ -29,6 +29,7 @@ public class GetCouponDetailResponseDto {
private String valid_start;
private String valid_ends;
private String minAmount;
private Integer storeChannelLimit;
private Active active;
private List<ActiveProduct> activeProduct;
private List<ActiveRestrictionVOS> activeRestrictionVOS;
......
......@@ -73,6 +73,29 @@ public interface CommonService {
return null;
}
/**
* 查询门店服务 - 获取组织结构树
*
* @param partnerId
* @param storeCode
* @return
*/
default List<String> getOrgIdsForCoupon(String partnerId, String storeCode) {
GetOrgTreeListRequest request = new GetOrgTreeListRequest();
request.setPartnerId(partnerId);
request.setStoreCode(storeCode);
StoreCenterService storeCenterService = SpringBeanUtil.getBean(StoreCenterService.class);
BaseResponse<GetOrgTreeListResponse> orgList = storeCenterService.getOrgTreeList(request, LogThreadLocal.getTrackingNo());
if (orgList != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(orgList.getCode())) {
List<GetOrgTreeListResponse.OrgList> orgResponseList = orgList.getData().getOrgList();
if (CollectionUtils.isEmpty(orgResponseList)){
return null;
}
return orgResponseList.stream().map(org -> org.getOrganizationId()).collect(Collectors.toList());
}
return null;
}
default String getOrgIdsAsString(String partnerId, String storeCode) {
List<String> orgIdList = this.getOrgIds(partnerId, storeCode);
return CollectionUtils.isNotEmpty(orgIdList) ? Joiner.on(",").join(orgIdList) : "";
......
......@@ -512,6 +512,7 @@ public class CouponServiceImpl implements CouponService {
couponAvailableReqVo.setTotalAmount(Integer.valueOf(totalAmount + ""));
couponAvailableReqVo.setProductList(productList);
couponAvailableReqVo.setChannelCodeList(commonService.getOrgCodes(partnerId, storeId));
// couponAvailableReqVo.setChannelIdList(commonService.getOrgIdsForCoupon(partnerId, storeId));
if (StringUtils.isNotBlank(menuType)) {
String code = BusinessTypeEnum.getByType(menuType).getCode();
String channel = CouponRedeemChannel.getChannelByType(code);
......@@ -1261,52 +1262,52 @@ public class CouponServiceImpl implements CouponService {
return createCouponBeanVos;
}
/**
* 查询当前门店下可用商品券,循环获取
*
* @param partnerId
* @param storeId
* @param codes
*/
public List<CouponStateVo> getCouponStateByStoreId(String partnerId, String storeId, List<String> codes) {
String appSecret = getAppSecret(partnerId);
// 最大15一提交
int maxNum = 15;
int count = codes.size() / maxNum;
// 计算可用不可用券
CouponAvailableReqVo couponAvailableReqVo = new CouponAvailableReqVo();
couponAvailableReqVo.setMerchantId(partnerId);
couponAvailableReqVo.setProviderId(partnerId);
couponAvailableReqVo.setStoreId(storeId);
List<Product> productList = Lists.newArrayList();
// 优惠券优先级最高,根据商品原价做计算
// 订单金额
Long totalAmount = 0L;
couponAvailableReqVo.setTotalAmount(Integer.valueOf(totalAmount + ""));
couponAvailableReqVo.setProductList(productList);
couponAvailableReqVo.setChannelCodeList(commonService.getOrgCodes(partnerId, storeId));
// 构建计算SDK
List<CouponStateVo> couponStateList = Lists.newArrayList();
for (int j = 0; j <= count; j++) {
List calCouponCodes = null;
if (j == count) {
calCouponCodes = codes.subList(maxNum * j, codes.size());
} else {
calCouponCodes = codes.subList(maxNum * j, maxNum * j + maxNum);
}
// 书写逻辑
couponAvailableReqVo.setCouponCodes(calCouponCodes);
ApiLog.debug("availableCoupon couponAvailableService.getCouponsAvailable num:{};start:{}", j, JSON.toJSONString(couponAvailableReqVo));
//CouponAvailableRespVo couponsAvailable = couponAvailableService.getCouponsAvailable(couponAvailableReqVo, appSecret);
CouponAvailableRespDto couponsAvailable = couponAdaptClient.getCouponsAvailable(couponAvailableReqVo);
ApiLog.debug("availableCoupon couponAvailableService.getCouponsAvailable num:{};end:{}", j, JSON.toJSONString(couponsAvailable));
if (Objects.equals(String.valueOf(couponsAvailable.getResult()), ResponseResult.SUCCESS.getCode())
&& CollectionUtils.isNotEmpty(couponsAvailable.getCouponStateList())) {
couponStateList.addAll(couponsAvailable.getCouponStateList());
}
}
return couponStateList;
}
// /**
// * 查询当前门店下可用商品券,循环获取
// *
// * @param partnerId
// * @param storeId
// * @param codes
// */
// public List<CouponStateVo> getCouponStateByStoreId(String partnerId, String storeId, List<String> codes) {
// String appSecret = getAppSecret(partnerId);
// // 最大15一提交
// int maxNum = 15;
// int count = codes.size() / maxNum;
// // 计算可用不可用券
// CouponAvailableReqVo couponAvailableReqVo = new CouponAvailableReqVo();
// couponAvailableReqVo.setMerchantId(partnerId);
// couponAvailableReqVo.setProviderId(partnerId);
// couponAvailableReqVo.setStoreId(storeId);
// List<Product> productList = Lists.newArrayList();
// // 优惠券优先级最高,根据商品原价做计算
// // 订单金额
// Long totalAmount = 0L;
// couponAvailableReqVo.setTotalAmount(Integer.valueOf(totalAmount + ""));
// couponAvailableReqVo.setProductList(productList);
// couponAvailableReqVo.setChannelCodeList(commonService.getOrgCodes(partnerId, storeId));
// // 构建计算SDK
// List<CouponStateVo> couponStateList = Lists.newArrayList();
// for (int j = 0; j <= count; j++) {
// List calCouponCodes = null;
// if (j == count) {
// calCouponCodes = codes.subList(maxNum * j, codes.size());
// } else {
// calCouponCodes = codes.subList(maxNum * j, maxNum * j + maxNum);
// }
// // 书写逻辑
// couponAvailableReqVo.setCouponCodes(calCouponCodes);
// ApiLog.debug("availableCoupon couponAvailableService.getCouponsAvailable num:{};start:{}", j, JSON.toJSONString(couponAvailableReqVo));
// //CouponAvailableRespVo couponsAvailable = couponAvailableService.getCouponsAvailable(couponAvailableReqVo, appSecret);
// CouponAvailableRespDto couponsAvailable = couponAdaptClient.getCouponsAvailable(couponAvailableReqVo);
// ApiLog.debug("availableCoupon couponAvailableService.getCouponsAvailable num:{};end:{}", j, JSON.toJSONString(couponsAvailable));
// if (Objects.equals(String.valueOf(couponsAvailable.getResult()), ResponseResult.SUCCESS.getCode())
// && CollectionUtils.isNotEmpty(couponsAvailable.getCouponStateList())) {
// couponStateList.addAll(couponsAvailable.getCouponStateList());
// }
// }
// return couponStateList;
// }
@Override
public GetCouponBarCodeResponseVo getCouponBarCode(String couponCode) {
......
......@@ -424,6 +424,7 @@ public class CouponDiscountCalculation {
couponAvailableReqVo.setTotalAmount(Integer.valueOf(totalAmount + ""));
couponAvailableReqVo.setProductList(productList);
couponAvailableReqVo.setChannelCodeList(commonService.getOrgCodes(partnerId, storeId));
// couponAvailableReqVo.setChannelIdList(commonService.getOrgIdsForCoupon(partnerId, storeId));
couponAvailableReqVo.setStationId("999");
couponAvailableReqVo.setOperatorId("999");
// 构建计算SDK
......@@ -462,6 +463,9 @@ public class CouponDiscountCalculation {
res.setMerchantId(requestVo.getPartnerId());
res.setStoreId(requestVo.getStoreId());
res.setChannelIdList(commonService.getOrgCodes(requestVo.getPartnerId(), requestVo.getStoreId()));
// res.setChannelIdList(commonService.getOrgIdsForCoupon(requestVo.getPartnerId(), requestVo.getStoreId()));
// res.setChannelCodeList(commonService.getOrgCodes(requestVo.getPartnerId(), requestVo.getStoreId()));
res.setCouponCodes(couponCodes);
List<CouponProductVo> calculAmountProductList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(cartGoods)) {
......
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