clubFullFactories = JSON.parseArray(fullFactoryBeanList, ClubFullFactory.class);在这里插入代码片
list 集合 转成 json字符串:
List<ClubFullFactory> fullFactoryBeanList = fullFactoryMapper.findFullFactoryBeanList(2, "");
//已经结束的满减送
List<ClubFullFactory> fullFactoryEndList = fullFactoryMapper.findFullFactoryBeanList(3, "");
//查询已经结束的IDS
List<String> fullIdsList = fullFactoryMapper.findFullIdsList(3, "");
if (!fullIdsList.isEmpty()){
fullFactoryMapper.updateIngStatusList(fullIdsList);
}
String beanList=fullFactoryBeanList.toString();
String endList=fullFactoryEndList.toString();
***String s1 = JSON.toJSONString(fullFactoryBeanList);***
String s2 = JSON.toJSONString(fullFactoryEndList);
//转换
String param = (fullFactoryBeanList==null?"":"fullFactoryBeanList="+s1)+(fullFactoryEndList==null?"":"&fullFactoryEndList="+s2);
json字符串 转成 list 集合 :
@RequestMapping("updateFullGoodsSku.do")
public ResponseMsg updateFullGoodsSku(String fullFactoryBeanList,String fullFactoryEndList){
ResponseMsg responseMsg = new ResponseMsg();
/**
* json 转 List<T>
*/
List<ClubFullFactory> clubFullFactories=new ArrayList<>();
List<ClubFullFactory> clubFullFactories1=new ArrayList<>();
if (!StringUtil.isEmpty(fullFactoryBeanList)){
***clubFullFactories = JSON.parseArray(fullFactoryBeanList, ClubFullFactory.class);***
}
if (!StringUtil.isEmpty(fullFactoryEndList)){
clubFullFactories1 = JSON.parseArray(fullFactoryEndList, ClubFullFactory.class);
}
int i = skuService.updateFullGoodsSku(clubFullFactories,clubFullFactories1);
if (i<=0) responseMsg.setStatus(ResponseMsg.ERROR);
else responseMsg.setMessage("更新成功");
return responseMsg;
}