diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java index 3a8d3beb..4e83e415 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java @@ -13,6 +13,7 @@ import org.dromara.common.web.core.BaseController; import org.dromara.property.domain.bo.ServiceWorkOrdersBo; import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo; import org.dromara.property.domain.vo.ServiceWorkOrdersVo; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo; import org.dromara.property.service.IServiceWorkOrdersService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -35,7 +36,6 @@ public class MServiceWorkOrdersController extends BaseController { * 小程序新增【工单处理】 */ @Log(title = "【小程序新增工单处理】", businessType = BusinessType.INSERT) - @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody MServiceWorkOrdersBo bo) { return toAjax(serviceWorkOrdersService.insertMServiceWorkOrdersBo(bo)); @@ -44,7 +44,7 @@ public class MServiceWorkOrdersController extends BaseController { * 小程序查询【工单处理】 */ @GetMapping("/list") - public TableDataInfo list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { + public TableDataInfo list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { return serviceWorkOrdersService.queryMobilePageList(bo, pageQuery); } /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java index 68cafea7..416643ab 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java @@ -107,10 +107,6 @@ public class ServiceWorkOrdersBo extends BaseEntity { * 图片 */ private String imgUrl; - /** - * 工单图片 - */ - private String orderImgUrl; /** * 备注 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java index d1e8799d..fcac6c8b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java @@ -105,6 +105,10 @@ public class MServiceWorkOrdersBo extends BaseEntity { * 工单图片 */ private String orderImgUrl; + /** + * 问题描述 + */ + private String issueDesc; /** * 备注 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/ChargeTypeEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/ChargeTypeEnum.java new file mode 100644 index 00000000..b54c9402 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/ChargeTypeEnum.java @@ -0,0 +1,30 @@ +package org.dromara.property.domain.enums; + +/** + * 收费类型枚举 + */ +public enum ChargeTypeEnum { + /** + * 房屋收费 + */ + HOUS_CHARGES("房屋收费", "1"), + /** + * 车辆收费 + */ + CARD_CHARGES("车辆收费", "2"); + private final String name; + private final String value; + + ChargeTypeEnum(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/CostPayFeeAuditVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostPayFeeAuditVo.java index e7704979..45aabf19 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostPayFeeAuditVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostPayFeeAuditVo.java @@ -53,8 +53,12 @@ public class CostPayFeeAuditVo implements Serializable { /** * 房间号(如101,202) */ - @ExcelProperty(value = "房间号(如101,202)") + @ExcelProperty(value = "房间号") private String roomNumber; + /** + * 车牌号 + */ + private String carNumber; /** * 费用项目id diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java index ec5db7b3..5ab02bee 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java @@ -146,6 +146,7 @@ public class ServiceWorkOrdersVo implements Serializable { * 图片 */ private String imgUrl; + /** * 备注 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersRecordVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersRecordVo.java new file mode 100644 index 00000000..ff858da1 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersRecordVo.java @@ -0,0 +1,61 @@ +package org.dromara.property.domain.vo.mobile; + + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.property.domain.ServiceWorkOrdersRecord; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * @author yuyongle + * @version 1.0 + * @description: TODO + * @date 2025/8/26 13:53 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ServiceWorkOrdersRecord.class) +public class MServiceWorkOrdersRecordVo implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 工单id + */ + @ExcelProperty(value = "工单id") + private String orderId; + + /** + * 状态(0创建工单,1已派单2已抢单3处理中,4已完成) + */ + @ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成)") + private String status; + + /** + * 处理人 + */ + @ExcelProperty(value = "处理人") + private Long handler; + /** + * 处理人 + */ + @ExcelProperty(value = "处理人") + private String handlerName; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersVo.java new file mode 100644 index 00000000..cb4a5d53 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersVo.java @@ -0,0 +1,166 @@ +package org.dromara.property.domain.vo.mobile; + + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.property.domain.ServiceWorkOrders; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author yuyongle + * @version 1.0 + * @description: TODO + * @date 2025/8/26 13:52 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ServiceWorkOrders.class) +public class MServiceWorkOrdersVo implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 工单编号 + */ + @ExcelProperty(value = "工单编号") + private String orderNo; + /** + * 权重 + */ + @ExcelProperty(value = "权重") + private String processingWeight; + + /** + * 工单名称 + */ + @ExcelProperty(value = "工单名称") + private String orderName; + + /** + * 工单类型 + */ + @ExcelProperty(value = "工单类型") + private Long type; + /** + * 上报类型 + */ + private String reportingType; + /** + * 工单类型名称 + */ + @ExcelProperty(value = "工单类型名称") + private String typeName; + + /** + * 状态 + */ + @ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成,5已评价)") + private String status; + + /** + * 派单时间 + */ + @ExcelProperty(value = "派单时间") + private Date dispatchTime; + /** + * 运作模式(0派单+抢单,1派单,2自动派单) + */ + private String operationMode; + /** + * 发起人 + */ + private String initiatorPeople; + + /** + * 处理人姓名 + */ + private long handler; + /** + * 抄送人 + */ + private long ccPeople; + /** + * 发起人手机号 + */ + @ExcelProperty(value = "发起人手机号") + private String initiatorPhone; + /** + * 处理人姓名文本 + */ + @ExcelProperty(value = "处理人姓名文本") + private String handlerText; + + /** + * 处理人姓名文本 + */ + @ExcelProperty(value = "处理人电话") + private String handlerPhone; + + /** + * 地址 + */ + @ExcelProperty(value = "地址") + private String location; + + /** + * 计划完成时间 + */ + @ExcelProperty(value = "计划完成时间") + private Date planCompleTime; + + /** + * 完成时间 + */ + @ExcelProperty(value = "完成时间") + private Date compleTime; + + /** + * 评价 + */ + @ExcelProperty(value = "评价") + private Integer serviceEvalua; + + /** + * 是否超时 + */ + @ExcelProperty(value = "是否超时") + private String isTimeOut; + + /** + * 评价文本 + */ + private String serviceEvaluaText; + /** + * 工单图片 + */ + private String orderImgUrl; + /** + * 图片 + */ + private String imgUrl; + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + /** + * 工单记录 + */ + List recordVoList; +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java index 44f2a5bb..c933d2c8 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java @@ -17,6 +17,7 @@ import java.util.List; public interface PlantsPlanProductMapper extends BaseMapperPlus { void deleteByPlanId(Long planId); + void deleteByPlanIds(List planIds); List queryProductsInfo(Long planId); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java index d7a72d32..50015766 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java @@ -67,6 +67,12 @@ public interface IPlantsPlanProductService { */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + /** + * 根据方案id删除方案产品 + * @param ids + */ + void deleteByPlanIds(List ids); + /** * 批量保存租赁方案植物 * diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java index b5129f58..a9707a0c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java @@ -8,6 +8,7 @@ import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo; import org.dromara.property.domain.vo.ServiceWorkOrderAnalysisVo; import org.dromara.property.domain.vo.ServiceWorkOrdersInfoVo; import org.dromara.property.domain.vo.ServiceWorkOrdersVo; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo; import java.util.Collection; import java.util.List; @@ -101,5 +102,5 @@ public interface IServiceWorkOrdersService { * @param pageQuery 分页参数 * @return 【工单处理】分页列表 */ - TableDataInfo queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery); + TableDataInfo queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java index ca8efbed..993f144f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java @@ -81,8 +81,9 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService { Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); // List residentPersonIdList = result.getRecords().stream().map(vo -> vo.getPersonId()).distinct().collect(Collectors.toList()); // List remoteUserVos = remoteUserService.selectListByIds(residentPersonIdList); + List residentPeoplelist = residentPersonMapper.selectList(); - List roomNames = roomService.queryRoomNameList(idList); +// List roomNames = roomService.queryRoomNameList(idList); result.getRecords().stream().forEach(s -> { if (CollUtil.isNotEmpty(residentPeoplelist)) { ResidentPerson residentPerson = residentPeoplelist.stream() diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java index 807db09b..c2875629 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java @@ -18,6 +18,7 @@ import org.dromara.property.domain.CostHouseCharge; import org.dromara.property.domain.CostPayFeeAudit; import org.dromara.property.domain.bo.CostPayFeeAuditBo; import org.dromara.property.domain.enums.ChargeStatusEnum; +import org.dromara.property.domain.enums.ChargeTypeEnum; import org.dromara.property.domain.vo.*; import org.dromara.property.mapper.*; import org.dromara.property.service.ICostPayFeeAuditService; @@ -59,7 +60,18 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { CostItemsVo costItemsVo = costItemsMapper.selectVoById(costPayFeeAuditVo.getItemId()); costPayFeeAuditVo.setChargeItem(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeItem() : null); costPayFeeAuditVo.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null); - //TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId()); + if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) { + CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(costPayFeeAuditVo.getChargeId()); + if (ObjectUtil.isNotEmpty(costHouseCharge)) { + String queryRoomName = roomMapper.queryRoomName(costHouseCharge.getRoomId()); + costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(queryRoomName) ? queryRoomName : null); + } + } + if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) { + CostCarCharge costCarCharge = costCarChargeMapper.selectById(costPayFeeAuditVo.getChargeId()); + costPayFeeAuditVo.setCarNumber(ObjectUtil.isNotEmpty(costCarCharge) ? costCarCharge.getCarNumber() : null); + } + // TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId()); //costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(roomVo)? roomVo.getRoomNumber() :null ); return costPayFeeAuditVo; } @@ -175,13 +187,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { private void validEntityBeforeUpdate(CostPayFeeAudit entity) { //TODO 做一些数据校验,如唯一约束 if (entity.getState().equals("1")) { - if (entity.getChargeType().equals("1")) { + if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) { CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项不存在!"); costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_WAS_APPROVED.getValue()); coinHouseChargeMapper.updateById(costHouseCharge); } - if (entity.getChargeType().equals("2")) { + if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) { CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空"); @@ -190,13 +202,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { } } if (entity.getState().equals("2")) { - if (entity.getChargeType().equals("1")) { + if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) { CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项为空"); costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue()); coinHouseChargeMapper.updateById(costHouseCharge); } - if (entity.getChargeType().equals("2")) { + if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) { CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空"); costCarCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue()); 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 e523081d..39f4e93b 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 @@ -85,11 +85,13 @@ public class MeetBookingServiceImpl implements IMeetBookingService { public TableDataInfo queryPageList(MeetBookingBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + List meetBookingVoList = new ArrayList<>(); + if(CollUtil.isNotEmpty(result.getRecords())){ List residentUnitVolist = residentUnitMapper.selectVoList(); List userId = result.getRecords().stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList()); List remoteUserVos = residentPersonMapper.selectVoByIds(userId); // List remoteUserVos = remoteUserService.selectListByIds(userId); - List meetBookingVoList = new ArrayList<>(); + result.getRecords().stream().forEach(s -> { if (CollUtil.isNotEmpty(residentUnitVolist)) { ResidentUnitVo residentUnitVo = residentUnitVolist.stream() @@ -104,6 +106,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService { } meetBookingVoList.add(s); }); + } return TableDataInfo.build(new Page().setRecords(meetBookingVoList).setTotal(result.getTotal())); } 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 1f6eacf5..56a6e119 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 @@ -1,8 +1,10 @@ package org.dromara.property.service.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import org.apache.dubbo.config.annotation.DubboReference; +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,11 +14,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.MeetAttach; import org.dromara.property.domain.MeetBooking; +import org.dromara.property.domain.vo.MeetAttachVo; import org.dromara.property.domain.vo.ResidentPersonVo; -import org.dromara.property.mapper.MeetBookingMapper; -import org.dromara.property.mapper.ResidentPersonMapper; -import org.dromara.property.mapper.TbRoomMapper; +import org.dromara.property.mapper.*; import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.vo.RemoteUserVo; import org.springframework.stereotype.Service; @@ -24,7 +26,6 @@ import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.MeetBo; import org.dromara.property.domain.vo.MeetVo; import org.dromara.property.domain.Meet; -import org.dromara.property.mapper.MeetMapper; import org.dromara.property.service.IMeetService; import org.springframework.transaction.annotation.Transactional; @@ -48,6 +49,7 @@ import java.util.stream.Collectors; public class MeetServiceImpl implements IMeetService { private final MeetMapper baseMapper; + private final MeetAttachMapper meetAttachMapper; private final ResidentPersonMapper residentPersonMapper; private final TbRoomMapper roomMapper; private final MeetBookingMapper meetbookMapper; @@ -63,7 +65,7 @@ public class MeetServiceImpl implements IMeetService { @Override public MeetVo queryById(Long id) { MeetVo meetVo = baseMapper.selectVoById(id); - // ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); + // ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); // if(ObjectUtil.isNotEmpty(residentPersonVo)){ // meetVo.setPrincipalsName(residentPersonVo.getUserName()); // meetVo.setPhoneNo(residentPersonVo.getPhone()); @@ -216,6 +218,10 @@ public class MeetServiceImpl implements IMeetService { public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 + boolean exists = meetAttachMapper.exists(new LambdaQueryWrapper().in(MeetAttach::getMeetId, ids)); + Assert.isTrue(!exists, "会议室具有增值服务,不允许单独删除"); + boolean meetbookExists = meetbookMapper.exists(new LambdaQueryWrapper().in(MeetBooking::getMeetId, ids)); + Assert.isTrue(!meetbookExists, "会议室具有预约记录,不允许单独删除"); } return baseMapper.deleteByIds(ids) > 0; } 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 0ea6d4bd..1d6f5474 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 @@ -159,6 +159,7 @@ public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService { /** * 查询租赁方案植物数据 + * * @param planId * @return */ @@ -166,4 +167,17 @@ public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService { public List queryPlanProductsInfo(Long planId) { return baseMapper.queryProductsInfo(planId); } + + /** + * 根据方案id删除方案产品 + * + * @param ids 方案id + * @return + */ + @Override + public void deleteByPlanIds(List ids) { + if (CollectionUtils.isNotEmpty(ids)) { + baseMapper.deleteByPlanIds(ids); + } + } } 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 d63c6278..a4947964 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 @@ -25,6 +25,7 @@ import org.dromara.property.domain.vo.PlantsRentalPlanVo; import org.dromara.property.domain.PlantsRentalPlan; import org.dromara.property.mapper.PlantsRentalPlanMapper; import org.dromara.property.service.IPlantsRentalPlanService; +import org.springframework.transaction.annotation.Transactional; import java.util.*; @@ -166,6 +167,7 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { * @return 是否删除成功 */ @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if(isValid){ PlantsRentalOrderBo plantsRentalOrderBo = new PlantsRentalOrderBo(); @@ -174,6 +176,8 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { if(CollectionUtils.isNotEmpty(plantsRentalOrderVos)){ throw new ServiceException("当前选中租赁方案不可删除"); } + //删除方案产品数据 + planProductService.deleteByPlanIds(ids.stream().toList()); } return baseMapper.deleteByIds(ids) > 0; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java index af6440aa..543061ac 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java @@ -26,6 +26,8 @@ import org.dromara.property.domain.enums.OrderReportingTypeEnum; import org.dromara.property.domain.enums.OrderTypeOperationEnum; import org.dromara.property.domain.enums.WorkOrderStatusEnum; import org.dromara.property.domain.vo.*; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersRecordVo; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo; import org.dromara.property.mapper.ResidentPersonMapper; import org.dromara.property.mapper.ServiceWorkOrdersMapper; import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper; @@ -119,23 +121,20 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { public TableDataInfo queryPageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - if (ObjectUtil.isEmpty(result.getRecords())) { - return TableDataInfo.build(result); + if (ObjectUtil.isNotEmpty(result.getRecords())) { + List typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList()); + List serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList); + if (ObjectUtil.isNotEmpty(serviceWorkOrdersTypeVoList)) { + List serviceWorkOrdersVoList = new ArrayList<>(); + result.getRecords().stream().forEach(s -> { + ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = serviceWorkOrdersTypeVoList.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getType())).findFirst().orElse(null); + s.setTypeName(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOrderTypeName() : null); + s.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null); + serviceWorkOrdersVoList.add(s); + }); + } } - List typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList()); - List serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList); - if (ObjectUtil.isEmpty(serviceWorkOrdersTypeVoList)) { - return TableDataInfo.build(result); - } - List serviceWorkOrdersVoList = new ArrayList<>(); - result.getRecords().stream().forEach(s -> { - ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = serviceWorkOrdersTypeVoList.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getType())).findFirst().orElse(null); - - s.setTypeName(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOrderTypeName() : null); - s.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null); - serviceWorkOrdersVoList.add(s); - }); - return TableDataInfo.build(new Page().setRecords(serviceWorkOrdersVoList).setTotal(result.getTotal())); + return TableDataInfo.build(result); } /** @@ -246,14 +245,14 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { .ge(AttendanceUserGroup::getEndDate, today) .orderByAsc(AttendanceUserGroup::getCreateTime) ); - Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups),"暂无排班人员"); + Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups), "暂无排班人员"); // 缓存当天排班数据(假设当天不会变) - RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups); + RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups); } // 2. 获取并更新轮询索引(原子性很重要) int currentIndex; - Integer lastScheduleId = RedisUtils.getCacheObject(DateUtil.today()+"LastScheduleId"); + Integer lastScheduleId = RedisUtils.getCacheObject(DateUtil.today() + "LastScheduleId"); if (lastScheduleId == null || lastScheduleId < 0 || lastScheduleId >= attendanceUserGroups.size()) { currentIndex = 0; // 越界或未设置,重置为0 } else { @@ -262,7 +261,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { currentIndex = 0; // 循环轮询 } } - RedisUtils.setCacheObject(DateUtil.today()+"LastScheduleId", currentIndex); + RedisUtils.setCacheObject(DateUtil.today() + "LastScheduleId", currentIndex); // 3. 分配处理人 AttendanceUserGroup assignedGroup = attendanceUserGroups.get(currentIndex); @@ -631,30 +630,66 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { * @return 【工单处理】分页列表 */ @Override - public TableDataInfo queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) { - - //当前登录用户 + public TableDataInfo queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) { + // 当前登录用户 LoginUser loginUser = LoginHelper.getLoginUser(); if (!LoginHelper.isSuperAdmin(loginUser.getUserId())) { bo.setHandler(loginUser.getUserId()); } LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - if (ObjectUtil.isEmpty(result.getRecords())) { - return TableDataInfo.build(result); - } - List typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList()); - List serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList); - if (ObjectUtil.isEmpty(serviceWorkOrdersTypeVoList)) { - return TableDataInfo.build(result); - } - List serviceWorkOrdersVoList = new ArrayList<>(); - result.getRecords().stream().forEach(s -> { - ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = serviceWorkOrdersTypeVoList.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getType())).findFirst().orElse(null); - s.setTypeName(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOrderTypeName() : null); - serviceWorkOrdersVoList.add(s); - }); - return TableDataInfo.build(new Page().setRecords(serviceWorkOrdersVoList).setTotal(result.getTotal())); + // 转换 VO 类型 + List mServiceWorkOrdersVos = new ArrayList<>(); + if (CollUtil.isNotEmpty(result.getRecords())) { + List typeList = result.getRecords().stream() + .map(ServiceWorkOrdersVo::getType) + .distinct() + .collect(Collectors.toList()); + + List typeVoList = typesMapper.selectVoByIds(typeList); + Map typeMap = typeVoList.stream() + .collect(Collectors.toMap(ServiceWorkOrdersTypeVo::getId, ServiceWorkOrdersTypeVo::getOrderTypeName, (a, b) -> a)); + //收集处理人转化成list + List handlerIdList = result.getRecords().stream().map(ServiceWorkOrdersVo::getHandler) + .distinct() + .collect(Collectors.toList()); + List remoteUserVos = remoteUserService.selectListByIds(handlerIdList); + // 转换并设置 typeName + mServiceWorkOrdersVos = result.getRecords().stream().map(vo -> { + MServiceWorkOrdersVo mVo = BeanUtil.copyProperties(vo, MServiceWorkOrdersVo.class); + dataProcessing(mVo, typeMap, remoteUserVos); + return mVo; + }).collect(Collectors.toList()); + } + // 构建分页结果 + Page pageResult = new Page<>(); + pageResult.setRecords(mServiceWorkOrdersVos); + pageResult.setTotal(result.getTotal()); + pageResult.setCurrent(result.getCurrent()); + pageResult.setSize(result.getSize()); + return TableDataInfo.build(pageResult); + } + + /** + * 处理数据 + * + * @param mServiceWorkOrdersVo + */ + private void dataProcessing(MServiceWorkOrdersVo mServiceWorkOrdersVo, Map typeMap, List remoteUserVos) { + mServiceWorkOrdersVo.setTypeName(typeMap.getOrDefault(mServiceWorkOrdersVo.getType(), null)); + //通过处理人id查询处理人信息 + RemoteUserVo remoteUserVo = remoteUserVos.stream().filter(user -> user.getUserId().equals(mServiceWorkOrdersVo.getHandler())).findFirst().orElse(null); + mServiceWorkOrdersVo.setHandlerPhone(remoteUserVo != null ? remoteUserVo.getPhonenumber() : null); + mServiceWorkOrdersVo.setHandlerText(remoteUserVo != null ? remoteUserVo.getNickName() : null); + //查询工单处理记录 + List serviceWorkOrdersRecordVoList = workOrdersRecordMapper.selectVoList(new LambdaQueryWrapper().eq(ServiceWorkOrdersRecord::getOrderId, mServiceWorkOrdersVo.getId())); + if (CollUtil.isNotEmpty(serviceWorkOrdersRecordVoList)) { + List mServiceWorkOrdersRecordVos = BeanUtil.copyToList(serviceWorkOrdersRecordVoList, MServiceWorkOrdersRecordVo.class); + mServiceWorkOrdersRecordVos.stream().forEach(workOrdersRecordVo -> { + workOrdersRecordVo.setHandlerName(Objects.nonNull(remoteUserVo) ? remoteUserVo.getNickName() : null); + }); + mServiceWorkOrdersVo.setRecordVoList(mServiceWorkOrdersRecordVos); + } } } 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 f46532f8..d07caa86 100644 --- a/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml +++ b/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml @@ -26,6 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from plants_plan_product p where p.plan_id=#{planId} + + delete from plants_plan_product p where p.plan_id in + + #{planId} + + +