调整
This commit is contained in:
parent
767e6d9139
commit
55716462b9
@ -101,6 +101,8 @@ public class CustomerMainController {
|
|||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('base:customer-main:delete')")
|
@PreAuthorize("@ss.hasPermission('base:customer-main:delete')")
|
||||||
public CommonResult<Boolean> deleteCustomerMain(@RequestParam("id") String id) {
|
public CommonResult<Boolean> deleteCustomerMain(@RequestParam("id") String id) {
|
||||||
|
// TODO: 2024/8/4 临时
|
||||||
|
customerMainService.removeById(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +146,7 @@ public class CustomerMainController {
|
|||||||
* @date 19:21 2024/8/3
|
* @date 19:21 2024/8/3
|
||||||
**/
|
**/
|
||||||
@PostMapping("/bindCustomerCar")
|
@PostMapping("/bindCustomerCar")
|
||||||
@Operation(summary = "创建客户管理")
|
@Operation(summary = "绑定车辆")
|
||||||
@PreAuthorize("@ss.hasPermission('base:customer-main:car')")
|
@PreAuthorize("@ss.hasPermission('base:customer-main:car')")
|
||||||
public CommonResult<Boolean> bindCustomerCar(@Valid @RequestBody CustomerMainSaveReqVO saveReqVO) {
|
public CommonResult<Boolean> bindCustomerCar(@Valid @RequestBody CustomerMainSaveReqVO saveReqVO) {
|
||||||
customerMainService.bindCustomAndCar(saveReqVO);
|
customerMainService.bindCustomAndCar(saveReqVO);
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.label.controller.admin;
|
package cn.iocoder.yudao.module.label.controller.admin;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.label.entity.Label;
|
import cn.iocoder.yudao.module.label.entity.Label;
|
||||||
import cn.iocoder.yudao.module.label.service.LabelService;
|
import cn.iocoder.yudao.module.label.service.LabelService;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
|
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelSaveReqVO;
|
import cn.iocoder.yudao.module.label.vo.LabelSaveReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -20,12 +17,8 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 标签库")
|
@Tag(name = "管理后台 - 标签库")
|
||||||
@ -37,23 +30,48 @@ public class LabelController {
|
|||||||
@Resource
|
@Resource
|
||||||
private LabelService labelService;
|
private LabelService labelService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新建标签
|
||||||
|
*
|
||||||
|
* @param createReqVO 标签扩展类
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.String>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:18 2024/8/4
|
||||||
|
**/
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建标签库")
|
@Operation(summary = "创建标签库")
|
||||||
@PreAuthorize("@ss.hasPermission('base:label:create')")
|
@PreAuthorize("@ss.hasPermission('base:label:create')")
|
||||||
public CommonResult<String> createLabel(@Valid @RequestBody LabelSaveReqVO createReqVO) {
|
public CommonResult<Boolean> createLabel(@Valid @RequestBody LabelSaveReqVO createReqVO) {
|
||||||
return success(labelService.createLabel(createReqVO));
|
labelService.saveLabel(createReqVO);
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新标签库
|
||||||
|
*
|
||||||
|
* @param updateReqVO 标签扩展类
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.String>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:18 2024/8/4
|
||||||
|
**/
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新标签库")
|
@Operation(summary = "更新标签库")
|
||||||
@PreAuthorize("@ss.hasPermission('base:label:update')")
|
@PreAuthorize("@ss.hasPermission('base:label:update')")
|
||||||
public CommonResult<Boolean> updateLabel(@Valid @RequestBody LabelSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateLabel(@Valid @RequestBody LabelSaveReqVO updateReqVO) {
|
||||||
labelService.updateLabel(updateReqVO);
|
labelService.saveLabel(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标签
|
||||||
|
*
|
||||||
|
* @param id 标签id
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:33 2024/8/4
|
||||||
|
**/
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除标签库")
|
@Operation(summary = "删除标签")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('base:label:delete')")
|
@PreAuthorize("@ss.hasPermission('base:label:delete')")
|
||||||
public CommonResult<Boolean> deleteLabel(@RequestParam("id") String id) {
|
public CommonResult<Boolean> deleteLabel(@RequestParam("id") String id) {
|
||||||
@ -61,6 +79,14 @@ public class LabelController {
|
|||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id获取标签
|
||||||
|
*
|
||||||
|
* @param id 标签id
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.label.vo.LabelRespVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:33 2024/8/4
|
||||||
|
**/
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得标签库")
|
@Operation(summary = "获得标签库")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@ -70,25 +96,25 @@ public class LabelController {
|
|||||||
return success(BeanUtils.toBean(label, LabelRespVO.class));
|
return success(BeanUtils.toBean(label, LabelRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签库分页查询
|
||||||
|
*
|
||||||
|
* @param pageReqVO LabelPageReqVO实体
|
||||||
|
* @param pageNo 分页参数
|
||||||
|
* @param pageSize 分页参数
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < ?>>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:37 2024/8/4
|
||||||
|
**/
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得标签库分页")
|
@Operation(summary = "获得标签库分页")
|
||||||
@PreAuthorize("@ss.hasPermission('base:label:query')")
|
@PreAuthorize("@ss.hasPermission('base:label:query')")
|
||||||
public CommonResult<PageResult<LabelRespVO>> getLabelPage(@Valid LabelPageReqVO pageReqVO) {
|
public CommonResult<IPage<?>> getLabelPage(LabelPageReqVO pageReqVO,
|
||||||
PageResult<Label> pageResult = labelService.getLabelPage(pageReqVO);
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
return success(BeanUtils.toBean(pageResult, LabelRespVO.class));
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<LabelRespVO> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(labelService.queryListPage(pageReqVO, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
|
||||||
@Operation(summary = "导出标签库 Excel")
|
|
||||||
@PreAuthorize("@ss.hasPermission('base:label:export')")
|
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
|
||||||
public void exportLabelExcel(@Valid LabelPageReqVO pageReqVO,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
||||||
List<Label> list = labelService.getLabelPage(pageReqVO).getList();
|
|
||||||
// 导出 Excel
|
|
||||||
ExcelUtils.write(response, "标签库.xls", "数据", LabelRespVO.class,
|
|
||||||
BeanUtils.toBean(list, LabelRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ public class Label extends TenantBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 主键标识
|
* 主键标识
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.INPUT)
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 标签名称
|
* 标签名称
|
||||||
@ -35,5 +35,7 @@ public class Label extends TenantBaseDO {
|
|||||||
* 系统标识
|
* 系统标识
|
||||||
*/
|
*/
|
||||||
private String systemCode;
|
private String systemCode;
|
||||||
|
/**标签样式*/
|
||||||
|
private String labelType;
|
||||||
|
|
||||||
}
|
}
|
@ -1,8 +1,13 @@
|
|||||||
package cn.iocoder.yudao.module.label.mapper;
|
package cn.iocoder.yudao.module.label.mapper;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.label.entity.Label;
|
import cn.iocoder.yudao.module.label.entity.Label;
|
||||||
|
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户管理扩展Mapper
|
* 客户管理扩展Mapper
|
||||||
@ -12,5 +17,16 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface LabelMapper extends BaseMapper<Label> {
|
public interface LabelMapper extends BaseMapper<Label> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询标签页sql
|
||||||
|
*
|
||||||
|
* @param pageReqVO LabelPageReqVO
|
||||||
|
* @param page LabelRespVO
|
||||||
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.label.vo.LabelRespVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:28 2024/8/4
|
||||||
|
**/
|
||||||
|
IPage<LabelRespVO> selectListPage(@Param("entity") LabelPageReqVO pageReqVO, Page<LabelRespVO> page);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,55 +1,59 @@
|
|||||||
package cn.iocoder.yudao.module.label.service;
|
package cn.iocoder.yudao.module.label.service;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.module.label.entity.Label;
|
import cn.iocoder.yudao.module.label.entity.Label;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
|
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelSaveReqVO;
|
import cn.iocoder.yudao.module.label.vo.LabelSaveReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标签库 Service 接口
|
* 标签库 Service 接口
|
||||||
*
|
*
|
||||||
* @author 后台管理员
|
* @author 后台管理员
|
||||||
*/
|
*/
|
||||||
public interface LabelService extends IService<Label> {
|
public interface LabelService extends IService<Label> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建标签库
|
* 创建标签库
|
||||||
*
|
*
|
||||||
* @param createReqVO 创建信息
|
* @param createReqVO LabelSaveReqVO
|
||||||
* @return 编号
|
* @return java.lang.String
|
||||||
*/
|
* @author PQZ
|
||||||
String createLabel(@Valid LabelSaveReqVO createReqVO);
|
* @date 14:19 2024/8/4
|
||||||
|
**/
|
||||||
|
void saveLabel(LabelSaveReqVO createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新标签库
|
* 删除标签
|
||||||
*
|
*
|
||||||
* @param updateReqVO 更新信息
|
* @param id 标签id
|
||||||
*/
|
* @return void
|
||||||
void updateLabel(@Valid LabelSaveReqVO updateReqVO);
|
* @author PQZ
|
||||||
|
* @date 14:22 2024/8/4
|
||||||
/**
|
**/
|
||||||
* 删除标签库
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteLabel(String id);
|
void deleteLabel(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得标签库
|
* 通过标签id获取标签信息
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 标签id
|
||||||
* @return 标签库
|
* @return cn.iocoder.yudao.module.label.entity.Label
|
||||||
*/
|
* @author PQZ
|
||||||
|
* @date 14:23 2024/8/4
|
||||||
|
**/
|
||||||
Label getLabel(String id);
|
Label getLabel(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得标签库分页
|
* 分页查询标签库
|
||||||
*
|
*
|
||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO LabelPageReqVO
|
||||||
* @return 标签库分页
|
* @param page Page
|
||||||
*/
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.label.vo.LabelRespVO>
|
||||||
PageResult<Label> getLabelPage(LabelPageReqVO pageReqVO);
|
* @author PQZ
|
||||||
|
* @date 14:25 2024/8/4
|
||||||
|
**/
|
||||||
|
IPage<LabelRespVO> queryListPage(LabelPageReqVO pageReqVO, Page<LabelRespVO> page);
|
||||||
|
|
||||||
}
|
}
|
@ -1,12 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.label.service.impl;
|
package cn.iocoder.yudao.module.label.service.impl;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.label.entity.Label;
|
import cn.iocoder.yudao.module.label.entity.Label;
|
||||||
import cn.iocoder.yudao.module.label.mapper.LabelMapper;
|
import cn.iocoder.yudao.module.label.mapper.LabelMapper;
|
||||||
import cn.iocoder.yudao.module.label.service.LabelService;
|
import cn.iocoder.yudao.module.label.service.LabelService;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
|
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelSaveReqVO;
|
import cn.iocoder.yudao.module.label.vo.LabelSaveReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -25,46 +27,60 @@ public class LabelServiceImpl extends ServiceImpl<LabelMapper, Label> implements
|
|||||||
@Resource
|
@Resource
|
||||||
private LabelMapper labelMapper;
|
private LabelMapper labelMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建标签库
|
||||||
|
*
|
||||||
|
* @param createReqVO LabelSaveReqVO
|
||||||
|
* @return java.lang.String
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:19 2024/8/4
|
||||||
|
**/
|
||||||
@Override
|
@Override
|
||||||
public String createLabel(LabelSaveReqVO createReqVO) {
|
public void saveLabel(LabelSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
Label label = BeanUtils.toBean(createReqVO, Label.class);
|
Label label = BeanUtils.toBean(createReqVO, Label.class);
|
||||||
labelMapper.insert(label);
|
this.saveOrUpdate(label);
|
||||||
// 返回
|
|
||||||
return label.getId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateLabel(LabelSaveReqVO updateReqVO) {
|
|
||||||
// 校验存在
|
|
||||||
validateLabelExists(updateReqVO.getId());
|
|
||||||
// 更新
|
|
||||||
Label updateObj = BeanUtils.toBean(updateReqVO, Label.class);
|
|
||||||
labelMapper.updateById(updateObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标签
|
||||||
|
*
|
||||||
|
* @param id 标签id
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:22 2024/8/4
|
||||||
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void deleteLabel(String id) {
|
public void deleteLabel(String id) {
|
||||||
// 校验存在
|
this.removeById(id);
|
||||||
validateLabelExists(id);
|
|
||||||
// 删除
|
|
||||||
labelMapper.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateLabelExists(String id) {
|
|
||||||
if (labelMapper.selectById(id) == null) {
|
|
||||||
// throw exception(LABEL_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过标签id获取标签信息
|
||||||
|
*
|
||||||
|
* @param id 标签id
|
||||||
|
* @return cn.iocoder.yudao.module.label.entity.Label
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:23 2024/8/4
|
||||||
|
**/
|
||||||
@Override
|
@Override
|
||||||
public Label getLabel(String id) {
|
public Label getLabel(String id) {
|
||||||
return labelMapper.selectById(id);
|
return labelMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询标签库
|
||||||
|
*
|
||||||
|
* @param pageReqVO LabelPageReqVO
|
||||||
|
* @param page Page
|
||||||
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.label.vo.LabelRespVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:25 2024/8/4
|
||||||
|
**/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<Label> getLabelPage(LabelPageReqVO pageReqVO) {
|
public IPage<LabelRespVO> queryListPage(LabelPageReqVO pageReqVO, Page<LabelRespVO> page) {
|
||||||
return null;
|
return labelMapper.selectListPage(pageReqVO, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.label.vo;
|
package cn.iocoder.yudao.module.label.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.label.entity.Label;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@ -13,19 +14,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class LabelPageReqVO extends PageParam {
|
public class LabelPageReqVO extends Label {
|
||||||
|
|
||||||
@Schema(description = "标签名称", example = "芋艿")
|
|
||||||
private String lableName;
|
|
||||||
|
|
||||||
@Schema(description = "标签描述")
|
|
||||||
private String lableDesc;
|
|
||||||
|
|
||||||
@Schema(description = "系统标识")
|
|
||||||
private String systemCode;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.label.vo;
|
package cn.iocoder.yudao.module.label.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.label.entity.Label;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -10,26 +11,6 @@ import com.alibaba.excel.annotation.*;
|
|||||||
@Schema(description = "管理后台 - 标签库 Response VO")
|
@Schema(description = "管理后台 - 标签库 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class LabelRespVO {
|
public class LabelRespVO extends Label {
|
||||||
|
|
||||||
@Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "1802")
|
|
||||||
@ExcelProperty("主键标识")
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
@Schema(description = "标签名称", example = "芋艿")
|
|
||||||
@ExcelProperty("标签名称")
|
|
||||||
private String lableName;
|
|
||||||
|
|
||||||
@Schema(description = "标签描述")
|
|
||||||
@ExcelProperty("标签描述")
|
|
||||||
private String lableDesc;
|
|
||||||
|
|
||||||
@Schema(description = "系统标识")
|
|
||||||
@ExcelProperty("系统标识")
|
|
||||||
private String systemCode;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.label.vo;
|
package cn.iocoder.yudao.module.label.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.label.entity.Label;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -7,18 +8,8 @@ import javax.validation.constraints.*;
|
|||||||
|
|
||||||
@Schema(description = "管理后台 - 标签库新增/修改 Request VO")
|
@Schema(description = "管理后台 - 标签库新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class LabelSaveReqVO {
|
public class LabelSaveReqVO extends Label {
|
||||||
|
|
||||||
@Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "1802")
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
@Schema(description = "标签名称", example = "芋艿")
|
|
||||||
private String lableName;
|
|
||||||
|
|
||||||
@Schema(description = "标签描述")
|
|
||||||
private String lableDesc;
|
|
||||||
|
|
||||||
@Schema(description = "系统标识")
|
|
||||||
private String systemCode;
|
|
||||||
|
|
||||||
}
|
}
|
@ -2,103 +2,16 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="cn.iocoder.yudao.module.label.mapper.LabelMapper">
|
<mapper namespace="cn.iocoder.yudao.module.label.mapper.LabelMapper">
|
||||||
|
|
||||||
<sql id="baseCarMainColumn">
|
<select id="selectListPage" resultType="cn.iocoder.yudao.module.label.vo.LabelRespVO">
|
||||||
tbcm.id,
|
|
||||||
tbcm.engine_number,
|
|
||||||
tbcm.vin,
|
|
||||||
tbcm.license_number,
|
|
||||||
tbcm.car_model,
|
|
||||||
tbcm.maintenance_date,
|
|
||||||
tbcm.maintenance_mileage,
|
|
||||||
tbcm.inspection_date,
|
|
||||||
tbcm.insurance_date,
|
|
||||||
tbcm.check_date,
|
|
||||||
tbcm.next_maintenance_date,
|
|
||||||
tbcm.next_maintenance_mileage,
|
|
||||||
tbcm.next_inspection_date,
|
|
||||||
tbcm.insurance_expiry_date,
|
|
||||||
tbcm.next_check_date,
|
|
||||||
tbcm.car_brand,
|
|
||||||
tbcm.car_nature,
|
|
||||||
tbcm.car_category,
|
|
||||||
tbcm.car_register_date,
|
|
||||||
tbcm.car_license_img,
|
|
||||||
tbcm.recently_handled_business,
|
|
||||||
tbcm.recently_handle_business_time,
|
|
||||||
tbcm.deleted,
|
|
||||||
tbcm.creator,
|
|
||||||
tbcm.create_time,
|
|
||||||
tbcm.updater,
|
|
||||||
tbcm.update_time
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="findPage" resultType="cn.iocoder.yudao.module.custom.vo.CarMainRespVO">
|
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="baseCarMainColumn"></include>
|
*
|
||||||
FROM `base_car_main` tbcm
|
|
||||||
WHERE
|
|
||||||
tbcm.deleted = 0
|
|
||||||
<if test="dto.licenseNumber != null and dto.licenseNumber != ''">
|
|
||||||
AND tbcm.license_number LIKE CONCAT('%',#{dto.licenseNumber},'%')
|
|
||||||
</if>
|
|
||||||
<if test="dto.carBrand != null and dto.carBrand != ''">
|
|
||||||
AND tbcm.car_brand = #{dto.carBrand}
|
|
||||||
</if>
|
|
||||||
<if test="dto.carCategory != null and dto.carCategory != ''">
|
|
||||||
AND tbcm.car_category = #{dto.carCategory}
|
|
||||||
</if>
|
|
||||||
<if test="dto.recentlyHandledBusiness != null and dto.recentlyHandledBusiness != ''">
|
|
||||||
AND tbcm.recently_handled_business = #{dto.recentlyHandledBusiness}
|
|
||||||
</if>
|
|
||||||
<if test="dto.recentlyHandleBusinessTime != null">
|
|
||||||
AND tbcm.recently_handle_business_time = #{dto.recentlyHandleBusinessTime}
|
|
||||||
</if>
|
|
||||||
<if test="dto.vin != null and dto.vin != ''">
|
|
||||||
AND tbcm.vin LIKE CONCAT('%',#{dto.vin},'%')
|
|
||||||
</if>
|
|
||||||
<if test="dto.recentlyHandledBusiness != null and dto.recentlyHandledBusiness != ''">
|
|
||||||
AND tbcm.tenant_id = #{dto.tenant}
|
|
||||||
</if>
|
|
||||||
<if test="dto.carModel != null and dto.carModel != ''">
|
|
||||||
AND tbcm.car_model = #{dto.carModel}
|
|
||||||
</if>
|
|
||||||
<if test="dto.carNature != null and dto.carNature != ''">
|
|
||||||
AND tbcm.car_nature = #{dto.carNature}
|
|
||||||
</if>
|
|
||||||
<if test="dto.engineNumber != null and dto.engineNumber != ''">
|
|
||||||
AND tbcm.engine_number LIKE CONCAT('%',#{dto.engineNumber},'%')
|
|
||||||
</if>
|
|
||||||
|
|
||||||
ORDER BY
|
|
||||||
tbcm.car_register_date DESC
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="isDataKeyValueRepeat" resultType="cn.iocoder.yudao.module.custom.entity.CarMain">
|
|
||||||
SELECT
|
|
||||||
tbcm.id
|
|
||||||
FROM `base_car_main` tbcm
|
|
||||||
WHERE
|
|
||||||
tbcm.deleted = 0
|
|
||||||
<if test="dto.licenseNumber != null and dto.licenseNumber != ''">
|
|
||||||
AND tbcm.license_number = #{dto.licenseNumber}
|
|
||||||
</if>
|
|
||||||
<if test="dto.vin != null and dto.vin != ''">
|
|
||||||
AND tbcm.vin = #{dto.vin}
|
|
||||||
</if>
|
|
||||||
<if test="dto.engineNumber != null and dto.engineNumber != ''">
|
|
||||||
AND tbcm.engine_number = #{dto.engineNumber}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
<select id="selectListByCusId" resultType="cn.iocoder.yudao.module.custom.vo.CarMainRespVO">
|
|
||||||
SELECT
|
|
||||||
<include refid="baseCarMainColumn"></include>,main.is_owner AS isOwner
|
|
||||||
FROM
|
FROM
|
||||||
base_customer_car main
|
base_label
|
||||||
LEFT JOIN base_car_main tbcm ON main.car_id = tbcm.id AND tbcm.deleted = 0
|
<where>
|
||||||
WHERE
|
deleted = 0
|
||||||
main.deleted = 0
|
<if test="entity.labelName != null and entity.cusName != ''">
|
||||||
AND main.cus_id = #{cusId}
|
AND label_name LIKE concat('%',#{entity.labelName},'%')
|
||||||
ORDER BY main.create_time DESC
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user