json取值

数据库格式:
[{"jjxId":13,"jjxName":"测试三","jjxDate":"1111"},{"jjxId":15,"jjxName":"测试五","jjxDate":"2222"}]
	public R getNew(@PathVariable("fpId") Integer fpId,@PathVariable("deptId") Integer deptId){

		AAA djbPo = new AAA();
		djbPo = AAAService.getById(fpId);


		List<String> lst = new ArrayList<>();

		JSONArray pmNameArr = JSON.parseArray(djbPo.getJjxXq());;
		for (Object x : pmNameArr) {
			JSONObject info = JSON.parseObject(x.toString());
			lst.add(info.get("jjxId").toString());
		}

		BBB jiangjinFpJjlydjb = new BBB();
		jiangjinFpJjlydjb.setDataState(1);
		jiangjinFpJjlydjb.setJjDeptId(deptId);

		QueryWrapper<BBB> queryWrapper = Wrappers.query(jiangjinFpJjlydjb);
		queryWrapper.gt("shengy_je", 0);
		//默认可用的显示
		queryWrapper.ge("yxqz", LocalDateTime.now());
		queryWrapper.notIn("jjx_id",lst);

		return R.ok(BBBService.list(queryWrapper));
	}
posted @ 2021-08-30 18:29  寒冷的雨呢  阅读(302)  评论(0编辑  收藏  举报