public Mapdelete(JSONObject head, JSONObject body) throws Exception { Map attributes=new HashMap (); JSONArray couponJson=body.optJSONArray("couponId"); String token=head.optString("token"); Object object=UserCacheManage.getAppUser(token); //if(object!=null){ //UserCache user=(UserCache)object; String userId="4028668150c6aedb0150c6ddde750005"; HhUserEntity hhUserEntity=super.getEntity(HhUserEntity.class, userId); if(hhUserEntity!=null){ String ids=""; Object [] couponIds=(Object[])couponJson.toArray(); if(couponIds!=null&&couponIds.length>0){ for(int i=0;i list = super.findByQueryString(hql); if(list!=null&&list.size()>0){ super.deleteAllEntitie(list); }
我要取到couponId然后批量删除实体,但是body.optJSONArray("couponId")得到的是object类型不是jsonarry类型,这怎么办- -
直接强转不行?