|
|
|
@@ -175,22 +175,15 @@ public class WxOrderController extends BaseController { |
|
|
|
String app_id = jsonObject.getString("app_id"); |
|
|
|
String open_id = jsonObject.getString("open_id"); |
|
|
|
//透传字段 |
|
|
|
String cp_extra = jsonObject.getString("cp_extra"); |
|
|
|
if(StringUtils.isBlank(cp_extra)){ |
|
|
|
map.put("err_no",ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); |
|
|
|
map.put("err_tips","缺少透传字段"); |
|
|
|
return map; |
|
|
|
} |
|
|
|
Map<String,Long> couponMap = new HashMap<>(); |
|
|
|
Map<String,String> couponMap = new HashMap<>(); |
|
|
|
try{ |
|
|
|
JSONArray jsonArray = JSONObject.parseArray(cp_extra); |
|
|
|
for(int i=0;i<jsonArray.size();i++){ |
|
|
|
String goodsId = jsonArray.getJSONObject(i).getString("goodsId"); |
|
|
|
Long couponChannelId = jsonArray.getJSONObject(i).getLongValue("couponChannelId"); |
|
|
|
if(StringUtils.isNotBlank(goodsId) && couponChannelId != null){ |
|
|
|
couponMap.put(goodsId,couponChannelId); |
|
|
|
} |
|
|
|
String cp_extra = jsonObject.getString("cp_extra"); |
|
|
|
if(StringUtils.isBlank(cp_extra)){ |
|
|
|
map.put("err_no",ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); |
|
|
|
map.put("err_tips","缺少透传字段"); |
|
|
|
return map; |
|
|
|
} |
|
|
|
couponMap = JSONObject.parseObject(cp_extra, Map.class); |
|
|
|
}catch(Exception e){ |
|
|
|
} |
|
|
|
if(couponMap.isEmpty()){ |
|
|
|
@@ -237,7 +230,7 @@ public class WxOrderController extends BaseController { |
|
|
|
List<PlatPushOrderSaveDto> list = new ArrayList<>(); |
|
|
|
for (CreateOrderCallback.Good good:createOrderCallback.getGoods()) { |
|
|
|
PlatPushOrderSaveDto dto = new PlatPushOrderSaveDto(); |
|
|
|
dto.setCouponChannelId(couponMap.get(good.getGoodsId())); |
|
|
|
dto.setCouponChannelId(Long.parseLong(couponMap.get(good.getGoodsId()))); |
|
|
|
dto.setCount(good.getQuantity()); |
|
|
|
dto.setExtParam(good.getItemOrderInfoList().toString()); |
|
|
|
list.add(dto); |
|
|
|
|