From 912b404610fc08ea2768d33b2af55373a82e9928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chhk=E2=80=9D?= <“hhk@mail.com”> Date: Wed, 7 Aug 2024 16:22:27 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=89=93=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/CarMainController.java | 28 +++++++++++++++++-- .../module/custom/service/CarMainService.java | 2 +- .../service/impl/CarMainServiceImpl.java | 20 +++++++------ .../yudao/module/custom/vo/CarMainReqVO.java | 7 +++++ .../yudao/module/custom/vo/CarMainRespVO.java | 6 +++- .../module/custom/vo/CascaderOptionsVO.java | 2 ++ .../custom/vo/CustomerMainSaveReqVO.java | 2 -- 7 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java index 4010dcdb..28d76fe4 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java @@ -5,7 +5,9 @@ import cn.iocoder.yudao.module.custom.service.CarMainService; import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; +import cn.iocoder.yudao.module.label.service.BusiLabelService; import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -16,8 +18,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import javax.validation.*; import javax.servlet.http.*; +import javax.validation.Valid; import java.util.*; import java.io.IOException; @@ -25,6 +27,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.common.BaseConstants.TABLE_BASE_CAR_MAIN; +import static cn.iocoder.yudao.common.BaseConstants.TABLE_BASE_CUSTOMER_MAIN; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; @@ -40,9 +44,12 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; @Validated public class CarMainController { - @Resource + @Autowired private CarMainService carMainService; + @Autowired + private BusiLabelService busiLabelService; + /** * 创建车辆信息 * @@ -141,9 +148,24 @@ public class CarMainController { @PostMapping("/bindCustomerCar") @Operation(summary = "绑定用户") @PreAuthorize("@ss.hasPermission('base:car-main:bindCustomer')") - public CommonResult bindCustomerCar(@RequestBody CustomerMainSaveReqVO saveReqVO) { + public CommonResult bindCustomerCar(@RequestBody CarMainReqVO saveReqVO) { carMainService.bindCustomAndCar(saveReqVO); return success(true); } + /** + * 设置标签 + * + * @param saveReqVO CustomerMainSaveReqVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 16:35 2024/8/6 + **/ + @PostMapping("/setLabel") + @Operation(summary = "设置标签") + public CommonResult setLabel(@RequestBody CarMainReqVO saveReqVO) { + busiLabelService.saveBusiLable(saveReqVO.getId(), TABLE_BASE_CAR_MAIN, saveReqVO.getLabelList()); + return success(true); + } + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java index 8dbf9ec2..94c236db 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java @@ -65,5 +65,5 @@ public interface CarMainService extends IService { * @param saveReqVO CustomerMainSaveReqVO实体 * @return void **/ - void bindCustomAndCar(CustomerMainSaveReqVO saveReqVO); + void bindCustomAndCar(CarMainReqVO saveReqVO); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java index 2e801f00..a9cb88b1 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java @@ -1,14 +1,9 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerCar; -import cn.iocoder.yudao.module.custom.entity.CustomerItem; -import cn.iocoder.yudao.module.custom.entity.CustomerMain; import cn.iocoder.yudao.module.custom.mapper.CarMainMapper; import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper; import cn.iocoder.yudao.module.custom.service.CarMainService; @@ -16,8 +11,8 @@ import cn.iocoder.yudao.module.custom.service.CustomerCarService; import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; -import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import cn.iocoder.yudao.module.label.entity.BusiLabel; +import cn.iocoder.yudao.module.label.service.BusiLabelService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -30,7 +25,6 @@ import java.util.ArrayList; import java.util.List; import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CAR; -import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CUSTOMER; /** * 车辆信息 Service 实现类 @@ -46,6 +40,10 @@ public class CarMainServiceImpl extends ServiceImpl impl @Autowired private CustomerCarService customerCarService; + @Autowired + private BusiLabelService busiLabelService; + + /** * 创建车辆信息 * @@ -128,6 +126,10 @@ public class CarMainServiceImpl extends ServiceImpl impl List cusList = customerCarMapper.selectCusListByCarId(id); result.setCusList(cusList); + //联查标签信息 + List labelList = busiLabelService.listByMainId(id); + result.setLabelList(labelList); + return result; } @@ -152,7 +154,7 @@ public class CarMainServiceImpl extends ServiceImpl impl * @return void **/ @Override - public void bindCustomAndCar(CustomerMainSaveReqVO saveReqVO) { + public void bindCustomAndCar(CarMainReqVO saveReqVO) { List customerCars = new ArrayList<>(); List cusList = saveReqVO.getCusList(); if (ObjectUtil.isNotEmpty(cusList)){ diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java index 95f2fc40..571f067b 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java @@ -1,10 +1,12 @@ package cn.iocoder.yudao.module.custom.vo; +import cn.iocoder.yudao.module.label.entity.BusiLabel; import lombok.*; import io.swagger.v3.oas.annotations.media.Schema; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -78,4 +80,9 @@ public class CarMainReqVO extends PageParam { @Schema(description = "租户ID") private String tenantId; + @Schema(description = "车辆绑定客户信息") + private List cusList; + + @Schema(description = "车辆绑定标签信息") + List labelList; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java index 49e46ca5..17a09474 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.custom.vo; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.label.entity.BusiLabel; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -25,9 +26,12 @@ public class CarMainRespVO extends CarMain { @Schema(description = "是否车主(0否1是)") private String isOwner; - @Schema(description = "创建时间") + @Schema(description = "关联客户信息") private List cusList; + @Schema(description = "标签信息") + List labelList; + diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java new file mode 100644 index 00000000..4fa1f9e9 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java @@ -0,0 +1,2 @@ +package cn.iocoder.yudao.module.custom.vo;public class CascaderOptionsVO { +} diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java index 97efbd47..1989cd30 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java @@ -16,8 +16,6 @@ public class CustomerMainSaveReqVO extends CustomerMain { private List itemList; /**客户绑定车辆信息*/ private List carList; - /**客户绑定车辆信息*/ - private List cusList; /**标签信息*/ List labelList; From b58f2a9d6786756b8a2eb9748e884290a0fe803d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chhk=E2=80=9D?= <“hhk@mail.com”> Date: Wed, 7 Aug 2024 16:23:29 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=89=93=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/iocoder/yudao/common/BaseConstants.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java index 44f87724..377d21f7 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java @@ -15,6 +15,8 @@ public class BaseConstants { public static final String CUS_SIGN_CAR = "car"; /**客户信息表名称*/ public static final String TABLE_BASE_CUSTOMER_MAIN = "base_customer_main"; + /**车辆信息表名称*/ + public static final String TABLE_BASE_CAR_MAIN = "base_car_main"; /**新增标识*/ public static final String SIGN_CREATE = "create"; /**编辑标识*/ From 7e263447be33fda5e421c705d3230f655eb4a3dc Mon Sep 17 00:00:00 2001 From: Vinjor Date: Wed, 7 Aug 2024 16:40:54 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=A5=96=E7=BA=A7=E5=88=97=E8=A1=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/dept/vo/dept/DeptRespVO.java | 3 ++ .../admin/dept/vo/dept/DeptSaveReqVO.java | 3 ++ .../system/dal/dataobject/dept/DeptDO.java | 4 +++ .../system/service/dept/DeptServiceImpl.java | 32 ++++++++++++++----- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java index 83e6ed08..bd111e3b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java @@ -18,6 +18,9 @@ public class DeptRespVO { @Schema(description = "父部门 ID", example = "1024") private Long parentId; + @Schema(description = "祖级列表", example = "1024") + private String ancestors; + @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Integer sort; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java index 0d6276fe..1cbb086d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java @@ -25,6 +25,9 @@ public class DeptSaveReqVO { @Schema(description = "父部门 ID", example = "1024") private Long parentId; + @Schema(description = "祖级列表", example = "1024") + private String ancestors; + @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "显示顺序不能为空") private Integer sort; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java index a59fa8b6..d9f9a2e7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java @@ -38,6 +38,10 @@ public class DeptDO extends TenantBaseDO { * 关联 {@link #id} */ private Long parentId; + /** + * 祖级列表 + */ + private String ancestors; /** * 显示顺序 */ diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index 8530f882..48bcefa4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -45,8 +45,8 @@ public class DeptServiceImpl implements DeptService { if (createReqVO.getParentId() == null) { createReqVO.setParentId(DeptDO.PARENT_ID_ROOT); } - // 校验父部门的有效性 - validateParentDept(null, createReqVO.getParentId()); + // 校验父部门的有效性同时顺便设置祖级列表 + createReqVO.setAncestors(validateParentDept(null, createReqVO.getParentId())); // 校验部门名的唯一性 validateDeptNameUnique(null, createReqVO.getParentId(), createReqVO.getName()); @@ -66,8 +66,8 @@ public class DeptServiceImpl implements DeptService { } // 校验自己存在 validateDeptExists(updateReqVO.getId()); - // 校验父部门的有效性 - validateParentDept(updateReqVO.getId(), updateReqVO.getParentId()); + // 校验父部门的有效性同时顺便设置祖级列表 + updateReqVO.setAncestors(validateParentDept(null, updateReqVO.getParentId())); // 校验部门名的唯一性 validateDeptNameUnique(updateReqVO.getId(), updateReqVO.getParentId(), updateReqVO.getName()); @@ -116,9 +116,10 @@ public class DeptServiceImpl implements DeptService { } @VisibleForTesting - void validateParentDept(Long id, Long parentId) { + String validateParentDept(Long id, Long parentId) { + StringBuilder ancestorsBuilder = new StringBuilder(String.valueOf(parentId)); if (parentId == null || DeptDO.PARENT_ID_ROOT.equals(parentId)) { - return; + return ancestorsBuilder.toString(); } // 1. 不能设置自己为父部门 if (Objects.equals(id, parentId)) { @@ -130,12 +131,26 @@ public class DeptServiceImpl implements DeptService { throw exception(DEPT_PARENT_NOT_EXITS); } // 3. 递归校验父部门,如果父部门是自己的子部门,则报错,避免形成环路 - if (id == null) { // id 为空,说明新增,不需要考虑环路 - return; + if (id == null) { // id 为空,说明新增,不需要考虑环路,但是需要拼接祖级列表 + for (int i = 0; i < Short.MAX_VALUE; i++) { + // 3.1 校验环路 + parentId = parentDept.getParentId(); + ancestorsBuilder.insert(0, parentId + ","); + // 3.2 继续递归下一级父部门 + if (parentId == null || DeptDO.PARENT_ID_ROOT.equals(parentId)) { + break; + } + parentDept = deptMapper.selectById(parentId); + if (parentDept == null) { + break; + } + } + return ancestorsBuilder.toString(); } for (int i = 0; i < Short.MAX_VALUE; i++) { // 3.1 校验环路 parentId = parentDept.getParentId(); + ancestorsBuilder.insert(0, parentId + ","); if (Objects.equals(id, parentId)) { throw exception(DEPT_PARENT_IS_CHILD); } @@ -148,6 +163,7 @@ public class DeptServiceImpl implements DeptService { break; } } + return ancestorsBuilder.toString(); } @VisibleForTesting From 03db497bfed107e91765a3af4a8cb0da93baec40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chhk=E2=80=9D?= <“hhk@mail.com”> Date: Wed, 7 Aug 2024 18:01:16 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=93=81=E7=89=8C=E5=9E=8B=E5=8F=B7?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/CarModelController.java | 22 ++++-- .../module/custom/mapper/CarBrandMapper.java | 8 +- .../module/custom/mapper/CarModelMapper.java | 13 +++- .../custom/service/CarModelService.java | 12 +++ .../service/impl/CarModelServiceImpl.java | 73 +++++++++++++++++++ .../yudao/module/custom/vo/CarModelReqVO.java | 1 + .../module/custom/vo/CarModelRespVO.java | 5 ++ .../module/custom/vo/CascaderOptionsVO.java | 29 +++++++- .../mapper/custom/CarBrandMapper.xml | 18 +++++ .../mapper/custom/CarModelMapper.xml | 42 +++++++++++ 10 files changed, 210 insertions(+), 13 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java index 022bab19..22155098 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java @@ -2,9 +2,7 @@ package cn.iocoder.yudao.module.custom.controller.admin; import cn.iocoder.yudao.module.custom.entity.CarModel; import cn.iocoder.yudao.module.custom.service.CarModelService; -import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; -import cn.iocoder.yudao.module.custom.vo.CarModelReqVO; -import cn.iocoder.yudao.module.custom.vo.CarModelRespVO; +import cn.iocoder.yudao.module.custom.vo.*; import cn.iocoder.yudao.module.custom.vo.CarModelReqVO; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springframework.beans.factory.annotation.Autowired; @@ -137,8 +135,7 @@ public class CarModelController { @GetMapping("/export-excel") @Operation(summary = "导出车辆品牌型号 Excel") @PreAuthorize("@ss.hasPermission('base:car-model:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportCarModelExcel(CarModelReqVO pageReqVO, + public void searchBrand(CarModelReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List list = carModelService.getCarModelPage(pageReqVO).getRecords(); @@ -146,4 +143,19 @@ public class CarModelController { ExcelUtils.write(response, "车辆品牌型号.xls", "数据", CarModelRespVO.class, list); } + /** + * 筛选品牌型号 + * + * @param reqVO + * @return + */ + @PostMapping("/searchBrand") + @Operation(summary = "筛选品牌型号") + @PreAuthorize("@ss.hasPermission('base:car-main:query')") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult> searchBrand(@RequestBody CarModelReqVO reqVO) { + List result = carModelService.searchBrand(reqVO); + return success(result); + } + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarBrandMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarBrandMapper.java index ac5256f8..7e6a70b0 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarBrandMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarBrandMapper.java @@ -3,15 +3,15 @@ package cn.iocoder.yudao.module.custom.mapper; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.custom.entity.CarBrand; import cn.iocoder.yudao.module.custom.entity.CarMain; -import cn.iocoder.yudao.module.custom.vo.CarBrandReqVO; -import cn.iocoder.yudao.module.custom.vo.CarBrandRespVO; -import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; +import cn.iocoder.yudao.module.custom.vo.*; 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.Param; +import java.util.List; + /** * 车辆品牌维护 Mapper * @@ -22,4 +22,6 @@ public interface CarBrandMapper extends BaseMapper { IPage findPage(Page page,@Param("dto") CarBrandReqVO reqVO); + List searchBrand(@Param("dto") CarBrandReqVO reqVO); + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarModelMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarModelMapper.java index cadbceb9..e798b5e3 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarModelMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarModelMapper.java @@ -3,16 +3,15 @@ package cn.iocoder.yudao.module.custom.mapper; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CarModel; -import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; -import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; -import cn.iocoder.yudao.module.custom.vo.CarModelReqVO; -import cn.iocoder.yudao.module.custom.vo.CarModelRespVO; +import cn.iocoder.yudao.module.custom.vo.*; 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.Param; +import java.util.List; + /** * 车辆品牌型号 Mapper * @@ -25,5 +24,11 @@ public interface CarModelMapper extends BaseMapper { IPage getCarModelPageByBrandId(Page page, @Param("dto") CarModelReqVO reqVO); + List searchModelByBrandid(@Param("dto") CarModelReqVO reqVO); + +// List searchModel(@Param("dto") CarModelReqVO reqVO); + + + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java index d40cc39b..ba97f098 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java @@ -6,8 +6,12 @@ import cn.iocoder.yudao.module.custom.entity.CarModel; import cn.iocoder.yudao.module.custom.vo.CarModelReqVO; import cn.iocoder.yudao.module.custom.vo.CarModelReqVO; import cn.iocoder.yudao.module.custom.vo.CarModelRespVO; +import cn.iocoder.yudao.module.custom.vo.CascaderOptionsVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 车辆品牌型号 Service 接口 @@ -62,4 +66,12 @@ public interface CarModelService extends IService { */ IPage getCarModelPageByBrandId(CarModelReqVO pageReqVO); + /** + * 筛选品牌型号 + * + * @param reqVO + * @return + */ + List searchBrand(CarModelReqVO reqVO); + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java index 9c6908fe..6d3a5605 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java @@ -1,7 +1,10 @@ package cn.iocoder.yudao.module.custom.service.impl; +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.module.custom.entity.CarBrand; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CarModel; +import cn.iocoder.yudao.module.custom.mapper.CarBrandMapper; import cn.iocoder.yudao.module.custom.mapper.CarModelMapper; import cn.iocoder.yudao.module.custom.service.CarModelService; import cn.iocoder.yudao.module.custom.vo.*; @@ -9,6 +12,7 @@ import cn.iocoder.yudao.module.custom.vo.CarModelReqVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -16,6 +20,8 @@ import org.springframework.validation.annotation.Validated; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; /** @@ -27,6 +33,9 @@ import java.util.UUID; @Validated public class CarModelServiceImpl extends ServiceImpl implements CarModelService { + @Autowired + CarBrandMapper carBrandMapper; + @Override public String createCarModel(CarModelReqVO createReqVO) { // 插入 @@ -71,4 +80,68 @@ public class CarModelServiceImpl extends ServiceImpl i return baseMapper.findPage(page,pageReqVO); } + @Override + public List searchBrand(CarModelReqVO reqVO) { + + +// if (ObjectUtil.isNotEmpty(reqVO.getModelName() ) && !"".equals(reqVO.getModelName()) ){ + //有筛选的情况要根据条件查出相关父项品牌和所有子项型号,加入result。仅展示关联父项 + CarBrandReqVO brandQuery = new CarBrandReqVO(); + brandQuery.setBrandName(reqVO.getModelName()); + List nameResult = carBrandMapper.searchBrand(brandQuery); + + + +// CarBrandReqVO brandQueryAbbName = new CarBrandReqVO(); +// brandQueryAbbName.setAbbName(reqVO.getModelName()); +// +// List brands = carBrandMapper.searchBrand(brandQueryAbbName); +//// result.addAll(getChildModel(brands)); +// +// +// +// CarModelReqVO modelQueryModelName = new CarModelReqVO(); +// modelQueryModelName.setModelName(reqVO.getModelName()); +// baseMapper.searchModel(modelQueryModelName); +// +// CarModelReqVO modelQueryAbbName = new CarModelReqVO(); +// modelQueryAbbName.setAbbName(reqVO.getModelName()); +// baseMapper.searchModel(modelQueryAbbName); + + + +// }else { +// //无筛选的情况要查出所有父项品牌,然后根据id加入其下所有子项型号 +// +// //取所有品牌 +// List brands = carBrandMapper.searchBrand(new CarBrandReqVO()); +// //根据父级品牌集合取所有的型号子选项 +//// result = getChildModel(brands); +// +// } + + return getChildModel(nameResult,reqVO.getModelName()); + } + + /** + * 根据父级品牌集合取所有的型号子选项 + * + * @param brands + * @return + */ + private List getChildModel(List brands,String name){ + //遍历父级数据 + for (CascaderOptionsVO brandItem: brands) { + CarModelReqVO query = new CarModelReqVO(); + query.setBrandId(brandItem.getValue()); + query.setModelName(name); + //取品牌下属型号选项 + List models = baseMapper.searchModelByBrandid(query); + //父级数据拼装 + brandItem.setChildren(models); + + } + return brands; + } + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java index 1781f598..7ecf2663 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java @@ -44,4 +44,5 @@ public class CarModelReqVO extends PageParam { + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelRespVO.java index f9d47bd4..20348a6a 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelRespVO.java @@ -17,4 +17,9 @@ public class CarModelRespVO extends CarModel { @ExcelProperty("创建时间") private LocalDateTime createTime; +// /** +// * 车辆品牌型号选项 +// */ +// List modelOptions; + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java index 4fa1f9e9..f84aa352 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CascaderOptionsVO.java @@ -1,2 +1,29 @@ -package cn.iocoder.yudao.module.custom.vo;public class CascaderOptionsVO { +package cn.iocoder.yudao.module.custom.vo; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "级联选择器选项") +public class CascaderOptionsVO { + /** + * 选项值 + */ + private String value; + /** + * 选项名 + */ + private String label; + /** + * 选项子项 + */ + List children; + /** + * 懒加载:是否为叶子节点 0父 1子 + */ + int leaf; + } diff --git a/dl-module-base/src/main/resources/mapper/custom/CarBrandMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CarBrandMapper.xml index 7b2ebd87..7eec2559 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CarBrandMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CarBrandMapper.xml @@ -54,4 +54,22 @@ tbcb.create_time DESC + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/CarModelMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CarModelMapper.xml index 120d79a5..d9cf8579 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CarModelMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CarModelMapper.xml @@ -68,4 +68,46 @@ tbcmod.sort DESC + + + + \ No newline at end of file From 7d54a42b35f51b698ca8e921eb516b46bac33ac8 Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 7 Aug 2024 19:53:08 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CarMainServiceImpl.java | 21 +++++++++++++++---- .../yudao/module/custom/vo/CarMainReqVO.java | 2 ++ .../yudao/module/custom/vo/CarMainRespVO.java | 7 +++++++ .../module/custom/vo/CustomerMainRespVO.java | 3 +++ .../resources/mapper/custom/CarMainMapper.xml | 4 +++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java index a9cb88b1..1aedccf2 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java @@ -63,8 +63,13 @@ public class CarMainServiceImpl extends ServiceImpl impl } } + //车俩品牌型号级联选择器返回值,第一位是品牌,第二位是型号 + List brandAndModel = createReqVO.getBrandAndModel(); // 插入 CarMain carMain = BeanUtils.toBean(createReqVO, CarMain.class); + carMain.setCarBrand(brandAndModel.get(0)); + carMain.setCarModel(brandAndModel.get(1)); + baseMapper.insert(carMain); // 返回 return CommonResult.success("新增成功"); @@ -88,9 +93,13 @@ public class CarMainServiceImpl extends ServiceImpl impl } } - // 更新 - CarMain updateObj = BeanUtils.toBean(updateReqVO, CarMain.class); - baseMapper.updateById(updateObj); + //车俩品牌型号级联选择器返回值,第一位是品牌,第二位是型号 + List brandAndModel = updateReqVO.getBrandAndModel(); + // 插入 + CarMain carMain = BeanUtils.toBean(updateReqVO, CarMain.class); + carMain.setCarBrand(brandAndModel.get(0)); + carMain.setCarModel(brandAndModel.get(1)); + baseMapper.updateById(carMain); return CommonResult.success("修改成功"); } @@ -120,8 +129,12 @@ public class CarMainServiceImpl extends ServiceImpl impl public CarMainRespVO getCarMain(String id) { //数据单查 CarMain carMain = baseMapper.selectById(id); - CarMainRespVO result = BeanUtils.toBean(carMain, CarMainRespVO.class); + List brandAndModel = new ArrayList<>(); + brandAndModel.add(carMain.getCarBrand()); + brandAndModel.add(carMain.getCarModel()); + CarMainRespVO result = BeanUtils.toBean(carMain, CarMainRespVO.class); + result.setBrandAndModel(brandAndModel); //联查客户信息 List cusList = customerCarMapper.selectCusListByCarId(id); result.setCusList(cusList); diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java index 571f067b..dba7d736 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainReqVO.java @@ -85,4 +85,6 @@ public class CarMainReqVO extends PageParam { @Schema(description = "车辆绑定标签信息") List labelList; + /**车辆品牌型号数组*/ + List brandAndModel; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java index 17a09474..eb533506 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java @@ -31,8 +31,15 @@ public class CarMainRespVO extends CarMain { @Schema(description = "标签信息") List labelList; + /**品牌字符*/ + String brandStr; + /**型号字符*/ + String modelStr; + /**车辆品牌型号数组*/ + List brandAndModel; + diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java index 90df7a00..c4659974 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java @@ -27,6 +27,9 @@ public class CustomerMainRespVO extends CustomerMain { /**标签信息*/ List labelList; + /**车辆品牌型号数组*/ + List brandAndModel; + /**是否车主(0否1是)*/ private String isOwner; diff --git a/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml index f9fd3c5a..9b478754 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml @@ -34,8 +34,10 @@ SELECT , - main.is_owner AS isOwner + main.is_owner AS isOwner,bcb.brand_name AS brandStr,bcm.model_name AS modelStr FROM base_customer_car main LEFT JOIN base_car_main tbcarm ON main.car_id = tbcarm.id AND tbcarm.deleted = 0 + LEFT JOIN base_car_brand bcb ON bcb.deleted = 0 AND tbcarm.car_brand = bcb.id + LEFT JOIN base_car_model bcm ON bcm.deleted = 0 AND tbcarm.car_model = bcm.id WHERE main.deleted = 0 AND From 6e2fb4d874707e83433befc18319354145c9584b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chhk=E2=80=9D?= <“hhk@mail.com”> Date: Thu, 8 Aug 2024 10:56:21 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=93=81=E7=89=8C?= =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E4=BC=98=E5=8C=96;=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/CarBrandController.java | 14 +-- .../controller/admin/CarModelController.java | 2 +- .../module/custom/mapper/CarMainMapper.java | 8 ++ .../custom/service/CarModelService.java | 2 +- .../service/impl/CarBrandServiceImpl.java | 32 ++++++- .../service/impl/CarMainServiceImpl.java | 23 +++-- .../service/impl/CarModelServiceImpl.java | 92 +++++++++---------- .../resources/mapper/custom/CarMainMapper.xml | 26 +++++- 8 files changed, 127 insertions(+), 72 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarBrandController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarBrandController.java index 18c476e8..8f438392 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarBrandController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarBrandController.java @@ -39,13 +39,13 @@ public class CarBrandController { private CarBrandService carBrandService; /** - * 创建车辆品牌维护 + * 创建车辆品牌 * * @param createReqVO * @return */ @PostMapping("/create") - @Operation(summary = "创建车辆品牌维护") + @Operation(summary = "创建车辆品牌") @PreAuthorize("@ss.hasPermission('base:car-brand:create')") public CommonResult createCarBrand(@RequestBody CarBrandReqVO createReqVO) { return success(carBrandService.createCarBrand(createReqVO)); @@ -58,7 +58,7 @@ public class CarBrandController { * @return */ @PutMapping("/update") - @Operation(summary = "更新车辆品牌维护") + @Operation(summary = "更新车辆品牌") @PreAuthorize("@ss.hasPermission('base:car-brand:update')") public CommonResult updateCarBrand(@RequestBody CarBrandReqVO updateReqVO) { carBrandService.updateCarBrand(updateReqVO); @@ -66,7 +66,7 @@ public class CarBrandController { } @DeleteMapping("/delete") - @Operation(summary = "删除车辆品牌维护") + @Operation(summary = "删除车辆品牌") @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('base:car-brand:delete')") public CommonResult deleteCarBrand(@RequestParam("id") String id) { @@ -75,7 +75,7 @@ public class CarBrandController { } @GetMapping("/get") - @Operation(summary = "获得车辆品牌维护") + @Operation(summary = "获得车辆品牌") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('base:car-brand:query')") public CommonResult getCarBrand(@RequestParam("id") String id) { @@ -84,7 +84,7 @@ public class CarBrandController { } @GetMapping("/page") - @Operation(summary = "获得车辆品牌维护分页") + @Operation(summary = "获得车辆品牌分页") @PreAuthorize("@ss.hasPermission('base:car-brand:query')") public CommonResult> getCarBrandPage(CarBrandReqVO pageReqVO) { IPage pageResult = carBrandService.getCarBrandPage(pageReqVO); @@ -92,7 +92,7 @@ public class CarBrandController { } @GetMapping("/export-excel") - @Operation(summary = "导出车辆品牌维护 Excel") + @Operation(summary = "导出车辆品牌 Excel") @PreAuthorize("@ss.hasPermission('base:car-brand:export')") @ApiAccessLog(operateType = EXPORT) public void exportCarBrandExcel(CarBrandReqVO pageReqVO, diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java index 22155098..af569312 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarModelController.java @@ -150,7 +150,7 @@ public class CarModelController { * @return */ @PostMapping("/searchBrand") - @Operation(summary = "筛选品牌型号") + @Operation(summary = "获取品牌型号级联下拉") @PreAuthorize("@ss.hasPermission('base:car-main:query')") @Parameter(name = "id", description = "编号", required = true, example = "1024") public CommonResult> searchBrand(@RequestBody CarModelReqVO reqVO) { diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java index e69e856f..f4223db8 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java @@ -29,6 +29,14 @@ public interface CarMainMapper extends BaseMapper { */ IPage findPage(Page page, @Param("dto") CarMainReqVO pageReqVO); + /** + * 获得车辆信息分页 + * + * @param id + * @return + */ + CarMainRespVO findOne(@Param("id") String id); + /** diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java index ba97f098..793ee7bd 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarModelService.java @@ -67,7 +67,7 @@ public interface CarModelService extends IService { IPage getCarModelPageByBrandId(CarModelReqVO pageReqVO); /** - * 筛选品牌型号 + * 获取品牌型号级联下拉 * * @param reqVO * @return diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java index dfd890d4..4cb46d9e 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java @@ -9,9 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import java.util.UUID; @@ -25,6 +23,12 @@ import java.util.UUID; @Validated public class CarBrandServiceImpl extends ServiceImpl implements CarBrandService { + /** + * 创建车辆品牌维护 + * + * @param createReqVO 创建信息 + * @return 编号 + */ @Override public String createCarBrand(CarBrandReqVO createReqVO) { // 插入 @@ -35,6 +39,11 @@ public class CarBrandServiceImpl extends ServiceImpl i return carBrand.getId(); } + /** + * 更新车辆品牌维护 + * + * @param updateReqVO 更新信息 + */ @Override public void updateCarBrand(CarBrandReqVO updateReqVO) { @@ -43,19 +52,34 @@ public class CarBrandServiceImpl extends ServiceImpl i baseMapper.updateById(updateObj); } + /** + * 删除车辆品牌维护 + * + * @param id 编号 + */ @Override public void deleteCarBrand(String id) { - // 删除 baseMapper.deleteById(id); } - + /** + * 获得车辆品牌维护 + * + * @param id 编号 + * @return 车辆品牌维护 + */ @Override public CarBrand getCarBrand(String id) { return baseMapper.selectById(id); } + /** + * 获得车辆品牌维护分页 + * + * @param pageReqVO 分页查询 + * @return 车辆品牌维护分页 + */ @Override public IPage getCarBrandPage(CarBrandReqVO pageReqVO) { Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java index 1aedccf2..7e2a5036 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java @@ -68,7 +68,12 @@ public class CarMainServiceImpl extends ServiceImpl impl // 插入 CarMain carMain = BeanUtils.toBean(createReqVO, CarMain.class); carMain.setCarBrand(brandAndModel.get(0)); - carMain.setCarModel(brandAndModel.get(1)); + //判断是否仅填入了品牌 + if(brandAndModel.size()>1){ + //填入了型号 + carMain.setCarModel(brandAndModel.get(1)); + } + baseMapper.insert(carMain); // 返回 @@ -128,22 +133,22 @@ public class CarMainServiceImpl extends ServiceImpl impl @Override public CarMainRespVO getCarMain(String id) { //数据单查 - CarMain carMain = baseMapper.selectById(id); + CarMainRespVO carMainRespVO = baseMapper.findOne(id); List brandAndModel = new ArrayList<>(); - brandAndModel.add(carMain.getCarBrand()); - brandAndModel.add(carMain.getCarModel()); - CarMainRespVO result = BeanUtils.toBean(carMain, CarMainRespVO.class); - result.setBrandAndModel(brandAndModel); + brandAndModel.add(carMainRespVO.getCarBrand()); + brandAndModel.add(carMainRespVO.getCarModel()); + + carMainRespVO.setBrandAndModel(brandAndModel); //联查客户信息 List cusList = customerCarMapper.selectCusListByCarId(id); - result.setCusList(cusList); + carMainRespVO.setCusList(cusList); //联查标签信息 List labelList = busiLabelService.listByMainId(id); - result.setLabelList(labelList); + carMainRespVO.setLabelList(labelList); - return result; + return carMainRespVO; } /** diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java index 6d3a5605..02d3aed0 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarModelServiceImpl.java @@ -1,8 +1,6 @@ package cn.iocoder.yudao.module.custom.service.impl; -import cn.hutool.core.util.ObjectUtil; -import cn.iocoder.yudao.module.custom.entity.CarBrand; -import cn.iocoder.yudao.module.custom.entity.CarMain; + import cn.iocoder.yudao.module.custom.entity.CarModel; import cn.iocoder.yudao.module.custom.mapper.CarBrandMapper; import cn.iocoder.yudao.module.custom.mapper.CarModelMapper; @@ -14,13 +12,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -36,6 +31,12 @@ public class CarModelServiceImpl extends ServiceImpl i @Autowired CarBrandMapper carBrandMapper; + /** + * 创建车辆品牌型号 + * + * @param createReqVO 创建信息 + * @return 编号 + */ @Override public String createCarModel(CarModelReqVO createReqVO) { // 插入 @@ -46,6 +47,11 @@ public class CarModelServiceImpl extends ServiceImpl i return carModel.getId(); } + /** + * 更新车辆品牌型号 + * + * @param updateReqVO 更新信息 + */ @Override public void updateCarModel(CarModelReqVO updateReqVO) { // 更新 @@ -53,26 +59,47 @@ public class CarModelServiceImpl extends ServiceImpl i baseMapper.updateById(updateObj); } + /** + * 删除车辆品牌型号 + * + * @param id 编号 + */ @Override public void deleteCarModel(String id) { - // 删除 baseMapper.deleteById(id); } - + /** + * 获得车辆品牌型号 + * + * @param id 编号 + * @return 车辆品牌型号 + */ @Override public CarModel getCarModel(String id) { return baseMapper.selectById(id); } + /** + * 获得车辆品牌型号分页 + * + * @param pageReqVO 分页查询 + * @return 车辆品牌型号分页 + */ @Override public IPage getCarModelPage(CarModelReqVO pageReqVO) { //取分页参数 Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); return baseMapper.findPage(page,pageReqVO); - } - + } + + /** + * 获得车辆品牌型号分页 + * + * @param pageReqVO 分页查询 + * @return 车辆品牌型号分页 + */ @Override public IPage getCarModelPageByBrandId(CarModelReqVO pageReqVO) { //取分页参数 @@ -80,45 +107,18 @@ public class CarModelServiceImpl extends ServiceImpl i return baseMapper.findPage(page,pageReqVO); } + /** + * 获取品牌型号级联下拉 + * + * @param reqVO + * @return + */ @Override public List searchBrand(CarModelReqVO reqVO) { - -// if (ObjectUtil.isNotEmpty(reqVO.getModelName() ) && !"".equals(reqVO.getModelName()) ){ - //有筛选的情况要根据条件查出相关父项品牌和所有子项型号,加入result。仅展示关联父项 - CarBrandReqVO brandQuery = new CarBrandReqVO(); - brandQuery.setBrandName(reqVO.getModelName()); - List nameResult = carBrandMapper.searchBrand(brandQuery); - - - -// CarBrandReqVO brandQueryAbbName = new CarBrandReqVO(); -// brandQueryAbbName.setAbbName(reqVO.getModelName()); -// -// List brands = carBrandMapper.searchBrand(brandQueryAbbName); -//// result.addAll(getChildModel(brands)); -// -// -// -// CarModelReqVO modelQueryModelName = new CarModelReqVO(); -// modelQueryModelName.setModelName(reqVO.getModelName()); -// baseMapper.searchModel(modelQueryModelName); -// -// CarModelReqVO modelQueryAbbName = new CarModelReqVO(); -// modelQueryAbbName.setAbbName(reqVO.getModelName()); -// baseMapper.searchModel(modelQueryAbbName); - - - -// }else { -// //无筛选的情况要查出所有父项品牌,然后根据id加入其下所有子项型号 -// -// //取所有品牌 -// List brands = carBrandMapper.searchBrand(new CarBrandReqVO()); -// //根据父级品牌集合取所有的型号子选项 -//// result = getChildModel(brands); -// -// } + CarBrandReqVO brandQuery = new CarBrandReqVO(); + brandQuery.setBrandName(reqVO.getModelName()); + List nameResult = carBrandMapper.searchBrand(brandQuery); return getChildModel(nameResult,reqVO.getModelName()); } diff --git a/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml index 9b478754..708155b5 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml @@ -34,10 +34,13 @@ + + + SELECT + main.* + FROM + dl_base_cont_temp main + + deleted = 0 + + AND main.temp_name LIKE concat('%',#{entity.tempName},'%') + + + AND main.temp_type = #{entity.tempType} + + + AND main.temp_use = #{entity.tempUse} + + + + \ No newline at end of file From 90941913110fe3792c50e6c5bf58b737c77d0f10 Mon Sep 17 00:00:00 2001 From: PQZ Date: Thu, 8 Aug 2024 17:33:24 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E5=90=88=E5=90=8C=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/BaseContTempController.java | 39 +++++++++++++++-- .../cont/service/BaseContTempService.java | 25 ++++++----- .../service/impl/BaseContTempServiceImpl.java | 43 ++++++++++++------- .../resources/mapper/cont/BaseContTemp.xml | 1 + 4 files changed, 77 insertions(+), 31 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContTempController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContTempController.java index d965c236..fab1f662 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContTempController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContTempController.java @@ -51,21 +51,46 @@ public class BaseContTempController { return success(contTempService.getContTempPage(pageReqVO, page)); } + /** + * 创建合同模板 + * + * @param createReqVO BaseContTempSaveReqVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 17:11 2024/8/8 + **/ @PostMapping("/create") @Operation(summary = "创建合同模板") @PreAuthorize("@ss.hasPermission('base:cont-temp:create')") - public CommonResult createContTemp(@Valid @RequestBody BaseContTempSaveReqVO createReqVO) { - return success(contTempService.createContTemp(createReqVO)); + public CommonResult createContTemp(@Valid @RequestBody BaseContTempSaveReqVO createReqVO) { + contTempService.saveConTemp(createReqVO); + return success(true); } + /** + * 编辑合同模板 + * + * @param updateReqVO BaseContTempSaveReqVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 17:11 2024/8/8 + **/ @PutMapping("/update") @Operation(summary = "更新合同模板") @PreAuthorize("@ss.hasPermission('base:cont-temp:update')") public CommonResult updateContTemp(@Valid @RequestBody BaseContTempSaveReqVO updateReqVO) { - contTempService.updateContTemp(updateReqVO); + contTempService.saveConTemp(updateReqVO); return success(true); } + /** + * 删除合同模板 + * + * @param id 合同模板id + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 17:12 2024/8/8 + **/ @DeleteMapping("/delete") @Operation(summary = "删除合同模板") @Parameter(name = "id", description = "编号", required = true) @@ -75,6 +100,14 @@ public class BaseContTempController { return success(true); } + /** + * 通过id查询合同模板 + * + * @param id id + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 17:12 2024/8/8 + **/ @GetMapping("/get") @Operation(summary = "获得合同模板") @Parameter(name = "id", description = "编号", required = true, example = "1024") diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContTempService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContTempService.java index 9dec53e9..b3b4d2e3 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContTempService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContTempService.java @@ -17,26 +17,25 @@ import javax.validation.Valid; */ public interface BaseContTempService extends IService { - /** - * 创建合同模板 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - String createContTemp(@Valid BaseContTempSaveReqVO createReqVO); /** - * 更新合同模板 + * 保存合同模板 * - * @param updateReqVO 更新信息 - */ - void updateContTemp(@Valid BaseContTempSaveReqVO updateReqVO); + * @param reqVo BaseContTempSaveReqVO + * @return void + * @author PQZ + * @date 17:13 2024/8/8 + **/ + void saveConTemp(BaseContTempSaveReqVO reqVo); /** * 删除合同模板 * - * @param id 编号 - */ + * @param id 模板id + * @return void + * @author PQZ + * @date 17:16 2024/8/8 + **/ void deleteContTemp(String id); /** diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContTempServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContTempServiceImpl.java index 6a0f7935..2db5a2a5 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContTempServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContTempServiceImpl.java @@ -22,33 +22,46 @@ import javax.annotation.Resource; */ @Service @Validated -public class BaseContTempServiceImpl extends ServiceImpl implements BaseContTempService { +public class BaseContTempServiceImpl extends ServiceImpl implements BaseContTempService { @Resource private BaseContTempMapper contTempMapper; + + /** + * 保存合同模板 + * + * @param reqVo BaseContTempSaveReqVO + * @return void + * @author PQZ + * @date 17:13 2024/8/8 + **/ @Override - public String createContTemp(BaseContTempSaveReqVO createReqVO) { - // 插入 - BaseContTemp contTemp = BeanUtils.toBean(createReqVO, BaseContTemp.class); - contTempMapper.insert(contTemp); - // 返回 - return contTemp.getId(); - } - - @Override - public void updateContTemp(BaseContTempSaveReqVO updateReqVO) { - // 更新 - BaseContTemp updateObj = BeanUtils.toBean(updateReqVO, BaseContTemp.class); - contTempMapper.updateById(updateObj); + public void saveConTemp(BaseContTempSaveReqVO reqVo) { + BaseContTemp saveObj = BeanUtils.toBean(reqVo, BaseContTemp.class); + saveOrUpdate(saveObj); } + /** + * 删除合同模板 + * + * @param id 模板id + * @return void + * @author PQZ + * @date 17:16 2024/8/8 + **/ @Override public void deleteContTemp(String id) { // 删除 contTempMapper.deleteById(id); } + /** + * 获得合同模板 + * + * @param id 编号 + * @return 合同模板 + */ @Override public BaseContTemp getContTemp(String id) { return contTempMapper.selectById(id); @@ -65,7 +78,7 @@ public class BaseContTempServiceImpl extends ServiceImpl getContTempPage(BaseContTempPageReqVO pageReqVO, Page page) { - return contTempMapper.selectListPage(pageReqVO,page); + return contTempMapper.selectListPage(pageReqVO, page); } } \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/cont/BaseContTemp.xml b/dl-module-base/src/main/resources/mapper/cont/BaseContTemp.xml index 0a41637c..ef2cfb7d 100644 --- a/dl-module-base/src/main/resources/mapper/cont/BaseContTemp.xml +++ b/dl-module-base/src/main/resources/mapper/cont/BaseContTemp.xml @@ -19,5 +19,6 @@ AND main.temp_use = #{entity.tempUse} +ORDER BY main.create_time DESC \ No newline at end of file From 3ade6b2f3ba91faa23d53e4b583fe08dc509601b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chhk=E2=80=9D?= <“hhk@mail.com”> Date: Thu, 8 Aug 2024 20:11:22 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/PropertyController.java | 90 +++++++++++ .../admin/PropertyDealController.java | 90 +++++++++++ .../admin/PropertyDealItemController.java | 90 +++++++++++ .../admin/PropertyKeepController.java | 90 +++++++++++ .../admin/PropertyPosController.java | 90 +++++++++++ .../yudao/module/custom/entity/Property.java | 150 ++++++++++++++++++ .../module/custom/entity/PropertyDealDO.java | 55 +++++++ .../custom/entity/PropertyDealItemDO.java | 81 ++++++++++ .../module/custom/entity/PropertyKeep.java | 49 ++++++ .../module/custom/entity/PropertyPosDO.java | 59 +++++++ .../custom/mapper/PropertyDealItemMapper.java | 22 +++ .../custom/mapper/PropertyDealMapper.java | 22 +++ .../custom/mapper/PropertyKeepMapper.java | 22 +++ .../module/custom/mapper/PropertyMapper.java | 22 +++ .../custom/mapper/PropertyPosMapper.java | 22 +++ .../service/PropertyDealItemService.java | 55 +++++++ .../custom/service/PropertyDealService.java | 54 +++++++ .../custom/service/PropertyKeepService.java | 54 +++++++ .../custom/service/PropertyPosService.java | 54 +++++++ .../custom/service/PropertyService.java | 54 +++++++ .../service/impl/CarMainServiceImpl.java | 17 +- .../impl/PropertyDealItemServiceImpl.java | 56 +++++++ .../service/impl/PropertyDealServiceImpl.java | 57 +++++++ .../service/impl/PropertyKeepServiceImpl.java | 56 +++++++ .../service/impl/PropertyPosServiceImpl.java | 57 +++++++ .../service/impl/PropertyServiceImpl.java | 55 +++++++ .../custom/vo/PropertyDealItemReqVO.java | 63 ++++++++ .../custom/vo/PropertyDealItemRespVO.java | 74 +++++++++ .../module/custom/vo/PropertyDealReqVO.java | 44 +++++ .../module/custom/vo/PropertyDealRespVO.java | 47 ++++++ .../module/custom/vo/PropertyKeepReqVO.java | 41 +++++ .../module/custom/vo/PropertyKeepRespVO.java | 20 +++ .../module/custom/vo/PropertyPosReqVO.java | 46 ++++++ .../module/custom/vo/PropertyPosRespVO.java | 51 ++++++ .../yudao/module/custom/vo/PropertyReqVO.java | 115 ++++++++++++++ .../module/custom/vo/PropertyRespVO.java | 20 +++ .../mapper/custom/PropertyDealItemMapper.xml | 12 ++ .../mapper/custom/PropertyDealMapper.xml | 12 ++ .../mapper/custom/PropertyKeepMapper.xml | 12 ++ .../mapper/custom/PropertyMapper.xml | 12 ++ .../mapper/custom/PropertyPosMapper.xml | 12 ++ 41 files changed, 2099 insertions(+), 5 deletions(-) create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyController.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealController.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealItemController.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyKeepController.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyPosController.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/Property.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealDO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealItemDO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyKeep.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyPosDO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealItemMapper.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealMapper.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyKeepMapper.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyMapper.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyPosMapper.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealItemService.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealService.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyKeepService.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyPosService.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyService.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealItemServiceImpl.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealServiceImpl.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyKeepServiceImpl.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyPosServiceImpl.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyServiceImpl.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemReqVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemRespVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealReqVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealRespVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepReqVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepRespVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosReqVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosRespVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyReqVO.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyRespVO.java create mode 100644 dl-module-base/src/main/resources/mapper/custom/PropertyDealItemMapper.xml create mode 100644 dl-module-base/src/main/resources/mapper/custom/PropertyDealMapper.xml create mode 100644 dl-module-base/src/main/resources/mapper/custom/PropertyKeepMapper.xml create mode 100644 dl-module-base/src/main/resources/mapper/custom/PropertyMapper.xml create mode 100644 dl-module-base/src/main/resources/mapper/custom/PropertyPosMapper.xml diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyController.java new file mode 100644 index 00000000..80397052 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyController.java @@ -0,0 +1,90 @@ +package cn.iocoder.yudao.module.custom.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.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.custom.entity.Property; +import cn.iocoder.yudao.module.custom.service.PropertyService; +import cn.iocoder.yudao.module.custom.vo.PropertyReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +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; + +@Tag(name = "管理后台 - 企业管理-资产") +@RestController +@RequestMapping("/company/property") +@Validated +public class PropertyController { + + @Resource + private PropertyService propertyService; + + @PostMapping("/create") + @Operation(summary = "创建企业管理-资产") + @PreAuthorize("@ss.hasPermission('company:property:create')") + public CommonResult createProperty(@RequestBody PropertyReqVO createReqVO) { + return success(propertyService.createProperty(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新企业管理-资产") + @PreAuthorize("@ss.hasPermission('company:property:update')") + public CommonResult updateProperty(@RequestBody PropertyReqVO updateReqVO) { + propertyService.updateProperty(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除企业管理-资产") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('company:property:delete')") + public CommonResult deleteProperty(@RequestParam("id") String id) { + propertyService.deleteProperty(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得企业管理-资产") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('company:property:query')") + public CommonResult getProperty(@RequestParam("id") String id) { + Property property = propertyService.getProperty(id); + return success(BeanUtils.toBean(property, PropertyRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得企业管理-资产分页") + @PreAuthorize("@ss.hasPermission('company:property:query')") + public CommonResult> getPropertyPage(PropertyReqVO pageReqVO) { + IPage pageResult = propertyService.getPropertyPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出企业管理-资产 Excel") + @PreAuthorize("@ss.hasPermission('company:property:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportPropertyExcel(PropertyReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = propertyService.getPropertyPage(pageReqVO).getRecords(); + // 导出 Excel + ExcelUtils.write(response, "企业管理-资产.xls", "数据", PropertyRespVO.class, list); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealController.java new file mode 100644 index 00000000..4a9c21d6 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealController.java @@ -0,0 +1,90 @@ +package cn.iocoder.yudao.module.custom.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.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyDealDO; +import cn.iocoder.yudao.module.custom.service.PropertyDealService; +import cn.iocoder.yudao.module.custom.vo.PropertyDealReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +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; + +@Tag(name = "管理后台 - 企业管理-资产处置单/变动单") +@RestController +@RequestMapping("/company/property-deal") +@Validated +public class PropertyDealController { + + @Resource + private PropertyDealService propertyDealService; + + @PostMapping("/create") + @Operation(summary = "创建企业管理-资产处置单/变动单") + @PreAuthorize("@ss.hasPermission('company:property-deal:create')") + public CommonResult createPropertyDeal(@RequestBody PropertyDealReqVO createReqVO) { + return success(propertyDealService.createPropertyDeal(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新企业管理-资产处置单/变动单") + @PreAuthorize("@ss.hasPermission('company:property-deal:update')") + public CommonResult updatePropertyDeal(@RequestBody PropertyDealReqVO updateReqVO) { + propertyDealService.updatePropertyDeal(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除企业管理-资产处置单/变动单") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('company:property-deal:delete')") + public CommonResult deletePropertyDeal(@RequestParam("id") String id) { + propertyDealService.deletePropertyDeal(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得企业管理-资产处置单/变动单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('company:property-deal:query')") + public CommonResult getPropertyDeal(@RequestParam("id") String id) { + PropertyDealDO propertyDeal = propertyDealService.getPropertyDeal(id); + return success(BeanUtils.toBean(propertyDeal, PropertyDealRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得企业管理-资产处置单/变动单分页") + @PreAuthorize("@ss.hasPermission('company:property-deal:query')") + public CommonResult> getPropertyDealPage(PropertyDealReqVO pageReqVO) { + IPage propertyDealPage = propertyDealService.getPropertyDealPage(pageReqVO); + return success(propertyDealPage); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出企业管理-资产处置单/变动单 Excel") + @PreAuthorize("@ss.hasPermission('company:property-deal:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportPropertyDealExcel(PropertyDealReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = propertyDealService.getPropertyDealPage(pageReqVO).getRecords(); + // 导出 Excel + ExcelUtils.write(response, "企业管理-资产处置单/变动单.xls", "数据", PropertyDealRespVO.class,list); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealItemController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealItemController.java new file mode 100644 index 00000000..2d5418a1 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyDealItemController.java @@ -0,0 +1,90 @@ +package cn.iocoder.yudao.module.custom.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.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyDealItemDO; +import cn.iocoder.yudao.module.custom.service.PropertyDealItemService; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +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; + +@Tag(name = "管理后台 - 企业管理-资产处置子") +@RestController +@RequestMapping("/company/property-deal-item") +@Validated +public class PropertyDealItemController { + + @Resource + private PropertyDealItemService propertyDealItemService; + + @PostMapping("/create") + @Operation(summary = "创建企业管理-资产处置子") + @PreAuthorize("@ss.hasPermission('company:property-deal-item:create')") + public CommonResult createPropertyDealItem(@RequestBody PropertyDealItemReqVO createReqVO) { + return success(propertyDealItemService.createPropertyDealItem(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新企业管理-资产处置子") + @PreAuthorize("@ss.hasPermission('company:property-deal-item:update')") + public CommonResult updatePropertyDealItem(@RequestBody PropertyDealItemReqVO updateReqVO) { + propertyDealItemService.updatePropertyDealItem(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除企业管理-资产处置子") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('company:property-deal-item:delete')") + public CommonResult deletePropertyDealItem(@RequestParam("id") String id) { + propertyDealItemService.deletePropertyDealItem(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得企业管理-资产处置子") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('company:property-deal-item:query')") + public CommonResult getPropertyDealItem(@RequestParam("id") String id) { + PropertyDealItemDO propertyDealItem = propertyDealItemService.getPropertyDealItem(id); + return success(BeanUtils.toBean(propertyDealItem, PropertyDealItemRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得企业管理-资产处置子分页") + @PreAuthorize("@ss.hasPermission('company:property-deal-item:query')") + public CommonResult> getPropertyDealItemPage(PropertyDealItemReqVO pageReqVO) { + IPage propertyDealItemPage = propertyDealItemService.getPropertyDealItemPage(pageReqVO); + return success(propertyDealItemPage); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出企业管理-资产处置子 Excel") + @PreAuthorize("@ss.hasPermission('company:property-deal-item:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportPropertyDealItemExcel(PropertyDealItemReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = propertyDealItemService.getPropertyDealItemPage(pageReqVO).getRecords(); + // 导出 Excel + ExcelUtils.write(response, "企业管理-资产处置子.xls", "数据", PropertyDealItemRespVO.class,list); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyKeepController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyKeepController.java new file mode 100644 index 00000000..be736424 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyKeepController.java @@ -0,0 +1,90 @@ +package cn.iocoder.yudao.module.custom.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.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyKeep; +import cn.iocoder.yudao.module.custom.service.PropertyKeepService; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +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; + +@Tag(name = "管理后台 - 资产维修/保养记录") +@RestController +@RequestMapping("/company/property-keep") +@Validated +public class PropertyKeepController { + + @Resource + private PropertyKeepService propertyKeepService; + + @PostMapping("/create") + @Operation(summary = "创建资产维修/保养记录") + @PreAuthorize("@ss.hasPermission('company:property-keep:create')") + public CommonResult createPropertyKeep(@RequestBody PropertyKeepReqVO createReqVO) { + return success(propertyKeepService.createPropertyKeep(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新资产维修/保养记录") + @PreAuthorize("@ss.hasPermission('company:property-keep:update')") + public CommonResult updatePropertyKeep(@RequestBody PropertyKeepReqVO updateReqVO) { + propertyKeepService.updatePropertyKeep(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除资产维修/保养记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('company:property-keep:delete')") + public CommonResult deletePropertyKeep(@RequestParam("id") String id) { + propertyKeepService.deletePropertyKeep(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得资产维修/保养记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('company:property-keep:query')") + public CommonResult getPropertyKeep(@RequestParam("id") String id) { + PropertyKeep propertyKeep = propertyKeepService.getPropertyKeep(id); + return success(BeanUtils.toBean(propertyKeep, PropertyKeepRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得资产维修/保养记录分页") + @PreAuthorize("@ss.hasPermission('company:property-keep:query')") + public CommonResult> getPropertyKeepPage(PropertyKeepReqVO pageReqVO) { + IPage pageResult = propertyKeepService.getPropertyKeepPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出资产维修/保养记录 Excel") + @PreAuthorize("@ss.hasPermission('company:property-keep:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportPropertyKeepExcel(PropertyKeepReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = propertyKeepService.getPropertyKeepPage(pageReqVO).getRecords(); + // 导出 Excel + ExcelUtils.write(response, "资产维修/保养记录.xls", "数据", PropertyKeepRespVO.class, list); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyPosController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyPosController.java new file mode 100644 index 00000000..78ed3255 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/PropertyPosController.java @@ -0,0 +1,90 @@ +package cn.iocoder.yudao.module.custom.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.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyPosDO; +import cn.iocoder.yudao.module.custom.service.PropertyPosService; +import cn.iocoder.yudao.module.custom.vo.PropertyPosReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyPosRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +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; + +@Tag(name = "管理后台 - 企业管理-资产存放位置") +@RestController +@RequestMapping("/company/property-pos") +@Validated +public class PropertyPosController { + + @Resource + private PropertyPosService propertyPosService; + + @PostMapping("/create") + @Operation(summary = "创建企业管理-资产存放位置") + @PreAuthorize("@ss.hasPermission('company:property-pos:create')") + public CommonResult createPropertyPos(@RequestBody PropertyPosReqVO createReqVO) { + return success(propertyPosService.createPropertyPos(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新企业管理-资产存放位置") + @PreAuthorize("@ss.hasPermission('company:property-pos:update')") + public CommonResult updatePropertyPos(@RequestBody PropertyPosReqVO updateReqVO) { + propertyPosService.updatePropertyPos(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除企业管理-资产存放位置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('company:property-pos:delete')") + public CommonResult deletePropertyPos(@RequestParam("id") String id) { + propertyPosService.deletePropertyPos(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得企业管理-资产存放位置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('company:property-pos:query')") + public CommonResult getPropertyPos(@RequestParam("id") String id) { + PropertyPosDO propertyPos = propertyPosService.getPropertyPos(id); + return success(BeanUtils.toBean(propertyPos, PropertyPosRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得企业管理-资产存放位置分页") + @PreAuthorize("@ss.hasPermission('company:property-pos:query')") + public CommonResult> getPropertyPosPage(PropertyPosReqVO pageReqVO) { + IPage pageResult = propertyPosService.getPropertyPosPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出企业管理-资产存放位置 Excel") + @PreAuthorize("@ss.hasPermission('company:property-pos:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportPropertyPosExcel(PropertyPosReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = propertyPosService.getPropertyPosPage(pageReqVO).getRecords(); + // 导出 Excel + ExcelUtils.write(response, "企业管理-资产存放位置.xls", "数据", PropertyPosRespVO.class,list); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/Property.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/Property.java new file mode 100644 index 00000000..4fa8ccdd --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/Property.java @@ -0,0 +1,150 @@ +package cn.iocoder.yudao.module.custom.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 企业管理-资产 DO + * + * @author 后台管理员 + */ +@TableName("company_property") +@KeySequence("company_property_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class Property extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 企业id + */ + private String corpId; + /** + * 部门id + */ + private Long deptId; + /** + * 存放位置 + */ + private String posId; + /** + * 使用人id + */ + private String userId; + /** + * 资产编号 + */ + private String propNo; + /** + * 资产名称 + */ + private String propName; + /** + * 资产分类 + */ + private String propCatg; + /** + * 预计使用年限 + */ + private Integer useYear; + /** + * 价值类型 + * + * 枚举 {@link TODO company_cost_type 对应的类} + */ + private String costType; + /** + * 资产数量 + */ + private Integer propNum; + /** + * 资产原值(元) + */ + private BigDecimal costTotal; + /** + * 资产状态 + * + * 枚举 {@link TODO company_prop_status 对应的类} + */ + private String propStatus; + /** + * 品牌 + */ + private String brand; + /** + * 规格型号 + */ + private String spec; + /** + * 生产厂家 + */ + private String factory; + /** + * 出场序列号/编号 + */ + private String serialNo; + /** + * 数量计量单位 + */ + private String unit; + /** + * 取得日期 + */ + private LocalDate getDate; + /** + * 出厂日期 + */ + private LocalDate prodDate; + /** + * 供应商 + */ + private String supplier; + /** + * 启用日期 + */ + private LocalDate openDate; + /** + * 净值(元) + */ + private BigDecimal netValue; + /** + * 凭证号 + */ + private String voucherNo; + /** + * 维修/保养周期单位 + */ + private String keepCycleType; + /** + * 维修/保养周期 + */ + private Integer keepCycle; + /** + * 上次维修/保养日期 + */ + private LocalDate lastKeepDate; + /** + * 下次维修/保养日期 + */ + private LocalDate nextKeepDate; + /** + * 附件urls + */ + private String fileUrls; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealDO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealDO.java new file mode 100644 index 00000000..f41253a9 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealDO.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.custom.entity; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +import java.time.LocalDate; + +/** + * 企业管理-资产处置单/变动单 DO + * + * @author 后台管理员 + */ +@TableName("company_property_deal") +@KeySequence("company_property_deal_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PropertyDealDO extends BaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 企业id(base_company表中的id) + */ + private String corpId; + /** + * 部门id(system_dept表中的id,用来做数据权限控制) + */ + private Long deptId; + /** + * 数据类型 + * + * 枚举 {@link TODO property_data_type 对应的类} + */ + private String dataType; + /** + * 处置/变动单号 + */ + private String dealNo; + /** + * 处置/变动日期 + */ + private LocalDate dealDate; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealItemDO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealItemDO.java new file mode 100644 index 00000000..f1edfcad --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyDealItemDO.java @@ -0,0 +1,81 @@ +package cn.iocoder.yudao.module.custom.entity; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * 企业管理-资产处置子 DO + * + * @author 后台管理员 + */ +@TableName("company_property_deal_item") +@KeySequence("company_property_deal_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PropertyDealItemDO extends BaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 处置单/变动单id + */ + private String dealId; + /** + * 资产id + */ + private String propertyId; + /** + * 处置方式 + * + * 枚举 {@link TODO company_deal_way 对应的类} + */ + private String dealWay; + /** + * 原企业id + */ + private String oldCorpId; + /** + * 调入企业id + */ + private String corpId; + /** + * 原部门id + */ + private Long oldDeptId; + /** + * 调入部门id + */ + private Long deptId; + /** + * 原存放地id + */ + private String oldPosId; + /** + * 调入存放地id + */ + private String posId; + /** + * 原使用人id + */ + private Long oldUserId; + /** + * 调入使用人id + */ + private Long userId; + /** + * 备注 + */ + private String remark; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyKeep.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyKeep.java new file mode 100644 index 00000000..494cc79d --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyKeep.java @@ -0,0 +1,49 @@ +package cn.iocoder.yudao.module.custom.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +import java.time.LocalDate; + +/** + * 资产维修/保养记录 DO + * + * @author 后台管理员 + */ +@TableName("company_property_keep") +@KeySequence("company_property_keep_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PropertyKeep extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 资产id + */ + private String propertyId; + /** + * 维修/保养日期 + */ + private LocalDate keepDate; + /** + * 备注 + */ + private String remark; + /** + * 附件urls + */ + private String fileUrls; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyPosDO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyPosDO.java new file mode 100644 index 00000000..8fb6bf09 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/PropertyPosDO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.custom.entity; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +import java.math.BigDecimal; + +/** + * 企业管理-资产存放位置 DO + * + * @author vinjor-m + */ +@TableName("company_property_pos") +@KeySequence("company_property_pos_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PropertyPosDO extends BaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 企业id(base_company表中的id) + */ + private String corpId; + /** + * 部门id(system_dept表中的id,用来做数据权限控制) + */ + private Long deptId; + /** + * 存放地名称 + */ + private String posName; + /** + * 存放地地址 + */ + private String address; + /** + * 面积 + */ + private BigDecimal area; + /** + * 存放类型 + * + * 枚举 {@link TODO company_deposit_type 对应的类} + */ + private String depositType; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealItemMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealItemMapper.java new file mode 100644 index 00000000..5ac8fff5 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealItemMapper.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.custom.mapper; + +import cn.iocoder.yudao.module.custom.entity.PropertyDealItemDO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemRespVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Mapper; + +/** + * 企业管理-资产处置子 Mapper + * + * @author 后台管理员 + */ +@Mapper +public interface PropertyDealItemMapper extends BaseMapper { + + default IPage selectPage(PropertyDealItemReqVO reqVO) { + return null; + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealMapper.java new file mode 100644 index 00000000..f77d1002 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyDealMapper.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.custom.mapper; + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.custom.entity.PropertyDealDO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Mapper; + +/** + * 企业管理-资产处置单/变动单 Mapper + * + * @author 后台管理员 + */ +@Mapper +public interface PropertyDealMapper extends BaseMapperX { + + default IPage selectPage(PropertyDealReqVO reqVO) { + return null; + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyKeepMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyKeepMapper.java new file mode 100644 index 00000000..360cda63 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyKeepMapper.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.custom.mapper; + +import cn.iocoder.yudao.module.custom.entity.PropertyKeep; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepRespVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Mapper; + +/** + * 资产维修/保养记录 Mapper + * + * @author 后台管理员 + */ +@Mapper +public interface PropertyKeepMapper extends BaseMapper { + + default IPage selectPage(PropertyKeepReqVO reqVO) { + return null; + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyMapper.java new file mode 100644 index 00000000..72b705e4 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyMapper.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.custom.mapper; + +import cn.iocoder.yudao.module.custom.entity.Property; +import cn.iocoder.yudao.module.custom.vo.PropertyReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyRespVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Mapper; + +/** + * 企业管理-资产 Mapper + * + * @author 后台管理员 + */ +@Mapper +public interface PropertyMapper extends BaseMapper { + + default IPage selectPage(PropertyReqVO reqVO) { + return null; + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyPosMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyPosMapper.java new file mode 100644 index 00000000..dd9e7d33 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/PropertyPosMapper.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.custom.mapper; + +import cn.iocoder.yudao.module.custom.entity.PropertyPosDO; +import cn.iocoder.yudao.module.custom.vo.PropertyPosReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyPosRespVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Mapper; + +/** + * 企业管理-资产存放位置 Mapper + * + * @author vinjor-m + */ +@Mapper +public interface PropertyPosMapper extends BaseMapper { + + default IPage selectPage(PropertyPosReqVO reqVO) { + return null; + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealItemService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealItemService.java new file mode 100644 index 00000000..e771a503 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealItemService.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.custom.service; + +import cn.iocoder.yudao.module.custom.entity.PropertyDealItemDO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + + +/** + * 企业管理-资产处置子 Service 接口 + * + * @author 后台管理员 + */ +public interface PropertyDealItemService extends IService { + + /** + * 创建企业管理-资产处置子 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createPropertyDealItem(PropertyDealItemReqVO createReqVO); + + /** + * 更新企业管理-资产处置子 + * + * @param updateReqVO 更新信息 + */ + void updatePropertyDealItem(PropertyDealItemReqVO updateReqVO); + + /** + * 删除企业管理-资产处置子 + * + * @param id 编号 + */ + void deletePropertyDealItem(String id); + + /** + * 获得企业管理-资产处置子 + * + * @param id 编号 + * @return 企业管理-资产处置子 + */ + PropertyDealItemDO getPropertyDealItem(String id); + + /** + * 获得企业管理-资产处置子分页 + * + * @param pageReqVO 分页查询 + * @return 企业管理-资产处置子分页 + */ + IPage getPropertyDealItemPage(PropertyDealItemReqVO pageReqVO); + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealService.java new file mode 100644 index 00000000..738fe16d --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyDealService.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.custom.service; + +import cn.iocoder.yudao.module.custom.entity.PropertyDealDO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 企业管理-资产处置单/变动单 Service 接口 + * + * @author 后台管理员 + */ +public interface PropertyDealService extends IService { + + /** + * 创建企业管理-资产处置单/变动单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createPropertyDeal(PropertyDealReqVO createReqVO); + + /** + * 更新企业管理-资产处置单/变动单 + * + * @param updateReqVO 更新信息 + */ + void updatePropertyDeal(PropertyDealReqVO updateReqVO); + + /** + * 删除企业管理-资产处置单/变动单 + * + * @param id 编号 + */ + void deletePropertyDeal(String id); + + /** + * 获得企业管理-资产处置单/变动单 + * + * @param id 编号 + * @return 企业管理-资产处置单/变动单 + */ + PropertyDealDO getPropertyDeal(String id); + + /** + * 获得企业管理-资产处置单/变动单分页 + * + * @param pageReqVO 分页查询 + * @return 企业管理-资产处置单/变动单分页 + */ + IPage getPropertyDealPage(PropertyDealReqVO pageReqVO); + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyKeepService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyKeepService.java new file mode 100644 index 00000000..18219535 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyKeepService.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.custom.service; + +import cn.iocoder.yudao.module.custom.entity.PropertyKeep; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 资产维修/保养记录 Service 接口 + * + * @author 后台管理员 + */ +public interface PropertyKeepService extends IService { + + /** + * 创建资产维修/保养记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createPropertyKeep(PropertyKeepReqVO createReqVO); + + /** + * 更新资产维修/保养记录 + * + * @param updateReqVO 更新信息 + */ + void updatePropertyKeep(PropertyKeepReqVO updateReqVO); + + /** + * 删除资产维修/保养记录 + * + * @param id 编号 + */ + void deletePropertyKeep(String id); + + /** + * 获得资产维修/保养记录 + * + * @param id 编号 + * @return 资产维修/保养记录 + */ + PropertyKeep getPropertyKeep(String id); + + /** + * 获得资产维修/保养记录分页 + * + * @param pageReqVO 分页查询 + * @return 资产维修/保养记录分页 + */ + IPage getPropertyKeepPage(PropertyKeepReqVO pageReqVO); + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyPosService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyPosService.java new file mode 100644 index 00000000..c80de4a9 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyPosService.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.custom.service; + +import cn.iocoder.yudao.module.custom.entity.PropertyPosDO; +import cn.iocoder.yudao.module.custom.vo.PropertyPosReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyPosRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 企业管理-资产存放位置 Service 接口 + * + * @author vinjor-m + */ +public interface PropertyPosService extends IService { + + /** + * 创建企业管理-资产存放位置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createPropertyPos(PropertyPosReqVO createReqVO); + + /** + * 更新企业管理-资产存放位置 + * + * @param updateReqVO 更新信息 + */ + void updatePropertyPos(PropertyPosReqVO updateReqVO); + + /** + * 删除企业管理-资产存放位置 + * + * @param id 编号 + */ + void deletePropertyPos(String id); + + /** + * 获得企业管理-资产存放位置 + * + * @param id 编号 + * @return 企业管理-资产存放位置 + */ + PropertyPosDO getPropertyPos(String id); + + /** + * 获得企业管理-资产存放位置分页 + * + * @param pageReqVO 分页查询 + * @return 企业管理-资产存放位置分页 + */ + IPage getPropertyPosPage(PropertyPosReqVO pageReqVO); + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyService.java new file mode 100644 index 00000000..3bc25573 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/PropertyService.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.custom.service; + +import cn.iocoder.yudao.module.custom.entity.Property; +import cn.iocoder.yudao.module.custom.vo.PropertyReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 企业管理-资产 Service 接口 + * + * @author 后台管理员 + */ +public interface PropertyService extends IService { + + /** + * 创建企业管理-资产 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createProperty(PropertyReqVO createReqVO); + + /** + * 更新企业管理-资产 + * + * @param updateReqVO 更新信息 + */ + void updateProperty(PropertyReqVO updateReqVO); + + /** + * 删除企业管理-资产 + * + * @param id 编号 + */ + void deleteProperty(String id); + + /** + * 获得企业管理-资产 + * + * @param id 编号 + * @return 企业管理-资产 + */ + Property getProperty(String id); + + /** + * 获得企业管理-资产分页 + * + * @param pageReqVO 分页查询 + * @return 企业管理-资产分页 + */ + IPage getPropertyPage(PropertyReqVO pageReqVO); + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java index 7e2a5036..10373e6f 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerCar; import cn.iocoder.yudao.module.custom.mapper.CarMainMapper; @@ -18,9 +19,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -72,9 +71,10 @@ public class CarMainServiceImpl extends ServiceImpl impl if(brandAndModel.size()>1){ //填入了型号 carMain.setCarModel(brandAndModel.get(1)); + }else { + carMain.setCarModel(""); } - - + //todo 计算下次保养时间,下次保养里程,下次年检时间,保险到期时间 baseMapper.insert(carMain); // 返回 return CommonResult.success("新增成功"); @@ -103,7 +103,14 @@ public class CarMainServiceImpl extends ServiceImpl impl // 插入 CarMain carMain = BeanUtils.toBean(updateReqVO, CarMain.class); carMain.setCarBrand(brandAndModel.get(0)); - carMain.setCarModel(brandAndModel.get(1)); + //判断是否仅填入了品牌 + if(brandAndModel.size()>1){ + //填入了型号 + carMain.setCarModel(brandAndModel.get(1)); + }else { + carMain.setCarModel(""); + } + //todo 计算下次保养时间,下次保养里程,下次年检时间,保险到期时间 baseMapper.updateById(carMain); return CommonResult.success("修改成功"); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealItemServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealItemServiceImpl.java new file mode 100644 index 00000000..1f4599ec --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealItemServiceImpl.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.custom.service.impl; + +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyDealItemDO; +import cn.iocoder.yudao.module.custom.mapper.PropertyDealItemMapper; +import cn.iocoder.yudao.module.custom.service.PropertyDealItemService; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealItemRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 企业管理-资产处置子 Service 实现类 + * + * @author 后台管理员 + */ +@Service +@Validated +public class PropertyDealItemServiceImpl extends ServiceImpl implements PropertyDealItemService { + + @Override + public String createPropertyDealItem(PropertyDealItemReqVO createReqVO) { + // 插入 + PropertyDealItemDO propertyDealItem = BeanUtils.toBean(createReqVO, PropertyDealItemDO.class); + baseMapper.insert(propertyDealItem); + // 返回 + return propertyDealItem.getId(); + } + + @Override + public void updatePropertyDealItem(PropertyDealItemReqVO updateReqVO) { + // 更新 + PropertyDealItemDO updateObj = BeanUtils.toBean(updateReqVO, PropertyDealItemDO.class); + baseMapper.updateById(updateObj); + } + + @Override + public void deletePropertyDealItem(String id) { + // 删除 + baseMapper.deleteById(id); + } + + + @Override + public PropertyDealItemDO getPropertyDealItem(String id) { + return baseMapper.selectById(id); + } + + @Override + public IPage getPropertyDealItemPage(PropertyDealItemReqVO pageReqVO) { + return baseMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealServiceImpl.java new file mode 100644 index 00000000..8f7f0b2f --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyDealServiceImpl.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.module.custom.service.impl; + +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyDealDO; +import cn.iocoder.yudao.module.custom.mapper.PropertyDealMapper; +import cn.iocoder.yudao.module.custom.service.PropertyDealService; +import cn.iocoder.yudao.module.custom.vo.PropertyDealReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyDealRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + + +/** + * 企业管理-资产处置单/变动单 Service 实现类 + * + * @author 后台管理员 + */ +@Service +@Validated +public class PropertyDealServiceImpl extends ServiceImpl implements PropertyDealService { + + @Override + public String createPropertyDeal(PropertyDealReqVO createReqVO) { + // 插入 + PropertyDealDO propertyDeal = BeanUtils.toBean(createReqVO, PropertyDealDO.class); + baseMapper.insert(propertyDeal); + // 返回 + return propertyDeal.getId(); + } + + @Override + public void updatePropertyDeal(PropertyDealReqVO updateReqVO) { + // 更新 + PropertyDealDO updateObj = BeanUtils.toBean(updateReqVO, PropertyDealDO.class); + baseMapper.updateById(updateObj); + } + + @Override + public void deletePropertyDeal(String id) { + // 删除 + baseMapper.deleteById(id); + } + + + @Override + public PropertyDealDO getPropertyDeal(String id) { + return baseMapper.selectById(id); + } + + @Override + public IPage getPropertyDealPage(PropertyDealReqVO pageReqVO) { + return baseMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyKeepServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyKeepServiceImpl.java new file mode 100644 index 00000000..bc246af9 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyKeepServiceImpl.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.custom.service.impl; + +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyKeep; +import cn.iocoder.yudao.module.custom.mapper.PropertyKeepMapper; +import cn.iocoder.yudao.module.custom.service.PropertyKeepService; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyKeepRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 资产维修/保养记录 Service 实现类 + * + * @author 后台管理员 + */ +@Service +@Validated +public class PropertyKeepServiceImpl extends ServiceImpl implements PropertyKeepService { + + @Override + public String createPropertyKeep(PropertyKeepReqVO createReqVO) { + // 插入 + PropertyKeep propertyKeep = BeanUtils.toBean(createReqVO, PropertyKeep.class); + baseMapper.insert(propertyKeep); + // 返回 + return propertyKeep.getId(); + } + + @Override + public void updatePropertyKeep(PropertyKeepReqVO updateReqVO) { + // 更新 + PropertyKeep updateObj = BeanUtils.toBean(updateReqVO, PropertyKeep.class); + baseMapper.updateById(updateObj); + } + + @Override + public void deletePropertyKeep(String id) { + // 删除 + baseMapper.deleteById(id); + } + + + @Override + public PropertyKeep getPropertyKeep(String id) { + return baseMapper.selectById(id); + } + + @Override + public IPage getPropertyKeepPage(PropertyKeepReqVO pageReqVO) { + return baseMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyPosServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyPosServiceImpl.java new file mode 100644 index 00000000..91750cc8 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyPosServiceImpl.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.module.custom.service.impl; + +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.custom.entity.PropertyPosDO; +import cn.iocoder.yudao.module.custom.mapper.PropertyPosMapper; +import cn.iocoder.yudao.module.custom.service.PropertyPosService; +import cn.iocoder.yudao.module.custom.vo.PropertyPosReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyPosRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 企业管理-资产存放位置 Service 实现类 + * + * @author vinjor-m + */ +@Service +@Validated +public class PropertyPosServiceImpl extends ServiceImpl implements PropertyPosService { + + @Override + public String createPropertyPos(PropertyPosReqVO createReqVO) { + // 插入 + PropertyPosDO propertyPos = BeanUtils.toBean(createReqVO, PropertyPosDO.class); + baseMapper.insert(propertyPos); + // 返回 + return propertyPos.getId(); + } + + @Override + public void updatePropertyPos(PropertyPosReqVO updateReqVO) { + // 更新 + PropertyPosDO updateObj = BeanUtils.toBean(updateReqVO, PropertyPosDO.class); + baseMapper.updateById(updateObj); + } + + @Override + public void deletePropertyPos(String id) { + // 删除 + baseMapper.deleteById(id); + } + + + + @Override + public PropertyPosDO getPropertyPos(String id) { + return baseMapper.selectById(id); + } + + @Override + public IPage getPropertyPosPage(PropertyPosReqVO pageReqVO) { + return baseMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyServiceImpl.java new file mode 100644 index 00000000..cf2767ec --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/PropertyServiceImpl.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.custom.service.impl; + +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.custom.entity.Property; +import cn.iocoder.yudao.module.custom.mapper.PropertyMapper; +import cn.iocoder.yudao.module.custom.service.PropertyService; +import cn.iocoder.yudao.module.custom.vo.PropertyReqVO; +import cn.iocoder.yudao.module.custom.vo.PropertyRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 企业管理-资产 Service 实现类 + * + * @author 后台管理员 + */ +@Service +@Validated +public class PropertyServiceImpl extends ServiceImpl implements PropertyService { + + @Override + public String createProperty(PropertyReqVO createReqVO) { + // 插入 + Property property = BeanUtils.toBean(createReqVO, Property.class); + baseMapper.insert(property); + // 返回 + return property.getId(); + } + + @Override + public void updateProperty(PropertyReqVO updateReqVO) { + // 更新 + Property updateObj = BeanUtils.toBean(updateReqVO, Property.class); + baseMapper.updateById(updateObj); + } + + @Override + public void deleteProperty(String id) { + // 删除 + baseMapper.deleteById(id); + } + + @Override + public Property getProperty(String id) { + return baseMapper.selectById(id); + } + + @Override + public IPage getPropertyPage(PropertyReqVO pageReqVO) { + return baseMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemReqVO.java new file mode 100644 index 00000000..38648b19 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemReqVO.java @@ -0,0 +1,63 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 企业管理-资产处置子分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PropertyDealItemReqVO extends PageParam { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "18095") + private String id; + + @Schema(description = "处置单/变动单id", example = "12936") + private String dealId; + + @Schema(description = "资产id", example = "14421") + private String propertyId; + + @Schema(description = "处置方式") + private String dealWay; + + @Schema(description = "原企业id", example = "17291") + private String oldCorpId; + + @Schema(description = "调入企业id", example = "21009") + private String corpId; + + @Schema(description = "原部门id", example = "23846") + private Long oldDeptId; + + @Schema(description = "调入部门id", example = "3881") + private Long deptId; + + @Schema(description = "原存放地id", example = "8837") + private String oldPosId; + + @Schema(description = "调入存放地id", example = "28147") + private String posId; + + @Schema(description = "原使用人id", example = "23983") + private Long oldUserId; + + @Schema(description = "调入使用人id", example = "918") + private Long userId; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemRespVO.java new file mode 100644 index 00000000..0a7fc4e9 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealItemRespVO.java @@ -0,0 +1,74 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 企业管理-资产处置子 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PropertyDealItemRespVO { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "18095") + @ExcelProperty("主键标识") + private String id; + + @Schema(description = "处置单/变动单id", example = "12936") + @ExcelProperty("处置单/变动单id") + private String dealId; + + @Schema(description = "资产id", example = "14421") + @ExcelProperty("资产id") + private String propertyId; + + @Schema(description = "处置方式") + @ExcelProperty(value = "处置方式", converter = DictConvert.class) + @DictFormat("company_deal_way") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String dealWay; + + @Schema(description = "原企业id", example = "17291") + @ExcelProperty("原企业id") + private String oldCorpId; + + @Schema(description = "调入企业id", example = "21009") + @ExcelProperty("调入企业id") + private String corpId; + + @Schema(description = "原部门id", example = "23846") + @ExcelProperty("原部门id") + private Long oldDeptId; + + @Schema(description = "调入部门id", example = "3881") + @ExcelProperty("调入部门id") + private Long deptId; + + @Schema(description = "原存放地id", example = "8837") + @ExcelProperty("原存放地id") + private String oldPosId; + + @Schema(description = "调入存放地id", example = "28147") + @ExcelProperty("调入存放地id") + private String posId; + + @Schema(description = "原使用人id", example = "23983") + @ExcelProperty("原使用人id") + private Long oldUserId; + + @Schema(description = "调入使用人id", example = "918") + @ExcelProperty("调入使用人id") + private Long userId; + + @Schema(description = "备注", example = "你说的对") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealReqVO.java new file mode 100644 index 00000000..1cebdff3 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealReqVO.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 企业管理-资产处置单/变动单分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PropertyDealReqVO extends PageParam { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "18095") + private String id; + + @Schema(description = "企业id(base_company表中的id)", example = "21595") + private String corpId; + + @Schema(description = "部门id(system_dept表中的id,用来做数据权限控制)", example = "19510") + private Long deptId; + + @Schema(description = "数据类型", example = "1") + private String dataType; + + @Schema(description = "处置/变动单号") + private String dealNo; + + @Schema(description = "处置/变动日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] dealDate; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealRespVO.java new file mode 100644 index 00000000..27c5e635 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyDealRespVO.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 企业管理-资产处置单/变动单 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PropertyDealRespVO { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "29577") + @ExcelProperty("主键标识") + private String id; + + @Schema(description = "企业id(base_company表中的id)", example = "21595") + @ExcelProperty("企业id(base_company表中的id)") + private String corpId; + + @Schema(description = "部门id(system_dept表中的id,用来做数据权限控制)", example = "19510") + @ExcelProperty("部门id(system_dept表中的id,用来做数据权限控制)") + private Long deptId; + + @Schema(description = "数据类型", example = "1") + @ExcelProperty(value = "数据类型", converter = DictConvert.class) + @DictFormat("property_data_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String dataType; + + @Schema(description = "处置/变动单号") + @ExcelProperty("处置/变动单号") + private String dealNo; + + @Schema(description = "处置/变动日期") + @ExcelProperty("处置/变动日期") + private LocalDate dealDate; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepReqVO.java new file mode 100644 index 00000000..451b1aee --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepReqVO.java @@ -0,0 +1,41 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; + +@Schema(description = "管理后台 - 资产维修/保养记录分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PropertyKeepReqVO extends PageParam { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "22729") + private String id; + + @Schema(description = "资产id", example = "20917") + private String propertyId; + + @Schema(description = "维修/保养日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate keepDate; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "附件urls") + private String fileUrls; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepRespVO.java new file mode 100644 index 00000000..af7b40ae --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyKeepRespVO.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.module.custom.entity.Property; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 资产维修/保养记录 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PropertyKeepRespVO extends Property { + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosReqVO.java new file mode 100644 index 00000000..26ccf5cd --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosReqVO.java @@ -0,0 +1,46 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 企业管理-资产存放位置分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PropertyPosReqVO extends PageParam { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "18095") + private String id; + + @Schema(description = "企业id(base_company表中的id)", example = "5018") + private String corpId; + + @Schema(description = "部门id(system_dept表中的id,用来做数据权限控制)", example = "25943") + private Long deptId; + + @Schema(description = "存放地名称", example = "王五") + private String posName; + + @Schema(description = "存放地地址") + private String address; + + @Schema(description = "面积") + private BigDecimal area; + + @Schema(description = "存放类型", example = "2") + private String depositType; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosRespVO.java new file mode 100644 index 00000000..dd1605d7 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyPosRespVO.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.custom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 企业管理-资产存放位置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PropertyPosRespVO { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "19336") + @ExcelProperty("主键标识") + private String id; + + @Schema(description = "企业id(base_company表中的id)", example = "5018") + @ExcelProperty("企业id(base_company表中的id)") + private String corpId; + + @Schema(description = "部门id(system_dept表中的id,用来做数据权限控制)", example = "25943") + @ExcelProperty("部门id(system_dept表中的id,用来做数据权限控制)") + private Long deptId; + + @Schema(description = "存放地名称", example = "王五") + @ExcelProperty("存放地名称") + private String posName; + + @Schema(description = "存放地地址") + @ExcelProperty("存放地地址") + private String address; + + @Schema(description = "面积") + @ExcelProperty("面积") + private BigDecimal area; + + @Schema(description = "存放类型", example = "2") + @ExcelProperty(value = "存放类型", converter = DictConvert.class) + @DictFormat("company_deposit_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String depositType; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyReqVO.java new file mode 100644 index 00000000..117195ba --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyReqVO.java @@ -0,0 +1,115 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; + +@Schema(description = "管理后台 - 企业管理-资产分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PropertyReqVO extends PageParam { + + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "22729") + private String id; + + @Schema(description = "企业id", example = "9124") + private String corpId; + + @Schema(description = "部门id", example = "2480") + private Long deptId; + + @Schema(description = "存放位置", example = "7241") + private String posId; + + @Schema(description = "使用人id", example = "6217") + private String userId; + + @Schema(description = "资产编号") + private String propNo; + + @Schema(description = "资产名称", example = "芋艿") + private String propName; + + @Schema(description = "资产分类") + private String propCatg; + + @Schema(description = "预计使用年限") + private Integer useYear; + + @Schema(description = "价值类型", example = "01") + private String costType; + + @Schema(description = "资产数量") + private Integer propNum; + + @Schema(description = "资产原值(元)") + private BigDecimal costTotal; + + @Schema(description = "资产状态", example = "02") + private String propStatus; + + @Schema(description = "品牌") + private String brand; + + @Schema(description = "规格型号") + private String spec; + + @Schema(description = "生产厂家") + private String factory; + + @Schema(description = "出场序列号/编号") + private String serialNo; + + @Schema(description = "数量计量单位") + private String unit; + + @Schema(description = "取得日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate[] getDate; + + @Schema(description = "出厂日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate[] prodDate; + + @Schema(description = "供应商") + private String supplier; + + @Schema(description = "启用日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate[] openDate; + + @Schema(description = "净值(元)") + private BigDecimal netValue; + + @Schema(description = "凭证号") + private String voucherNo; + + @Schema(description = "维修/保养周期单位", example = "2") + private String keepCycleType; + + @Schema(description = "维修/保养周期") + private Integer keepCycle; + + @Schema(description = "上次维修/保养日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate[] lastKeepDate; + + @Schema(description = "下次维修/保养日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate[] nextKeepDate; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyRespVO.java new file mode 100644 index 00000000..2de03972 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/PropertyRespVO.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.custom.vo; + +import cn.iocoder.yudao.module.custom.entity.Property; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 企业管理-资产 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PropertyRespVO extends Property { + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/PropertyDealItemMapper.xml b/dl-module-base/src/main/resources/mapper/custom/PropertyDealItemMapper.xml new file mode 100644 index 00000000..bf042fcb --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/custom/PropertyDealItemMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/PropertyDealMapper.xml b/dl-module-base/src/main/resources/mapper/custom/PropertyDealMapper.xml new file mode 100644 index 00000000..2e486bde --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/custom/PropertyDealMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/PropertyKeepMapper.xml b/dl-module-base/src/main/resources/mapper/custom/PropertyKeepMapper.xml new file mode 100644 index 00000000..51acf816 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/custom/PropertyKeepMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/PropertyMapper.xml b/dl-module-base/src/main/resources/mapper/custom/PropertyMapper.xml new file mode 100644 index 00000000..a9432c36 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/custom/PropertyMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/PropertyPosMapper.xml b/dl-module-base/src/main/resources/mapper/custom/PropertyPosMapper.xml new file mode 100644 index 00000000..319c0a54 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/custom/PropertyPosMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file