| | |
| | | } |
| | | |
| | | /** |
| | | * 房屋-标签 房屋自定义新增或修改 |
| | | * @param householdLabel |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveOrUpdateHouseLabel") |
| | | @ApiOperation(value = "自定义新增或修改", notes = "传入householdLabel") |
| | | public R saveOrUpdateHouseLabel(@Valid @RequestBody UserHouseLabelEntity householdLabel) { |
| | | return R.status(householdLabelService.saveOrUpdateHouseLabel(householdLabel)); |
| | | } |
| | | |
| | | /** |
| | | * 住户-标签 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | |
| | | IPage<HouseholdLabelVO> statisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel); |
| | | |
| | | IPage<HouseholdLabelVO> getCommunityStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel); |
| | | |
| | | /** |
| | | * 房屋-标签 房屋自定义新增或修改 |
| | | * @param householdLabel |
| | | * @return |
| | | */ |
| | | boolean saveOrUpdateHouseLabel(UserHouseLabelEntity householdLabel); |
| | | } |
| | |
| | | public IPage<HouseholdLabelVO> getCommunityStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel) { |
| | | return page.setRecords(baseMapper.getCommunityStatisticalLabels(page, householdLabel)); |
| | | } |
| | | |
| | | /** |
| | | * 房屋-标签 房屋自定义新增或修改 |
| | | * @param householdLabel |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdateHouseLabel(UserHouseLabelEntity householdLabel) { |
| | | // 查询标签名称 |
| | | LabelEntity labelEntity = labelService.getById(householdLabel.getLabelId()); |
| | | householdLabel.setLabelName(labelEntity.getLabelName()); |
| | | // 先删除之前的房屋绑定的标签 |
| | | QueryWrapper<UserHouseLabelEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("house_code",householdLabel.getHouseCode()) |
| | | .eq("lable_type",2); |
| | | // 删除 |
| | | remove(queryWrapper); |
| | | // 插入 |
| | | return save(householdLabel); |
| | | } |
| | | } |