@@ -396,15 +396,20 @@ public class WxCouponServiceImpl implements WxCouponService {
private Long parseMerchantId(JSONObject merchantParam){
return Long.valueOf(merchantParam.getString("id"));
if (!StringUtils.isBlank(merchantParam.getString("id"))){
return Long.valueOf(merchantParam.getString("id"));
}
return null;
}
private String parseParameter(JSONObject merchantParam){
return merchantParam.getString("parameter");
}
private Integer parseBusiness(JSONObject merchantParam){
String businessIdStr = merchantParam.getString("businessId");
return Integer.valueOf(businessIdStr);
if ( !StringUtils.isBlank(businessIdStr)) {
return Integer.valueOf(businessIdStr);
}
return null;
}
private Integer parseSubBusiness(JSONObject merchantParam){
String subBusinessIdStr = merchantParam.getString("subBusinessId");
@@ -1538,7 +1543,7 @@ public class WxCouponServiceImpl implements WxCouponService {
StringBuffer merchantParams = new StringBuffer("[{\"tenantId\":").append(mallTenantEntity.getTenantId()).append(",\"mallMerchantParams\":").append("[");
Long[] mids = wxCoupon.getMerchantIds();
for (int i = 0 ;i < mids.length; i++ ){
merchantParams.append("{\"id\":").append(mids[i]).append("}");
merchantParams.append("{\"id\":").append(mids[i]).append(",\"businessId\":").append(EnumBusiness.BUSINESS_ID6.getCode()).append(" }");
if (i < mids.length-1 ) {
merchantParams.append(",");
}
@@ -1549,7 +1554,7 @@ public class WxCouponServiceImpl implements WxCouponService {
final IdWorker idWorker = IdWorker.get();
updateCouponMerchants(coupon,idWorker);
//平台券设置商管商户
if (null == makeMerchantId && null != coupon.getMakeMerchantId()){
if (null != coupon.getMakeMerchantId()) {
wxCouponMapper.setMakeMerchantId(coupon);
}
}catch(Exception e) {