From 08f93f5bae9755d96702df8b0e36f7e357dc47e6 Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Fri, 16 Aug 2024 21:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E5=A4=84=E7=BD=AE=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/PropertyDealController.java | 117 ++++++------ .../admin/PropertyDealItemController.java | 180 +++++++++--------- .../module/property/entity/Property.java | 6 + .../module/property/entity/PropertyDeal.java | 37 ++-- .../property/entity/PropertyDealItem.java | 32 ++-- .../mapper/PropertyDealItemMapper.java | 11 +- .../property/mapper/PropertyDealMapper.java | 18 +- .../service/PropertyDealItemService.java | 76 ++++---- .../property/service/PropertyDealService.java | 74 +++---- .../impl/PropertyDealItemServiceImpl.java | 65 +++---- .../service/impl/PropertyDealServiceImpl.java | 90 ++++++--- .../property/vo/PropertyDealItemReqVO.java | 62 +----- .../property/vo/PropertyDealItemRespVO.java | 11 +- .../module/property/vo/PropertyDealReqVO.java | 43 +---- .../property/vo/PropertyDealRespVO.java | 18 +- .../property/PropertyDealItemMapper.xml | 10 +- .../mapper/property/PropertyDealMapper.xml | 10 +- 17 files changed, 400 insertions(+), 460 deletions(-) diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealController.java index 5163e227..218faabc 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealController.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealController.java @@ -1,30 +1,26 @@ package cn.iocoder.yudao.module.property.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.property.entity.PropertyDeal; import cn.iocoder.yudao.module.property.service.PropertyDealService; -import cn.iocoder.yudao.module.property.vo.PropertyDealReqVO; import cn.iocoder.yudao.module.property.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 org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; 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; +/** + * 管理后台 - 企业管理-资产处置单/变动单 + * @author 小李 + * @date 21:24 2024/8/16 +**/ @Tag(name = "管理后台 - 企业管理-资产处置单/变动单") @RestController @RequestMapping("/company/property-deal") @@ -37,54 +33,55 @@ public class PropertyDealController { @PostMapping("/create") @Operation(summary = "创建企业管理-资产处置单/变动单") @PreAuthorize("@ss.hasPermission('company:property-deal:create')") - public CommonResult createPropertyDeal(@RequestBody PropertyDealReqVO createReqVO) { - return success(propertyDealService.createPropertyDeal(createReqVO)); + public CommonResult createPropertyDeal(@RequestBody PropertyDealRespVO createReqVO) { + propertyDealService.createPropertyDeal(createReqVO); + return CommonResult.ok(); } - @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) { - PropertyDeal 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); - } +// @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) { +// PropertyDeal 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-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealItemController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealItemController.java index 3f706330..9749d88b 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealItemController.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/controller/admin/PropertyDealItemController.java @@ -1,90 +1,90 @@ -package cn.iocoder.yudao.module.property.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.property.entity.PropertyDealItem; -import cn.iocoder.yudao.module.property.service.PropertyDealItemService; -import cn.iocoder.yudao.module.property.vo.PropertyDealItemReqVO; -import cn.iocoder.yudao.module.property.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) { - PropertyDealItem 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 +//package cn.iocoder.yudao.module.property.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.property.entity.PropertyDealItem; +//import cn.iocoder.yudao.module.property.service.PropertyDealItemService; +//import cn.iocoder.yudao.module.property.vo.PropertyDealItemReqVO; +//import cn.iocoder.yudao.module.property.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) { +// PropertyDealItem 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-company/src/main/java/cn/iocoder/yudao/module/property/entity/Property.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/Property.java index 0c8d86ab..ddd4f4ef 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/Property.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/Property.java @@ -155,11 +155,17 @@ public class Property extends TenantBaseDO { @ExcelProperty("附件") private String fileUrls; + /** 使用人 */ @TableField(exist = false) @ExcelProperty("使用人") private String staffName; + /** 存放位置 */ @TableField(exist = false) @ExcelProperty("存放位置") private String posName; + + /** 处置方式 */ + @TableField(exist = false) + private String dealWay; } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDeal.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDeal.java index 240da783..1fbaaa08 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDeal.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDeal.java @@ -1,55 +1,56 @@ package cn.iocoder.yudao.module.property.entity; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDate; +import java.util.Date; /** * 企业管理-资产处置单/变动单 DO - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:17 2024/8/16 +**/ @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 PropertyDeal extends BaseDO { +public class PropertyDeal extends TenantBaseDO { /** * 主键标识 */ - @TableId(type = IdType.ASSIGN_UUID) + @TableId(type = IdType.ASSIGN_ID) 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; - + @JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date dealDate; } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDealItem.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDealItem.java index c70fae85..de145119 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDealItem.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/entity/PropertyDealItem.java @@ -1,78 +1,86 @@ package cn.iocoder.yudao.module.property.entity; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +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.util.Date; + /** * 企业管理-资产处置子 DO - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:33 2024/8/16 +**/ @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 PropertyDealItem extends BaseDO { +public class PropertyDealItem extends TenantBaseDO { /** * 主键标识 */ - @TableId(type = IdType.ASSIGN_UUID) + @TableId(type = IdType.ASSIGN_ID) 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; + /** * 备注 */ diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealItemMapper.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealItemMapper.java index 423bdf78..3de000e2 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealItemMapper.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealItemMapper.java @@ -9,14 +9,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 企业管理-资产处置子 Mapper - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:35 2024/8/16 +**/ @Mapper public interface PropertyDealItemMapper extends BaseMapper { - - default IPage selectPage(PropertyDealItemReqVO reqVO) { - return null; - } - } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealMapper.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealMapper.java index fff5f4dc..bac29849 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealMapper.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/mapper/PropertyDealMapper.java @@ -1,22 +1,14 @@ package cn.iocoder.yudao.module.property.mapper; -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.property.entity.PropertyDeal; -import cn.iocoder.yudao.module.property.vo.PropertyDealReqVO; -import cn.iocoder.yudao.module.property.vo.PropertyDealRespVO; -import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * 企业管理-资产处置单/变动单 Mapper - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:22 2024/8/16 +**/ @Mapper -public interface PropertyDealMapper extends BaseMapperX { - - default IPage selectPage(PropertyDealReqVO reqVO) { - return null; - } - +public interface PropertyDealMapper extends BaseMapper { } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealItemService.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealItemService.java index 8f15a977..93dc36d5 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealItemService.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealItemService.java @@ -2,54 +2,52 @@ package cn.iocoder.yudao.module.property.service; import cn.iocoder.yudao.module.property.entity.PropertyDealItem; import cn.iocoder.yudao.module.property.vo.PropertyDealItemReqVO; -import cn.iocoder.yudao.module.property.vo.PropertyDealItemRespVO; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; /** * 企业管理-资产处置子 Service 接口 - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:37 2024/8/16 +**/ public interface PropertyDealItemService extends IService { /** - * 创建企业管理-资产处置子 - * + * 创建企业管理-资产处置子表 + * @author 小李 + * @date 21:36 2024/8/16 * @param createReqVO 创建信息 - * @return 编号 - */ - String createPropertyDealItem(PropertyDealItemReqVO createReqVO); + **/ + void createPropertyDealItem(PropertyDealItemReqVO createReqVO); - /** - * 更新企业管理-资产处置子 - * - * @param updateReqVO 更新信息 - */ - void updatePropertyDealItem(PropertyDealItemReqVO updateReqVO); - - /** - * 删除企业管理-资产处置子 - * - * @param id 编号 - */ - void deletePropertyDealItem(String id); - - /** - * 获得企业管理-资产处置子 - * - * @param id 编号 - * @return 企业管理-资产处置子 - */ - PropertyDealItem getPropertyDealItem(String id); - - /** - * 获得企业管理-资产处置子分页 - * - * @param pageReqVO 分页查询 - * @return 企业管理-资产处置子分页 - */ - IPage getPropertyDealItemPage(PropertyDealItemReqVO pageReqVO); +// /** +// * 更新企业管理-资产处置子 +// * +// * @param updateReqVO 更新信息 +// */ +// void updatePropertyDealItem(PropertyDealItemReqVO updateReqVO); +// +// /** +// * 删除企业管理-资产处置子 +// * +// * @param id 编号 +// */ +// void deletePropertyDealItem(String id); +// +// /** +// * 获得企业管理-资产处置子 +// * +// * @param id 编号 +// * @return 企业管理-资产处置子 +// */ +// PropertyDealItem getPropertyDealItem(String id); +// +// /** +// * 获得企业管理-资产处置子分页 +// * +// * @param pageReqVO 分页查询 +// * @return 企业管理-资产处置子分页 +// */ +// IPage getPropertyDealItemPage(PropertyDealItemReqVO pageReqVO); } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealService.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealService.java index 834efe00..7511c169 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealService.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/PropertyDealService.java @@ -8,47 +8,47 @@ import com.baomidou.mybatisplus.extension.service.IService; /** * 企业管理-资产处置单/变动单 Service 接口 - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:24 2024/8/16 +**/ public interface PropertyDealService extends IService { /** * 创建企业管理-资产处置单/变动单 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - String createPropertyDeal(PropertyDealReqVO createReqVO); + * @author 小李 + * @date 21:24 2024/8/16 + * @param createReqVO 处置单/变动单对象 + **/ + void createPropertyDeal(PropertyDealRespVO createReqVO); - /** - * 更新企业管理-资产处置单/变动单 - * - * @param updateReqVO 更新信息 - */ - void updatePropertyDeal(PropertyDealReqVO updateReqVO); - - /** - * 删除企业管理-资产处置单/变动单 - * - * @param id 编号 - */ - void deletePropertyDeal(String id); - - /** - * 获得企业管理-资产处置单/变动单 - * - * @param id 编号 - * @return 企业管理-资产处置单/变动单 - */ - PropertyDeal getPropertyDeal(String id); - - /** - * 获得企业管理-资产处置单/变动单分页 - * - * @param pageReqVO 分页查询 - * @return 企业管理-资产处置单/变动单分页 - */ - IPage getPropertyDealPage(PropertyDealReqVO pageReqVO); +// /** +// * 更新企业管理-资产处置单/变动单 +// * +// * @param updateReqVO 更新信息 +// */ +// void updatePropertyDeal(PropertyDealReqVO updateReqVO); +// +// /** +// * 删除企业管理-资产处置单/变动单 +// * +// * @param id 编号 +// */ +// void deletePropertyDeal(String id); +// +// /** +// * 获得企业管理-资产处置单/变动单 +// * +// * @param id 编号 +// * @return 企业管理-资产处置单/变动单 +// */ +// PropertyDeal getPropertyDeal(String id); +// +// /** +// * 获得企业管理-资产处置单/变动单分页 +// * +// * @param pageReqVO 分页查询 +// * @return 企业管理-资产处置单/变动单分页 +// */ +// IPage getPropertyDealPage(PropertyDealReqVO pageReqVO); } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealItemServiceImpl.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealItemServiceImpl.java index 7d2216fa..226b107a 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealItemServiceImpl.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealItemServiceImpl.java @@ -13,44 +13,45 @@ import org.springframework.validation.annotation.Validated; /** * 企业管理-资产处置子 Service 实现类 - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:37 2024/8/16 +**/ @Service @Validated public class PropertyDealItemServiceImpl extends ServiceImpl implements PropertyDealItemService { + /** + * 创建企业管理-资产处置子表 + * @author 小李 + * @date 21:36 2024/8/16 + * @param createReqVO 创建信息 + **/ @Override - public String createPropertyDealItem(PropertyDealItemReqVO createReqVO) { - // 插入 - PropertyDealItem propertyDealItem = BeanUtils.toBean(createReqVO, PropertyDealItem.class); - baseMapper.insert(propertyDealItem); - // 返回 - return propertyDealItem.getId(); + public void createPropertyDealItem(PropertyDealItemReqVO createReqVO) { } - @Override - public void updatePropertyDealItem(PropertyDealItemReqVO updateReqVO) { - // 更新 - PropertyDealItem updateObj = BeanUtils.toBean(updateReqVO, PropertyDealItem.class); - baseMapper.updateById(updateObj); - } - - @Override - public void deletePropertyDealItem(String id) { - // 删除 - baseMapper.deleteById(id); - } - - - @Override - public PropertyDealItem getPropertyDealItem(String id) { - return baseMapper.selectById(id); - } - - @Override - public IPage getPropertyDealItemPage(PropertyDealItemReqVO pageReqVO) { - return baseMapper.selectPage(pageReqVO); - } +// @Override +// public void updatePropertyDealItem(PropertyDealItemReqVO updateReqVO) { +// // 更新 +// PropertyDealItem updateObj = BeanUtils.toBean(updateReqVO, PropertyDealItem.class); +// baseMapper.updateById(updateObj); +// } +// +// @Override +// public void deletePropertyDealItem(String id) { +// // 删除 +// baseMapper.deleteById(id); +// } +// +// +// @Override +// public PropertyDealItem 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-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealServiceImpl.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealServiceImpl.java index eb7d1e51..bdace3e7 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealServiceImpl.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/service/impl/PropertyDealServiceImpl.java @@ -1,57 +1,85 @@ package cn.iocoder.yudao.module.property.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.property.entity.PropertyDeal; +import cn.iocoder.yudao.module.property.entity.PropertyDealItem; import cn.iocoder.yudao.module.property.mapper.PropertyDealMapper; +import cn.iocoder.yudao.module.property.service.PropertyDealItemService; import cn.iocoder.yudao.module.property.service.PropertyDealService; import cn.iocoder.yudao.module.property.vo.PropertyDealReqVO; import cn.iocoder.yudao.module.property.vo.PropertyDealRespVO; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; 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; +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + /** * 企业管理-资产处置单/变动单 Service 实现类 - * - * @author 后台管理员 - */ + * @author 小李 + * @date 21:26 2024/8/16 +**/ @Service @Validated public class PropertyDealServiceImpl extends ServiceImpl implements PropertyDealService { + @Resource + private PropertyDealItemService propertyDealItemService; + + /** + * 创建企业管理-资产处置单/变动单 + * @author 小李 + * @date 21:24 2024/8/16 + * @param createReqVO 处置单/变动单对象 + **/ @Override - public String createPropertyDeal(PropertyDealReqVO createReqVO) { - // 插入 - PropertyDeal propertyDeal = BeanUtils.toBean(createReqVO, PropertyDeal.class); + @DSTransactional + public void createPropertyDeal(PropertyDealRespVO createReqVO) { + /* 创建主表 */ + PropertyDeal propertyDeal = BeanUtil.toBean(createReqVO, PropertyDeal.class); + propertyDeal.setCorpId(createReqVO.getPropList().get(0).getCorpId()); + propertyDeal.setDeptId(createReqVO.getPropList().get(0).getDeptId()); baseMapper.insert(propertyDeal); - // 返回 - return propertyDeal.getId(); + String dealId = propertyDeal.getId(); + /* 创建子表 */ + List propertyDealItems = createReqVO.getPropList().stream().map(item -> { + PropertyDealItem propertyDealItem = new PropertyDealItem(); + propertyDealItem.setDealId(dealId); + propertyDealItem.setPropertyId(item.getId()); + propertyDealItem.setDealWay(item.getDealWay()); + return propertyDealItem; + }).collect(Collectors.toList()); + propertyDealItemService.saveBatch(propertyDealItems); } - @Override - public void updatePropertyDeal(PropertyDealReqVO updateReqVO) { - // 更新 - PropertyDeal updateObj = BeanUtils.toBean(updateReqVO, PropertyDeal.class); - baseMapper.updateById(updateObj); - } - - @Override - public void deletePropertyDeal(String id) { - // 删除 - baseMapper.deleteById(id); - } - - - @Override - public PropertyDeal getPropertyDeal(String id) { - return baseMapper.selectById(id); - } - - @Override - public IPage getPropertyDealPage(PropertyDealReqVO pageReqVO) { - return baseMapper.selectPage(pageReqVO); - } +// @Override +// public void updatePropertyDeal(PropertyDealReqVO updateReqVO) { +// // 更新 +// PropertyDeal updateObj = BeanUtils.toBean(updateReqVO, PropertyDeal.class); +// baseMapper.updateById(updateObj); +// } +// +// @Override +// public void deletePropertyDeal(String id) { +// // 删除 +// baseMapper.deleteById(id); +// } +// +// +// @Override +// public PropertyDeal 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-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemReqVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemReqVO.java index c6e54fc2..3348bf49 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemReqVO.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemReqVO.java @@ -1,63 +1,15 @@ package cn.iocoder.yudao.module.property.vo; -import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.module.property.entity.PropertyDealItem; 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; +/** + * 企业管理-资产处置子分页 Request VO + * @author 小李 + * @date 21:34 2024/8/16 +**/ @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) - private LocalDateTime createTime; - +public class PropertyDealItemReqVO extends PropertyDealItem { } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemRespVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemRespVO.java index e07d89f7..cc8bde5e 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemRespVO.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealItemRespVO.java @@ -8,13 +8,12 @@ import lombok.Data; import java.time.LocalDateTime; +/** + * 企业管理-资产处置子 Response VO + * @author 小李 + * @date 21:34 2024/8/16 +**/ @Schema(description = "管理后台 - 企业管理-资产处置子 Response VO") @Data -@ExcelIgnoreUnannotated public class PropertyDealItemRespVO extends PropertyDealItem { - - @Schema(description = "创建时间") - @ExcelProperty("创建时间") - private LocalDateTime createTime; - } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealReqVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealReqVO.java index ee149c0b..194f6cb6 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealReqVO.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealReqVO.java @@ -1,44 +1,15 @@ package cn.iocoder.yudao.module.property.vo; -import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.module.property.entity.PropertyDeal; 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; +/** + * 企业管理-资产处置单/变动单分页 Request VO + * @author 小李 + * @date 21:19 2024/8/16 +**/ @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) - private LocalDate dealDate; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) - private LocalDateTime createTime; - +public class PropertyDealReqVO extends PropertyDeal { } \ No newline at end of file diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealRespVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealRespVO.java index b0c31349..f7a25c9d 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealRespVO.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/property/vo/PropertyDealRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.property.vo; +import cn.iocoder.yudao.module.property.entity.Property; import cn.iocoder.yudao.module.property.entity.PropertyDeal; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; @@ -7,14 +8,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; +import java.util.List; +/** + * 管理后台 - 企业管理-资产处置单/变动单 Response VO + * @author 小李 + * @date 21:19 2024/8/16 +**/ @Schema(description = "管理后台 - 企业管理-资产处置单/变动单 Response VO") @Data -@ExcelIgnoreUnannotated public class PropertyDealRespVO extends PropertyDeal { - @Schema(description = "创建时间") - @ExcelProperty("创建时间") - private LocalDateTime createTime; - + /** + * 多个资产 + * @author 小李 + * @date 21:20 2024/8/16 + **/ + private List propList; } \ No newline at end of file diff --git a/dl-module-company/src/main/resources/mapper/property/PropertyDealItemMapper.xml b/dl-module-company/src/main/resources/mapper/property/PropertyDealItemMapper.xml index bf042fcb..8ec733f2 100644 --- a/dl-module-company/src/main/resources/mapper/property/PropertyDealItemMapper.xml +++ b/dl-module-company/src/main/resources/mapper/property/PropertyDealItemMapper.xml @@ -1,12 +1,4 @@ - - - - + \ No newline at end of file diff --git a/dl-module-company/src/main/resources/mapper/property/PropertyDealMapper.xml b/dl-module-company/src/main/resources/mapper/property/PropertyDealMapper.xml index 2e486bde..c290a2e2 100644 --- a/dl-module-company/src/main/resources/mapper/property/PropertyDealMapper.xml +++ b/dl-module-company/src/main/resources/mapper/property/PropertyDealMapper.xml @@ -1,12 +1,4 @@ - - - - + \ No newline at end of file