优化更新:新增标识
parent
f12e4019cd
commit
a25d60ba4d
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.system.common.domain;
|
||||
package com.muyu.business.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
|
@ -0,0 +1,20 @@
|
|||
package com.muyu.business.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName MarkingListRequest
|
||||
* @Description TODO
|
||||
* @Author YinYuYang
|
||||
* @Date 2024/4/10 20:46
|
||||
* Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class MarkingListRequest {
|
||||
|
||||
private String markingName;
|
||||
|
||||
private Integer pageNum;
|
||||
|
||||
private Integer pageSize;
|
||||
}
|
|
@ -1,12 +1,10 @@
|
|||
package com.muyu.business.domain.request;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
|
@ -20,7 +18,7 @@ import javax.validation.constraints.Pattern;
|
|||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FenceListRequest{
|
||||
public class FenceListRequest {
|
||||
|
||||
/**
|
||||
* 围栏名称
|
||||
|
|
|
@ -15,6 +15,8 @@ import com.muyu.common.security.annotation.RequiresPermissions;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName BusinessFenceController
|
||||
* @Description 电子围栏控制层
|
||||
|
@ -121,4 +123,11 @@ public class FenceInfoController extends BaseController
|
|||
{
|
||||
return toAjax(fenceInfoService.savePolygon(mapRequest));
|
||||
}
|
||||
|
||||
@RequiresPermissions("business:fence:query")
|
||||
@GetMapping("/findFence")
|
||||
public List<Fence> findFence()
|
||||
{
|
||||
return fenceInfoService.findFence();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
package com.muyu.business.controller;
|
||||
|
||||
import com.muyu.business.domain.Marking;
|
||||
import com.muyu.business.domain.req.MarkingListRequest;
|
||||
import com.muyu.business.service.IMarkingService;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 标识列表Controller
|
||||
*
|
||||
* @author yinyuyang
|
||||
* @date 2024-04-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/marking")
|
||||
public class MarkingController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMarkingService markingService;
|
||||
|
||||
/**
|
||||
* 查询标识列表列表
|
||||
*/
|
||||
@RequiresPermissions("business:marking:list")
|
||||
@GetMapping("/list")
|
||||
public Result<PageResult<Marking>> list(MarkingListRequest markingListRequest)
|
||||
{
|
||||
return markingService.findList(markingListRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取标识列表详细信息
|
||||
*/
|
||||
@RequiresPermissions("business:marking:query")
|
||||
@GetMapping(value = "/findById/{markingId}")
|
||||
public Marking getInfo(@PathVariable("markingId") Integer markingId)
|
||||
{
|
||||
return markingService.findById(markingId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标识列表
|
||||
*/
|
||||
@RequiresPermissions("business:marking:add")
|
||||
@Log(title = "标识列表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/insert")
|
||||
public Result add(@RequestBody Marking marking)
|
||||
{
|
||||
return toAjax(markingService.insertMarking(marking));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标识列表
|
||||
*/
|
||||
@RequiresPermissions("business:marking:edit")
|
||||
@Log(title = "标识列表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public Result edit(@RequestBody Marking marking)
|
||||
{
|
||||
return toAjax(markingService.updateMarking(marking));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标识列表
|
||||
*/
|
||||
@RequiresPermissions("business:marking:remove")
|
||||
@Log(title = "标识列表", businessType = BusinessType.DELETE)
|
||||
@PostMapping("delete/{markingId}")
|
||||
public Result remove(@PathVariable Integer markingId)
|
||||
{
|
||||
return toAjax(markingService.delete(markingId));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.business.domain.Marking;
|
||||
|
||||
/**
|
||||
* 标识列表Mapper接口
|
||||
*
|
||||
* @author yinyuyang
|
||||
* @date 2024-04-10
|
||||
*/
|
||||
public interface MarkingMapper extends BaseMapper<Marking>
|
||||
{
|
||||
|
||||
}
|
|
@ -7,6 +7,8 @@ import com.muyu.business.domain.request.MapRequest;
|
|||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子围栏Service接口
|
||||
*
|
||||
|
@ -46,4 +48,5 @@ public interface IFenceInfoService extends IService<Fence>
|
|||
Fence selectFenceByFenceId(Integer fenceId);
|
||||
|
||||
int savePolygon(MapRequest mapRequest);
|
||||
List<Fence> findFence();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package com.muyu.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.business.domain.Marking;
|
||||
import com.muyu.business.domain.req.MarkingListRequest;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
|
||||
/**
|
||||
* 标识列表Service接口
|
||||
*
|
||||
* @author yinyuyang
|
||||
* @date 2024-04-10
|
||||
*/
|
||||
public interface IMarkingService extends IService<Marking>
|
||||
{
|
||||
|
||||
Result<PageResult<Marking>> findList(MarkingListRequest markingListRequest);
|
||||
|
||||
int insertMarking(Marking marking);
|
||||
|
||||
int updateMarking(Marking marking);
|
||||
|
||||
Marking findById(Integer markingId);
|
||||
|
||||
int delete(Integer markingId);
|
||||
}
|
|
@ -160,4 +160,13 @@ public class FenceInfoServiceImpl extends ServiceImpl<FenceInfoMapper, Fence>
|
|||
|
||||
return fenceInfoMapper.update(fence,updateWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<Fence> findFence() {
|
||||
|
||||
LambdaQueryWrapper<Fence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
queryWrapper.select(Fence::getFenceId,Fence::getFenceName);
|
||||
|
||||
return fenceInfoMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package com.muyu.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.business.domain.Marking;
|
||||
import com.muyu.business.domain.req.MarkingListRequest;
|
||||
import com.muyu.business.mapper.MarkingMapper;
|
||||
import com.muyu.business.service.IMarkingService;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标识列表Service业务层处理
|
||||
*
|
||||
* @author yinyuyang
|
||||
* @date 2024-04-10
|
||||
*/
|
||||
@Service
|
||||
public class MarkingServiceImpl extends ServiceImpl<MarkingMapper, Marking>
|
||||
implements IMarkingService
|
||||
{
|
||||
@Autowired
|
||||
private MarkingMapper markingMapper;
|
||||
|
||||
@Override
|
||||
public Result<PageResult<Marking>> findList(MarkingListRequest markingListRequest) {
|
||||
|
||||
PageHelper.startPage(markingListRequest.getPageNum(),markingListRequest.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<Marking> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
queryWrapper.like(StringUtils.isNotEmpty(markingListRequest.getMarkingName()),Marking::getMarkingName,
|
||||
markingListRequest.getMarkingName());
|
||||
|
||||
List<Marking> list = this.list(queryWrapper);
|
||||
|
||||
PageInfo<Marking> pageInfo = new PageInfo<>(list);
|
||||
|
||||
return PageResult.toResult(pageInfo.getTotal(),list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertMarking(Marking marking) {
|
||||
|
||||
return markingMapper.insert(marking);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMarking(Marking marking) {
|
||||
|
||||
return markingMapper.updateById(marking);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Marking findById(Integer markingId) {
|
||||
|
||||
return markingMapper.selectById(markingId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Integer markingId) {
|
||||
|
||||
return markingMapper.deleteById(markingId);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue