This commit is contained in:
2026-03-25 17:19:20 +08:00
parent 3b2711b15f
commit 6d576d0668
3 changed files with 63 additions and 1 deletions

View File

@ -35,7 +35,7 @@ import java.util.Map;
@Api(tags = {"指导巡逻-方格点位接口"})
@RestController
@AllArgsConstructor
@RequestMapping("/tbZdxlFgdw")
@RequestMapping("/tbZdxlFgdw")
public class TbZdxlFgdwController {
/**
@ -172,4 +172,30 @@ public class TbZdxlFgdwController {
return ResponseResult.success(tbZdxlFgdwService.getSquarePoints(longitude, latitude, distance));
}
/**
* 删除单条(逻辑删除)
* @param id 主键ID
* @return ResponseResult 删除结果
*/
@ApiOperation(value = "删除单条")
@DeleteMapping("/{id}")
@JwtSysUser
@Log(title = "指导巡逻-方格点位接口-删除单条", businessType = BusinessType.DELETE)
public ResponseResult<Integer> deleteById(@PathVariable("id") Long id) {
return ResponseResult.success(tbZdxlFgdwService.deleteById(id));
}
/**
* 批量删除(逻辑删除)
* @param ids 主键ID列表
* @return ResponseResult 删除结果
*/
@ApiOperation(value = "批量删除")
@DeleteMapping("/batch")
@JwtSysUser
@Log(title = "指导巡逻-方格点位接口-批量删除", businessType = BusinessType.DELETE)
public ResponseResult<Integer> deleteByIds(@RequestParam List<Long> ids) {
return ResponseResult.success(tbZdxlFgdwService.deleteByIds(ids));
}
}

View File

@ -13,6 +13,7 @@ import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO;
import com.mosty.base.utils.PageUtils;
import com.mosty.base.utils.QueryWrapperUtils;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.yjzl.mapper.TbZdxlFgdwMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbZdxlFgdwService;
@ -249,4 +250,25 @@ public class TbZdxlFgdwServiceImpl extends ServiceImpl<TbZdxlFgdwMapper, TbZdxlF
return squareMap;
}
@Override
public Integer deleteById(Long id) {
if (ObjectUtils.isEmpty(id)) {
return 0;
}
return this.baseMapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer deleteByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return 0;
}
int count = 0;
for (Long id : ids) {
count += this.deleteById(id);
}
return count;
}
}

View File

@ -76,4 +76,18 @@ public interface TbZdxlFgdwService {
*/
Map<String, BigDecimal> getSquarePoints(double longitude, double latitude, double distance);
/**
* 删除单条(逻辑删除)
* @param id 主键ID
* @return 删除结果
*/
Integer deleteById(Long id);
/**
* 批量删除(逻辑删除)
* @param ids 主键ID列表
* @return 删除结果
*/
Integer deleteByIds(List<Long> ids);
}