Commit 68fa8d87 by 张跃

组织id

parent 287aa839
......@@ -117,7 +117,7 @@ public class CocoCouponRelationServiceImpl implements CouponRelationService {
couponCodeVerificationDto.setTrans_id(orderBean.getOid());
couponCodeVerificationDto.setBusiness_date(DateUtil.convert2Str(new Date(), DateUtil.FORMAT_yyyyMMdd));
// 核销券新增参数:组织机构ID
couponCodeVerificationDto.setChannel_codes(storeService.getOrgIdsArr(orderBean.getCompanyId(), orderBean.getShopId()));
couponCodeVerificationDto.setChannel_ids(storeService.getOrgIdsArr(orderBean.getCompanyId(), orderBean.getShopId()));
// 核销交易信息
List<CouponCodeVerificationTransDto> transactions = new ArrayList<>();
......
......@@ -82,7 +82,7 @@ public class KgdCouponServiceImpl implements CouponService {
List<String> orgIds = storeService.getOrgIds(getStoreBO);
String channelIds = CollectionUtils.isNotEmpty(orgIds) ? Joiner.on(",").join(orgIds) : "";
map.put(Finals.CHANNEL_CODE_LIST, channelIds);
map.put(Finals.CHANNEL_ID_LIST, channelIds);
String appSecret = getAppSecret(getCouponDetailBO.getPartnerId());
String sign = SignUtil.createMD5Sign(map, appSecret);
map.put(Finals.SIGN, sign);
......
......@@ -15,11 +15,16 @@ import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest;
import com.freemud.application.sdk.api.storecenter.request.vo.GetOrgTreeListRequest;
import com.freemud.application.sdk.api.storecenter.response.StoreResponse;
import com.freemud.application.sdk.api.storecenter.response.vo.GetOrgTreeListResponse;
import com.freemud.application.sdk.api.storecenter.service.StoreCenterService;
import com.freemud.application.sdk.api.util.ResponseUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Service("KgdStoreService")
public class KgdStoreServiceImpl implements StoreService {
......@@ -39,12 +44,19 @@ public class KgdStoreServiceImpl implements StoreService {
GetOrgTreeListRequest request = new GetOrgTreeListRequest();
request.setPartnerId(getStoreBO.getPartnerId());
request.setStoreCode(getStoreBO.getStoreCode());
BaseResponse<List<String>> orgList = storeCenterService.getOrgList(request, LogThreadLocal.getTrackingNo());
if (orgList != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(orgList.getCode())) {
return orgList.getData();
BaseResponse<GetOrgTreeListResponse> response = storeCenterService.getOrgTreeList(request, LogThreadLocal.getTrackingNo());
if (Objects.equals("100", response.getCode()) && response.getData() != null) {
List<GetOrgTreeListResponse.OrgList> orgList = ((GetOrgTreeListResponse)response.getData()).getOrgList();
if (CollectionUtils.isEmpty(orgList)) {
return null;
} else {
List<String> orgIds = (List)orgList.stream().map(GetOrgTreeListResponse.OrgList::getOrganizationId).collect(Collectors.toList());
return orgIds;
}
} else {
return null;
}
}
@Override
public StoreInfoBO getStoreInfo(GetStoreInfoBO getStoreInfo) {
......
......@@ -97,7 +97,7 @@ public interface CommonService {
}
default String getOrgIdsAsString(String partnerId, String storeCode) {
List<String> orgIdList = this.getOrgIds(partnerId, storeCode);
List<String> orgIdList = this.getOrgIdsForCoupon(partnerId, storeCode);
return CollectionUtils.isNotEmpty(orgIdList) ? Joiner.on(",").join(orgIdList) : "";
}
......
......@@ -287,7 +287,7 @@ public class CouponServiceImpl implements CouponService {
map.put(Finals.ACTION, "code.allDetails");
// 券码接口新增参数:组织机构(多个用英文逗号分离)
String channelIds = commonService.getOrgIdsAsString(requestVo.getPartnerId(), requestVo.getStoreId());
map.put(Finals.CHANNEL_CODE_LIST, channelIds);
map.put(Finals.CHANNEL_ID_LIST, channelIds);
String appSecret = getAppSecret(requestVo.getPartnerId());
String sign = SignUtil.createMD5Sign(map, appSecret);
map.put(Finals.SIGN, sign);
......@@ -511,8 +511,8 @@ public class CouponServiceImpl implements CouponService {
Long totalAmount = createProductRequest(cartGoods, productList, isNew);
couponAvailableReqVo.setTotalAmount(Integer.valueOf(totalAmount + ""));
couponAvailableReqVo.setProductList(productList);
couponAvailableReqVo.setChannelCodeList(commonService.getOrgCodes(partnerId, storeId));
// couponAvailableReqVo.setChannelIdList(commonService.getOrgIdsForCoupon(partnerId, storeId));
// 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);
......
......@@ -1408,7 +1408,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
activityCalculationDiscountRequestDto.setGoods(calculationDiscountGoodsList);
activityCalculationDiscountRequestDto.setCoupons(coupons);
activityCalculationDiscountRequestDto.setOrgIds(commonService.getOrgIds(partnerId, storeId));
activityCalculationDiscountRequestDto.setOrgIds(commonService.getOrgIdsForCoupon(partnerId, storeId));
activityCalculationDiscountRequestDto.setDistributionFee(distributionFee);
activityCalculationDiscountRequestDto.setIsMember(isMember);
ActivityCalculationDiscountResponseDto activityCalculationDiscountResponseDto;
......
......@@ -191,7 +191,7 @@ public class CalculationSharingDiscountService {
//组装促销
calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList);
calculationSharingDiscountRequestDto.setCoupons(coupons);
calculationSharingDiscountRequestDto.setOrgIds(commonService.getOrgIds(partnerId,storeId));
calculationSharingDiscountRequestDto.setOrgIds(commonService.getOrgIdsForCoupon(partnerId,storeId));
calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount);
calculationSharingDiscountRequestDto.setIsMember(isMember);
......
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