| | |
| | | YwPoint entity = baseMapper.selectById(form.getId()); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | entity.setPointTag(form.getPointTag().stream().collect(Collectors.joining(","))); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | public Result page(YwPointQuery query) { |
| | | IPage<YwPointVO> page = PageUtil.getPage(query, YwPointVO.class); |
| | | baseMapper.page(page, query); |
| | | page.getRecords().stream().forEach(point -> { |
| | | if (StringUtils.hasText(point.getPointTagString())) { |
| | | point.setPointTags(point.getPointTagString().split(",")); |
| | | } |
| | | }); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | |
| | | YwPoint entity = baseMapper.selectById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | YwPointVO vo = YwPointVO.getVoByEntity(entity, null); |
| | | if (StringUtils.hasText(entity.getPointTag())) { |
| | | vo.setPointTags(entity.getPointTag().split(",")); |
| | | } |
| | | if (Objects.nonNull(entity.getDeptId())) { |
| | | vo.setDeptIds(sysDeptMapper.selectParents(entity.getDeptId())); |
| | | } |