|
|
|
@@ -665,10 +665,27 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
} |
|
|
|
|
|
|
|
if (EnumPayMchType.DIRECT.equals(payMchType)) { |
|
|
|
Long merchantId = null; |
|
|
|
if (merchantParamList.size() > 1) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "直连模式只能选择一个对应门店"); |
|
|
|
List<Long> merchantIds = new ArrayList<>(); |
|
|
|
for (JSONObject o:merchantParamList) { |
|
|
|
merchantIds.add(o.getLong("id")); |
|
|
|
} |
|
|
|
WxMerchant merchantQ = new WxMerchant(); |
|
|
|
merchantQ.updateTenantInfo(record); |
|
|
|
merchantQ.setIds(merchantIds); |
|
|
|
merchantQ.setIsAdmin(EnumYesOrNo.YES.getCode()); |
|
|
|
merchantQ.setStatus(EnumMerchantStatus.VALID.getCode()); |
|
|
|
List<Long> list = wxMerchantMapper.findIdList(merchantQ); |
|
|
|
if(list == null || list.isEmpty()){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "直连模式多门店券需包含一个商管商户"); |
|
|
|
}else if(list.size() > 1){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "直连模式多门店券只能包含一个商管商户"); |
|
|
|
} |
|
|
|
merchantId = list.get(0); |
|
|
|
}else{ |
|
|
|
merchantId = merchantParamList.get(0).getLong("id"); |
|
|
|
} |
|
|
|
Long merchantId = merchantParamList.get(0).getLong("id"); |
|
|
|
WxProfitSharingReceiver psReceiverQ = new WxProfitSharingReceiver(); |
|
|
|
psReceiverQ.updateTenantInfo(record); |
|
|
|
psReceiverQ.setMerchantId(merchantId); |
|
|
|
|