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