From ce5763e2bf5dae2155e95dd44ae2b88fca84f667 Mon Sep 17 00:00:00 2001 From: lihongbiao <964708803@qq.com> Date: Tue, 15 Jul 2025 20:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=AE=A2=E6=88=B7=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CnCustomerTypeController.java | 125 ------------------ .../modules/system/domain/CnCustomerType.java | 36 ----- .../system/mapper/CnCustomerTypeMapper.java | 18 --- .../system/service/CnCustomerTypeService.java | 34 ----- .../impl/CnCustomerTypeServiceImpl.java | 48 ------- .../resources/mapper/CnCustomerTypeMapper.xml | 5 - 6 files changed, 266 deletions(-) delete mode 100644 aircraft-system/src/main/java/com/aircraft/modules/system/controller/CnCustomerTypeController.java delete mode 100644 aircraft-system/src/main/java/com/aircraft/modules/system/domain/CnCustomerType.java delete mode 100644 aircraft-system/src/main/java/com/aircraft/modules/system/mapper/CnCustomerTypeMapper.java delete mode 100644 aircraft-system/src/main/java/com/aircraft/modules/system/service/CnCustomerTypeService.java delete mode 100644 aircraft-system/src/main/java/com/aircraft/modules/system/service/impl/CnCustomerTypeServiceImpl.java delete mode 100644 aircraft-system/src/main/resources/mapper/CnCustomerTypeMapper.xml diff --git a/aircraft-system/src/main/java/com/aircraft/modules/system/controller/CnCustomerTypeController.java b/aircraft-system/src/main/java/com/aircraft/modules/system/controller/CnCustomerTypeController.java deleted file mode 100644 index 1991742..0000000 --- a/aircraft-system/src/main/java/com/aircraft/modules/system/controller/CnCustomerTypeController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.aircraft.modules.system.controller; - - -import com.aircraft.annotation.Log; -import com.aircraft.modules.system.domain.CnCustomerType; -import com.aircraft.modules.system.service.CnCustomerTypeService; -import com.aircraft.utils.PageResult; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import kotlin.Result; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - *

- * 前端控制器 - *

- * - * @author cli - * @since 2025-07-09 - */ -@RestController -@RequestMapping("/cnCustomerType") -public class CnCustomerTypeController { - - private static final Logger LOG = LoggerFactory.getLogger(CnCustomerTypeController.class); - @Autowired - private CnCustomerTypeService entityService; - - @Log("分页查询客户类型") - @ApiOperation(value = "分页查询客户类型", notes = "分页查询客户类型") - @RequestMapping(method = RequestMethod.GET) - @ApiImplicitParams({@ApiImplicitParam(name = "size", value = "分页大小", paramType = "query"), - @ApiImplicitParam(name = "current", value = "当前页面:从1开始", paramType = "query")}) - public ResponseEntity> findByPage(final CnCustomerType example, final Page page) { - PageResult records = entityService.page(example,page); - return new ResponseEntity<>(records,HttpStatus.OK); - } - - @Log("删除客户类型") - @ApiOperation(value = "删除客户类型") - @RequestMapping(value = "{id}", method = {RequestMethod.DELETE}) - @ApiImplicitParam(name = "id", value = "客户类型ID", required = true, paramType = "path") - public ResponseEntity delete(@PathVariable final Integer id) { - try { - entityService.removeById(id); - return new ResponseEntity<>("成功删除客户类型",HttpStatus.OK); - } catch (DataIntegrityViolationException e) { - LOG.error("删除客户类型失败", e); - throw new RuntimeException( "删除客户类型失败,该客户类型不能删除,存在其他关联数据",e); - } catch (Exception e) { - LOG.error("删除客户类型失败", e); - throw new RuntimeException( "删除客户类型失败",e); - } - } - - @Log("查询单个客户类型") - @ApiOperation(value = "查询单个客户类型") - @RequestMapping(value = "{id}", method = {RequestMethod.GET}) - @ApiImplicitParam(name = "id", value = "客户类型ID", required = true, paramType = "path") - public ResponseEntity one(@PathVariable final Integer id) { - try { - CnCustomerType entity = entityService.getById(id); - return new ResponseEntity<>(entity,HttpStatus.OK); - } catch (Exception e) { - LOG.error("查询单个客户类型失败", e); - throw new RuntimeException( "查询单个客户类型失败",e); - } - } - - @Log("添加客户类型") - @ApiOperation(value = "添加客户类型") - @RequestMapping(method = {RequestMethod.POST}) - public ResponseEntity add(@Valid @RequestBody final CnCustomerType entity, final BindingResult result) { - try { - entityService.save(entity); - return new ResponseEntity<>("成功保存客户类型",HttpStatus.OK); - } catch (Exception e) { - LOG.error("添加客户类型失败", e); - throw new RuntimeException( "添加客户类型失败",e); - } - } - - @Log("修改客户类型") - @ApiOperation(value = "修改客户类型") - @RequestMapping(method = {RequestMethod.PUT}) - public ResponseEntity update(@Valid @RequestBody final CnCustomerType entity, final BindingResult result) { - try { - if (null == entity.getId()) { - throw new RuntimeException("id不能为空"); - } - entityService.updateById(entity); - return new ResponseEntity<>("成功修改客户类型",HttpStatus.OK); - } catch (Exception e) { - LOG.error("修改客户类型失败", e); - throw new RuntimeException( "修改客户类型失败",e); - } - } - - @ApiOperation(value = "全部客户类型") - @RequestMapping(value = "all", method = RequestMethod.GET) - public ResponseEntity all(CnCustomerType example) { - List entitys = entityService.list(example); - if (null != entitys) { - return new ResponseEntity<>(entitys,HttpStatus.OK); - } - return new ResponseEntity<>(Collections.emptyList(),HttpStatus.OK); - } - -} - diff --git a/aircraft-system/src/main/java/com/aircraft/modules/system/domain/CnCustomerType.java b/aircraft-system/src/main/java/com/aircraft/modules/system/domain/CnCustomerType.java deleted file mode 100644 index 0c3616f..0000000 --- a/aircraft-system/src/main/java/com/aircraft/modules/system/domain/CnCustomerType.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.aircraft.modules.system.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.aircraft.base.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - *

- * - *

- * - * @author cli - * @since 2025-07-09 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("cn_customer_type") -public class CnCustomerType extends BaseEntity { - - private static final long serialVersionUID = 1L; - - private Integer id; - - /** - * 类型名称 - */ - private String typeName; - - /** - * 描述 - */ - private String description; - - -} diff --git a/aircraft-system/src/main/java/com/aircraft/modules/system/mapper/CnCustomerTypeMapper.java b/aircraft-system/src/main/java/com/aircraft/modules/system/mapper/CnCustomerTypeMapper.java deleted file mode 100644 index 8c1f72a..0000000 --- a/aircraft-system/src/main/java/com/aircraft/modules/system/mapper/CnCustomerTypeMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.aircraft.modules.system.mapper; - -import com.aircraft.modules.system.domain.CnCustomerType; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * Mapper 接口 - *

- * - * @author cli - * @since 2025-07-09 - */ -@Mapper -public interface CnCustomerTypeMapper extends BaseMapper { - -} diff --git a/aircraft-system/src/main/java/com/aircraft/modules/system/service/CnCustomerTypeService.java b/aircraft-system/src/main/java/com/aircraft/modules/system/service/CnCustomerTypeService.java deleted file mode 100644 index dbe7482..0000000 --- a/aircraft-system/src/main/java/com/aircraft/modules/system/service/CnCustomerTypeService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.aircraft.modules.system.service; - -import com.aircraft.modules.system.domain.CnCustomerType; -import com.aircraft.utils.PageResult; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - *

- * 服务类 - *

- * - * @author cli - * @since 2025-07-09 - */ -public interface CnCustomerTypeService extends IService { - - /** - * 条件查询 - * @param example - * @return - */ - List list(CnCustomerType example); - - /** - * 分页查询 - * @param example - * @param page - * @return - */ - PageResult page(CnCustomerType example, IPage page); -} diff --git a/aircraft-system/src/main/java/com/aircraft/modules/system/service/impl/CnCustomerTypeServiceImpl.java b/aircraft-system/src/main/java/com/aircraft/modules/system/service/impl/CnCustomerTypeServiceImpl.java deleted file mode 100644 index 8f7db66..0000000 --- a/aircraft-system/src/main/java/com/aircraft/modules/system/service/impl/CnCustomerTypeServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.aircraft.modules.system.service.impl; - -import com.aircraft.modules.system.domain.CnCustomerType; -import com.aircraft.modules.system.mapper.CnCustomerTypeMapper; -import com.aircraft.modules.system.service.CnCustomerTypeService; -import com.aircraft.utils.PageResult; -import com.aircraft.utils.PageUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 服务实现类 - *

- * - * @author cli - * @since 2025-07-09 - */ -@Service -public class CnCustomerTypeServiceImpl extends ServiceImpl implements CnCustomerTypeService { - - @Override - public List list(CnCustomerType example) { - return this.list(buildWrapper(example)); - } - - @Override - public PageResult page(CnCustomerType example, IPage page) { - return PageUtil.toPage(this.page(page,buildWrapper(example)).getRecords()); - } - - /** - * 构建查询 - * - * @param example - * @return - */ - private QueryWrapper buildWrapper(CnCustomerType example) { - QueryWrapper wrapper = new QueryWrapper<>(); - return wrapper; - } - - -} diff --git a/aircraft-system/src/main/resources/mapper/CnCustomerTypeMapper.xml b/aircraft-system/src/main/resources/mapper/CnCustomerTypeMapper.xml deleted file mode 100644 index d7daebc..0000000 --- a/aircraft-system/src/main/resources/mapper/CnCustomerTypeMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - -