From d61e7b163db4b70e6942a86a8c0d5b69f7a0c09f Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Sat, 17 Jun 2023 12:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BD=AC=E7=A7=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86;=20=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TowerContractController.java | 2 +- .../controller/TowerLendingController.java | 152 +++++++++++++++++ .../TowerLendingSettleListController.java | 153 ++++++++++++++++++ .../tower/entity/TowerContractEquipment.java | 3 + .../entity/TowerContractSettleEquipment.java | 3 + .../gxwebsoft/tower/entity/TowerCustomer.java | 5 + .../gxwebsoft/tower/entity/TowerLending.java | 84 ++++++++++ .../tower/entity/TowerLendingSettleList.java | 124 ++++++++++++++ .../tower/mapper/TowerEquipmentMapper.java | 3 +- .../tower/mapper/TowerLendingMapper.java | 38 +++++ .../mapper/TowerLendingSettleListMapper.java | 38 +++++ .../tower/mapper/xml/TowerLendingMapper.xml | 59 +++++++ .../xml/TowerLendingSettleListMapper.xml | 98 +++++++++++ .../tower/param/TowerLendingParam.java | 58 +++++++ .../param/TowerLendingSettleListParam.java | 109 +++++++++++++ .../tower/service/TowerLendingService.java | 42 +++++ .../TowerLendingSettleListService.java | 42 +++++ .../service/impl/TowerLendingServiceImpl.java | 47 ++++++ .../TowerLendingSettleListServiceImpl.java | 47 ++++++ .../gxwebsoft/generator/TowerGenerator.java | 3 +- 20 files changed, 1107 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/gxwebsoft/tower/controller/TowerLendingController.java create mode 100644 src/main/java/com/gxwebsoft/tower/controller/TowerLendingSettleListController.java create mode 100644 src/main/java/com/gxwebsoft/tower/entity/TowerLending.java create mode 100644 src/main/java/com/gxwebsoft/tower/entity/TowerLendingSettleList.java create mode 100644 src/main/java/com/gxwebsoft/tower/mapper/TowerLendingMapper.java create mode 100644 src/main/java/com/gxwebsoft/tower/mapper/TowerLendingSettleListMapper.java create mode 100644 src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingMapper.xml create mode 100644 src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingSettleListMapper.xml create mode 100644 src/main/java/com/gxwebsoft/tower/param/TowerLendingParam.java create mode 100644 src/main/java/com/gxwebsoft/tower/param/TowerLendingSettleListParam.java create mode 100644 src/main/java/com/gxwebsoft/tower/service/TowerLendingService.java create mode 100644 src/main/java/com/gxwebsoft/tower/service/TowerLendingSettleListService.java create mode 100644 src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingSettleListServiceImpl.java diff --git a/src/main/java/com/gxwebsoft/tower/controller/TowerContractController.java b/src/main/java/com/gxwebsoft/tower/controller/TowerContractController.java index 2c12f98..37ef4f2 100644 --- a/src/main/java/com/gxwebsoft/tower/controller/TowerContractController.java +++ b/src/main/java/com/gxwebsoft/tower/controller/TowerContractController.java @@ -100,7 +100,7 @@ public class TowerContractController extends BaseController { @PutMapping() public ApiResult update(@RequestBody TowerContract towerContract) { if (towerContractService.updateById(towerContract)) { - return success("修改成功"); + return success(towerContract.getContractId()); } return fail("修改失败"); } diff --git a/src/main/java/com/gxwebsoft/tower/controller/TowerLendingController.java b/src/main/java/com/gxwebsoft/tower/controller/TowerLendingController.java new file mode 100644 index 0000000..afa986f --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/controller/TowerLendingController.java @@ -0,0 +1,152 @@ +package com.gxwebsoft.tower.controller; + +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.tower.entity.*; +import com.gxwebsoft.tower.service.TowerLendingService; +import com.gxwebsoft.tower.param.TowerLendingParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 拆借管理控制器 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Api(tags = "拆借管理管理") +@RestController +@RequestMapping("/api/tower/tower-lending") +public class TowerLendingController extends BaseController { + @Resource + private TowerLendingService towerLendingService; + + @PreAuthorize("hasAuthority('tower:towerLending:list')") + @OperationLog + @ApiOperation("分页查询拆借管理") + @GetMapping("/page") + public ApiResult> page(TowerLendingParam param) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); + wrapper.selectAll(TowerLending.class) + .select(TowerContract::getContactNumber) + .select(TowerContract::getSignDate) + .select(TowerProject::getProjectName) + .selectAs(TowerCustomer::getName, TowerCustomer::getCustomerName) + .select(Company::getCompanyName) + .leftJoin(TowerContract.class, TowerContract::getContractId, TowerLending::getContractId) + .leftJoin(TowerProject.class, TowerProject::getProjectId, TowerContract::getProjectId) + .leftJoin(TowerCustomer.class, TowerCustomer::getCustomerId, TowerContract::getCustomerId) + .leftJoin(Company.class, Company::getCompanyId, TowerContract::getCompanyId); + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(towerLendingService.page(page, wrapper)); + // 使用关联查询 + //return success(towerLendingService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('tower:towerLending:list')") + @OperationLog + @ApiOperation("查询全部拆借管理") + @GetMapping() + public ApiResult> list(TowerLendingParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(towerLendingService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(towerLendingService.listRel(param)); + } + + @PreAuthorize("hasAuthority('tower:towerLending:list')") + @OperationLog + @ApiOperation("根据id查询拆借管理") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(towerLendingService.getById(id)); + // 使用关联查询 + //return success(towerLendingService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('tower:towerLending:save')") + @OperationLog + @ApiOperation("添加拆借管理") + @PostMapping() + public ApiResult save(@RequestBody TowerLending towerLending) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + towerLending.setUserId(loginUser.getUserId()); + } + if (towerLendingService.save(towerLending)) { + return success(towerLending.getLendingId()); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:update')") + @OperationLog + @ApiOperation("修改拆借管理") + @PutMapping() + public ApiResult update(@RequestBody TowerLending towerLending) { + if (towerLendingService.updateById(towerLending)) { + return success(towerLending.getLendingId()); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:remove')") + @OperationLog + @ApiOperation("删除拆借管理") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (towerLendingService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:save')") + @OperationLog + @ApiOperation("批量添加拆借管理") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (towerLendingService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:update')") + @OperationLog + @ApiOperation("批量修改拆借管理") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(towerLendingService, "lending_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:remove')") + @OperationLog + @ApiOperation("批量删除拆借管理") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (towerLendingService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/tower/controller/TowerLendingSettleListController.java b/src/main/java/com/gxwebsoft/tower/controller/TowerLendingSettleListController.java new file mode 100644 index 0000000..3c89468 --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/controller/TowerLendingSettleListController.java @@ -0,0 +1,153 @@ +package com.gxwebsoft.tower.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.gxwebsoft.apps.entity.Equipment; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.tower.entity.*; +import com.gxwebsoft.tower.service.TowerLendingSettleListService; +import com.gxwebsoft.tower.param.TowerLendingSettleListParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 拆借结算清单控制器 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Api(tags = "拆借结算清单管理") +@RestController +@RequestMapping("/api/tower/tower-lending-settle") +public class TowerLendingSettleListController extends BaseController { + @Resource + private TowerLendingSettleListService towerLendingSettleListService; + + @PreAuthorize("hasAuthority('tower:towerLending:list')") + @OperationLog + @ApiOperation("分页查询拆借结算清单") + @GetMapping("/page") + public ApiResult> page(TowerLendingSettleListParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(towerLendingSettleListService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(towerLendingSettleListService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('tower:towerLending:list')") + @OperationLog + @ApiOperation("查询全部拆借结算清单") + @GetMapping() + public ApiResult> list(TowerLendingSettleListParam param) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); + wrapper.selectAll(TowerLendingSettleList.class) + .selectAs(TowerEquipment::getName, TowerEquipment::getEquipmentName) + .select(TowerEquipment::getFactoryNo) + .select(TowerEquipment::getFilingNo) + .select(TowerEquipment::getEquipmentNo) + .leftJoin(TowerEquipment.class, TowerEquipment::getEquipmentId, TowerLendingSettleList::getEquipmentId); + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(towerLendingSettleListService.list(wrapper)); + // 使用关联查询 + //return success(towerLendingSettleListService.listRel(param)); + } + + @PreAuthorize("hasAuthority('tower:towerLending:list')") + @OperationLog + @ApiOperation("根据id查询拆借结算清单") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(towerLendingSettleListService.getById(id)); + // 使用关联查询 + //return success(towerLendingSettleListService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('tower:towerLending:save')") + @OperationLog + @ApiOperation("添加拆借结算清单") + @PostMapping() + public ApiResult save(@RequestBody TowerLendingSettleList towerLendingSettleList) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + towerLendingSettleList.setUserId(loginUser.getUserId()); + } + if (towerLendingSettleListService.save(towerLendingSettleList)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:update')") + @OperationLog + @ApiOperation("修改拆借结算清单") + @PutMapping() + public ApiResult update(@RequestBody TowerLendingSettleList towerLendingSettleList) { + if (towerLendingSettleListService.updateById(towerLendingSettleList)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:remove')") + @OperationLog + @ApiOperation("删除拆借结算清单") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (towerLendingSettleListService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:save')") + @OperationLog + @ApiOperation("批量添加拆借结算清单") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("lending_id", list.get(0).getLendingId()); + towerLendingSettleListService.remove(queryWrapper); + if (towerLendingSettleListService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:update')") + @OperationLog + @ApiOperation("批量修改拆借结算清单") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(towerLendingSettleListService, "lending_settle_list_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('tower:towerLending:remove')") + @OperationLog + @ApiOperation("批量删除拆借结算清单") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (towerLendingSettleListService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/tower/entity/TowerContractEquipment.java b/src/main/java/com/gxwebsoft/tower/entity/TowerContractEquipment.java index c367d40..3289142 100644 --- a/src/main/java/com/gxwebsoft/tower/entity/TowerContractEquipment.java +++ b/src/main/java/com/gxwebsoft/tower/entity/TowerContractEquipment.java @@ -29,6 +29,9 @@ public class TowerContractEquipment implements Serializable { @ApiModelProperty(value = "合同ID") private Integer contractId; + @ApiModelProperty(value = "设备ID") + private Integer equipmentId; + @ApiModelProperty(value = "设备") private String equipmentName; diff --git a/src/main/java/com/gxwebsoft/tower/entity/TowerContractSettleEquipment.java b/src/main/java/com/gxwebsoft/tower/entity/TowerContractSettleEquipment.java index 0fb0b72..fd737c6 100644 --- a/src/main/java/com/gxwebsoft/tower/entity/TowerContractSettleEquipment.java +++ b/src/main/java/com/gxwebsoft/tower/entity/TowerContractSettleEquipment.java @@ -28,6 +28,9 @@ public class TowerContractSettleEquipment implements Serializable { private Integer contractId; + @ApiModelProperty(value = "设备ID") + private Integer equipmentId; + @ApiModelProperty(value = "设备") private String equipmentName; diff --git a/src/main/java/com/gxwebsoft/tower/entity/TowerCustomer.java b/src/main/java/com/gxwebsoft/tower/entity/TowerCustomer.java index cd6fdca..09d0397 100644 --- a/src/main/java/com/gxwebsoft/tower/entity/TowerCustomer.java +++ b/src/main/java/com/gxwebsoft/tower/entity/TowerCustomer.java @@ -1,6 +1,7 @@ package com.gxwebsoft.tower.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableLogic; @@ -28,6 +29,10 @@ public class TowerCustomer implements Serializable { @ApiModelProperty(value = "客户名称") private String name; + @ApiModelProperty(value = "客户名称") + @TableField(exist = false) + private String customerName; + @ApiModelProperty(value = "全称") private String fullName; diff --git a/src/main/java/com/gxwebsoft/tower/entity/TowerLending.java b/src/main/java/com/gxwebsoft/tower/entity/TowerLending.java new file mode 100644 index 0000000..510a89d --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/entity/TowerLending.java @@ -0,0 +1,84 @@ +package com.gxwebsoft.tower.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 拆借管理 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "TowerLending对象", description = "拆借管理") +public class TowerLending implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "lending_id", type = IdType.AUTO) + private Integer lendingId; + + @ApiModelProperty(value = "合同ID") + private Integer contractId; + + @ApiModelProperty(value = "产权单位") + private String propertyCompany; + + @ApiModelProperty(value = "结算日期") + private String settleDate; + + @ApiModelProperty(value = "本期结算金额") + private BigDecimal settleAmount; + + @ApiModelProperty(value = "附件") + private String fileList; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "所有人") + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "修改时间") + private LocalDateTime updateTime; + + @ApiModelProperty(value = "合同编号") + @TableField(exist = false) + private String contactNumber; + + @ApiModelProperty(value = "签订时间") + @TableField(exist = false) + private LocalDateTime signDate; + + @ApiModelProperty(value = "项目名称") + @TableField(exist = false) + private String projectName; + + @ApiModelProperty(value = "承租方") + @TableField(exist = false) + private String customerName; + + @ApiModelProperty(value = "租赁方") + @TableField(exist = false) + private String companyName; + +} diff --git a/src/main/java/com/gxwebsoft/tower/entity/TowerLendingSettleList.java b/src/main/java/com/gxwebsoft/tower/entity/TowerLendingSettleList.java new file mode 100644 index 0000000..6e69e00 --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/entity/TowerLendingSettleList.java @@ -0,0 +1,124 @@ +package com.gxwebsoft.tower.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.TableLogic; + +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 拆借结算清单 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "TowerLendingSettleList对象", description = "拆借结算清单") +public class TowerLendingSettleList implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "lending_settle_list_id", type = IdType.AUTO) + private Integer lendingSettleListId; + + @ApiModelProperty(value = "拆借主单id") + private Integer lendingId; + + @ApiModelProperty(value = "设备") + private Integer equipmentId; + + @ApiModelProperty(value = "拆借路线") + private String lendingPath; + + @ApiModelProperty(value = "合作方式") + private String coopWay; + + @ApiModelProperty(value = "结算开始日期") + private String startDate; + + @ApiModelProperty(value = "结算截止日期") + private String stopDate; + + @ApiModelProperty(value = "计费天数") + private Integer calDay; + + @ApiModelProperty(value = "整月") + private Boolean isFullMonth; + + @ApiModelProperty(value = "月计费天数") + private Integer daysInMonth; + + @ApiModelProperty(value = "月租金") + private BigDecimal monthRentAmount; + + @ApiModelProperty(value = "应付租金") + private BigDecimal shouldPayRentAmount; + + @ApiModelProperty(value = "日租金") + private BigDecimal dailyRentAmount; + + @ApiModelProperty(value = "应补租金") + private BigDecimal shouldSupplementAmount; + + @ApiModelProperty(value = "应扣租金") + private BigDecimal shouldDeductionAmount; + + @ApiModelProperty(value = "实付金额") + private BigDecimal paidAmount; + + @ApiModelProperty(value = "税率") + private BigDecimal taxRate; + + @ApiModelProperty(value = "税金") + private BigDecimal taxAmount; + + @ApiModelProperty(value = "税价合计") + private BigDecimal totalAmountWithTax; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "用户ID") + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "修改时间") + private LocalDateTime updateTime; + + @ApiModelProperty(value = "设备名称") + @TableField(exist = false) + private String equipmentName; + + @ApiModelProperty(value = "出厂编号") + @TableField(exist = false) + private String factoryNo; + + @ApiModelProperty(value = "备案编号") + @TableField(exist = false) + private String filingNo; + + @ApiModelProperty(value = "设备编号") + @TableField(exist = false) + private String equipmentNo; + +} diff --git a/src/main/java/com/gxwebsoft/tower/mapper/TowerEquipmentMapper.java b/src/main/java/com/gxwebsoft/tower/mapper/TowerEquipmentMapper.java index 6ca0886..5e29a69 100644 --- a/src/main/java/com/gxwebsoft/tower/mapper/TowerEquipmentMapper.java +++ b/src/main/java/com/gxwebsoft/tower/mapper/TowerEquipmentMapper.java @@ -2,6 +2,7 @@ package com.gxwebsoft.tower.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.yulichang.base.MPJBaseMapper; import com.gxwebsoft.tower.entity.TowerEquipment; import com.gxwebsoft.tower.param.TowerEquipmentParam; import org.apache.ibatis.annotations.Param; @@ -14,7 +15,7 @@ import java.util.List; * @author 科技小王子 * @since 2023-05-20 15:06:43 */ -public interface TowerEquipmentMapper extends BaseMapper { +public interface TowerEquipmentMapper extends MPJBaseMapper { /** * 分页查询 diff --git a/src/main/java/com/gxwebsoft/tower/mapper/TowerLendingMapper.java b/src/main/java/com/gxwebsoft/tower/mapper/TowerLendingMapper.java new file mode 100644 index 0000000..0621d89 --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/mapper/TowerLendingMapper.java @@ -0,0 +1,38 @@ +package com.gxwebsoft.tower.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.yulichang.base.MPJBaseMapper; +import com.gxwebsoft.tower.entity.TowerLending; +import com.gxwebsoft.tower.param.TowerLendingParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 拆借管理Mapper + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +public interface TowerLendingMapper extends MPJBaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") TowerLendingParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") TowerLendingParam param); + +} diff --git a/src/main/java/com/gxwebsoft/tower/mapper/TowerLendingSettleListMapper.java b/src/main/java/com/gxwebsoft/tower/mapper/TowerLendingSettleListMapper.java new file mode 100644 index 0000000..ee9cb0f --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/mapper/TowerLendingSettleListMapper.java @@ -0,0 +1,38 @@ +package com.gxwebsoft.tower.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.yulichang.base.MPJBaseMapper; +import com.gxwebsoft.tower.entity.TowerLendingSettleList; +import com.gxwebsoft.tower.param.TowerLendingSettleListParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 拆借结算清单Mapper + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +public interface TowerLendingSettleListMapper extends MPJBaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") TowerLendingSettleListParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") TowerLendingSettleListParam param); + +} diff --git a/src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingMapper.xml b/src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingMapper.xml new file mode 100644 index 0000000..48dfd75 --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingMapper.xml @@ -0,0 +1,59 @@ + + + + + + + SELECT a.* + FROM tower_lending a + + + AND a.lending_id = #{param.lendingId} + + + AND a.contract_id = #{param.contractId} + + + AND a.property_company LIKE CONCAT('%', #{param.propertyCompany}, '%') + + + AND a.settle_date LIKE CONCAT('%', #{param.settleDate}, '%') + + + AND a.settle_amount = #{param.settleAmount} + + + AND a.file_list LIKE CONCAT('%', #{param.fileList}, '%') + + + AND a.remark LIKE CONCAT('%', #{param.remark}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingSettleListMapper.xml b/src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingSettleListMapper.xml new file mode 100644 index 0000000..8087e8f --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingSettleListMapper.xml @@ -0,0 +1,98 @@ + + + + + + + SELECT a.* + FROM tower_lending_settle_list a + + + AND a.lending_settle_list_id = #{param.lendingSettleListId} + + + AND a.lending_id = #{param.lendingId} + + + AND a.equipment_id = #{param.equipmentId} + + + AND a.lending_path LIKE CONCAT('%', #{param.lendingPath}, '%') + + + AND a.coop_way LIKE CONCAT('%', #{param.coopWay}, '%') + + + AND a.start_date LIKE CONCAT('%', #{param.startDate}, '%') + + + AND a.stop_date LIKE CONCAT('%', #{param.stopDate}, '%') + + + AND a.cal_day = #{param.calDay} + + + AND a.is_full_month = #{param.isFullMonth} + + + AND a.days_in_month = #{param.daysInMonth} + + + AND a.month_rent_amount = #{param.monthRentAmount} + + + AND a.should_pay_rent_amount = #{param.shouldPayRentAmount} + + + AND a.daily_rent_amount = #{param.dailyRentAmount} + + + AND a.should_supplement_amount = #{param.shouldSupplementAmount} + + + AND a.should_deduction_amount = #{param.shouldDeductionAmount} + + + AND a.paid_amount = #{param.paidAmount} + + + AND a.tax_rate = #{param.taxRate} + + + AND a.tax_amount = #{param.taxAmount} + + + AND a.total_amount_with_tax = #{param.totalAmountWithTax} + + + AND a.remark LIKE CONCAT('%', #{param.remark}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/tower/param/TowerLendingParam.java b/src/main/java/com/gxwebsoft/tower/param/TowerLendingParam.java new file mode 100644 index 0000000..86b940b --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/param/TowerLendingParam.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.tower.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 拆借管理查询参数 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "TowerLendingParam对象", description = "拆借管理查询参数") +public class TowerLendingParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + private Integer lendingId; + + @ApiModelProperty(value = "合同ID") + @QueryField(type = QueryType.EQ) + private Integer contractId; + + @ApiModelProperty(value = "产权单位") + private String propertyCompany; + + @ApiModelProperty(value = "结算日期") + private String settleDate; + + @ApiModelProperty(value = "本期结算金额") + @QueryField(type = QueryType.EQ) + private BigDecimal settleAmount; + + @ApiModelProperty(value = "附件") + private String fileList; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "所有人") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/tower/param/TowerLendingSettleListParam.java b/src/main/java/com/gxwebsoft/tower/param/TowerLendingSettleListParam.java new file mode 100644 index 0000000..18421c8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/param/TowerLendingSettleListParam.java @@ -0,0 +1,109 @@ +package com.gxwebsoft.tower.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 拆借结算清单查询参数 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "TowerLendingSettleListParam对象", description = "拆借结算清单查询参数") +public class TowerLendingSettleListParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + private Integer lendingSettleListId; + + @ApiModelProperty(value = "拆借主单id") + @QueryField(type = QueryType.EQ) + private Integer lendingId; + + @ApiModelProperty(value = "设备") + @QueryField(type = QueryType.EQ) + private Integer equipmentId; + + @ApiModelProperty(value = "拆借路线") + private String lendingPath; + + @ApiModelProperty(value = "合作方式") + private String coopWay; + + @ApiModelProperty(value = "结算开始日期") + private String startDate; + + @ApiModelProperty(value = "结算截止日期") + private String stopDate; + + @ApiModelProperty(value = "计费天数") + @QueryField(type = QueryType.EQ) + private Integer calDay; + + @ApiModelProperty(value = "整月") + @QueryField(type = QueryType.EQ) + private Boolean isFullMonth; + + @ApiModelProperty(value = "月计费天数") + @QueryField(type = QueryType.EQ) + private Integer daysInMonth; + + @ApiModelProperty(value = "月租金") + @QueryField(type = QueryType.EQ) + private BigDecimal monthRentAmount; + + @ApiModelProperty(value = "应付租金") + @QueryField(type = QueryType.EQ) + private BigDecimal shouldPayRentAmount; + + @ApiModelProperty(value = "日租金") + @QueryField(type = QueryType.EQ) + private BigDecimal dailyRentAmount; + + @ApiModelProperty(value = "应补租金") + @QueryField(type = QueryType.EQ) + private BigDecimal shouldSupplementAmount; + + @ApiModelProperty(value = "应扣租金") + @QueryField(type = QueryType.EQ) + private BigDecimal shouldDeductionAmount; + + @ApiModelProperty(value = "实付金额") + @QueryField(type = QueryType.EQ) + private BigDecimal paidAmount; + + @ApiModelProperty(value = "税率") + @QueryField(type = QueryType.EQ) + private BigDecimal taxRate; + + @ApiModelProperty(value = "税金") + @QueryField(type = QueryType.EQ) + private BigDecimal taxAmount; + + @ApiModelProperty(value = "税价合计") + @QueryField(type = QueryType.EQ) + private BigDecimal totalAmountWithTax; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/tower/service/TowerLendingService.java b/src/main/java/com/gxwebsoft/tower/service/TowerLendingService.java new file mode 100644 index 0000000..f5ab783 --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/service/TowerLendingService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.tower.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.tower.entity.TowerLending; +import com.gxwebsoft.tower.param.TowerLendingParam; + +import java.util.List; + +/** + * 拆借管理Service + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +public interface TowerLendingService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(TowerLendingParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(TowerLendingParam param); + + /** + * 根据id查询 + * + * @param lendingId + * @return TowerLending + */ + TowerLending getByIdRel(Integer lendingId); + +} diff --git a/src/main/java/com/gxwebsoft/tower/service/TowerLendingSettleListService.java b/src/main/java/com/gxwebsoft/tower/service/TowerLendingSettleListService.java new file mode 100644 index 0000000..8876f0e --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/service/TowerLendingSettleListService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.tower.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.tower.entity.TowerLendingSettleList; +import com.gxwebsoft.tower.param.TowerLendingSettleListParam; + +import java.util.List; + +/** + * 拆借结算清单Service + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +public interface TowerLendingSettleListService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(TowerLendingSettleListParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(TowerLendingSettleListParam param); + + /** + * 根据id查询 + * + * @param lendingSettleListId + * @return TowerLendingSettleList + */ + TowerLendingSettleList getByIdRel(Integer lendingSettleListId); + +} diff --git a/src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingServiceImpl.java b/src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingServiceImpl.java new file mode 100644 index 0000000..445f795 --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.tower.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.tower.mapper.TowerLendingMapper; +import com.gxwebsoft.tower.service.TowerLendingService; +import com.gxwebsoft.tower.entity.TowerLending; +import com.gxwebsoft.tower.param.TowerLendingParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 拆借管理Service实现 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Service +public class TowerLendingServiceImpl extends ServiceImpl implements TowerLendingService { + + @Override + public PageResult pageRel(TowerLendingParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(TowerLendingParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public TowerLending getByIdRel(Integer lendingId) { + TowerLendingParam param = new TowerLendingParam(); + param.setLendingId(lendingId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingSettleListServiceImpl.java b/src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingSettleListServiceImpl.java new file mode 100644 index 0000000..59a1d0d --- /dev/null +++ b/src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingSettleListServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.tower.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.tower.mapper.TowerLendingSettleListMapper; +import com.gxwebsoft.tower.service.TowerLendingSettleListService; +import com.gxwebsoft.tower.entity.TowerLendingSettleList; +import com.gxwebsoft.tower.param.TowerLendingSettleListParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 拆借结算清单Service实现 + * + * @author 科技小王子 + * @since 2023-06-15 10:29:54 + */ +@Service +public class TowerLendingSettleListServiceImpl extends ServiceImpl implements TowerLendingSettleListService { + + @Override + public PageResult pageRel(TowerLendingSettleListParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(TowerLendingSettleListParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public TowerLendingSettleList getByIdRel(Integer lendingSettleListId) { + TowerLendingSettleListParam param = new TowerLendingSettleListParam(); + param.setLendingSettleListId(lendingSettleListId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/TowerGenerator.java b/src/test/java/com/gxwebsoft/generator/TowerGenerator.java index 434eb07..ccec0b6 100644 --- a/src/test/java/com/gxwebsoft/generator/TowerGenerator.java +++ b/src/test/java/com/gxwebsoft/generator/TowerGenerator.java @@ -51,7 +51,8 @@ public class TowerGenerator { // "tower_settle", // "tower_settle_detail", // "tower_history_settle", - "tower_rent_record", + "tower_lending", + "tower_lending_settle_list", }; // 需要去除的表前缀 private static final String[] TABLE_PREFIX = new String[]{