From 79d55e458f501fbaaf742dbb3723c08dba1d7f6a Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Fri, 4 Jul 2025 14:57:15 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E5=AE=A4=E8=AE=BE=E7=BD=AE=E5=92=8C=E4=BC=9A=E8=AE=AE=E5=AE=A4?= =?UTF-8?q?=E5=A2=9E=E5=80=BC=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EnumFetcherController.java | 34 +++++++++++ .../controller/MeetAttachController.java | 20 +++---- .../property/controller/MeetController.java | 11 ++-- .../org/dromara/property/domain/Meet.java | 35 ++++++++++-- .../dromara/property/domain/MeetAttach.java | 4 ++ .../dromara/property/domain/bo/MeetBo.java | 51 ++++++++++++++++- .../domain/enums/MeetAttachStatusEnum.java | 34 +++++++++++ .../property/domain/enums/MeetStatusEnum.java | 34 +++++++++++ .../property/domain/vo/MeePictureVo.java | 36 ++++++++++++ .../dromara/property/domain/vo/MeetVo.java | 22 +++++--- .../property/service/EnumFetcherService.java | 17 ++++++ .../property/service/IMeetAttachService.java | 7 +++ .../property/service/IMeetService.java | 7 +++ .../service/impl/EnumFetcherServiceImpl.java | 56 +++++++++++++++++++ .../service/impl/MeetAttachServiceImpl.java | 32 +++++++++++ .../service/impl/MeetServiceImpl.java | 32 +++++++++++ .../mapper/Property/MeetPictureMapper.xml | 7 +++ 17 files changed, 410 insertions(+), 29 deletions(-) create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/controller/EnumFetcherController.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetAttachStatusEnum.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetStatusEnum.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeePictureVo.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/service/EnumFetcherService.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java create mode 100644 ruoyi-modules/Property/src/main/resources/mapper/Property/MeetPictureMapper.xml diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/EnumFetcherController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/EnumFetcherController.java new file mode 100644 index 00000000..c55eb0bd --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/EnumFetcherController.java @@ -0,0 +1,34 @@ +package org.dromara.property.controller; + + +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.domain.R; +import org.dromara.property.service.EnumFetcherService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * @author yuqi + */ +@RestController +@RequestMapping("/enum-fetcher") +@RequiredArgsConstructor +public class EnumFetcherController { + + private final EnumFetcherService enumFetcherService; + + /** + * + * @param name + * @return 获取枚举全部值 参数以字段大驼峰格式 如:OmsOrderStatus + */ + @GetMapping("/enum-values/{name}") + public R> getEnumValues(@PathVariable("name") String name) { + Map map = enumFetcherService.getEnumValues(name); + return R.ok(map); + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java index 93307d2b..e4b8b62b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java @@ -46,16 +46,16 @@ public class MeetAttachController extends BaseController { return meetAttachService.queryPageList(bo, pageQuery); } - /** - * 导出会议室增值服务列表 - */ - @SaCheckPermission("property:attach:export") - @Log(title = "会议室增值服务", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(MeetAttachBo bo, HttpServletResponse response) { - List list = meetAttachService.queryList(bo); - ExcelUtil.exportExcel(list, "会议室增值服务", MeetAttachVo.class, response); - } + ///** + // * 导出会议室增值服务列表 + // */ + //@SaCheckPermission("property:attach:export") + //@Log(title = "会议室增值服务", businessType = BusinessType.EXPORT) + //@PostMapping("/export") + //public void export(MeetAttachBo bo, HttpServletResponse response) { + // List list = meetAttachService.queryList(bo); + // ExcelUtil.exportExcel(list, "会议室增值服务", MeetAttachVo.class, response); + //} /** * 获取会议室增值服务详细信息 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java index b82a4f79..3d5d83dd 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java @@ -2,6 +2,8 @@ package org.dromara.property.controller; import java.util.List; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.*; @@ -32,6 +34,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; @Validated @RequiredArgsConstructor @RestController +@Tag(name = " 会议室设置") @RequestMapping("/meet") public class MeetController extends BaseController { @@ -40,7 +43,8 @@ public class MeetController extends BaseController { /** * 查询会议室管理列表 */ - @SaCheckPermission("property:meet:list") + // @SaCheckPermission("property:meet:list") + @Operation @GetMapping("/list") public TableDataInfo list(MeetBo bo, PageQuery pageQuery) { return meetService.queryPageList(bo, pageQuery); @@ -62,10 +66,9 @@ public class MeetController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("property:meet:query") + //@SaCheckPermission("property:meet:query") @GetMapping("/{id}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable("id") Long id) { + public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { return R.ok(meetService.queryById(id)); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java index 4988eb8f..e97ac089 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java @@ -58,19 +58,42 @@ public class Meet extends TenantEntity { private Long attach; /** - * 创建人id + * 负责人 */ - private Long createById; + private String principals; /** - * 更新人id + * 描述 */ - private Long updateById; + private String desc; /** - * 搜索值 + * 联系电话 */ - private String searchValue; + private String phoneNo; + /** + * (0不审核,1审核) + */ + private Integer isCheck; + /** + * 预约时间 + */ + private String appointmentTime; + + /** + * 开放时段 + */ + private String openHours; + + /** + * 状态(0启用,1禁用) + */ + private Integer status; + + /** + * (1免费2.付费,3面议) + */ + private Integer expenseType; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/MeetAttach.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/MeetAttach.java index b0119f98..b0792919 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/MeetAttach.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/MeetAttach.java @@ -56,6 +56,10 @@ public class MeetAttach extends TenantEntity { * 状态 */ private Long state; + /** + * 图片 + */ + private String picture; /** * 创建人id diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBo.java index 3bf7c624..aca92565 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBo.java @@ -1,5 +1,6 @@ package org.dromara.property.domain.bo; +import com.baomidou.mybatisplus.annotation.TableId; import org.dromara.property.domain.Meet; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; @@ -9,6 +10,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; +import java.util.List; + /** * 会议室管理业务对象 meet * @@ -23,22 +26,25 @@ public class MeetBo extends BaseEntity { /** * 主键 */ - @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + @TableId(value = "id") private Long id; /** * 会议室名称 */ + @NotBlank(message = "会议室名称不能为空") private String name; /** * 位置 */ + @NotBlank(message = "位置不能为空") private String location; /** * 容纳人数 */ + @NotBlank(message = "容纳人数不能为空") private Long personNumber; /** @@ -56,5 +62,48 @@ public class MeetBo extends BaseEntity { */ private Long attach; + /** + * 负责人 + */ + private String principals; + + /** + * 描述 + */ + private String desc; + + /** + * 联系电话 + */ + private String phoneNo; + + /** + * (0不审核,1审核) + */ + private Integer isCheck; + + /** + * 预约时间 + */ + private String appointmentTime; + + /** + * 开放时段 + */ + private String openHours; + + /** + * 状态(0启用,1禁用) + */ + private Integer status; + + /** + * (1免费2.付费,3面议) + */ + private Integer expenseType; + /** + * 新增图片 + */ + private String picture; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetAttachStatusEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetAttachStatusEnum.java new file mode 100644 index 00000000..925bd048 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetAttachStatusEnum.java @@ -0,0 +1,34 @@ +package org.dromara.property.domain.enums; + +/** + * @Author:yuyongle + * @Date:2025/7/4 10:35 + * @Description: + **/ +public enum MeetAttachStatusEnum { + /** + * 待确认 + */ + ENAABLE("上架", "0"), + /** + * 待提货 + */ + DEACTIVATE("下架", "1"); + + + private final String name; + private final String value; + + MeetAttachStatusEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetStatusEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetStatusEnum.java new file mode 100644 index 00000000..9fc74f3d --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/MeetStatusEnum.java @@ -0,0 +1,34 @@ +package org.dromara.property.domain.enums; + +/** + * @Author:yuyongle + * @Date:2025/7/4 10:35 + * @Description: + **/ +public enum MeetStatusEnum { + /** + * 待确认 + */ + ENAABLE("启用", "0"), + /** + * 待提货 + */ + DEACTIVATE("停用", "1"); + + + private final String name; + private final String value; + + MeetStatusEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeePictureVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeePictureVo.java new file mode 100644 index 00000000..aa04d0cf --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeePictureVo.java @@ -0,0 +1,36 @@ +package org.dromara.property.domain.vo; + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import com.baomidou.mybatisplus.annotation.TableId; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.property.domain.Meet; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @Author:yuyongle + * @Date:2025/7/3 17:35 + * @Description: + **/ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = Meet.class) +public class MeePictureVo implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + /** + * 会议id + */ + private Long meetId; + /** + * 图片路径 + */ + private String pictureUrl; +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java index b86245bc..89ff8b3a 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java @@ -41,7 +41,7 @@ public class MeetVo implements Serializable { private String name; /** - * 位置 + * 会议室位置 */ @ExcelProperty(value = "位置") private String location; @@ -51,7 +51,10 @@ public class MeetVo implements Serializable { */ @ExcelProperty(value = "容纳人数") private Long personNumber; - + /** + * 状态(0启用,1禁用) + */ + private Integer status; /** * 基础服务 */ @@ -61,9 +64,8 @@ public class MeetVo implements Serializable { /** * 基础价格 */ - @ExcelProperty(value = "基础价格") + @ExcelProperty(value = "费用") private Long basePrice; - /** * 增值服务是否启用 */ @@ -71,10 +73,14 @@ public class MeetVo implements Serializable { private Long attach; /** - * 创建时间 + * 负责人 */ - @ExcelProperty(value = "创建时间") - private Date createTime; - + @ExcelProperty(value = "负责人") + private String principals; + /** + * 联系电话 + */ + @ExcelProperty(value = "联系电话") + private String phoneNo; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/EnumFetcherService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/EnumFetcherService.java new file mode 100644 index 00000000..e9179946 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/EnumFetcherService.java @@ -0,0 +1,17 @@ +package org.dromara.property.service; + +import java.util.Map; + +/** + * @Author:yuyongle + * @Date:2025/7/4 09:41 + * @Description: + **/ +public interface EnumFetcherService { + /** + * 获取枚举值 + * @param type 大驼峰格式 + * @return + */ + Map getEnumValues(String type); +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetAttachService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetAttachService.java index cf3ee047..ec4328ca 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetAttachService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetAttachService.java @@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 会议室增值服务Service接口 @@ -66,4 +67,10 @@ public interface IMeetAttachService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 获取下拉接口数据 + * @param type + */ + Map getMeetAttachSelectDate(String type); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java index 8cbc2444..7c591b78 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java @@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 会议室管理Service接口 @@ -66,4 +67,10 @@ public interface IMeetService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 获取下拉接口数据 + * @param type + */ + public Map getMeetSelectDate(String type); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java new file mode 100644 index 00000000..9305f957 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java @@ -0,0 +1,56 @@ +package org.dromara.property.service.impl; + +import lombok.RequiredArgsConstructor; +import org.dromara.property.domain.enums.MeetAttachStatusEnum; +import org.dromara.property.domain.enums.MeetStatusEnum; +import org.dromara.property.service.EnumFetcherService; +import org.dromara.property.service.IMeetAttachService; +import org.dromara.property.service.IMeetService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Author:yuyongle + * @Date:2025/7/4 09:41 + * @Description: + **/ +@Service +@RequiredArgsConstructor +public class EnumFetcherServiceImpl implements EnumFetcherService { + @Autowired + private IMeetService meetService; + @Autowired + private IMeetAttachService meetAttachService; + + @Override + public Map getEnumValues(String type) { + switch (type) { + case "getMeetName": + return meetService.getMeetSelectDate(type); + case "getMeetPrincipals": + return meetService.getMeetSelectDate(type); + case "getMeetStatus": + return getMeetStatus(); + case "getMeetAttachName": + return meetAttachService.getMeetAttachSelectDate(type); + case "getMeetAttachType": + return meetAttachService.getMeetAttachSelectDate(type); + case "getMeetAttachStatus()": + return getMeetAttachStatus(); + default: + throw new IllegalArgumentException("Unknown type: " + type); + } + } + + Map getMeetStatus() { + return java.util.Arrays.stream(MeetStatusEnum.values()) + .collect(Collectors.toMap(MeetStatusEnum::getValue, MeetStatusEnum::getName)); + } + Map getMeetAttachStatus() { + return java.util.Arrays.stream(MeetAttachStatusEnum.values()) + .collect(Collectors.toMap(MeetAttachStatusEnum::getValue, MeetAttachStatusEnum::getName)); + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetAttachServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetAttachServiceImpl.java index d1f7dbe3..579df9db 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetAttachServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetAttachServiceImpl.java @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.Meet; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.MeetAttachBo; import org.dromara.property.domain.vo.MeetAttachVo; @@ -19,6 +20,7 @@ import org.dromara.property.service.IMeetAttachService; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 会议室增值服务Service业务层处理 @@ -134,4 +136,34 @@ public class MeetAttachServiceImpl implements IMeetAttachService { } return baseMapper.deleteByIds(ids) > 0; } + /** + * 下拉接口数据 + */ + @Override + public Map getMeetAttachSelectDate(String type){ + + switch (type) { + case "getMeetAttachName": + return getList().stream() + .collect(Collectors.toMap( + MeetAttach::getProjectName, + MeetAttach::getProjectName, + (oldValue, newValue) -> oldValue + )); + case "getMeetAttachType": + return getList().stream() + .collect(Collectors.toMap( + MeetAttach::getType, + MeetAttach::getType, + (oldValue, newValue) -> oldValue + )); + default: + throw new IllegalArgumentException("Unknown type: " + type); + } + } + public List getList(){ + LambdaQueryWrapper meetQueryWrapper = new LambdaQueryWrapper<>(); + return baseMapper.selectList(meetQueryWrapper); + + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java index a86ad518..2dbe908e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java @@ -19,6 +19,7 @@ import org.dromara.property.service.IMeetService; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 会议室管理Service业务层处理 @@ -110,6 +111,7 @@ public class MeetServiceImpl implements IMeetService { public Boolean updateByBo(MeetBo bo) { Meet update = MapstructUtils.convert(bo, Meet.class); validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; } @@ -134,4 +136,34 @@ public class MeetServiceImpl implements IMeetService { } return baseMapper.deleteByIds(ids) > 0; } + /** + * 下拉接口数据 + */ + @Override + public Map getMeetSelectDate(String type){ + + switch (type) { + case "getMeetName": + return getList().stream() + .collect(Collectors.toMap( + Meet::getName, + Meet::getName, + (oldValue, newValue) -> oldValue + )); + case "getMeetPrincipals": + return getList().stream() + .collect(Collectors.toMap( + Meet::getPrincipals, + Meet::getPrincipals, + (oldValue, newValue) -> oldValue + )); + default: + throw new IllegalArgumentException("Unknown type: " + type); + } + } + public List getList(){ + LambdaQueryWrapper meetQueryWrapper = new LambdaQueryWrapper<>(); + return baseMapper.selectList(meetQueryWrapper); + + } } diff --git a/ruoyi-modules/Property/src/main/resources/mapper/Property/MeetPictureMapper.xml b/ruoyi-modules/Property/src/main/resources/mapper/Property/MeetPictureMapper.xml new file mode 100644 index 00000000..76925665 --- /dev/null +++ b/ruoyi-modules/Property/src/main/resources/mapper/Property/MeetPictureMapper.xml @@ -0,0 +1,7 @@ + + + + + From f9a7990de95c7bc64b1a864cd89bbc343dfe6870 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 4 Jul 2025 17:44:53 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 95 +++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 41 deletions(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index e0dfe1c9..c547780f 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -1,52 +1,65 @@ name: Gitea Actions Demo run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 on: [push] - jobs: Explore-Gitea-Actions: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest +# env: +# HTTP_PROXY: http://192.168.1.219:7890 +# HTTPS_PROXY: http://192.168.1.219:7890 +# NO_PROXY: localhost,127.0.0.1 steps: - - name: Checkout code - uses: http://127.0.0.1:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像 + uses: actions/checkout@v4 # 拉取代码到工作目录 + - name: Set up JDK 17 + uses: actions/setup-java@v3 with: - fetch-depth: 1 # 只拉取最新一次提交 - - name: Maven - run: mvn clean install - - name: Build with Maven - run: mvn -B package -DskipTests -pl ruoyi-modules/Property -am - - name: cp - run: copy ./ruoyi-modules/Property/target/Property.jar C:\devtool\server - - name: kill - run: Get-NetTCPConnection -LocalPort 10001 -State Listen -ErrorAction SilentlyContinue | Where-Object { $_.OwningProcess -ne $null } | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force -ErrorAction SilentlyContinue } - - name: run - run: java -jar C:\devtool\server\Property.jar + java-version: '17' + distribution: 'temurin' + cache: maven +# - name: Cache Maven dependencies +# uses: actions/cache@v3 +# with: +# path: ~/.m2/repository +# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} +# restore-keys: | +# ${{ runner.os }}-maven- + - name: Set up Maven + uses: stCarolas/setup-maven@v5 + with: + maven-version: 3.8.2 - # - copy ./ruoyi-modules/Property/target/Property.jar C:\devtool\server - # - pwd - # - java -jar ./docker/jar/Property.jar - - # - name: cd - # run: cd ruoyi-modules/Property - # - name: Build with Maven - # run: mvn -B clean package -DskipTests --file pom.xml - - # - name: Start Spring Cloud Services - # run: | - # # 启动顺序示例:注册中心 -> 配置中心 -> 网关 -> 业务服务 - # echo "Starting Server..." - # java -jar Property.jar - # SERVER_PIDS[0]=$! - - # # 等待注册中心启动 - # sleep 30 + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} +# - name: Set up JDK +# uses: actions/setup-java@v3 +# with: +# java-version: '17' +# distribution: 'temurin' +# - name: Build with Maven +# run: mvn clean package + - name: Install dependencies + run: mvn clean package -DskipTests + - name: copy file via ssh password + uses: appleboy/scp-action@v0.1.7 + with: + host: 192.168.1.3 + username: root + password: by@2025! + port: 22 + source: "RuoYi-Cloud-Plus/ruoyi-modules/Property/target/Property.jar,RuoYi-Cloud-Plus/ruoyi-modules/Property/docker-compose.yml,Dockerfile" + target: "/home/runner/plus/" + - name: Deploy to server via SSH + uses: appleboy/ssh-action@v0.1.7 + with: + host: 192.168.1.220 + username: root + password: 2003moc + port: 22 + script: | + cd /home/runner/plus + docker-compose up -d --force-recreate - # done - - # 保持工作流运行,避免服务被终止 - # wait - # env: - # JAVA_OPTS: "-Xmx512m -Xms256m" - # timeout-minutes: 20 - + - run: echo "🍏 This job's status is ${{ job.status }}." From 014a157921a1988cb7a5a825686bff4dbdaa0df6 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Fri, 4 Jul 2025 17:59:19 +0800 Subject: [PATCH 03/19] =?UTF-8?q?1=E3=80=81=E7=BB=BF=E6=A4=8D=E7=A7=9F?= =?UTF-8?q?=E8=B5=81=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlantsOrderMaintainController.java | 32 +++++ .../PlantsRentalOrderController.java | 33 ++++- .../property/domain/PlantsOrderCharge.java | 10 +- .../property/domain/PlantsPlanProduct.java | 5 + .../property/domain/PlantsProduct.java | 2 + .../domain/bo/PlantsOrderChargeBo.java | 11 +- .../domain/bo/PlantsOrderMaintainBo.java | 6 +- .../domain/bo/PlantsPlanProductBo.java | 7 +- .../property/domain/bo/PlantsProductBo.java | 9 +- .../domain/bo/PlantsRentalOrderBo.java | 12 +- .../domain/bo/PlantsRentalPlanBo.java | 4 +- .../domain/vo/PlantsOrderChargeVo.java | 22 ++- .../domain/vo/PlantsPlanProductVo.java | 5 + .../mapper/PlantsOrderMaintainMapper.java | 27 ++++ .../mapper/PlantsRentalOrderMapper.java | 35 ++++- .../service/IPlantsOrderMaintainService.java | 19 +++ .../service/IPlantsProductService.java | 7 + .../service/IPlantsRentalOrderService.java | 22 +++ .../impl/PlantsOrderChargeServiceImpl.java | 14 +- .../impl/PlantsOrderMaintainServiceImpl.java | 79 ++++++++++- .../impl/PlantsProductServiceImpl.java | 34 ++++- .../impl/PlantsRentalOrderServiceImpl.java | 130 +++++++++++++++--- .../impl/PlantsRentalPlanServiceImpl.java | 15 +- 23 files changed, 474 insertions(+), 66 deletions(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java index 0f0239a3..115e5e35 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java @@ -1,6 +1,7 @@ package org.dromara.property.controller; import java.util.List; +import java.util.Map; import lombok.RequiredArgsConstructor; import jakarta.servlet.http.HttpServletResponse; @@ -103,4 +104,35 @@ public class PlantsOrderMaintainController extends BaseController { @PathVariable("ids") Long[] ids) { return toAjax(plantsOrderMaintainService.deleteWithValidByIds(List.of(ids), true)); } + + + /** + * 按用户评分统计养护 + * @return + */ + @GetMapping("/countByCusScore") + public R countByCusScore(){ + return R.ok(plantsOrderMaintainService.countByCusScore()); + } + + /** + * 统计养护完成情况 + * @return + */ + @GetMapping("/countAchieved") + public R countAchieved(){ + return R.ok(plantsOrderMaintainService.countAchieved()); + } + + /** + * 计算绿植养护完成率 + * @return + */ + @GetMapping("/countAchievedRate") + public R countAchievedRate(){ + return R.ok(plantsOrderMaintainService.countAchievedRate()); + } + + + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java index 112f5ead..25ff229c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java @@ -117,11 +117,42 @@ public class PlantsRentalOrderController extends BaseController { } /** - *按用户类型统计 + *按用户类型统计订单数 * @return */ @GetMapping("/countByCusType") public R countByCusType(){ return R.ok(plantsRentalOrderService.countByCusType()); } + + /** + * 客户续租率统计 + * @return + */ + @GetMapping("/countRenewRate") + public R countRenewRate(){ + return R.ok(plantsRentalOrderService.countRenewRate()); + } + + /** + * 按租赁方式统计租赁金额 + * @return + */ + @GetMapping("/countByRentalType") + public R countByRentalType(){ + return R.ok(plantsRentalOrderService.countByRentalType()); + } + + + /** + * 统计订单总数和租赁金额总数 + * @return + */ + @GetMapping("/countOrderAndAmount") + public R countOrderAndAmount(){ + return R.ok(plantsRentalOrderService.countOrderAndAmount()); + } + + + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderCharge.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderCharge.java index 1da70d92..1630f160 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderCharge.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderCharge.java @@ -4,6 +4,8 @@ import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -47,22 +49,22 @@ public class PlantsOrderCharge extends BaseEntity { /** * 租金 */ - private Long rent; + private BigDecimal rent; /** * 押金 */ - private Long deposit; + private BigDecimal deposit; /** * 违约金 */ - private Long penalty; + private BigDecimal penalty; /** * 总金额 */ - private Long totalAmount; + private BigDecimal totalAmount; /** * 收费日期 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsPlanProduct.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsPlanProduct.java index 6a76f247..d4734c30 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsPlanProduct.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsPlanProduct.java @@ -37,5 +37,10 @@ public class PlantsPlanProduct extends BaseEntity { */ private Long productId; + /** + * 绿植产品数量 + */ + private Integer productNum; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java index 31afe5b2..0df44cd9 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java @@ -74,3 +74,5 @@ public class PlantsProduct extends BaseEntity { } + + diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java index 4bcf0a0b..119a8cd4 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java @@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; + +import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -49,25 +51,24 @@ public class PlantsOrderChargeBo extends BaseEntity { * 租金 */ @NotNull(message = "租金不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long rent; + private BigDecimal rent; /** * 押金 */ @NotNull(message = "押金不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long deposit; + private BigDecimal deposit; /** * 违约金 */ @NotNull(message = "违约金不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long penalty; + private BigDecimal penalty; /** * 总金额 */ - @NotNull(message = "总金额不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long totalAmount; + private BigDecimal totalAmount; /** * 收费日期 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java index a1877554..98fb3a85 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java @@ -36,19 +36,19 @@ public class PlantsOrderMaintainBo extends BaseEntity { /** * 小区id */ - @NotNull(message = "小区id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long communityId; /** * 建筑id */ - @NotNull(message = "建筑id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long buildingId; /** * 楼层id */ - @NotNull(message = "楼层id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long floorId; /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java index bfc3236c..0590e093 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java @@ -23,7 +23,6 @@ public class PlantsPlanProductBo extends BaseEntity { /** * 主键 */ - @NotNull(message = "主键不能为空", groups = { EditGroup.class }) private Long id; /** @@ -38,5 +37,11 @@ public class PlantsPlanProductBo extends BaseEntity { @NotNull(message = "绿植产品id不能为空", groups = { AddGroup.class, EditGroup.class }) private Long productId; + /** + * 绿植产品数量 + */ + @NotNull(message = "产品数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer productNum; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java index 491ef009..e9b5c547 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java @@ -1,5 +1,7 @@ package org.dromara.property.domain.bo; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; import org.dromara.property.domain.PlantsProduct; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; @@ -15,6 +17,8 @@ import jakarta.validation.constraints.*; * @author mocheng * @date 2025-06-25 */ +@AllArgsConstructor +@NoArgsConstructor @Data @EqualsAndHashCode(callSuper = true) @AutoMapper(target = PlantsProduct.class, reverseConvertGenerate = false) @@ -29,7 +33,6 @@ public class PlantsProductBo extends BaseEntity { /** * 产品编号 */ - @NotBlank(message = "产品编号不能为空", groups = { AddGroup.class, EditGroup.class }) private String plantCode; /** @@ -78,5 +81,9 @@ public class PlantsProductBo extends BaseEntity { */ private String remark; + public PlantsProductBo(Long id, Long inventory) { + this.id = id; + this.inventory = inventory; + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java index e5cb20c0..573018ff 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java @@ -1,5 +1,7 @@ package org.dromara.property.domain.bo; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; import org.dromara.property.domain.PlantsRentalOrder; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; @@ -9,6 +11,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; /** @@ -17,6 +21,8 @@ import com.fasterxml.jackson.annotation.JsonFormat; * @author mocheng * @date 2025-06-30 */ +@AllArgsConstructor +@NoArgsConstructor @Data @EqualsAndHashCode(callSuper = true) @AutoMapper(target = PlantsRentalOrder.class, reverseConvertGenerate = false) @@ -114,7 +120,9 @@ public class PlantsRentalOrderBo extends BaseEntity { */ private Date signTime; - - + /** + * 产品 + */ + private List productList; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalPlanBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalPlanBo.java index 6b046f40..72560618 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalPlanBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalPlanBo.java @@ -63,10 +63,10 @@ public class PlantsRentalPlanBo extends BaseEntity { private String remarks; /** - * 产品id + * 绿植产品 */ @NotNull(message = "绿植产品不能为空", groups = { AddGroup.class, EditGroup.class }) - private List productIds; + private List productList; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderChargeVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderChargeVo.java index 61e18d89..8d2da1a0 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderChargeVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderChargeVo.java @@ -1,6 +1,10 @@ package org.dromara.property.domain.vo; +import java.math.BigDecimal; import java.util.Date; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import org.dromara.property.domain.PlantsOrderCharge; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; @@ -59,25 +63,25 @@ public class PlantsOrderChargeVo implements Serializable { * 租金 */ @ExcelProperty(value = "租金") - private Long rent; + private BigDecimal rent; /** * 押金 */ @ExcelProperty(value = "押金") - private Long deposit; + private BigDecimal deposit; /** * 违约金 */ @ExcelProperty(value = "违约金") - private Long penalty; + private BigDecimal penalty; /** * 总金额 */ @ExcelProperty(value = "总金额") - private Long totalAmount; + private BigDecimal totalAmount; /** * 收费日期 @@ -112,5 +116,15 @@ public class PlantsOrderChargeVo implements Serializable { @ExcelDictFormat(dictType = "pro_charging_status") private Long chargeStatus; + /** + * 创建时间 + */ + private Date createTime; + + /** + * 租赁订单 + */ + private PlantsRentalOrderVo rentalOrder; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsPlanProductVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsPlanProductVo.java index 46f1ea79..2986c90d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsPlanProductVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsPlanProductVo.java @@ -46,6 +46,11 @@ public class PlantsPlanProductVo implements Serializable { @ExcelProperty(value = "绿植产品id") private Long productId; + /** + * 绿植产品数量 + */ + private Integer productNum; + /** * 创建时间 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java index 4ab6ad0a..b5d968df 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java @@ -1,9 +1,13 @@ package org.dromara.property.mapper; +import org.apache.ibatis.annotations.Select; import org.dromara.property.domain.PlantsOrderMaintain; import org.dromara.property.domain.vo.PlantsOrderMaintainVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import java.util.List; +import java.util.Map; + /** * 绿植租赁-订单养护管理Mapper接口 * @@ -12,4 +16,27 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; */ public interface PlantsOrderMaintainMapper extends BaseMapperPlus { + @Select("SELECT " + + "(CASE WHEN 1 THEN '一星'" + + "WHEN 2 THEN '二星'" + + "WHEN 3 THEN '三星'" + + "WHEN 4 THEN '四星'" + + "WHEN 5 THEN '五星' END) AS score, " + + "COUNT(*) AS count " + + "FROM plants_order_maintain " + + "GROUP BY customer_score ORDER BY customer_score") + List> countByCusScore(); + + + @Select("SELECT serve_type AS type," + + "COUNT(*) AS total," + + "SUM(CASE WHEN state ='2' THEN 1 ELSE 0 END) AS finish," + + "ROUND(SUM(CASE WHEN state ='2' THEN 1 ELSE 0 END) * 100/NULLIF(COUNT(*),0),0) AS rate " + + "FROM plants_order_maintain" + + "GROUP BY serve_type") + List> countAchieved(); + + @Select("SELECT ROUND(SUM(CASE WHEN state ='2' THEN 1 ELSE 0 END) * 100/NULLIF(COUNT(*),0),1) AS rate " + + "FROM plants_order_maintain") + Double countAchievedRate(); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsRentalOrderMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsRentalOrderMapper.java index b456d18c..ee69c397 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsRentalOrderMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsRentalOrderMapper.java @@ -22,14 +22,11 @@ public interface PlantsRentalOrderMapper extends BaseMapperPlus> countByDay(); - @Select("SELECT " + - "CASE DAYOFWEEK(create_time) AS week," + - "COUNT(*) AS count" + + @Select("SELECT DAYOFWEEK(create_time) AS week, COUNT(*) AS count " + "FROM plants_rental_order " + - "WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY) " + - "AND create_time < DATE_ADD(DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY), INTERVAL 7 DAY) " + - "GROUP BY DATE(create_time) " + - "ORDER BY day") + "WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY)" + + "AND create_time < DATE_ADD(DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY), INTERVAL 7 DAY)" + + "GROUP BY week ORDER BY week") List> countByWeek(); @Select("SELECT DAY(create_time) AS day, COUNT(*) AS count " + @@ -40,4 +37,28 @@ public interface PlantsRentalOrderMapper extends BaseMapperPlus> countByMonth(); + @Select("SELECT customer_type AS type, COUNT(*) AS count " + + "FROM plants_rental_order " + + "GROUP BY customer_type") + List> countByCusType(); + + @Select("SELECT MONTH(create_time) AS month," + + "ROUND(SUM(CASE WHEN is_relet = 1 THEN 1 ELSE 0 END) * 100/NULLIF(COUNT(*),0),0) AS rate " + + "FROM plants_rental_order WHERE YEAR(create_time) = YEAR(CURDATE())"+ + "GROUP BY MONTH(create_time)" + + "ORDER BY month") + List> countRenewRate(); + + + @Select("SELECT (CASE WHEN rental_type=1 THEN '单点' ELSE '套餐' END) AS type, " + + "COUNT(total_amount) AS amount " + + "FROM plants_rental_order " + + "GROUP BY rental_type") + List> countByRentalType(); + + @Select("SELECT COUNT(*) AS num, " + + "COUNT(total_amount) AS amount " + + "FROM plants_rental_order") + Map countOrderAndAmount(); + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java index 18ac94d6..6b832200 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java @@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 绿植租赁-订单养护管理Service接口 @@ -66,4 +67,22 @@ public interface IPlantsOrderMaintainService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 按用户评分统计 + * @return + */ + List> countByCusScore(); + + /** + * 统计养护完成情况 + * @return + */ + Map countAchieved(); + + /** + * 计算绿植养护完成率 + * @return + */ + String countAchievedRate(); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java index 7a750304..77a1a086 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java @@ -66,4 +66,11 @@ public interface IPlantsProductService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 扣除商品库存 + * @param products 商品 + * @return 是否扣除成功 + */ + Boolean deductStock(List products); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java index 2a303780..bcf3c481 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java @@ -80,4 +80,26 @@ public interface IPlantsRentalOrderService { * @return */ Map countByCusType(); + + + /** + * 客户续租率统计 + * @return + */ + Map countRenewRate(); + + /** + * 按租赁方式统计订单数 + * @return + */ + List> countByRentalType(); + + + /** + * 统计订单总数和租赁金额总数 + * @return + */ + Map countOrderAndAmount(); + + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java index 7105a3bf..c948108c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java @@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.vo.PlantsRentalOrderVo; +import org.dromara.property.service.IPlantsRentalOrderService; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.PlantsOrderChargeBo; import org.dromara.property.domain.vo.PlantsOrderChargeVo; @@ -33,6 +35,7 @@ public class PlantsOrderChargeServiceImpl implements IPlantsOrderChargeService { private final PlantsOrderChargeMapper baseMapper; + private final IPlantsRentalOrderService plantsRentalOrderService; /** * 查询绿植租赁-订单收费 * @@ -41,7 +44,12 @@ public class PlantsOrderChargeServiceImpl implements IPlantsOrderChargeService { */ @Override public PlantsOrderChargeVo queryById(Long id){ - return baseMapper.selectVoById(id); + PlantsOrderChargeVo orderChargeVo = baseMapper.selectVoById(id); + if(orderChargeVo!=null&&orderChargeVo.getOrderId()!=null){ + PlantsRentalOrderVo orderVo = plantsRentalOrderService.queryById(orderChargeVo.getOrderId()); + orderChargeVo.setRentalOrder(orderVo); + } + return orderChargeVo; } /** @@ -123,7 +131,9 @@ public class PlantsOrderChargeServiceImpl implements IPlantsOrderChargeService { * 保存前的数据校验 */ private void validEntityBeforeSave(PlantsOrderCharge entity){ - //TODO 做一些数据校验,如唯一约束 + if(entity.getRent()!=null&&entity.getDeposit()!=null&&entity.getPenalty()!=null){ + entity.setTotalAmount(entity.getRent().add(entity.getDeposit()).add(entity.getPenalty())); + } } /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java index fc462187..e75082c5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -9,6 +10,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.system.api.RemoteDictService; +import org.dromara.system.api.domain.vo.RemoteDictDataVo; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.PlantsOrderMaintainBo; import org.dromara.property.domain.vo.PlantsOrderMaintainVo; @@ -16,9 +19,7 @@ import org.dromara.property.domain.PlantsOrderMaintain; import org.dromara.property.mapper.PlantsOrderMaintainMapper; import org.dromara.property.service.IPlantsOrderMaintainService; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; /** * 绿植租赁-订单养护管理Service业务层处理 @@ -33,6 +34,8 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi private final PlantsOrderMaintainMapper baseMapper; + private final RemoteDictService dictService; + /** * 查询绿植租赁-订单养护管理 * @@ -40,7 +43,7 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi * @return 绿植租赁-订单养护管理 */ @Override - public PlantsOrderMaintainVo queryById(Long id){ + public PlantsOrderMaintainVo queryById(Long id) { return baseMapper.selectVoById(id); } @@ -125,7 +128,7 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi /** * 保存前的数据校验 */ - private void validEntityBeforeSave(PlantsOrderMaintain entity){ + private void validEntityBeforeSave(PlantsOrderMaintain entity) { //TODO 做一些数据校验,如唯一约束 } @@ -138,9 +141,73 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi */ @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ + if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 } return baseMapper.deleteByIds(ids) > 0; } + + /** + * 按用户评分统计 + * + * @return + */ + @Override + public List> countByCusScore() { + List> maps = baseMapper.countByCusScore(); + return maps; + } + + /** + * 统计养护完成情况 + * + * @return + */ + @Override + public Map countAchieved() { + List type = new ArrayList<>(); + List total = new ArrayList<>(); + List finish = new ArrayList<>(); + List rate = new ArrayList<>(); + List typeList = dictService.selectDictDataByType(""); + if (CollectionUtils.isNotEmpty(typeList)) { + typeList.forEach(item -> { + type.add(item.getDictValue()); + }); + total.addAll(Collections.nCopies(typeList.size(), 0)); + finish.addAll(Collections.nCopies(typeList.size(), 0)); + rate.addAll(Collections.nCopies(typeList.size(), 0)); + List> maps = baseMapper.countAchieved(); + maps.forEach(item -> { + String typeVal = item.get("type").toString(); + int index = type.indexOf(typeVal); + int totalVal = Integer.valueOf(item.get("total").toString()); + int finishVal = Integer.valueOf(item.get("finish").toString()); + int rateVal = Integer.valueOf(item.get("rate").toString()); + total.set(index, totalVal); + finish.set(index, finishVal); + rate.set(index, rateVal); + }); + } + Map map = new HashMap<>(); + map.put("type", type); + map.put("total", total); + map.put("finish", finish); + map.put("rate", rate); + return map; + } + + /** + * 计算绿植养护完成率 + * + * @return 绿植养护完成率 + */ + @Override + public String countAchievedRate() { + Double rate = baseMapper.countAchievedRate(); + if (rate != null) { + return rate + "%"; + } + return "0%"; + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java index dca59e3f..ae4f92ce 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -15,6 +16,7 @@ import org.dromara.property.domain.vo.PlantsProductVo; import org.dromara.property.domain.PlantsProduct; import org.dromara.property.mapper.PlantsProductMapper; import org.dromara.property.service.IPlantsProductService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -40,7 +42,7 @@ public class PlantsProductServiceImpl implements IPlantsProductService { * @return 绿植租赁-绿植产品 */ @Override - public PlantsProductVo queryById(Long id){ + public PlantsProductVo queryById(Long id) { return baseMapper.selectVoById(id); } @@ -81,7 +83,7 @@ public class PlantsProductServiceImpl implements IPlantsProductService { lqw.eq(StringUtils.isNotBlank(bo.getSpecification()), PlantsProduct::getSpecification, bo.getSpecification()); lqw.eq(bo.getRent() != null, PlantsProduct::getRent, bo.getRent()); lqw.eq(bo.getState() != null, PlantsProduct::getState, bo.getState()); - lqw.gt(bo.getInventory()!=null,PlantsProduct::getInventory, bo.getInventory()); + lqw.gt(bo.getInventory() != null, PlantsProduct::getInventory, bo.getInventory()); return lqw; } @@ -98,7 +100,7 @@ public class PlantsProductServiceImpl implements IPlantsProductService { boolean flag = baseMapper.insert(add) > 0; if (flag) { bo.setId(add.getId()); - add.setPlantCode("LZ"+add.getId()); + add.setPlantCode("LZ" + add.getId()); baseMapper.updateById(add); } return flag; @@ -120,7 +122,7 @@ public class PlantsProductServiceImpl implements IPlantsProductService { /** * 保存前的数据校验 */ - private void validEntityBeforeSave(PlantsProduct entity){ + private void validEntityBeforeSave(PlantsProduct entity) { //TODO 做一些数据校验,如唯一约束 } @@ -133,9 +135,31 @@ public class PlantsProductServiceImpl implements IPlantsProductService { */ @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ + if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 } return baseMapper.deleteByIds(ids) > 0; } + + /** + * 扣除商品库存 + * + * @param products 商品 + * @return 是否扣除成功 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public Boolean deductStock(List products) { + Boolean flag = false; + for (PlantsProductBo product : products) { + PlantsProduct p = baseMapper.selectById(product.getId()); + if (p.getInventory() >= product.getInventory()) { + p.setInventory(p.getInventory() - product.getInventory()); + flag = baseMapper.updateById(p) > 0; + } else { + throw new ServiceException("绿植产品" + p.getPlantName() + "库存不足,无法租赁。"); + } + } + return flag; + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java index 434e1512..5ee1f4c9 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.property.service.impl; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -10,6 +11,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.PlantsProduct; +import org.dromara.property.domain.bo.PlantsProductBo; +import org.dromara.property.service.IPlantsProductService; +import org.dromara.system.api.RemoteDictService; +import org.dromara.system.api.domain.vo.RemoteDictDataVo; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.PlantsRentalOrderBo; import org.dromara.property.domain.vo.PlantsRentalOrderVo; @@ -33,6 +39,10 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { private final PlantsRentalOrderMapper baseMapper; + private final RemoteDictService dictService; + + private final IPlantsProductService productService; + /** * 查询绿植租赁-订单管理 * @@ -101,7 +111,7 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { @Override public Boolean insertByBo(PlantsRentalOrderBo bo) { PlantsRentalOrder add = MapstructUtils.convert(bo, PlantsRentalOrder.class); - validEntityBeforeSave(add); + validEntityBeforeSave(bo); boolean flag = baseMapper.insert(add) > 0; if (flag) { bo.setId(add.getId()); @@ -120,15 +130,32 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { @Override public Boolean updateByBo(PlantsRentalOrderBo bo) { PlantsRentalOrder update = MapstructUtils.convert(bo, PlantsRentalOrder.class); - validEntityBeforeSave(update); return baseMapper.updateById(update) > 0; } /** * 保存前的数据校验 */ - private void validEntityBeforeSave(PlantsRentalOrder entity) { - //TODO 做一些数据校验,如唯一约束 + private void validEntityBeforeSave(PlantsRentalOrderBo bo) { + //租赁方式 1单点 2套餐 + if ("1".equals(bo.getRentalType())) { + if (bo.getProductId() != null&&bo.getProductNum()!=null) { + ArrayList products = new ArrayList<>(); + PlantsProductBo plantsProduct = new PlantsProductBo(bo.getProductId(),bo.getProductNum()); + products.add(plantsProduct); + productService.deductStock(products); + }else { + throw new ServiceException("租赁产品不能为空"); + } + } else { + List productList = bo.getProductList(); + if(CollectionUtils.isNotEmpty(productList)){ + productService.deductStock(productList); + }else { + throw new ServiceException("租赁套餐不能为空"); + } + } + } /** @@ -197,17 +224,15 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { List> maps = baseMapper.countByWeek(); String[] time = new String[]{"周一", "周二", "周三", "周四", "周五", "周六", "周日"}; List counts = new ArrayList<>(Collections.nCopies(7, 0)); - for (int i = 0; i < maps.size(); i++) { - if (i == 0) { - int count = Integer.valueOf(maps.get(i).get("count").toString()); - counts.set(6, count); - } else if (i + 1 < maps.size()) { - int week = Integer.valueOf(maps.get(i + 1).get("week").toString()); - int count = Integer.valueOf(maps.get(i + 1).get("count").toString()); - counts.set(week, count); + maps.forEach(item -> { + int week = Integer.valueOf(item.get("week").toString()); + int count = Integer.valueOf(item.get("count").toString()); + if (week == 1) { + counts.set(7, count); + } else if (week > 1 && week < 7) { + counts.set(week - 2, count); } - - } + }); Map map = new HashMap<>(); map.put("time", Arrays.asList(time)); map.put("counts", counts); @@ -216,14 +241,15 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { /** * 统计月订单数 + * * @return */ public Map countByMonth() { List> maps = baseMapper.countByMonth(); int days = YearMonth.now().lengthOfMonth(); List time = new ArrayList<>(); - for (int i = 1; i <=days; i++) { - time.add(i); + for (int i = 1; i <= days; i++) { + time.add(i); } List counts = new ArrayList<>(Collections.nCopies(days, 0)); maps.forEach(item -> { @@ -239,8 +265,78 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { return map; } + /** + * 按客户类型统计订单数 + * + * @return + */ @Override public Map countByCusType() { - return Map.of(); + List type = new ArrayList<>(); + List counts = new ArrayList<>(); + List typeList = dictService.selectDictDataByType("wy_khlx"); + if (CollectionUtils.isNotEmpty(typeList)) { + counts.addAll(Collections.nCopies(typeList.size(), 0)); + typeList.forEach(item -> { + type.add(item.getDictValue()); + }); + List> maps = baseMapper.countByCusType(); + maps.forEach(item -> { + String typeVal = item.get("type").toString(); + int index = type.indexOf(typeVal); + int count = Integer.valueOf(item.get("count").toString()); + counts.set(index, count); + }); + } + Map map = new HashMap<>(); + map.put("type", type); + map.put("counts", counts); + return map; + } + + /** + * 客户续租率统计 + * + * @return + */ + @Override + public Map countRenewRate() { + List monthList = new ArrayList<>(); + for (int i = 1; i <= 12; i++) { + monthList.add(i + "月"); + } + List rateList = new ArrayList<>(Collections.nCopies(12, 0)); + List> maps = baseMapper.countRenewRate(); + maps.forEach(item -> { + int month = Integer.valueOf(item.get("month").toString()); + int index = monthList.indexOf(month + "月"); + int rate = Integer.valueOf(item.get("rate").toString()); + rateList.set(index, rate); + }); + Map map = new HashMap<>(); + map.put("month", monthList); + map.put("rate", rateList); + return map; + } + + /** + * 按租赁方式统计订单数 + * + * @return + */ + @Override + public List> countByRentalType() { + List> maps = baseMapper.countByRentalType(); + return maps; + } + + /** + * 统计订单总数和租赁金额总数 + * + * @return + */ + @Override + public Map countOrderAndAmount() { + return baseMapper.countOrderAndAmount(); } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java index 2018b0d3..9cddaa37 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.dromara.property.domain.PlantsPlanProduct; +import org.dromara.property.domain.bo.PlantsPlanProductBo; import org.dromara.property.domain.vo.PlantsPlanProductVo; import org.dromara.property.service.IPlantsPlanProductService; import org.dromara.property.service.IPlantsProductService; @@ -105,12 +106,13 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { if (flag) { Long planId = add.getId(); bo.setId(planId); - if(CollectionUtils.isNotEmpty(bo.getProductIds())){ + if(CollectionUtils.isNotEmpty(bo.getProductList())){ List list = new ArrayList<>(); - for (Long productId : bo.getProductIds()) { + for (PlantsPlanProductBo planProductBo : bo.getProductList()) { PlantsPlanProduct planProduct = new PlantsPlanProduct(); planProduct.setPlanId(planId); - planProduct.setProductId(productId); + planProduct.setProductId(planProductBo.getProductId()); + planProduct.setProductNum(planProductBo.getProductNum()); list.add(planProduct); } planProductService.saveBatch(list); @@ -129,12 +131,13 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { public Boolean updateByBo(PlantsRentalPlanBo bo) { PlantsRentalPlan update = MapstructUtils.convert(bo, PlantsRentalPlan.class); validEntityBeforeSave(update); - if(CollectionUtils.isNotEmpty(bo.getProductIds())){ + if(CollectionUtils.isNotEmpty(bo.getProductList())){ List list = new ArrayList<>(); - for (Long productId : bo.getProductIds()) { + for (PlantsPlanProductBo planProductBo : bo.getProductList()) { PlantsPlanProduct planProduct = new PlantsPlanProduct(); planProduct.setPlanId(update.getId()); - planProduct.setProductId(productId); + planProduct.setProductId(planProductBo.getProductId()); + planProduct.setProductNum(planProductBo.getProductNum()); list.add(planProduct); } planProductService.updateByPlanId(list,update.getId()); From 1e16f5efc86e8ea62619325545dbf5bdf1800265 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 4 Jul 2025 18:02:58 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index c547780f..83112365 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -4,10 +4,6 @@ on: [push] jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest -# env: -# HTTP_PROXY: http://192.168.1.219:7890 -# HTTPS_PROXY: http://192.168.1.219:7890 -# NO_PROXY: localhost,127.0.0.1 steps: - name: Checkout code uses: actions/checkout@v4 # 拉取代码到工作目录 @@ -17,13 +13,6 @@ jobs: java-version: '17' distribution: 'temurin' cache: maven -# - name: Cache Maven dependencies -# uses: actions/cache@v3 -# with: -# path: ~/.m2/repository -# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} -# restore-keys: | -# ${{ runner.os }}-maven- - name: Set up Maven uses: stCarolas/setup-maven@v5 with: @@ -32,13 +21,7 @@ jobs: - name: List files in the repository run: | ls ${{ gitea.workspace }} -# - name: Set up JDK -# uses: actions/setup-java@v3 -# with: -# java-version: '17' -# distribution: 'temurin' -# - name: Build with Maven -# run: mvn clean package + - name: Install dependencies run: mvn clean package -DskipTests - name: copy file via ssh password @@ -48,17 +31,17 @@ jobs: username: root password: by@2025! port: 22 - source: "RuoYi-Cloud-Plus/ruoyi-modules/Property/target/Property.jar,RuoYi-Cloud-Plus/ruoyi-modules/Property/docker-compose.yml,Dockerfile" - target: "/home/runner/plus/" + source: "SmartParks/ruoyi-modules/Property/target/Property.jar,SmartParks/ruoyi-modules/Property/docker-compose.yml,SmartParks/ruoyi-modules/Property/Dockerfile" + target: "/project/runner/plus/" - name: Deploy to server via SSH uses: appleboy/ssh-action@v0.1.7 with: host: 192.168.1.220 username: root - password: 2003moc + password: by@2025! port: 22 script: | - cd /home/runner/plus + cd /project/runner/plus/ docker-compose up -d --force-recreate From 2c6733d1ea045a3801fb65455243f1da47f51a2e Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 4 Jul 2025 18:03:29 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=87=B3=20ruoyi-modules/Property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-modules/Property/docker-compose.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ruoyi-modules/Property/docker-compose.yml diff --git a/ruoyi-modules/Property/docker-compose.yml b/ruoyi-modules/Property/docker-compose.yml new file mode 100644 index 00000000..be2f90a6 --- /dev/null +++ b/ruoyi-modules/Property/docker-compose.yml @@ -0,0 +1,21 @@ +services: + ruoyi-system: +# image: ruoyi/Property:2.4.0 + build: + context: . + dockerfile: Dockerfile + container_name: Property + environment: + # 时区上海 + TZ: Asia/Shanghai + ports: + - "10001:10001" + volumes: + # 配置文件 + - /docker/Property/logs/:/ruoyi/Property/logs + # skywalking 探针 + - /docker/skywalking/agent/:/ruoyi/skywalking/agent + privileged: true + network_mode: "host" + + From 42c55b757a5a0a3d8370d870a72ca25bc8381c5f Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sat, 5 Jul 2025 09:51:32 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index 83112365..9e697dd7 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -5,8 +5,13 @@ jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest steps: + - name: Checkout code - uses: actions/checkout@v4 # 拉取代码到工作目录 + uses: http://127.0.0.1:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像 + with: + fetch-depth: 1 # 只拉取最新一次提交 + # - name: Checkout code + # uses: actions/checkout@v4 # 拉取代码到工作目录 - name: Set up JDK 17 uses: actions/setup-java@v3 with: From 8f0fc2fd3209bd3d4aac26b9de7e5f86b5ba9408 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sat, 5 Jul 2025 09:52:07 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index 9e697dd7..ffd20cdf 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Checkout code - uses: http://127.0.0.1:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像 + uses:http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像 with: fetch-depth: 1 # 只拉取最新一次提交 # - name: Checkout code From c5a5fccb57df842042b5c18b188aeb78f7ae5125 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sat, 5 Jul 2025 09:52:18 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index ffd20cdf..6a7a8148 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Checkout code - uses:http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像 + uses: http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像 with: fetch-depth: 1 # 只拉取最新一次提交 # - name: Checkout code From 9217befba85a315850d43fc7242c0edbc4c97bad Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sat, 5 Jul 2025 10:07:46 +0800 Subject: [PATCH 09/19] refactor(sis): 1 --- .../org/dromara/sis/controller/SisPersonLibImgController.java | 2 +- .../main/java/org/dromara/sis/domain/bo/SisPersonLibImgBo.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/controller/SisPersonLibImgController.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/controller/SisPersonLibImgController.java index 66905c2a..9dc356dc 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/controller/SisPersonLibImgController.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/controller/SisPersonLibImgController.java @@ -98,7 +98,7 @@ public class SisPersonLibImgController extends BaseController { */ @SaCheckPermission("sis:personLibImg:remove") @Log(title = "人像信息", businessType = BusinessType.DELETE) - @DeleteMapping("del/{ids}") + @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable("ids") Long[] ids) { return toAjax(tbPersonLibImgService.deleteWithValidByIds(List.of(ids), true)); diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/domain/bo/SisPersonLibImgBo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/domain/bo/SisPersonLibImgBo.java index 7b44d104..3c595111 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/domain/bo/SisPersonLibImgBo.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/domain/bo/SisPersonLibImgBo.java @@ -41,7 +41,7 @@ public class SisPersonLibImgBo extends BaseEntity { /** * 图片ossId */ - @NotBlank(message = "图片ossId不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotNull(message = "图片ossId不能为空", groups = {AddGroup.class, EditGroup.class}) private Long imgOssId; /** From d09c0c7df885f38e701b8b25cf5f1a9be1bf23d0 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Sat, 5 Jul 2025 11:07:04 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E5=AE=A4=E8=AE=BE=E7=BD=AE=E5=92=8C=E4=BC=9A=E8=AE=AE=E5=AE=A4?= =?UTF-8?q?=E5=A2=9E=E5=80=BC=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MeetBookingController.java | 20 +++++----- .../property/controller/MeetController.java | 22 ++++++----- .../controller/MeetReservationController.java | 39 +++++++++++++++++++ .../property/domain/enums/PayStatusEnum.java | 9 +++++ .../property/service/IMeetBookingService.java | 8 ++++ .../property/service/IMeetService.java | 2 +- .../service/impl/EnumFetcherServiceImpl.java | 5 +++ .../service/impl/MeetBookingServiceImpl.java | 23 +++++++++++ 8 files changed, 107 insertions(+), 21 deletions(-) create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetReservationController.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java index 41d3427a..9578d55d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java @@ -46,16 +46,16 @@ public class MeetBookingController extends BaseController { return meetBookingService.queryPageList(bo, pageQuery); } - /** - * 导出会议预约列表 - */ - @SaCheckPermission("property:meetbooking:export") - @Log(title = "会议预约", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(MeetBookingBo bo, HttpServletResponse response) { - List list = meetBookingService.queryList(bo); - ExcelUtil.exportExcel(list, "会议预约", MeetBookingVo.class, response); - } + ///** + // * 导出会议预约列表 + // */ + //@SaCheckPermission("property:meetbooking:export") + //@Log(title = "会议预约", businessType = BusinessType.EXPORT) + //@PostMapping("/export") + //public void export(MeetBookingBo bo, HttpServletResponse response) { + // List list = meetBookingService.queryList(bo); + // ExcelUtil.exportExcel(list, "会议预约", MeetBookingVo.class, response); + //} /** * 获取会议预约详细信息 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java index 3d5d83dd..2db99093 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java @@ -50,16 +50,16 @@ public class MeetController extends BaseController { return meetService.queryPageList(bo, pageQuery); } - /** - * 导出会议室管理列表 - */ - @SaCheckPermission("property:meet:export") - @Log(title = "会议室管理", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(MeetBo bo, HttpServletResponse response) { - List list = meetService.queryList(bo); - ExcelUtil.exportExcel(list, "会议室管理", MeetVo.class, response); - } + ///** + // * 导出会议室管理列表 + // */ + //@SaCheckPermission("property:meet:export") + //@Log(title = "会议室管理", businessType = BusinessType.EXPORT) + //@PostMapping("/export") + //public void export(MeetBo bo, HttpServletResponse response) { + // List list = meetService.queryList(bo); + // ExcelUtil.exportExcel(list, "会议室管理", MeetVo.class, response); + //} /** * 获取会议室管理详细信息 @@ -67,6 +67,7 @@ public class MeetController extends BaseController { * @param id 主键 */ //@SaCheckPermission("property:meet:query") + @Operation @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { return R.ok(meetService.queryById(id)); @@ -76,6 +77,7 @@ public class MeetController extends BaseController { * 新增会议室管理 */ @SaCheckPermission("property:meet:add") + @Operation @Log(title = "会议室管理", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetReservationController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetReservationController.java new file mode 100644 index 00000000..1ff2698e --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetReservationController.java @@ -0,0 +1,39 @@ +package org.dromara.property.controller; + +import io.swagger.v3.oas.annotations.Operation; +import lombok.RequiredArgsConstructor; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.web.core.BaseController; +import org.dromara.property.domain.bo.MeetBo; +import org.dromara.property.domain.vo.MeetVo; +import org.dromara.property.service.IMeetService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author:yuyongle + * @Date:2025/7/4 15:14 + * @Description: + **/ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/reservation") +public class MeetReservationController extends BaseController { + private final IMeetService meetService; + + /** + * 查询会议室管理列表 + */ + // @SaCheckPermission("property:meet:list") + @Operation + @GetMapping("/list") + public List list(MeetBo bo) { + return meetService.queryList(bo); + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java new file mode 100644 index 00000000..0b073c4e --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java @@ -0,0 +1,9 @@ +package org.dromara.property.domain.enums; + +/** + * @Author:yuyongle + * @Date:2025/7/4 17:58 + * @Description: + **/ +public enum PayStatusEnum { +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetBookingService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetBookingService.java index a77446dc..108ceb01 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetBookingService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetBookingService.java @@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 会议预约Service接口 @@ -66,4 +67,11 @@ public interface IMeetBookingService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 查询会议接口下拉数据 + * @param type + * @return + */ + Map getMeetBooking(String type); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java index 7c591b78..85db7b8d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IMeetService.java @@ -72,5 +72,5 @@ public interface IMeetService { * 获取下拉接口数据 * @param type */ - public Map getMeetSelectDate(String type); + Map getMeetSelectDate(String type); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java index 9305f957..c0dd6724 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java @@ -5,6 +5,7 @@ import org.dromara.property.domain.enums.MeetAttachStatusEnum; import org.dromara.property.domain.enums.MeetStatusEnum; import org.dromara.property.service.EnumFetcherService; import org.dromara.property.service.IMeetAttachService; +import org.dromara.property.service.IMeetBookingService; import org.dromara.property.service.IMeetService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -24,6 +25,8 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { private IMeetService meetService; @Autowired private IMeetAttachService meetAttachService; + @Autowired + private IMeetBookingService meetBookingService; @Override public Map getEnumValues(String type) { @@ -40,6 +43,8 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { return meetAttachService.getMeetAttachSelectDate(type); case "getMeetAttachStatus()": return getMeetAttachStatus(); + case "getMeetBookingPerson()": + return meetBookingService.getMeetBooking(type); default: throw new IllegalArgumentException("Unknown type: " + type); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java index 3dfce854..4f9a0fa4 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java @@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.Meet; +import org.dromara.property.domain.MeetAttach; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.MeetBookingBo; import org.dromara.property.domain.vo.MeetBookingVo; @@ -19,6 +21,7 @@ import org.dromara.property.service.IMeetBookingService; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 会议预约Service业务层处理 @@ -141,4 +144,24 @@ public class MeetBookingServiceImpl implements IMeetBookingService { } return baseMapper.deleteByIds(ids) > 0; } + + @Override + public Map getMeetBooking(String type) { + switch (type) { + case "getMeetBookingPerson()": + return getList().stream() + .collect(Collectors.toMap( + MeetBooking::getPerson, + MeetBooking::getPerson, + (oldValue, newValue) -> oldValue + )); + default: + throw new IllegalArgumentException("Unknown type: " + type); + } + } + public List getList(){ + LambdaQueryWrapper meetQueryWrapper = new LambdaQueryWrapper<>(); + return baseMapper.selectList(meetQueryWrapper); + + } } From 4e2ce2f92272752070985af6818561ff893022a4 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sat, 5 Jul 2025 11:15:12 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index 6a7a8148..9991ce96 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -36,7 +36,7 @@ jobs: username: root password: by@2025! port: 22 - source: "SmartParks/ruoyi-modules/Property/target/Property.jar,SmartParks/ruoyi-modules/Property/docker-compose.yml,SmartParks/ruoyi-modules/Property/Dockerfile" + source: "ruoyi-modules/Property/target/Property.jar,ruoyi-modules/Property/docker-compose.yml,ruoyi-modules/Property/Dockerfile" target: "/project/runner/plus/" - name: Deploy to server via SSH uses: appleboy/ssh-action@v0.1.7 From 521dac9d14b142557b0a3ed542ccb4cf6fb7e219 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sat, 5 Jul 2025 11:27:51 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index 9991ce96..cecfcc1d 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -46,7 +46,7 @@ jobs: password: by@2025! port: 22 script: | - cd /project/runner/plus/ + cd /project/runner/plus/ruoyi-modules/Property docker-compose up -d --force-recreate From 20f6cc85411a74088ddddff278c6c415dcdfb7d0 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sat, 5 Jul 2025 11:48:57 +0800 Subject: [PATCH 13/19] =?UTF-8?q?refactor(sis):=20base64=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E6=A0=BC=E5=BC=8FJPG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SisAuthRecordServiceImpl.java | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAuthRecordServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAuthRecordServiceImpl.java index d4d5254e..dcfe11d1 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAuthRecordServiceImpl.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAuthRecordServiceImpl.java @@ -1,10 +1,10 @@ package org.dromara.sis.service.impl; +import cn.hutool.core.img.ImgUtil; import cn.hutool.core.lang.Assert; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.config.annotation.DubboReference; @@ -30,11 +30,10 @@ import org.dromara.sis.sdk.unview.model.UvModel; import org.dromara.sis.service.*; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - -import java.nio.file.Files; -import java.nio.file.Paths; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.util.*; -import java.util.stream.Collectors; /** * 授权记录Service业务层处理 @@ -182,7 +181,7 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService { // 宇视添加人像 UvModel.AddPersonParams addPersonParams = new UvModel.AddPersonParams(); addPersonParams.setPerson_name(imgVo.getImgName()); - addPersonParams.setImage_base64(Base64.getEncoder().encodeToString(imageByte)); + addPersonParams.setImage_base64(base64Helper(imageByte)); addPersonParams.setLib_id(Math.toIntExact(eqp_lib_id)); addPersonParams.setSex(imgVo.getSex()); addPersonParams.setEmail(imgVo.getEmail()); @@ -195,7 +194,7 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService { eqp_lib_img_id = addResult.getPerson_id(); } else { - UvModel.WorkClothesInfo addResult = unViewAiBoxApi.addWorkClothes(systemInfo, Math.toIntExact(eqp_lib_id), Base64.getEncoder().encodeToString(imageByte)); + UvModel.WorkClothesInfo addResult = unViewAiBoxApi.addWorkClothes(systemInfo, Math.toIntExact(eqp_lib_id), base64Helper(imageByte)); eqp_lib_img_id = addResult.getWorkclothes_id(); } Assert.notNull(eqp_lib_img_id, "图片上传宇视盒子失败"); @@ -295,6 +294,21 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService { return true; } + public String base64Helper(byte[] imageByte) throws IOException { + // 1. 将字节数组解码为BufferedImage对象 + ByteArrayInputStream bis = new ByteArrayInputStream(imageByte); + + // 2. 将图片重新编码为JPG格式的字节数组 + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + ImgUtil.convert(bis, "jpg", bos); + + byte[] jpgBytes = bos.toByteArray(); + + // 3. 将JPG字节数组转为Base64字符串 + return Base64.getEncoder().encodeToString(jpgBytes); + } + @Override public Boolean singleAuth(SingleAuthRecordBo bo) { return null; From 594f6d87590d7838ebbfe356955b19309441fbcd Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sat, 5 Jul 2025 11:50:34 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index cecfcc1d..1add414e 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -41,7 +41,7 @@ jobs: - name: Deploy to server via SSH uses: appleboy/ssh-action@v0.1.7 with: - host: 192.168.1.220 + host: 192.168.1.3 username: root password: by@2025! port: 22 From 487480c0e1a40c7eef8de3c84972a1bf29058863 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sat, 5 Jul 2025 14:25:46 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ruoyi-modules/Proper?= =?UTF-8?q?ty/Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-modules/Property/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/Property/Dockerfile b/ruoyi-modules/Property/Dockerfile index 7bf60168..c369d781 100644 --- a/ruoyi-modules/Property/Dockerfile +++ b/ruoyi-modules/Property/Dockerfile @@ -5,17 +5,17 @@ FROM bellsoft/liberica-openjdk-debian:17.0.11-cds LABEL maintainer="Lion Li" -RUN mkdir -p /ruoyi/system/logs \ - /ruoyi/system/temp \ +RUN mkdir -p /ruoyi/Property/logs \ + /ruoyi/Property/temp \ /ruoyi/skywalking/agent -WORKDIR /ruoyi/system +WORKDIR /ruoyi/Property ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" EXPOSE ${SERVER_PORT} -ADD ./target/ruoyi-system.jar ./app.jar +ADD ./target/Property.jar ./app.jar SHELL ["/bin/bash", "-c"] From 322a9944e8fa8f8d9dfe50f4d940089e9de54164 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Sat, 5 Jul 2025 15:45:50 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9E=9A=E4=B8=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MeetBookingController.java | 38 +++++++------------ .../property/controller/MeetController.java | 10 +++++ .../domain/enums/BookingPayStatusEnum.java | 34 +++++++++++++++++ .../domain/enums/BookingStatusEnum.java | 30 +++++++++++++++ .../property/domain/enums/PayStatusEnum.java | 9 ----- .../service/impl/EnumFetcherServiceImpl.java | 21 +++++++++- 6 files changed, 106 insertions(+), 36 deletions(-) create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingPayStatusEnum.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingStatusEnum.java delete mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java index 9578d55d..fa967cc2 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetBookingController.java @@ -38,25 +38,13 @@ public class MeetBookingController extends BaseController { private final IMeetBookingService meetBookingService; /** - * 查询会议预约列表 + * 查询会议预约记录列表 */ @SaCheckPermission("property:meetbooking:list") @GetMapping("/list") public TableDataInfo list(MeetBookingBo bo, PageQuery pageQuery) { return meetBookingService.queryPageList(bo, pageQuery); } - - ///** - // * 导出会议预约列表 - // */ - //@SaCheckPermission("property:meetbooking:export") - //@Log(title = "会议预约", businessType = BusinessType.EXPORT) - //@PostMapping("/export") - //public void export(MeetBookingBo bo, HttpServletResponse response) { - // List list = meetBookingService.queryList(bo); - // ExcelUtil.exportExcel(list, "会议预约", MeetBookingVo.class, response); - //} - /** * 获取会议预约详细信息 * @@ -91,16 +79,16 @@ public class MeetBookingController extends BaseController { return toAjax(meetBookingService.updateByBo(bo)); } - /** - * 删除会议预约 - * - * @param ids 主键串 - */ - @SaCheckPermission("property:meetbooking:remove") - @Log(title = "会议预约", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable("ids") Long[] ids) { - return toAjax(meetBookingService.deleteWithValidByIds(List.of(ids), true)); - } + ///** + // * 删除会议预约 + // * + // * @param ids 主键串 + // */ + //@SaCheckPermission("property:meetbooking:remove") + //@Log(title = "会议预约", businessType = BusinessType.DELETE) + //@DeleteMapping("/{ids}") + //public R remove(@NotEmpty(message = "主键不能为空") + // @PathVariable("ids") Long[] ids) { + // return toAjax(meetBookingService.deleteWithValidByIds(List.of(ids), true)); + //} } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java index 2db99093..fd082859 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetController.java @@ -50,6 +50,16 @@ public class MeetController extends BaseController { return meetService.queryPageList(bo, pageQuery); } + /** + * 查询未预约会议 + * @param bo + * @return + */ + @Operation + @GetMapping("/notlist") + public R> notlist(MeetBo bo) { + return R.ok(meetService.queryList(bo)); + } ///** // * 导出会议室管理列表 // */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingPayStatusEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingPayStatusEnum.java new file mode 100644 index 00000000..0007e1e0 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingPayStatusEnum.java @@ -0,0 +1,34 @@ +package org.dromara.property.domain.enums; + +/** + * @Author:yuyongle + * @Date:2025/7/4 17:58 + * @Description: + **/ +public enum BookingPayStatusEnum { + /** + * 待确认 + */ + ENAABLE("待支付", "0"), + /** + * 待提货 + */ + DEACTIVATE("已支付", "1"); + + + private final String name; + private final String value; + + BookingPayStatusEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingStatusEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingStatusEnum.java new file mode 100644 index 00000000..d97a8f8d --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/BookingStatusEnum.java @@ -0,0 +1,30 @@ +package org.dromara.property.domain.enums; + +/** + * @Author:yuyongle + * @Date:2025/7/5 14:13 + * @Description: + **/ +public enum BookingStatusEnum { + + READYTOSTART("待开始", "0"), + PENDINGREVIEW("待审核", "1"), + FINISHED("已结束", "1"); + + + private final String name; + private final String value; + + BookingStatusEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java deleted file mode 100644 index 0b073c4e..00000000 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/PayStatusEnum.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.dromara.property.domain.enums; - -/** - * @Author:yuyongle - * @Date:2025/7/4 17:58 - * @Description: - **/ -public enum PayStatusEnum { -} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java index c0dd6724..0c4aa144 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java @@ -1,6 +1,8 @@ package org.dromara.property.service.impl; import lombok.RequiredArgsConstructor; +import org.dromara.property.domain.enums.BookingPayStatusEnum; +import org.dromara.property.domain.enums.BookingStatusEnum; import org.dromara.property.domain.enums.MeetAttachStatusEnum; import org.dromara.property.domain.enums.MeetStatusEnum; import org.dromara.property.service.EnumFetcherService; @@ -41,10 +43,14 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { return meetAttachService.getMeetAttachSelectDate(type); case "getMeetAttachType": return meetAttachService.getMeetAttachSelectDate(type); - case "getMeetAttachStatus()": + case "getMeetAttachStatus": return getMeetAttachStatus(); - case "getMeetBookingPerson()": + case "getMeetBookingPerson": return meetBookingService.getMeetBooking(type); + case "getMeetBookingPayStatus": + return getMeetBookingPayStatus(); + case "getMeetBookingStatus": + return getMeetBookingStatus(); default: throw new IllegalArgumentException("Unknown type: " + type); } @@ -54,8 +60,19 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { return java.util.Arrays.stream(MeetStatusEnum.values()) .collect(Collectors.toMap(MeetStatusEnum::getValue, MeetStatusEnum::getName)); } + + Map getMeetAttachStatus() { return java.util.Arrays.stream(MeetAttachStatusEnum.values()) .collect(Collectors.toMap(MeetAttachStatusEnum::getValue, MeetAttachStatusEnum::getName)); } + + Map getMeetBookingPayStatus() { + return java.util.Arrays.stream(BookingPayStatusEnum.values()) + .collect(Collectors.toMap(BookingPayStatusEnum::getValue, BookingPayStatusEnum::getName)); + } + MapgetMeetBookingStatus() { + return java.util.Arrays.stream(BookingStatusEnum.values()) + .collect(Collectors.toMap(BookingStatusEnum::getValue, BookingStatusEnum::getName)); + } } From 73b45818361fe133fd4ec16e28fc1a2609c62ced Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Sat, 5 Jul 2025 15:54:34 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9E=9A=E4=B8=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/dromara/property/domain/bo/MeetAttachBo.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetAttachBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetAttachBo.java index a8d13785..4e57f8fb 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetAttachBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetAttachBo.java @@ -23,13 +23,11 @@ public class MeetAttachBo extends BaseEntity { /** * 主键 */ - @NotNull(message = "主键不能为空", groups = { EditGroup.class }) private Long id; /** * 会议室id */ - @NotNull(message = "会议室id不能为空", groups = { AddGroup.class, EditGroup.class }) private Long meetId; /** From 9a34602030900babd42dcf1f25d3f9a1974894b3 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Sat, 5 Jul 2025 17:38:27 +0800 Subject: [PATCH 18/19] =?UTF-8?q?1=E3=80=81=E7=A7=9F=E8=B5=81=E8=AE=A2?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlantsOrderMaintainController.java | 2 +- .../property/domain/PlantsOrderMaintain.java | 15 +---- .../property/domain/PlantsProduct.java | 3 +- .../property/domain/PlantsRentalOrder.java | 6 +- .../domain/bo/PlantsOrderChargeBo.java | 7 ++ .../domain/bo/PlantsOrderMaintainBo.java | 25 +++----- .../property/domain/bo/PlantsProductBo.java | 8 ++- .../domain/bo/PlantsRentalOrderBo.java | 6 +- .../domain/vo/PlantsOrderMaintainVo.java | 23 ++++--- .../property/domain/vo/PlantsProductVo.java | 8 ++- .../domain/vo/PlantsRentalOrderVo.java | 14 +++- .../mapper/PlantsOrderMaintainMapper.java | 4 +- .../service/IPlantsOrderMaintainService.java | 2 +- .../service/IPlantsProductService.java | 7 ++ .../impl/PlantsOrderChargeServiceImpl.java | 3 + .../impl/PlantsOrderMaintainServiceImpl.java | 32 +++++++--- .../impl/PlantsProductServiceImpl.java | 19 ++++++ .../impl/PlantsRentalOrderServiceImpl.java | 64 +++++++++++++++++-- .../Property/PlantsPlanProductMapper.xml | 2 + 19 files changed, 180 insertions(+), 70 deletions(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java index 115e5e35..cf4a824f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsOrderMaintainController.java @@ -129,7 +129,7 @@ public class PlantsOrderMaintainController extends BaseController { * @return */ @GetMapping("/countAchievedRate") - public R countAchievedRate(){ + public R countAchievedRate(){ return R.ok(plantsOrderMaintainService.countAchievedRate()); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderMaintain.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderMaintain.java index 15d61301..25fabdf3 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderMaintain.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsOrderMaintain.java @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import java.io.Serial; @@ -35,19 +34,9 @@ public class PlantsOrderMaintain extends BaseEntity { private String maintainName; /** - * 小区id + * 房间id */ - private Long communityId; - - /** - * 建筑id - */ - private Long buildingId; - - /** - * 楼层id - */ - private Long floorId; + private Long roomId; /** * 服务类型 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java index 0df44cd9..da0bbf08 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsProduct.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serial; +import java.math.BigDecimal; /** * 绿植租赁-绿植产品对象 plants_product @@ -55,7 +56,7 @@ public class PlantsProduct extends BaseEntity { /** * 租金 */ - private Long rent; + private BigDecimal rent; /** * 库存数量 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsRentalOrder.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsRentalOrder.java index 5b011a02..515bcff4 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsRentalOrder.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/PlantsRentalOrder.java @@ -4,6 +4,8 @@ import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -62,7 +64,7 @@ public class PlantsRentalOrder extends BaseEntity { /** * 应付总额 */ - private Long totalAmount; + private BigDecimal totalAmount; /** * 租赁方式 @@ -82,7 +84,7 @@ public class PlantsRentalOrder extends BaseEntity { /** * 租赁产品数量 */ - private Long productNum; + private Integer productNum; /** * 支付状态 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java index 119a8cd4..128cd027 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderChargeBo.java @@ -11,6 +11,8 @@ import jakarta.validation.constraints.*; import java.math.BigDecimal; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; /** @@ -100,5 +102,10 @@ public class PlantsOrderChargeBo extends BaseEntity { @NotNull(message = "收费状态不能为空", groups = { AddGroup.class, EditGroup.class }) private Long chargeStatus; + /** + * 订单id + */ + private List orderIds; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java index 98fb3a85..1927a500 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsOrderMaintainBo.java @@ -9,7 +9,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.List; /** * 绿植租赁-订单养护管理业务对象 plants_order_maintain @@ -34,22 +34,10 @@ public class PlantsOrderMaintainBo extends BaseEntity { private String maintainName; /** - * 小区id + * 房间id */ - - private Long communityId; - - /** - * 建筑id - */ - - private Long buildingId; - - /** - * 楼层id - */ - - private Long floorId; + @NotNull(message = "服务地点不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long roomId; /** * 服务类型 @@ -112,5 +100,10 @@ public class PlantsOrderMaintainBo extends BaseEntity { */ private Long state; + /** + * 订单id + */ + private List orderIds; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java index e9b5c547..163c3bc2 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsProductBo.java @@ -11,6 +11,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; +import java.math.BigDecimal; + /** * 绿植租赁-绿植产品业务对象 plants_product * @@ -62,13 +64,13 @@ public class PlantsProductBo extends BaseEntity { * 租金 */ @NotNull(message = "租金不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long rent; + private BigDecimal rent; /** * 库存数量 */ @NotNull(message = "库存数量不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long inventory; + private Integer inventory; /** * 状态(0下架 1上架 ) @@ -81,7 +83,7 @@ public class PlantsProductBo extends BaseEntity { */ private String remark; - public PlantsProductBo(Long id, Long inventory) { + public PlantsProductBo(Long id, Integer inventory) { this.id = id; this.inventory = inventory; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java index 573018ff..b0b95ff1 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java @@ -10,6 +10,8 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; + +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -72,7 +74,7 @@ public class PlantsRentalOrderBo extends BaseEntity { * 应付总额 */ @NotNull(message = "应付总额不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long totalAmount; + private BigDecimal totalAmount; /** * 租赁方式 @@ -93,7 +95,7 @@ public class PlantsRentalOrderBo extends BaseEntity { /** * 租赁产品数量 */ - private Long productNum; + private Integer productNum; /** * 支付状态 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderMaintainVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderMaintainVo.java index f98bdb0d..610e5858 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderMaintainVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsOrderMaintainVo.java @@ -43,22 +43,16 @@ public class PlantsOrderMaintainVo implements Serializable { private String maintainName; /** - * 小区id + * 房间id */ - @ExcelProperty(value = "小区id") - private Long communityId; + + private Long roomId; /** - * 建筑id + * 服务地点 */ - @ExcelProperty(value = "建筑id") - private Long buildingId; - - /** - * 楼层id - */ - @ExcelProperty(value = "楼层id") - private Long floorId; + @ExcelProperty(value = "服务地点") + private String roomName; /** * 服务类型 @@ -127,5 +121,10 @@ public class PlantsOrderMaintainVo implements Serializable { @ExcelProperty(value = "处理状态") private Long state; + /** + * 租赁订单 + */ + private PlantsRentalOrderVo rentalOrder; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsProductVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsProductVo.java index e5244ec9..ccffa626 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsProductVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsProductVo.java @@ -10,6 +10,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; @@ -68,7 +69,7 @@ public class PlantsProductVo implements Serializable { * 租金 */ @ExcelProperty(value = "租金") - private Long rent; + private BigDecimal rent; /** * 库存数量 @@ -95,5 +96,10 @@ public class PlantsProductVo implements Serializable { @ExcelProperty(value = "创建时间") private Date createTime; + /** + * 方案产品数量 + */ + private Integer planProNumber; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsRentalOrderVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsRentalOrderVo.java index cf512615..571f7582 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsRentalOrderVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/PlantsRentalOrderVo.java @@ -1,6 +1,8 @@ package org.dromara.property.domain.vo; +import java.math.BigDecimal; import java.util.Date; + import com.fasterxml.jackson.annotation.JsonFormat; import org.dromara.property.domain.PlantsRentalOrder; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; @@ -13,7 +15,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; import java.util.Date; - +import java.util.List; /** @@ -78,7 +80,7 @@ public class PlantsRentalOrderVo implements Serializable { * 应付总额 */ @ExcelProperty(value = "应付总额") - private Long totalAmount; + private BigDecimal totalAmount; /** * 租赁方式 @@ -102,7 +104,7 @@ public class PlantsRentalOrderVo implements Serializable { * 租赁产品数量 */ @ExcelProperty(value = "租赁产品数量") - private Long productNum; + private Integer productNum; /** * 支付状态 @@ -125,6 +127,7 @@ public class PlantsRentalOrderVo implements Serializable { /** * 合同编号 */ + @ExcelProperty(value = "合同编号") private String contractCode; /** @@ -133,5 +136,10 @@ public class PlantsRentalOrderVo implements Serializable { @ExcelProperty(value = "签署时间") private Date signTime; + /** + * 绿植产品 + */ + private List productList; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java index b5d968df..d6ad8dcd 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsOrderMaintainMapper.java @@ -17,7 +17,7 @@ import java.util.Map; public interface PlantsOrderMaintainMapper extends BaseMapperPlus { @Select("SELECT " + - "(CASE WHEN 1 THEN '一星'" + + "(CASE customer_score WHEN 1 THEN '一星'" + "WHEN 2 THEN '二星'" + "WHEN 3 THEN '三星'" + "WHEN 4 THEN '四星'" + @@ -32,7 +32,7 @@ public interface PlantsOrderMaintainMapper extends BaseMapperPlus> countAchieved(); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java index 6b832200..eb3f44c7 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsOrderMaintainService.java @@ -84,5 +84,5 @@ public interface IPlantsOrderMaintainService { * 计算绿植养护完成率 * @return */ - String countAchievedRate(); + Map countAchievedRate(); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java index 77a1a086..dd8a1f62 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsProductService.java @@ -73,4 +73,11 @@ public interface IPlantsProductService { * @return 是否扣除成功 */ Boolean deductStock(List products); + + /** + * 添加商品库存 + * @param products 商品 + * @return 是否添加成功 + */ + Boolean addStock(List products); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java index c948108c..1dd6f559 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderChargeServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.PlantsOrderMaintain; import org.dromara.property.domain.vo.PlantsRentalOrderVo; import org.dromara.property.service.IPlantsRentalOrderService; import org.springframework.stereotype.Service; @@ -94,6 +96,7 @@ public class PlantsOrderChargeServiceImpl implements IPlantsOrderChargeService { lqw.eq(bo.getInvoiceStatus() != null, PlantsOrderCharge::getInvoiceStatus, bo.getInvoiceStatus()); lqw.eq(bo.getInvoiceType() != null, PlantsOrderCharge::getInvoiceType, bo.getInvoiceType()); lqw.eq(bo.getChargeStatus() != null, PlantsOrderCharge::getChargeStatus, bo.getChargeStatus()); + lqw.in(CollectionUtils.isNotEmpty(bo.getOrderIds()), PlantsOrderCharge::getOrderId,bo.getOrderIds()); return lqw; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java index e75082c5..91273237 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsOrderMaintainServiceImpl.java @@ -10,6 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.vo.PlantsRentalOrderVo; +import org.dromara.property.service.IPlantsRentalOrderService; +import org.dromara.property.service.ITbRoomService; import org.dromara.system.api.RemoteDictService; import org.dromara.system.api.domain.vo.RemoteDictDataVo; import org.springframework.stereotype.Service; @@ -36,6 +39,10 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi private final RemoteDictService dictService; + private final IPlantsRentalOrderService plantsRentalOrderService; + + private final ITbRoomService roomService; + /** * 查询绿植租赁-订单养护管理 * @@ -44,7 +51,14 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi */ @Override public PlantsOrderMaintainVo queryById(Long id) { - return baseMapper.selectVoById(id); + PlantsOrderMaintainVo vo = baseMapper.selectVoById(id); + if(vo!=null){ + PlantsRentalOrderVo orderVo = plantsRentalOrderService.queryById(vo.getOrderId()); + vo.setRentalOrder(orderVo); + String roomName = roomService.queryRoomName(vo.getRoomId()); + vo.setRoomName(roomName); + } + return vo; } /** @@ -78,9 +92,7 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByAsc(PlantsOrderMaintain::getId); lqw.like(StringUtils.isNotBlank(bo.getMaintainName()), PlantsOrderMaintain::getMaintainName, bo.getMaintainName()); - lqw.eq(bo.getCommunityId() != null, PlantsOrderMaintain::getCommunityId, bo.getCommunityId()); - lqw.eq(bo.getBuildingId() != null, PlantsOrderMaintain::getBuildingId, bo.getBuildingId()); - lqw.eq(bo.getFloorId() != null, PlantsOrderMaintain::getFloorId, bo.getFloorId()); + lqw.eq(bo.getRoomId() != null, PlantsOrderMaintain::getRoomId, bo.getRoomId()); lqw.eq(bo.getServeType() != null, PlantsOrderMaintain::getServeType, bo.getServeType()); lqw.eq(bo.getPeriodType() != null, PlantsOrderMaintain::getPeriodType, bo.getPeriodType()); lqw.eq(bo.getPeriodFrequency() != null, PlantsOrderMaintain::getPeriodFrequency, bo.getPeriodFrequency()); @@ -92,6 +104,7 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi lqw.eq(bo.getCustomerScore() != null, PlantsOrderMaintain::getCustomerScore, bo.getCustomerScore()); lqw.eq(StringUtils.isNotBlank(bo.getCustomerAdvice()), PlantsOrderMaintain::getCustomerAdvice, bo.getCustomerAdvice()); lqw.eq(bo.getState() != null, PlantsOrderMaintain::getState, bo.getState()); + lqw.in(CollectionUtils.isNotEmpty(bo.getOrderIds()),PlantsOrderMaintain::getOrderId,bo.getOrderIds()); return lqw; } @@ -169,7 +182,7 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi List total = new ArrayList<>(); List finish = new ArrayList<>(); List rate = new ArrayList<>(); - List typeList = dictService.selectDictDataByType(""); + List typeList = dictService.selectDictDataByType("pro_service_type"); if (CollectionUtils.isNotEmpty(typeList)) { typeList.forEach(item -> { type.add(item.getDictValue()); @@ -203,11 +216,14 @@ public class PlantsOrderMaintainServiceImpl implements IPlantsOrderMaintainServi * @return 绿植养护完成率 */ @Override - public String countAchievedRate() { + public Map countAchievedRate() { Double rate = baseMapper.countAchievedRate(); + Map map = new HashMap<>(); + String s="0%"; if (rate != null) { - return rate + "%"; + s= rate + "%"; } - return "0%"; + map.put("rate", s); + return map; } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java index ae4f92ce..07ed5f58 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java @@ -162,4 +162,23 @@ public class PlantsProductServiceImpl implements IPlantsProductService { } return flag; } + + /** + * 添加商品库存 + * @param products 商品 + * @return 是否添加成功 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public Boolean addStock(List products) { + Boolean flag = false; + for (PlantsProductBo product : products) { + PlantsProduct p = baseMapper.selectById(product.getId()); + if(p!=null){ + p.setInventory(p.getInventory() + product.getInventory()); + flag = baseMapper.updateById(p) > 0; + } + } + return flag; + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java index 5ee1f4c9..136bfc1e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java @@ -12,16 +12,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.dromara.property.domain.PlantsProduct; +import org.dromara.property.domain.bo.PlantsOrderChargeBo; +import org.dromara.property.domain.bo.PlantsOrderMaintainBo; import org.dromara.property.domain.bo.PlantsProductBo; -import org.dromara.property.service.IPlantsProductService; +import org.dromara.property.domain.vo.*; +import org.dromara.property.service.*; import org.dromara.system.api.RemoteDictService; import org.dromara.system.api.domain.vo.RemoteDictDataVo; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.PlantsRentalOrderBo; -import org.dromara.property.domain.vo.PlantsRentalOrderVo; import org.dromara.property.domain.PlantsRentalOrder; import org.dromara.property.mapper.PlantsRentalOrderMapper; -import org.dromara.property.service.IPlantsRentalOrderService; import java.time.YearMonth; import java.util.*; @@ -43,6 +44,12 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { private final IPlantsProductService productService; + private final IPlantsPlanProductService planProductService; + +// private final IPlantsOrderMaintainService maintainService; +// +// private final IPlantsOrderChargeService chargeService; + /** * 查询绿植租赁-订单管理 * @@ -51,7 +58,22 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { */ @Override public PlantsRentalOrderVo queryById(Long id) { - return baseMapper.selectVoById(id); + PlantsRentalOrderVo orderVo = baseMapper.selectVoById(id); + ArrayList list = new ArrayList<>(); + if("1".equals(orderVo.getRentalType())){ + PlantsProductVo productVo = productService.queryById(orderVo.getProductId()); + productVo.setPlanProNumber(orderVo.getProductNum()); + list.add(productVo); + }else { + List planProductVos = planProductService.queryPlanProductsInfo(orderVo.getPlanId()); + for (PlantsPlanProductVo planProductVo : planProductVos) { + PlantsProductVo product = planProductVo.getProduct(); + product.setPlanProNumber(planProductVo.getProductNum()); + list.add(product); + } + } + orderVo.setProductList(list); + return orderVo; } /** @@ -168,7 +190,39 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if (isValid) { - //TODO 做一些业务上的校验,判断是否需要校验 + //有订单收费或订单维护数据不可删除 +// PlantsOrderChargeBo chargeBo = new PlantsOrderChargeBo(); +// chargeBo.setOrderIds(ids.stream().toList()); +// List chargeList = chargeService.queryList(chargeBo); +// PlantsOrderMaintainBo maintainBo = new PlantsOrderMaintainBo(); +// maintainBo.setOrderIds(ids.stream().toList()); +// List maintainList = maintainService.queryList(maintainBo); +// if(CollectionUtils.isNotEmpty(maintainList)||CollectionUtils.isNotEmpty(chargeList)){ +// throw new ServiceException("所选订单不可删除"); +// }else { +// //恢复产品库存 +// ArrayList productList = new ArrayList<>(); +// for (Long id : ids) { +// PlantsRentalOrder order = baseMapper.selectById(id); +// if("1".equals(order.getRentalType())){ +// Long productId = order.getProductId(); +// Integer productNum = order.getProductNum(); +// productList.add(new PlantsProductBo(productId,productNum)); +// }else { +// Long planId = order.getPlanId(); +// List planProductVos = planProductService.queryPlanProductsInfo(planId); +// for (PlantsPlanProductVo planProductVo : planProductVos) { +// productList.add(new PlantsProductBo(planProductVo.getProductId(),planProductVo.getProductNum())); +// } +// } +// } +// if(CollectionUtils.isNotEmpty(productList)){ +// Boolean b = productService.addStock(productList); +// if(!b){ +// throw new ServiceException("删除订单失败。"); +// } +// } +// } } return baseMapper.deleteByIds(ids) > 0; } diff --git a/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml b/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml index e675ba8d..f46532f8 100644 --- a/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml +++ b/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -30,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" c.id pid, c.plan_id, c.product_id, + c.product_num, p.* from plants_plan_product c left join plants_product p on c.product_id = p.id From 7b40b084c15dbe6f24d371c7b92f4596c4ecd681 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Mon, 7 Jul 2025 14:16:01 +0800 Subject: [PATCH 19/19] =?UTF-8?q?1=E3=80=81=E7=BB=BF=E6=A4=8D=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=B8=8B=E5=8D=95=E5=AE=A2=E6=88=B7=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlantsRentalOrderController.java | 9 ++ .../domain/bo/PlantsPlanProductBo.java | 8 ++ .../domain/bo/PlantsRentalOrderBo.java | 10 ++ .../service/IPlantsRentalOrderService.java | 6 + .../impl/PlantsPlanProductServiceImpl.java | 2 + .../impl/PlantsProductServiceImpl.java | 31 ++++- .../impl/PlantsRentalOrderServiceImpl.java | 111 ++++++++++-------- .../impl/PlantsRentalPlanServiceImpl.java | 13 +- 8 files changed, 139 insertions(+), 51 deletions(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java index 25ff229c..ed12bc2f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/PlantsRentalOrderController.java @@ -153,6 +153,15 @@ public class PlantsRentalOrderController extends BaseController { return R.ok(plantsRentalOrderService.countOrderAndAmount()); } + /** + * 统计下单客户总数 + * @return + */ + @GetMapping("/countCustomers") + public R countCustomers(){ + return R.ok(plantsRentalOrderService.countCustomers()); + } + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java index 0590e093..9c23f0c8 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsPlanProductBo.java @@ -9,6 +9,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; +import java.util.List; + /** * 绿植租赁-租赁方案-绿植业务对象 plants_plan_product * @@ -44,4 +46,10 @@ public class PlantsPlanProductBo extends BaseEntity { private Integer productNum; + /** + * 产品id + */ + private List productIds; + + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java index b0b95ff1..c9f45144 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/PlantsRentalOrderBo.java @@ -127,4 +127,14 @@ public class PlantsRentalOrderBo extends BaseEntity { */ private List productList; + /** + * 产品id + */ + private List productIds; + + /** + * 方案id + */ + private List planIds; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java index bcf3c481..b59bfd42 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsRentalOrderService.java @@ -101,5 +101,11 @@ public interface IPlantsRentalOrderService { */ Map countOrderAndAmount(); + /** + * 统计下单客户总数 + * @return + */ + Map countCustomers(); + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java index d4649376..0ea6d4bd 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -76,6 +77,7 @@ public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService { lqw.orderByAsc(PlantsPlanProduct::getId); lqw.eq(bo.getPlanId() != null, PlantsPlanProduct::getPlanId, bo.getPlanId()); lqw.eq(bo.getProductId() != null, PlantsPlanProduct::getProductId, bo.getProductId()); + lqw.in(CollectionUtils.isNotEmpty(bo.getProductIds()), PlantsPlanProduct::getProductId, bo.getProductIds()); return lqw; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java index 07ed5f58..ce439764 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsProductServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -10,6 +11,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.bo.PlantsPlanProductBo; +import org.dromara.property.domain.bo.PlantsRentalOrderBo; +import org.dromara.property.domain.vo.PlantsPlanProductVo; +import org.dromara.property.domain.vo.PlantsRentalOrderVo; +import org.dromara.property.service.IPlantsPlanProductService; +import org.dromara.property.service.IPlantsRentalOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.PlantsProductBo; import org.dromara.property.domain.vo.PlantsProductVo; @@ -29,11 +38,17 @@ import java.util.Collection; * @date 2025-06-25 */ @Slf4j -@RequiredArgsConstructor @Service public class PlantsProductServiceImpl implements IPlantsProductService { - private final PlantsProductMapper baseMapper; + @Autowired + private PlantsProductMapper baseMapper; + @Autowired + @Lazy + private IPlantsRentalOrderService rentalOrderService; + @Autowired + @Lazy + private IPlantsPlanProductService planProductService; /** * 查询绿植租赁-绿植产品 @@ -123,7 +138,7 @@ public class PlantsProductServiceImpl implements IPlantsProductService { * 保存前的数据校验 */ private void validEntityBeforeSave(PlantsProduct entity) { - //TODO 做一些数据校验,如唯一约束 + } /** @@ -136,7 +151,15 @@ public class PlantsProductServiceImpl implements IPlantsProductService { @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if (isValid) { - //TODO 做一些业务上的校验,判断是否需要校验 + PlantsRentalOrderBo order = new PlantsRentalOrderBo(); + order.setProductIds(ids.stream().toList()); + List orderVos = rentalOrderService.queryList(order); + PlantsPlanProductBo plantsPlanProductBo = new PlantsPlanProductBo(); + plantsPlanProductBo.setProductIds(ids.stream().toList()); + List planProductVos = planProductService.queryList(plantsPlanProductBo); + if(CollectionUtils.isNotEmpty(orderVos)||CollectionUtils.isNotEmpty(planProductVos)){ + throw new ServiceException("当前选中绿植产品不可删除。"); + } } return baseMapper.deleteByIds(ids) > 0; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java index 136bfc1e..dd287c4b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalOrderServiceImpl.java @@ -9,9 +9,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.dromara.property.domain.PlantsProduct; import org.dromara.property.domain.bo.PlantsOrderChargeBo; import org.dromara.property.domain.bo.PlantsOrderMaintainBo; import org.dromara.property.domain.bo.PlantsProductBo; @@ -19,6 +17,8 @@ import org.dromara.property.domain.vo.*; import org.dromara.property.service.*; import org.dromara.system.api.RemoteDictService; import org.dromara.system.api.domain.vo.RemoteDictDataVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.PlantsRentalOrderBo; import org.dromara.property.domain.PlantsRentalOrder; @@ -34,21 +34,24 @@ import java.util.*; * @date 2025-06-30 */ @Slf4j -@RequiredArgsConstructor @Service public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { - private final PlantsRentalOrderMapper baseMapper; - - private final RemoteDictService dictService; - - private final IPlantsProductService productService; - - private final IPlantsPlanProductService planProductService; - -// private final IPlantsOrderMaintainService maintainService; -// -// private final IPlantsOrderChargeService chargeService; + @Autowired + private PlantsRentalOrderMapper baseMapper; + @Autowired + private RemoteDictService dictService; + @Autowired + private IPlantsProductService productService; + @Autowired + @Lazy + private IPlantsPlanProductService planProductService; + @Autowired + @Lazy + private IPlantsOrderMaintainService maintainService; + @Autowired + @Lazy + private IPlantsOrderChargeService chargeService; /** * 查询绿植租赁-订单管理 @@ -121,6 +124,8 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { lqw.eq(bo.getIsRelet() != null, PlantsRentalOrder::getIsRelet, bo.getIsRelet()); lqw.eq(bo.getContractStatus() != null, PlantsRentalOrder::getContractStatus, bo.getContractStatus()); lqw.eq(bo.getSignTime() != null, PlantsRentalOrder::getSignTime, bo.getSignTime()); + lqw.in(CollectionUtils.isNotEmpty(bo.getProductIds()),PlantsRentalOrder::getProductId,bo.getProductIds()); + lqw.in(CollectionUtils.isNotEmpty(bo.getPlanIds()),PlantsRentalOrder::getPlanId,bo.getPlanIds()); return lqw; } @@ -191,38 +196,38 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if (isValid) { //有订单收费或订单维护数据不可删除 -// PlantsOrderChargeBo chargeBo = new PlantsOrderChargeBo(); -// chargeBo.setOrderIds(ids.stream().toList()); -// List chargeList = chargeService.queryList(chargeBo); -// PlantsOrderMaintainBo maintainBo = new PlantsOrderMaintainBo(); -// maintainBo.setOrderIds(ids.stream().toList()); -// List maintainList = maintainService.queryList(maintainBo); -// if(CollectionUtils.isNotEmpty(maintainList)||CollectionUtils.isNotEmpty(chargeList)){ -// throw new ServiceException("所选订单不可删除"); -// }else { -// //恢复产品库存 -// ArrayList productList = new ArrayList<>(); -// for (Long id : ids) { -// PlantsRentalOrder order = baseMapper.selectById(id); -// if("1".equals(order.getRentalType())){ -// Long productId = order.getProductId(); -// Integer productNum = order.getProductNum(); -// productList.add(new PlantsProductBo(productId,productNum)); -// }else { -// Long planId = order.getPlanId(); -// List planProductVos = planProductService.queryPlanProductsInfo(planId); -// for (PlantsPlanProductVo planProductVo : planProductVos) { -// productList.add(new PlantsProductBo(planProductVo.getProductId(),planProductVo.getProductNum())); -// } -// } -// } -// if(CollectionUtils.isNotEmpty(productList)){ -// Boolean b = productService.addStock(productList); -// if(!b){ -// throw new ServiceException("删除订单失败。"); -// } -// } -// } + PlantsOrderChargeBo chargeBo = new PlantsOrderChargeBo(); + chargeBo.setOrderIds(ids.stream().toList()); + List chargeList = chargeService.queryList(chargeBo); + PlantsOrderMaintainBo maintainBo = new PlantsOrderMaintainBo(); + maintainBo.setOrderIds(ids.stream().toList()); + List maintainList = maintainService.queryList(maintainBo); + if(CollectionUtils.isNotEmpty(maintainList)||CollectionUtils.isNotEmpty(chargeList)){ + throw new ServiceException("所选订单不可删除"); + }else { + //恢复产品库存 + ArrayList productList = new ArrayList<>(); + for (Long id : ids) { + PlantsRentalOrder order = baseMapper.selectById(id); + if("1".equals(order.getRentalType())){ + Long productId = order.getProductId(); + Integer productNum = order.getProductNum(); + productList.add(new PlantsProductBo(productId,productNum)); + }else { + Long planId = order.getPlanId(); + List planProductVos = planProductService.queryPlanProductsInfo(planId); + for (PlantsPlanProductVo planProductVo : planProductVos) { + productList.add(new PlantsProductBo(planProductVo.getProductId(),planProductVo.getProductNum())); + } + } + } + if(CollectionUtils.isNotEmpty(productList)){ + Boolean b = productService.addStock(productList); + if(!b){ + throw new ServiceException("删除订单失败。"); + } + } + } } return baseMapper.deleteByIds(ids) > 0; } @@ -393,4 +398,18 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService { public Map countOrderAndAmount() { return baseMapper.countOrderAndAmount(); } + + + /** + * 统计下单客户总数 + * @return + */ + @Override + public Map countCustomers() { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.groupBy(PlantsRentalOrder::getCustomerName); + Map map = new HashMap<>(); + map.put("count",baseMapper.selectVoList(lqw).size()); + return map; + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java index 9cddaa37..d63c6278 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.property.service.impl; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -12,9 +13,12 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.dromara.property.domain.PlantsPlanProduct; import org.dromara.property.domain.bo.PlantsPlanProductBo; +import org.dromara.property.domain.bo.PlantsRentalOrderBo; import org.dromara.property.domain.vo.PlantsPlanProductVo; +import org.dromara.property.domain.vo.PlantsRentalOrderVo; import org.dromara.property.service.IPlantsPlanProductService; import org.dromara.property.service.IPlantsProductService; +import org.dromara.property.service.IPlantsRentalOrderService; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.PlantsRentalPlanBo; import org.dromara.property.domain.vo.PlantsRentalPlanVo; @@ -39,6 +43,8 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { private final IPlantsPlanProductService planProductService; + private final IPlantsRentalOrderService rentalOrderService; + /** * 查询绿植租赁-租赁方案 * @@ -162,7 +168,12 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if(isValid){ - //TODO 做一些业务上的校验,判断是否需要校验 + PlantsRentalOrderBo plantsRentalOrderBo = new PlantsRentalOrderBo(); + plantsRentalOrderBo.setPlanIds(ids.stream().toList()); + List plantsRentalOrderVos = rentalOrderService.queryList(plantsRentalOrderBo); + if(CollectionUtils.isNotEmpty(plantsRentalOrderVos)){ + throw new ServiceException("当前选中租赁方案不可删除"); + } } return baseMapper.deleteByIds(ids) > 0; }