From 8340f5cf6ada2bfa6fb4fb5d9708db5716086d42 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Fri, 22 Aug 2025 20:03:34 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=BC=9A?= =?UTF-8?q?=E8=AE=AE=E5=AE=A4=E7=AD=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionRouteController.java | 12 +++--- .../controller/MeetAttachController.java | 10 ++--- .../TbVisitorManagementController.java | 2 +- .../mobile/MServiceWorkOrdersController.java | 2 +- .../property/domain/vo/CostHouseChargeVo.java | 4 ++ .../property/domain/vo/InspectionPointVo.java | 2 +- .../service/IServiceWorkOrdersService.java | 8 ++++ .../impl/CostCarChargeServiceImpl.java | 20 ++++++---- .../impl/CostHouseChargeServiceImpl.java | 16 ++++++-- .../impl/CustomerFeedbacksServiceImpl.java | 36 +++++++++-------- .../impl/InspectionPointServiceImpl.java | 12 +++++- .../service/impl/MeetBookingServiceImpl.java | 2 +- .../impl/ServiceWorkOrdersServiceImpl.java | 39 ++++++++++++++++--- 13 files changed, 114 insertions(+), 51 deletions(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java index 14b01122..81d91396 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java @@ -40,7 +40,7 @@ public class InspectionRouteController extends BaseController { /** * 查询巡检路线列表 */ - @SaCheckPermission("property:route:list") + @SaCheckPermission("property:inspectionRoute:list") @GetMapping("/list") public TableDataInfo list(InspectionRouteBo bo, PageQuery pageQuery) { return inspectionRouteService.queryPageList(bo, pageQuery); @@ -49,7 +49,7 @@ public class InspectionRouteController extends BaseController { /** * 导出巡检路线列表 */ - @SaCheckPermission("property:route:export") + @SaCheckPermission("property:inspectionRoute:export") @Log(title = "巡检路线", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(InspectionRouteBo bo, HttpServletResponse response) { @@ -62,7 +62,7 @@ public class InspectionRouteController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("property:route:query") + @SaCheckPermission("property:inspectionRoute:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { @@ -72,7 +72,7 @@ public class InspectionRouteController extends BaseController { /** * 新增巡检路线 */ - @SaCheckPermission("property:route:add") + @SaCheckPermission("property:inspectionRoute:add") @Log(title = "巡检路线", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() @@ -83,7 +83,7 @@ public class InspectionRouteController extends BaseController { /** * 修改巡检路线 */ - @SaCheckPermission("property:route:edit") + @SaCheckPermission("property:inspectionRoute:edit") @Log(title = "巡检路线", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() @@ -96,7 +96,7 @@ public class InspectionRouteController extends BaseController { * * @param ids 主键串 */ - @SaCheckPermission("property:route:remove") + @SaCheckPermission("property:inspectionRoute:remove") @Log(title = "巡检路线", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") 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 ffa91146..623d5ccd 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 @@ -40,7 +40,7 @@ public class MeetAttachController extends BaseController { /** * 查询分页会议室增值服务列表 */ - @SaCheckPermission("property:attach:list") + @SaCheckPermission("property:conferenceAddServices:list") @GetMapping("/list") public TableDataInfo pageList(MeetAttachBo bo, PageQuery pageQuery) { return meetAttachService.queryPageList(bo, pageQuery); @@ -57,7 +57,7 @@ public class MeetAttachController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("property:attach:query") + @SaCheckPermission("property:conferenceAddServices:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { @@ -67,7 +67,7 @@ public class MeetAttachController extends BaseController { /** * 新增会议室增值服务 */ - @SaCheckPermission("property:attach:add") + @SaCheckPermission("property:conferenceAddServices:add") @Log(title = "会议室增值服务", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() @@ -78,7 +78,7 @@ public class MeetAttachController extends BaseController { /** * 修改会议室增值服务 */ - @SaCheckPermission("property:attach:edit") + @SaCheckPermission("property:conferenceAddServices:edit") @Log(title = "会议室增值服务", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() @@ -91,7 +91,7 @@ public class MeetAttachController extends BaseController { * * @param ids 主键串 */ - @SaCheckPermission("property:attach:remove") + @SaCheckPermission("property:conferenceAddServices:remove") @Log(title = "会议室增值服务", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java index 71cbd677..8c520540 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java @@ -152,7 +152,7 @@ public class TbVisitorManagementController extends BaseController { /** * pc端新增访客管理 */ - @SaCheckPermission("property:visitorManagement::addVisitorManagement") + @SaCheckPermission("property:visitorManagement:addVisitorManagement") @Log(title = "访客管理", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping 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 4961fa12..3a8d3beb 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 @@ -45,7 +45,7 @@ public class MServiceWorkOrdersController extends BaseController { */ @GetMapping("/list") public TableDataInfo list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { - return serviceWorkOrdersService.queryPageList(bo, pageQuery); + return serviceWorkOrdersService.queryMobilePageList(bo, pageQuery); } /** * 修改【工单处理】 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java index 0cb4e6d5..29b63ee0 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java @@ -46,6 +46,10 @@ public class CostHouseChargeVo implements Serializable { * 业主 */ private Long personId; + /** + * 业主 + */ + private String personName; /** * 收费项目 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java index 1ed2899e..0c688eb7 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java @@ -41,7 +41,7 @@ public class InspectionPointVo implements Serializable { * 巡检项目id */ @ExcelProperty(value = "巡检项目id") - private Long itemName; + private String itemName; /** * 巡检点名称 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 c7ac8752..b5129f58 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 @@ -94,4 +94,12 @@ public interface IServiceWorkOrdersService { * @return */ List> getServiceWorkOrdersHandler(String type); + /** + * 分页查询【工单处理】列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 【工单处理】分页列表 + */ + 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 f7fd951d..7be26b05 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 @@ -1,5 +1,6 @@ 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 cn.hutool.core.util.RandomUtil; @@ -16,15 +17,13 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.property.domain.CostCarCharge; import org.dromara.property.domain.CostPayFeeAudit; import org.dromara.property.domain.CostReturnPayFee; +import org.dromara.property.domain.ResidentPerson; import org.dromara.property.domain.bo.CostCarChargeBo; import org.dromara.property.domain.bo.CostChargeReturnFeeBo; import org.dromara.property.domain.enums.ChargeStatusEnum; import org.dromara.property.domain.vo.CostCarChargeVo; import org.dromara.property.domain.vo.CostItemsVo; -import org.dromara.property.mapper.CostCarChargeMapper; -import org.dromara.property.mapper.CostItemsMapper; -import org.dromara.property.mapper.CostPayFeeAuditMapper; -import org.dromara.property.mapper.CostReturnPayFeeMapper; +import org.dromara.property.mapper.*; import org.dromara.property.service.ICostCarChargeService; import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.vo.RemoteUserVo; @@ -55,6 +54,7 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService { private final CostReturnPayFeeMapper costReturnPayFeeMapper; @DubboReference private RemoteUserService remoteUserService; + private final ResidentPersonMapper residentPersonMapper; /** @@ -79,11 +79,15 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService { public TableDataInfo queryPageList(CostCarChargeBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); 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 residentPersonIdList = result.getRecords().stream().map(vo -> vo.getPersonId()).distinct().collect(Collectors.toList()); +// List remoteUserVos = remoteUserService.selectListByIds(residentPersonIdList); + List residentPeoplelist = residentPersonMapper.selectList(); result.getRecords().stream().forEach(s -> { - RemoteUserVo remoteUserVo = remoteUserVos.stream().filter(vo -> vo.getUserId() != null && vo.getUserId().equals(s.getPersonId())).findFirst().orElse(null); - s.setPersonName(Objects.nonNull(remoteUserVo) ? remoteUserVo.getNickName() : null); + if (CollUtil.isNotEmpty(residentPeoplelist)) { + ResidentPerson residentPerson = residentPeoplelist.stream() + .filter(vo -> vo.getId() != null && vo.getId().equals(s.getPersonId())).findFirst().orElse(null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPerson)?residentPerson.getUserName():null); + } }); return TableDataInfo.build(result); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java index acadc285..76e391c5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.property.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.RandomUtil; @@ -16,6 +17,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.dromara.property.domain.CostPayFeeAudit; import org.dromara.property.domain.CostReturnPayFee; +import org.dromara.property.domain.ResidentPerson; import org.dromara.property.domain.bo.CostChargeReturnFeeBo; import org.dromara.property.domain.enums.ChargeStatusEnum; import org.dromara.property.domain.vo.*; @@ -67,9 +69,9 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { costHouseChargeDetailVo.setCostItemsVo(ObjectUtil.isNotEmpty(costItemsVo)?costItemsVo:null); TbRoomVo tbRoomVo = tbRoomMapper.selectVoById(costHouseChargeDetailVo.getRoomId()); costHouseChargeDetailVo.setRoomVo(ObjectUtil.isNotEmpty(tbRoomVo)?tbRoomVo:null); -// ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(costHouseChargeVo.getPersonId()); - RemoteUserVo userInfo = remoteUserService.getUserInfoById(costHouseChargeVo.getPersonId()); - costHouseChargeDetailVo.setPersonName(ObjectUtil.isNotEmpty(userInfo)?userInfo.getUserName():null); + ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(costHouseChargeVo.getPersonId()); + //RemoteUserVo userInfo = remoteUserService.getUserInfoById(costHouseChargeVo.getPersonId()); + costHouseChargeDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo)?residentPersonVo.getUserName():null); return costHouseChargeDetailVo; } @@ -83,7 +85,15 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { @Override public TableDataInfo queryPageList(CostHouseChargeBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); + List residentPeoplelist = residentPersonMapper.selectList(); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + result.getRecords().stream().forEach(s -> { + if (CollUtil.isNotEmpty(residentPeoplelist)) { + ResidentPerson residentPerson = residentPeoplelist.stream() + .filter(vo -> vo.getId() != null && vo.getId().equals(s.getPersonId())).findFirst().orElse(null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPerson)?residentPerson.getUserName():null); + } + }); return TableDataInfo.build(result); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java index b8ff931e..56b18650 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java @@ -64,10 +64,10 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { * @return 客户服务-意见反馈 */ @Override - public CustomerFeedbacksVo queryById(Long id){ + public CustomerFeedbacksVo queryById(Long id) { CustomerFeedbacksVo customerFeedbacksVo = baseMapper.selectVoById(id); ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(customerFeedbacksVo.getFeedbackType()); - customerFeedbacksVo.setFeedbackTypeName(StringUtils.isNotBlank(serviceWorkOrdersType.getOrderTypeName())?serviceWorkOrdersType.getOrderTypeName():null); + customerFeedbacksVo.setFeedbackTypeName(StringUtils.isNotBlank(serviceWorkOrdersType.getOrderTypeName()) ? serviceWorkOrdersType.getOrderTypeName() : null); String nikName = remoteUserService.selectNicknameById(customerFeedbacksVo.getFeedbackPersion()); customerFeedbacksVo.setFeedbackPersionName(nikName); return customerFeedbacksVo; @@ -100,28 +100,29 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { .collect(Collectors.toList()); List remoteUserVos = remoteUserService.selectListByIds(uerIds); result.getRecords().stream().forEach(s -> { - assembly(s,serviceWorkOrdersTypes,remoteUserVos); - }); + assembly(s, serviceWorkOrdersTypes, remoteUserVos); + }); } return TableDataInfo.build(result); } + /** * * @param customerFeedbacksVo 意见反馈返回信息 * */ - private void assembly(CustomerFeedbacksVo customerFeedbacksVo,List serviceWorkOrdersTypes,List remoteUserVos){ - - if(CollUtil.isNotEmpty(remoteUserVos)){ - RemoteUserVo remoteUserVo = remoteUserVos.stream() - .filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null); - customerFeedbacksVo.setFeedbackPersionName(StringUtils.isNotBlank(remoteUserVo.getNickName())?remoteUserVo.getNickName():null); - } + private void assembly(CustomerFeedbacksVo customerFeedbacksVo, List serviceWorkOrdersTypes, List remoteUserVos) { + if (CollUtil.isNotEmpty(remoteUserVos)) { + RemoteUserVo remoteUserVo = remoteUserVos.stream() + .filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null); + customerFeedbacksVo.setFeedbackPersionName(ObjectUtil.isNotNull(remoteUserVo) ? remoteUserVo.getNickName() : null); + } if (CollUtil.isNotEmpty(serviceWorkOrdersTypes)) { ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypes.stream().filter(vo -> vo.getId() != null && vo.getId().equals(customerFeedbacksVo.getFeedbackType())).findFirst().orElse(null); - customerFeedbacksVo.setFeedbackTypeName(StringUtils.isNotBlank(serviceWorkOrdersType.getOrderTypeName())?serviceWorkOrdersType.getOrderTypeName():null); + customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotNull(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null); } } + /** * 查询符合条件的客户服务-意见反馈列表 * @@ -179,22 +180,23 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(CustomerFeedbacksBo bo) { CustomerFeedbacks update = MapstructUtils.convert(bo, CustomerFeedbacks.class); - validEntityBeforeUpdate(update); + validEntityBeforeUpdate(update); return baseMapper.updateById(update) > 0; } /** * 保存前的数据校验 */ - private void validEntityBeforeSave(CustomerFeedbacks entity){ + private void validEntityBeforeSave(CustomerFeedbacks entity) { //TODO 做一些数据校验,如唯一约束 } + /** * 保存前的数据校验 */ - private void validEntityBeforeUpdate(CustomerFeedbacks entity){ + private void validEntityBeforeUpdate(CustomerFeedbacks entity) { //TODO 做一些数据校验,如唯一约束 - if(entity.getIsWorkOrder().equals("0")&& ObjectUtil.isEmpty(entity.getOrderId())){ + if (entity.getIsWorkOrder().equals("0") && ObjectUtil.isEmpty(entity.getOrderId())) { ServiceWorkOrders serviceWorkOrders = new ServiceWorkOrders(); serviceWorkOrders.setOrderName("意见反馈转工单"); LoginUser user = LoginHelper.getLoginUser(); @@ -226,7 +228,7 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { */ @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ + if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 } return baseMapper.deleteByIds(ids) > 0; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java index a7501f6f..710dcd6b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java @@ -12,8 +12,10 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.dromara.property.domain.InspectionPoint; import org.dromara.property.domain.bo.InspectionPointBo; +import org.dromara.property.domain.vo.InspectionItemVo; import org.dromara.property.domain.vo.InspectionPlanVo; import org.dromara.property.domain.vo.InspectionPointVo; +import org.dromara.property.mapper.InspectionItemMapper; import org.dromara.property.mapper.InspectionPlanMapper; import org.dromara.property.mapper.InspectionPointMapper; import org.dromara.property.service.IInspectionPointService; @@ -39,6 +41,7 @@ public class InspectionPointServiceImpl implements IInspectionPointService { private final InspectionPointMapper baseMapper; private final InspectionPlanMapper inspectionPlanMapper; + private final InspectionItemMapper inspectionItemMapper; /** * 查询巡检点 @@ -62,6 +65,8 @@ public class InspectionPointServiceImpl implements IInspectionPointService { public TableDataInfo queryPageList(InspectionPointBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + //收集巡检项目id + if (CollectionUtil.isEmpty(result.getRecords())) { return TableDataInfo.build(result); } @@ -69,8 +74,11 @@ public class InspectionPointServiceImpl implements IInspectionPointService { .map(vo -> vo.getItemId()) .distinct() .collect(Collectors.toList()); - List inspectionPlanVos = inspectionPlanMapper.selectVoByIds(itemIdList); - + List inspectionItemVos = inspectionItemMapper.selectVoByIds(itemIdList); + result.getRecords().stream().forEach(s->{ + InspectionItemVo inspectionItemVo = inspectionItemVos.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getItemId())).findFirst().orElse(null); + s.setItemName(inspectionItemVo.getItemName()); + }); return TableDataInfo.build(result); } 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 6ab9c33e..663e4992 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 @@ -134,7 +134,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService { if (CollUtil.isNotEmpty(residentUnitVolist)) { ResidentUnitVo residentUnitVo = residentUnitVolist.stream() .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null); - s.setUnitName(residentUnitVo.getName()); + s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo) ?residentUnitVo.getName():null); } if (CollUtil.isNotEmpty(remoteUserVos)) { RemoteUserVo remoteUserVo = remoteUserVos.stream() 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 77d4175a..ae95608a 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 @@ -108,12 +108,6 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { */ @Override public TableDataInfo queryPageList(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())) { @@ -550,5 +544,38 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { }; } + /** + * 分页查询【工单处理】列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 【工单处理】分页列表 + */ + @Override + 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())); + } } From 1b5204e6ed6ff62436b6f129818269374868aea0 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 22 Aug 2025 20:11:57 +0800 Subject: [PATCH 02/30] =?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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index 9a657a4b..b9089dbc 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -202,4 +202,8 @@ jobs: push: true cache-from: type=gha cache-to: type=gha,mode=max + -name: 重启服务 + run: | + kubectl rollout restart deployment sis -n smartparks + kubectl rollout restart deployment property -n smartparks From fb7e5c7e1922fbaa574cb4738e694e506a44ff34 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 22 Aug 2025 20:12:29 +0800 Subject: [PATCH 03/30] =?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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index b9089dbc..d634b349 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -202,8 +202,8 @@ jobs: push: true cache-from: type=gha cache-to: type=gha,mode=max - -name: 重启服务 - run: | + - name: 重启服务 + run: | kubectl rollout restart deployment sis -n smartparks kubectl rollout restart deployment property -n smartparks From a8dc8d99dfbe074e19793ca13d957bcefac25126 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 22 Aug 2025 20:13:25 +0800 Subject: [PATCH 04/30] =?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 | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index d634b349..731c640f 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -203,6 +203,7 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - name: 重启服务 + id: dockerfile-path run: | kubectl rollout restart deployment sis -n smartparks kubectl rollout restart deployment property -n smartparks From 953a545ba60df8da30104a8e4b673a18ec1fbb00 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 22 Aug 2025 20:26:28 +0800 Subject: [PATCH 05/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/mas?= =?UTF-8?q?ter.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/master.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitea/workflows/master.yml b/.gitea/workflows/master.yml index 9ca94237..fb8b52a3 100644 --- a/.gitea/workflows/master.yml +++ b/.gitea/workflows/master.yml @@ -87,3 +87,8 @@ jobs: echo "===== 清理操作 =====" docker system prune -f echo "===== 所有操作完成 ====" + + - name: 重启服务 + run: | + kubectl rollout restart deployment sis -n smartparks + kubectl rollout restart deployment property -n smartparks \ No newline at end of file From 1d8b948a13a54986efe79b93ff030d50fbdffb8f Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Fri, 22 Aug 2025 20:27:29 +0800 Subject: [PATCH 06/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/mas?= =?UTF-8?q?ter.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/master.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/master.yml b/.gitea/workflows/master.yml index fb8b52a3..f551cd7e 100644 --- a/.gitea/workflows/master.yml +++ b/.gitea/workflows/master.yml @@ -88,7 +88,7 @@ jobs: docker system prune -f echo "===== 所有操作完成 ====" - - name: 重启服务 - run: | - kubectl rollout restart deployment sis -n smartparks - kubectl rollout restart deployment property -n smartparks \ No newline at end of file + - name: 重启服务 + run: | + kubectl rollout restart deployment sis -n smartparks + kubectl rollout restart deployment property -n smartparks \ No newline at end of file From 63e5abc003b28a337a42e46e3a1ad0f9c04d04b6 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Fri, 22 Aug 2025 20:41:13 +0800 Subject: [PATCH 07/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=BC=9A?= =?UTF-8?q?=E8=AE=AE=E5=AE=A4=E7=AD=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/service/impl/InspectionPointServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java index 710dcd6b..ad4b399b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.property.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -77,7 +78,7 @@ public class InspectionPointServiceImpl implements IInspectionPointService { List inspectionItemVos = inspectionItemMapper.selectVoByIds(itemIdList); result.getRecords().stream().forEach(s->{ InspectionItemVo inspectionItemVo = inspectionItemVos.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getItemId())).findFirst().orElse(null); - s.setItemName(inspectionItemVo.getItemName()); + s.setItemName(ObjectUtil.isNotEmpty(inspectionItemVo)?inspectionItemVo.getItemName():null); }); return TableDataInfo.build(result); } From b022d3a68cdd15eb1b5b7f081f386e0f14988c0a Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Fri, 22 Aug 2025 20:52:39 +0800 Subject: [PATCH 08/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=BC=9A?= =?UTF-8?q?=E8=AE=AE=E5=AE=A4=E7=AD=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/property/service/impl/MeetBookingServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 663e4992..4e82e4c2 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 @@ -193,7 +193,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService { if (CollUtil.isNotEmpty(residentUnitVolist)) { ResidentUnitVo residentUnitVo = residentUnitVolist.stream() .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null); - s.setUnitName(residentUnitVo.getName()); + s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo)? residentUnitVo.getName():null); } if (CollUtil.isNotEmpty(remoteUserVos)) { RemoteUserVo remoteUserVo = remoteUserVos.stream() From 8966b52cc522862d54b48116f6c358da75e1c379 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Sat, 23 Aug 2025 13:52:58 +0800 Subject: [PATCH 09/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E6=96=B0=E5=A2=9E=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/service/impl/ServiceWorkOrdersServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 ae95608a..2d53d195 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 @@ -505,6 +505,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { ServiceWorkOrders add = MapstructUtils.convert(bo, ServiceWorkOrders.class); LoginUser user = LoginHelper.getLoginUser(); add.setOrderNo("GD" + IdUtil.getSnowflakeNextIdStr()); + add.setOrderName("工单名称"); add.setStatus("0"); add.setInitiatorPeople(user.getNickname()); validEntityBeforeSave(add); From 9eeca6f32e429101134b9b33470da6924d6e2d26 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Sat, 23 Aug 2025 15:27:13 +0800 Subject: [PATCH 10/30] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EnumFetcherServiceImpl.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) 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 5e0a865b..b5922ac5 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 @@ -7,11 +7,13 @@ import lombok.RequiredArgsConstructor; import org.apache.dubbo.config.annotation.DubboReference; import org.dromara.property.domain.AttendanceUserGroup; import org.dromara.property.domain.ServiceWorkOrdersType; +import org.dromara.property.domain.TbUnit; 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.mapper.ServiceWorkOrdersTypeMapper; +import org.dromara.property.mapper.TbUnitMapper; import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper; import org.dromara.property.service.*; import org.dromara.system.api.RemoteUserService; @@ -47,6 +49,7 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { @Autowired private ServiceWorkOrdersTypeMapper serviceWorkOrdersTypeMapper; @Autowired + private TbUnitMapper unitMapper; private AttendanceUserGroupMapper attendanceUserGroupMapper; @Override @@ -74,11 +77,29 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { return getAccount(new ArrayList<>()); case "getServiceWorkOrdersHandler": return serviceWorkOrdersService.getServiceWorkOrdersHandler(type); + case "getUnit": + return getUnit(); default: throw new IllegalArgumentException("Unknown type: " + type); } } + /** + * 获取单位枚举接口下拉 + * @return + */ + + private List> getUnit() { + List tbUnitList = unitMapper.selectList(); + return tbUnitList.stream() + .map(e -> { + Map map = new HashMap<>(); + map.put("value", e.getId()); + map.put("name", e.getUnitName()); + return map; + }) + .collect(Collectors.toList()); + } /** * 获取会议室状态枚举接口 From 5ec2a670499243c5f8610ee1492843672a2e63d5 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Sat, 23 Aug 2025 16:36:45 +0800 Subject: [PATCH 11/30] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/property/service/impl/EnumFetcherServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 b5922ac5..b10e19d8 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 @@ -50,6 +50,7 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { private ServiceWorkOrdersTypeMapper serviceWorkOrdersTypeMapper; @Autowired private TbUnitMapper unitMapper; + @Autowired private AttendanceUserGroupMapper attendanceUserGroupMapper; @Override From d3a1d16b8f7bfa7a83bd6e03bd1311a81a28ad25 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Sat, 23 Aug 2025 19:17:29 +0800 Subject: [PATCH 12/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=89=A9?= =?UTF-8?q?=E4=B8=9A=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cleanOrder/CleanOrderController.java | 2 +- .../org/dromara/property/domain/Meet.java | 5 +++ .../property/domain/bo/MeetBookingBo.java | 8 ++--- .../dromara/property/domain/vo/MeetVo.java | 4 +++ .../domain/vo/cleanOrderVo/CleanOrderVo.java | 5 +++ .../dromara/property/mapper/TbRoomMapper.java | 3 +- .../impl/InspectionPlanServiceImpl.java | 20 ++++++----- .../service/impl/MeetBookingServiceImpl.java | 36 +++++++++++-------- .../service/impl/MeetServiceImpl.java | 19 +++++----- .../cleanOrderImpl/CleanOrderServiceImpl.java | 14 +++++--- .../mapper/Property/TbRoomMapper.xml | 15 ++++---- 11 files changed, 80 insertions(+), 51 deletions(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java index 2d3f5a13..96ea5b21 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java @@ -40,7 +40,7 @@ public class CleanOrderController extends BaseController { /** * 查询保洁订单列表 */ - @SaCheckPermission("property:clean_order:list") + //@SaCheckPermission("property:clean_order:list") @GetMapping("/list") public TableDataInfo list(CleanOrderBo bo, PageQuery pageQuery) { return cleanOrderService.queryPageList(bo, pageQuery); 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 ebd38779..6567fad3 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 @@ -93,6 +93,11 @@ public class Meet extends TenantEntity { */ private String appointmentTime; + /** + * 图片 + */ + private String picture; + /** * 开放开始时段 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java index 9e1f7492..0512f2f3 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java @@ -67,7 +67,7 @@ public class MeetBookingBo extends BaseEntity { * 参会人数 */ @NotNull(message = "参会人数不能为空", groups = { AddGroup.class, EditGroup.class }) - private int personSum; + private Integer personSum; /** * 费用 @@ -78,17 +78,17 @@ public class MeetBookingBo extends BaseEntity { /** * 是否包含增值服务 */ - private int attach; + private Integer attach; /** * 支付状态 */ - private int payState; + private Integer payState; /** * 状态 */ - private int state; + private Integer state; /** 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 902cec12..b562928e 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 @@ -123,6 +123,10 @@ public class MeetVo implements Serializable { * 预约时间 */ private String appointmentTime; + /** + * 图片 + */ + private String picture; /** * (1免费2.付费,3面议) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java index e9bc10ac..c9e1762b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java @@ -38,6 +38,11 @@ public class CleanOrderVo implements Serializable { */ @ExcelProperty(value = "位置") private Long location; + /** + * 位置 + */ + @ExcelProperty(value = "位置") + private String locationName; /** * 面积 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java index bcb15a59..caae3fe6 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java @@ -1,6 +1,7 @@ package org.dromara.property.mapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.dromara.property.domain.TbRoom; import org.dromara.property.domain.vo.TbRoomVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; @@ -19,5 +20,5 @@ public interface TbRoomMapper extends BaseMapperPlus { //查询房间名称 String queryRoomName(Long roomId); - Map queryRoomNameList(List ids); + Map queryRoomNameList(@Param("ids") List ids); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java index c555a10d..9906ecc9 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java @@ -183,15 +183,17 @@ public class InspectionPlanServiceImpl implements IInspectionPlanService { */ private void validEntityBeforebo(Long id,InspectionPlanBo bo) { //TODO 做一些数据校验,如唯一约束 - Assert.isTrue(CollUtil.isNotEmpty(bo.getInspectionPlanStaffBoList()), "巡检人员不存在"); - QueryWrapper staffLambdaQueryWrapper = new QueryWrapper<>(); - staffLambdaQueryWrapper.eq("inspection_plan_id", id); - inspectionPlanStaffMapper.delete(staffLambdaQueryWrapper); - List inspectionPlanStaffBoList = bo.getInspectionPlanStaffBoList(); - inspectionPlanStaffBoList.stream().forEach(s->{ - s.setInspectionPlanId(id); - }); - inspectionPlanStaffMapper.insertBatch(BeanUtil.copyToList(inspectionPlanStaffBoList, InspectionPlanStaff.class)); + if(CollUtil.isNotEmpty(bo.getInspectionPlanStaffBoList())){ + QueryWrapper staffLambdaQueryWrapper = new QueryWrapper<>(); + staffLambdaQueryWrapper.eq("inspection_plan_id", id); + inspectionPlanStaffMapper.delete(staffLambdaQueryWrapper); + List inspectionPlanStaffBoList = bo.getInspectionPlanStaffBoList(); + inspectionPlanStaffBoList.stream().forEach(s->{ + s.setInspectionPlanId(id); + }); + inspectionPlanStaffMapper.insertBatch(BeanUtil.copyToList(inspectionPlanStaffBoList, InspectionPlanStaff.class)); + } + } /** 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 4e82e4c2..e523081d 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 @@ -65,9 +65,10 @@ public class MeetBookingServiceImpl implements IMeetBookingService { MeetVo meetVo = meetMapper.selectVoById(meetBookingDetailVo.getMeetId()); String locationName = roomMapper.queryRoomName(Long.valueOf(meetVo.getLocation())); meetBookingDetailVo.setLocationName(ObjectUtil.isNotEmpty(locationName) ? locationName : null); - RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetBookingVo.getPerson())); - meetBookingDetailVo.setPersonName(ObjectUtil.isNotEmpty(userInfo) ? userInfo.getNickName() : null); - meetBookingDetailVo.setPhone(ObjectUtil.isNotEmpty(userInfo) ? userInfo.getPhonenumber() : null); + //RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetBookingVo.getPerson())); + ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(Long.valueOf(meetBookingVo.getPerson())); + meetBookingDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); + meetBookingDetailVo.setPhone(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getPhone(): null); ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(Long.valueOf(meetBookingVo.getUnit())); meetBookingDetailVo.setUnitName(ObjectUtil.isNotNull(residentUnitVo) ? residentUnitVo.getName() : null); return meetBookingDetailVo; @@ -86,7 +87,8 @@ public class MeetBookingServiceImpl implements IMeetBookingService { Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); List residentUnitVolist = residentUnitMapper.selectVoList(); List userId = result.getRecords().stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList()); - List remoteUserVos = remoteUserService.selectListByIds(userId); + List remoteUserVos = residentPersonMapper.selectVoByIds(userId); + // List remoteUserVos = remoteUserService.selectListByIds(userId); List meetBookingVoList = new ArrayList<>(); result.getRecords().stream().forEach(s -> { if (CollUtil.isNotEmpty(residentUnitVolist)) { @@ -95,10 +97,10 @@ public class MeetBookingServiceImpl implements IMeetBookingService { s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null); } if (CollUtil.isNotEmpty(remoteUserVos)) { - RemoteUserVo remoteUserVo = remoteUserVos.stream() + ResidentPersonVo residentPersonVo = remoteUserVos.stream() .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null); - s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null); - s.setPhone(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getPhonenumber() : null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); + s.setPhone(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getPhone() : null); } meetBookingVoList.add(s); }); @@ -118,6 +120,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService { LocalDateTime startOfDay = date.atStartOfDay(); LocalDateTime endOfDay = date.atTime(LocalTime.MAX); meetBookingLambdaQueryWrapper + .eq(MeetBooking::getState,2) .le(MeetBooking::getScheduledStarttime, endOfDay) .ge(MeetBooking::getScheduledEndtime, startOfDay); List meetBookings = baseMapper.selectList(meetBookingLambdaQueryWrapper); @@ -128,7 +131,8 @@ public class MeetBookingServiceImpl implements IMeetBookingService { SimpleDateFormat df = new SimpleDateFormat("HH"); List residentUnitVolist = residentUnitMapper.selectVoList(); List userId = meetBookingAppointmentVoList.stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList()); - List remoteUserVos = remoteUserService.selectListByIds(userId); + // List remoteUserVos = remoteUserService.selectListByIds(userId); + List remoteUserVos = residentPersonMapper.selectVoByIds(userId); meetBookingAppointmentVoList.stream().forEach( s -> { if (CollUtil.isNotEmpty(residentUnitVolist)) { @@ -137,10 +141,10 @@ public class MeetBookingServiceImpl implements IMeetBookingService { s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo) ?residentUnitVo.getName():null); } if (CollUtil.isNotEmpty(remoteUserVos)) { - RemoteUserVo remoteUserVo = remoteUserVos.stream() - .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null); - s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null); - s.setPhone(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getPhonenumber() : null); + ResidentPersonVo residentPersonVo = remoteUserVos.stream() + .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); + s.setPhone(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getPhone() : null); } String str = df.format(s.getScheduledStarttime()); int a = Integer.parseInt(str); @@ -176,6 +180,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService { // 构建查询条件 LambdaQueryWrapper bookingLambdaQueryWrapper = new LambdaQueryWrapper<>(); bookingLambdaQueryWrapper.eq(MeetBooking::getMeetId, meetId) + .eq(MeetBooking::getState,2) .ge(MeetBooking::getScheduledStarttime, startOfWeek) .le(MeetBooking::getScheduledEndtime, endOfWeek); List meetBookingVoList = baseMapper.selectVoList(bookingLambdaQueryWrapper); @@ -188,7 +193,8 @@ public class MeetBookingServiceImpl implements IMeetBookingService { SimpleDateFormat df = new SimpleDateFormat("HH"); List residentUnitVolist = residentUnitMapper.selectVoList(); List userId = meetBookingWeekVoList.stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList()); - List remoteUserVos = remoteUserService.selectListByIds(userId); + // List remoteUserVos = remoteUserService.selectListByIds(userId); + List remoteUserVos = residentPersonMapper.selectVoByIds(userId); meetBookingWeekVoList.stream().forEach(s -> { if (CollUtil.isNotEmpty(residentUnitVolist)) { ResidentUnitVo residentUnitVo = residentUnitVolist.stream() @@ -196,9 +202,9 @@ public class MeetBookingServiceImpl implements IMeetBookingService { s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo)? residentUnitVo.getName():null); } if (CollUtil.isNotEmpty(remoteUserVos)) { - RemoteUserVo remoteUserVo = remoteUserVos.stream() + ResidentPersonVo residentPersonVo = remoteUserVos.stream() .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null); - s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); } //设置指定的Date对象不设置默认返回当天的星期 calendar.setTime(s.getScheduledStarttime()); 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 26bcdef0..c986c0b5 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 @@ -63,16 +63,16 @@ public class MeetServiceImpl implements IMeetService { @Override public MeetVo queryById(Long id) { MeetVo meetVo = baseMapper.selectVoById(id); -// ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); -// if(ObjectUtil.isNotEmpty(residentPersonVo)){ -// meetVo.setPrincipalsName(residentPersonVo.getUserName()); -// meetVo.setPhoneNo(residentPersonVo.getPhone()); -// } - RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetVo.getPrincipals())); - if (ObjectUtil.isNotEmpty(userInfo)) { - meetVo.setPrincipalsName(userInfo.getNickName()); - meetVo.setPhoneNo(userInfo.getPhonenumber()); + ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); + if(ObjectUtil.isNotEmpty(residentPersonVo)){ + meetVo.setPrincipalsName(residentPersonVo.getUserName()); + meetVo.setPhoneNo(residentPersonVo.getPhone()); } +// RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetVo.getPrincipals())); +// if (ObjectUtil.isNotEmpty(userInfo)) { +// meetVo.setPrincipalsName(userInfo.getNickName()); +// meetVo.setPhoneNo(userInfo.getPhonenumber()); +// } String locationName = roomMapper.queryRoomName(Long.valueOf(meetVo.getLocation())); meetVo.setLocationName(locationName); return meetVo; @@ -172,6 +172,7 @@ public class MeetServiceImpl implements IMeetService { @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(MeetBo bo) { Meet add = MapstructUtils.convert(bo, Meet.class); + bo.setStatus(1); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java index 96edb815..6b7e2831 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java @@ -10,12 +10,10 @@ import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.property.domain.Clean; -import org.dromara.property.domain.CleanOrder; -import org.dromara.property.domain.CleanRelation; -import org.dromara.property.domain.CleanserverOrder; +import org.dromara.property.domain.*; import org.dromara.property.domain.bo.cleanOrderBo.CleanOrderBo; import org.dromara.property.domain.vo.cleanOrderVo.CleanOrderVo; +import org.dromara.property.mapper.TbRoomMapper; import org.dromara.property.mapper.cleanOrderMapper.CleanMapper; import org.dromara.property.mapper.cleanOrderMapper.CleanOrderMapper; import org.dromara.property.mapper.cleanOrderMapper.CleanRelationMapper; @@ -47,6 +45,7 @@ public class CleanOrderServiceImpl implements ICleanOrderService { private final CleanMapper cleanMapper; private final CleanRelationMapper cleanRelationMapper; + private final TbRoomMapper roomMapper; //NOTUNBOOKING:未退订 BOOKING:已退订 private final Integer NOTUNBOOKING = 0; @@ -97,6 +96,13 @@ public class CleanOrderServiceImpl implements ICleanOrderService { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw, CleanOrderVo.class); // Page result = baseMapper.selectForPage(pageQuery.build(), lqw); + //List locationIdList = result.getRecords().stream().map(CleanOrderVo::getLocation).collect(Collectors.toList()); +// Map longStringMap = roomMapper.queryRoomName(item.getLocation()); + //找出符合条件的房间名称 + result.getRecords().forEach(item -> { + String localName = roomMapper.queryRoomName(item.getLocation()); + item.setLocationName(localName != null ? localName : "未知房间"); + }); return TableDataInfo.build(result); } diff --git a/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml b/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml index bdc04ceb..fbe839ae 100644 --- a/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml +++ b/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml @@ -6,26 +6,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - SELECT - concat(c.community_name, b.building_name, u.unit_name, f.floor_name, r.room_number) + r.id, + concat(c.community_name, b.building_name, f.floor_name, r.room_number) AS room_name FROM tb_room r INNER JOIN tb_floor f ON r.floor_id = f.id - INNER JOIN tb_unit u ON f.unit_id = u.id - INNER JOIN tb_building b ON u.building_id = b.id + INNER JOIN tb_building b ON f.building_id = b.id INNER JOIN tb_community c ON b.community_id = c.id - where r.id IN + WHERE r.id IN #{id} From c8475f818dbf1c47948f798fb0f01f2d409b9304 Mon Sep 17 00:00:00 2001 From: 15683799673 Date: Sat, 23 Aug 2025 19:53:46 +0800 Subject: [PATCH 13/30] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=9B=BE=E7=89=87=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sis/service/impl/SisAlarmEventProcessServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java index cdcc13eb..a6eeb1c5 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java @@ -153,7 +153,7 @@ public class SisAlarmEventProcessServiceImpl implements ISisAlarmEventProcessSer return null; } // 加载附件列表 - List sisAlarmEventAttachmentsVos = sisAlarmEventAttachmentsService.queryListByAlarmId(alarmId); + List sisAlarmEventAttachmentsVos = sisAlarmEventAttachmentsService.queryListByAlarmId(sisAlarmEventProcessVo.getId()); sisAlarmEventProcessVo.setAttachments(sisAlarmEventAttachmentsVos); return sisAlarmEventProcessVo; } From 0584a44601fd0e644397032f92f1236bdea5e8d6 Mon Sep 17 00:00:00 2001 From: dy <2389062315@qq.com> Date: Sat, 23 Aug 2025 22:55:11 +0800 Subject: [PATCH 14/30] =?UTF-8?q?H5=E6=96=B0=E5=A2=9E=E8=AE=BF=E5=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TbVisitorManagementController.java | 18 +++++++++++ .../service/ITbVisitorManagementService.java | 8 +++++ .../impl/TbVisitorManagementServiceImpl.java | 31 +++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java index 71cbd677..0353698e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java @@ -149,6 +149,24 @@ public class TbVisitorManagementController extends BaseController { return toAjax(tbVisitorManagementService.insertByBo(bo)); } + /** + * h5端新增访客管理 + * @param bo + * @return + */ + @SaCheckPermission("property:visitorManagement:addH5VistorManagement") + @Log(title = "访客管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/addH5VistorManagement") + public R addH5VistorManagement(@Validated(AddGroup.class) @RequestBody TbVisitorManagementBo bo) { + QrCodeInfo info = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY +"Qrcode" + bo.getQrCodeId()); + if (info==null){ + return R.fail("请确认Qr码有效"); + } + bo.setType(0); + return toAjax(tbVisitorManagementService.insertH5ByBo(bo)); + } + /** * pc端新增访客管理 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java index c79756d4..a36e3151 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java @@ -56,6 +56,14 @@ public interface ITbVisitorManagementService { */ Boolean insertByBo(TbVisitorManagementBo bo); + /** + * 新增访客管理 + * + * @param bo 访客管理 + * @return 是否新增成功 + */ + Boolean insertH5ByBo(TbVisitorManagementBo bo); + Boolean insertVistorManagementByBo(TbVisitorManagementBo bo); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java index 8b806766..81bfedfc 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java @@ -159,6 +159,37 @@ public class TbVisitorManagementServiceImpl implements ITbVisitorManagementServi } + /** + * H5端新增访客管理 + * + * @param bo 访客管理 + * @return 是否新增成功 + */ + @Override + public Boolean insertH5ByBo(TbVisitorManagementBo bo) { + QrCodeInfo info = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + "Qrcode" + bo.getQrCodeId()); + RedisUtils.deleteKeys(GlobalConstants.CAPTCHA_CODE_KEY + "Qrcode" + bo.getQrCodeId()); + TbVisitorManagement add = MapstructUtils.convert(bo, TbVisitorManagement.class); + validEntityBeforeSave(add); + assert add != null; + add.setCreateById(info.getUserid()); + RemoteUserVo userInfoById = remoteUserService.getUserInfoById(info.getUserid()); + add.setTenantId(userInfoById.getTenantId()); + add.setCreateBy(userInfoById.getUserId()); + add.setUpdateById(userInfoById.getUserId()); + add.setUpdateBy(userInfoById.getUserId()); + add.setCreateDept(userInfoById.getDeptId()); + boolean flag = baseMapper.insert(add) > 0; + + if (flag){ + bo.setId(add.getId()); + Long e8Id = syncE8PlatVisitor(bo); + add.setEEightId(e8Id); + baseMapper.updateById(add); + } + return flag; + } + /** * pc端新增访客管理 * From dad6666107896dbd0c9b17c512bc1cf6821bd352 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sun, 24 Aug 2025 16:58:03 +0800 Subject: [PATCH 15/30] =?UTF-8?q?feat(ImageUtil):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=8E=8B=E7=BC=A9=E6=96=B9=E5=90=91=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-modules/Sis/pom.xml | 6 + .../dromara/sis/sdk/e8/utils/ImageUtil.java | 133 +++++++++++++++++- 2 files changed, 134 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/Sis/pom.xml b/ruoyi-modules/Sis/pom.xml index 9cdc13cc..32ca6297 100644 --- a/ruoyi-modules/Sis/pom.xml +++ b/ruoyi-modules/Sis/pom.xml @@ -140,6 +140,12 @@ 3.0.0 + + com.drewnoakes + metadata-extractor + 2.18.0 + + net.java.dev.jna jna diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java index 4efff0a4..a209bd81 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java @@ -1,17 +1,21 @@ package org.dromara.sis.sdk.e8.utils; +import com.drew.imaging.ImageMetadataReader; +import com.drew.imaging.ImageProcessingException; +import com.drew.metadata.Metadata; +import com.drew.metadata.MetadataException; +import com.drew.metadata.exif.ExifIFD0Directory; import org.springframework.stereotype.Component; -import javax.imageio.IIOImage; -import javax.imageio.ImageIO; -import javax.imageio.ImageWriteParam; -import javax.imageio.ImageWriter; +import javax.imageio.*; +import javax.imageio.stream.ImageInputStream; import javax.imageio.stream.MemoryCacheImageOutputStream; import java.awt.*; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Iterator; /** * @author lsm @@ -22,7 +26,8 @@ import java.io.IOException; public class ImageUtil { public byte[] compressImageToRequirements(byte[] imageData) throws IOException { - BufferedImage image = ImageIO.read(new ByteArrayInputStream(imageData)); + // 读取图片并处理方向 + BufferedImage image = readAndFixOrientation(imageData); // 第一步:调整分辨率(不超过1000x1000) if (image.getWidth() > 1000 || image.getHeight() > 1000) { @@ -91,6 +96,124 @@ public class ImageUtil { return resizedImage; } + /** + * 读取图片并处理 EXIF 方向信息 + */ + private BufferedImage readAndFixOrientation(byte[] imageData) throws IOException { + try { + // 使用 metadata-extractor 读取 EXIF 方向信息 + Metadata metadata = ImageMetadataReader.readMetadata(new ByteArrayInputStream(imageData)); + ExifIFD0Directory directory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class); + + int orientation = 1; // 默认正常方向 + if (directory != null && directory.containsTag(ExifIFD0Directory.TAG_ORIENTATION)) { + orientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION); + } + + // 读取图片 + ImageInputStream input = ImageIO.createImageInputStream(new ByteArrayInputStream(imageData)); + Iterator readers = ImageIO.getImageReaders(input); + + if (!readers.hasNext()) { + throw new IOException("No ImageReader found for image data"); + } + + ImageReader reader = readers.next(); + reader.setInput(input); + BufferedImage image = reader.read(0); + reader.dispose(); + + // 根据方向信息旋转图片 + return rotateImageAccordingToOrientation(image, orientation); + } catch (ImageProcessingException e) { + throw new IOException("Failed to process image metadata", e); + } catch (MetadataException e) { + throw new RuntimeException(e); + } + } + + /** + * 根据方向信息旋转图片 + */ + private BufferedImage rotateImageAccordingToOrientation(BufferedImage image, int orientation) { + int width = image.getWidth(); + int height = image.getHeight(); + + return switch (orientation) { + case 1 -> // 正常 + image; + case 2 -> // 水平翻转 + flipImage(image, true, false); + case 3 -> // 旋转180度 + rotateImage(image, 180); + case 4 -> // 垂直翻转 + flipImage(image, false, true); + case 5 -> { + image = flipImage(image, true, false); + yield rotateImage(image, 270); + } + case 6 -> // 旋转90度 + rotateImage(image, 90); + case 7 -> { + image = flipImage(image, true, false); + yield rotateImage(image, 90); + } + case 8 -> // 旋转270度 + rotateImage(image, 270); + default -> image; + }; + } + + /** + * 旋转图片 + */ + private BufferedImage rotateImage(BufferedImage image, double degrees) { + double radians = Math.toRadians(degrees); + double sin = Math.abs(Math.sin(radians)); + double cos = Math.abs(Math.cos(radians)); + + int width = image.getWidth(); + int height = image.getHeight(); + + int newWidth = (int) Math.floor(width * cos + height * sin); + int newHeight = (int) Math.floor(height * cos + width * sin); + + BufferedImage rotated = new BufferedImage(newWidth, newHeight, image.getType()); + Graphics2D g = rotated.createGraphics(); + + g.translate((newWidth - width) / 2, (newHeight - height) / 2); + g.rotate(Math.toRadians(degrees), width / 2.0, height / 2.0); + g.drawRenderedImage(image, null); + g.dispose(); + + return rotated; + } + + /** + * 翻转图片 + */ + private BufferedImage flipImage(BufferedImage image, boolean horizontal, boolean vertical) { + int width = image.getWidth(); + int height = image.getHeight(); + + BufferedImage flipped = new BufferedImage(width, height, image.getType()); + Graphics2D g = flipped.createGraphics(); + + if (horizontal && vertical) { + g.drawImage(image, width, height, -width, -height, null); + } else if (horizontal) { + g.drawImage(image, width, 0, -width, height, null); + } else if (vertical) { + g.drawImage(image, 0, height, width, -height, null); + } else { + g.drawImage(image, 0, 0, null); + } + + g.dispose(); + return flipped; + } + + private byte[] compressWithQuality(BufferedImage image, float quality) throws IOException { // 获取JPEG编码器 ImageWriter writer = ImageIO.getImageWritersByFormatName("jpeg").next(); From 15a0f3f8846836803f8f12a6f41622c20bbe5ccd Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Sun, 24 Aug 2025 17:51:22 +0800 Subject: [PATCH 16/30] =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-modules/Property/Dockerfile b/ruoyi-modules/Property/Dockerfile index c369d781..4df39854 100644 --- a/ruoyi-modules/Property/Dockerfile +++ b/ruoyi-modules/Property/Dockerfile @@ -11,7 +11,7 @@ RUN mkdir -p /ruoyi/Property/logs \ WORKDIR /ruoyi/Property -ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" +ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Duser.timezone=Asia/Shanghai" EXPOSE ${SERVER_PORT} From 2c127576a06b58a3e2bbeb43ec52449a1f54c315 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Mon, 25 Aug 2025 16:31:11 +0800 Subject: [PATCH 17/30] =?UTF-8?q?=E5=88=A0=E9=99=A4=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 | 210 --------------------------------------- 1 file changed, 210 deletions(-) delete mode 100644 .gitea/workflows/dev.yml diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml deleted file mode 100644 index 731c640f..00000000 --- a/.gitea/workflows/dev.yml +++ /dev/null @@ -1,210 +0,0 @@ -run-name: ${{ gitea.actor }} 构建镜像并推送(不含JAR依赖上传)🚀 -on: - push: - branches: - - main - -jobs: - build-parent-pom: - runs-on: ubuntu - steps: - - name: 拉取代码仓库 - uses: http://git.missmoc.top/mocheng/checkout@v4 - - - name: 配置环境变量(绝对路径) - run: | - export JAVA_HOME="/java17/java17" - export MAVEN_HOME="/maven/apache-maven-3.9.11" - - if [ ! -f "$JAVA_HOME/bin/java" ]; then - echo "错误:JDK可执行文件不存在于 $JAVA_HOME/bin/java" - exit 1 - fi - if [ ! -f "$MAVEN_HOME/bin/mvn" ]; then - echo "错误:Maven可执行文件不存在于 $MAVEN_HOME/bin/mvn" - exit 1 - fi - - echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - echo "$JAVA_HOME/bin" >> $GITHUB_PATH - echo "MAVEN_HOME=$MAVEN_HOME" >> $GITHUB_ENV - echo "$MAVEN_HOME/bin" >> $GITHUB_PATH - - "$JAVA_HOME/bin/java" -version - "$MAVEN_HOME/bin/mvn" -v - - - name: 配置Maven仓库 - run: | - mkdir -p ~/.m2 - cat > ~/.m2/settings.xml << EOF - - - /root/.m2/repository - - - multi-repo - - - local-repo - file:///root/.m2/repository - - - aliyun-public - https://maven.aliyun.com/repository/public - - - - - - multi-repo - - - EOF - - - name: 构建主POM(仅本地安装,不上传) - run: | - MAIN_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/pom.xml" - if [ ! -f "$MAIN_POM_ABSOLUTE_PATH" ]; then - echo "错误:主POM文件不存在" - exit 1 - fi - - retries=3 - count=0 - until "$MAVEN_HOME/bin/mvn" clean install -U -DskipTests -f "$MAIN_POM_ABSOLUTE_PATH"; do - count=$((count + 1)) - if [ $count -ge $retries ]; then - echo "错误:主POM构建失败" - exit 1 - fi - sleep 10 - done - - # build-common-modules: - # needs: build-parent-pom - # runs-on: ubuntu - # steps: - # - name: 拉取代码仓库 - # uses: http://git.missmoc.top/mocheng/checkout@v4 - - # - name: 配置环境变量 - # run: | - # export JAVA_HOME="/java17/java17" - # export MAVEN_HOME="/maven/apache-maven-3.9.11" - # echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - # echo "$JAVA_HOME/bin" >> $GITHUB_PATH - # echo "MAVEN_HOME=$MAVEN_HOME" >> $GITHUB_ENV - # echo "$MAVEN_HOME/bin" >> $GITHUB_PATH - - # - name: 构建通用模块(仅本地使用,不上传) - # run: | - # COMMON_MODULES=( - # "ruoyi-common" - # "ruoyi-api" - # "ruoyi-common-bom" - # "ruoyi-common-alibaba-bom" - # "ruoyi-api-bom" - # ) - - # for module in "${COMMON_MODULES[@]}"; do - # MODULE_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${module}/pom.xml" - # if [ ! -f "$MODULE_POM_ABSOLUTE_PATH" ]; then - # echo "警告:模块 $module 不存在,跳过" - # continue - # fi - - # retries=3 - # count=0 - # until "$MAVEN_HOME/bin/mvn" clean compile install -U -DskipTests -f "$MODULE_POM_ABSOLUTE_PATH"; do - # count=$((count + 1)) - # if [ $count -ge $retries ]; then - # echo "错误:模块 $module 构建失败" - # exit 1 - # fi - # sleep 10 - # done - # done - - build-and-push-services: - needs: build-common-modules - runs-on: ubuntu - strategy: - matrix: - service: - - ruoyi-auth - - ruoyi-gateway - - ruoyi-modules/Property - - ruoyi-modules/ruoyi-gen - - ruoyi-modules/ruoyi-job - - ruoyi-modules/ruoyi-resource - - ruoyi-modules/ruoyi-system - - ruoyi-modules/ruoyi-workflow - - ruoyi-modules/Sis - - ruoyi-visual/ruoyi-monitor - - ruoyi-visual/ruoyi-nacos - - ruoyi-seata-server - - ruoyi-sentinel-dashboard - - ruoyi-snailjob-server - steps: - - name: 拉取代码仓库 - uses: http://git.missmoc.top/mocheng/checkout@v4 - - - name: 配置环境变量 - run: | - export JAVA_HOME="/java17/java17" - export MAVEN_HOME="/maven/apache-maven-3.9.11" - echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - echo "$JAVA_HOME/bin" >> $GITHUB_PATH - echo "MAVEN_HOME=$MAVEN_HOME" >> $GITHUB_ENV - echo "$MAVEN_HOME/bin" >> $GITHUB_PATH - - - name: 构建服务模块 - run: | - SERVICE_NAME="${{ matrix.service }}" - SERVICE_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${SERVICE_NAME}/pom.xml" - if [ ! -f "$SERVICE_POM_ABSOLUTE_PATH" ]; then - echo "错误:服务 $SERVICE_NAME 的POM文件不存在" - exit 1 - fi - - "$MAVEN_HOME/bin/mvn" clean package -U -DskipTests -f "$SERVICE_POM_ABSOLUTE_PATH" - - - name: 配置Docker Buildx - uses: http://git.missmoc.top/mocheng/setup-buildx-action@v3 - - - name: 登录到容器仓库 - uses: http://git.missmoc.top/mocheng/login-action@v3 - with: - registry: ${{ secrets.REGISTRY_URL }} - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_PASS }} - - - name: 确定Dockerfile路径 - id: dockerfile-path - run: | - SERVICE_NAME="${{ matrix.service }}" - DOCKERFILE_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${SERVICE_NAME}/Dockerfile" - - if [ -f "$DOCKERFILE_ABSOLUTE_PATH" ]; then - echo "dockerfile_path=$DOCKERFILE_ABSOLUTE_PATH" >> $GITHUB_OUTPUT - else - echo "dockerfile_path=${GITHUB_WORKSPACE}/Dockerfile" >> $GITHUB_OUTPUT - fi - - - name: 构建并推送Docker镜像(仅推送镜像,不上传JAR) - uses: http://git.missmoc.top/mocheng/build-push-action@v5 - with: - context: "${{ github.workspace }}" - file: ${{ github.workspace }}/${{ matrix.service }}/Dockerfile - tags: 172.100.10.45:3000/by2025/smartparks/${{ matrix.service }}:latest - # tags: ${{ secrets.REGISTRY_URL }}/by2025/$(echo ${{ matrix.service }} | tr 'A-Z' 'a-z'):${{ github.sha }} - # tags: ${{ secrets.REGISTRY_URL }}/by2025/${{ matrix.service }}:2.0.4 - push: true - cache-from: type=gha - cache-to: type=gha,mode=max - - name: 重启服务 - id: dockerfile-path - run: | - kubectl rollout restart deployment sis -n smartparks - kubectl rollout restart deployment property -n smartparks - From c86f887d3e2283d33389d29f57264bc2a62ee264 Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Mon, 25 Aug 2025 16:31:56 +0800 Subject: [PATCH 18/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/mas?= =?UTF-8?q?ter.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/master.yml b/.gitea/workflows/master.yml index f551cd7e..aabf353d 100644 --- a/.gitea/workflows/master.yml +++ b/.gitea/workflows/master.yml @@ -15,7 +15,7 @@ jobs: - name: 拉取代码 uses: http://git.missmoc.top/mocheng/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 1 - name: 使用Maven构建项目 run: | From da131cda5c5ee236f0fb6ecd22f9265b62b8ab66 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Mon, 25 Aug 2025 17:31:33 +0800 Subject: [PATCH 19/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=89=A9?= =?UTF-8?q?=E4=B8=9A=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServiceWorkOrdersController.java | 34 ++++-- .../property/domain/ServiceWorkOrders.java | 2 +- .../domain/ServiceWorkOrdersType.java | 7 +- .../property/domain/bo/CostCarChargeBo.java | 5 + .../domain/bo/ServiceWorkOrdersTypeBo.java | 5 +- .../domain/enums/OrderReportingTypeEnum.java | 28 +++++ .../domain/enums/OrderTypeOperationEnum.java | 28 +++++ .../domain/vo/CostHouseChargeDetailVo.java | 4 + .../property/domain/vo/CostHouseChargeVo.java | 5 + .../property/domain/vo/CostMeterWaterVo.java | 4 + .../domain/vo/ServiceWorkOrdersInfoVo.java | 5 +- .../domain/vo/ServiceWorkOrdersTypeVo.java | 5 +- .../domain/vo/ServiceWorkOrdersVo.java | 7 +- .../dromara/property/mapper/TbRoomMapper.java | 2 +- .../property/service/ITbRoomService.java | 7 ++ .../service/impl/AssetTypeServiceImpl.java | 2 +- .../impl/CostCarChargeServiceImpl.java | 1 + .../impl/CostHouseChargeServiceImpl.java | 20 ++-- .../impl/CostMeterWaterServiceImpl.java | 16 +++ .../impl/CostPayFeeAuditServiceImpl.java | 2 +- .../service/impl/MeetServiceImpl.java | 20 ++-- .../service/impl/ResidentUnitServiceImpl.java | 17 ++- .../impl/ServiceWorkOrdersServiceImpl.java | 112 +++++++++++++++--- .../service/impl/TbRoomServiceImpl.java | 8 ++ .../property/tasks/ServiceWorkOrderTasks.java | 103 ++++++++++------ .../mapper/Property/TbRoomMapper.xml | 3 +- 26 files changed, 362 insertions(+), 90 deletions(-) create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderReportingTypeEnum.java create mode 100644 ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderTypeOperationEnum.java diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java index 72906e58..870364de 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java @@ -26,7 +26,7 @@ import java.util.List; /** * 【业务管理-工单处理】 - * 前端访问路由地址为:/system/workOrders + * 前端访问路由地址为:/property/workOrders * * @author mocheng * @date 2025-07-07 @@ -42,7 +42,7 @@ public class ServiceWorkOrdersController extends BaseController { /** * 查询【工单处理】列表 */ - //@SaCheckPermission("system:workOrders:list") + @SaCheckPermission("property:workOrders:list") @GetMapping("/list") public TableDataInfo list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { return serviceWorkOrdersService.queryPageList(bo, pageQuery); @@ -51,7 +51,7 @@ public class ServiceWorkOrdersController extends BaseController { /** * 导出【工单处理】列表 */ - // @SaCheckPermission("system:workOrders:export") + @SaCheckPermission("property:workOrders:export") @Log(title = "【工单处理】", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(ServiceWorkOrdersBo bo, HttpServletResponse response) { @@ -64,7 +64,7 @@ public class ServiceWorkOrdersController extends BaseController { * * @param id 主键 */ - // @SaCheckPermission("system:workOrders:query") + @SaCheckPermission("property:workOrders:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { @@ -74,7 +74,7 @@ public class ServiceWorkOrdersController extends BaseController { /** * 新增【工单处理】 */ - // @SaCheckPermission("system:workOrders:add") + @SaCheckPermission("property:workOrders:add") @Log(title = "【工单处理】", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() @@ -85,20 +85,40 @@ public class ServiceWorkOrdersController extends BaseController { /** * 修改【工单处理】 */ - //@SaCheckPermission("system:workOrders:edit") + @SaCheckPermission("property:workOrders:edit") @Log(title = "【工单处理】", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody ServiceWorkOrdersBo bo) { return toAjax(serviceWorkOrdersService.updateByBo(bo)); } + /** + * 派单【工单处理】 + */ + @SaCheckPermission("property:workOrders:dispatch") + @Log(title = "【工单处理】", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/dispatch") + public R dispatch(@Validated(EditGroup.class) @RequestBody ServiceWorkOrdersBo bo) { + return toAjax(serviceWorkOrdersService.updateByBo(bo)); + } + /** + * 抢单【工单处理】 + */ + @SaCheckPermission("property:workOrders:grab") + @Log(title = "【工单处理】", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("grab") + public R grab(@Validated(EditGroup.class) @RequestBody ServiceWorkOrdersBo bo) { + return toAjax(serviceWorkOrdersService.updateByBo(bo)); + } /** * 删除【工单处理】 * * @param ids 主键串 */ - // @SaCheckPermission("system:workOrders:remove") + @SaCheckPermission("property:workOrders:remove") @Log(title = "【工单处理】", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java index 932b39b5..2642cfa6 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java @@ -47,7 +47,7 @@ public class ServiceWorkOrders extends TenantEntity { private Long type; /** - * 状态 + * 状态(0创建工单,1已派单2已抢单3处理中,4已完成,5已评价) */ private String status; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java index 9d88bdfe..118998aa 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java @@ -38,7 +38,7 @@ public class ServiceWorkOrdersType extends TenantEntity { private String orderTypeName; /** - * 运作模式 + * 运作模式(0派单+抢单,1派单,2自动派单) */ private String operationMode; @@ -56,7 +56,10 @@ public class ServiceWorkOrdersType extends TenantEntity { * 是否支持转单(0支持,1不支持) */ private Integer isTransfers; - + /** + * 权重(1一般2紧急3危急) + */ + private String processingWeight; /** * 搜索值 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java index e149f6be..54d530b1 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java @@ -50,6 +50,11 @@ public class CostCarChargeBo extends BaseEntity { * 车位 */ private String location; + /** + * 车位名称 + */ + private String locationName; + /** * 缴费状态 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java index aa7376a5..a9a15f6c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java @@ -54,7 +54,10 @@ public class ServiceWorkOrdersTypeBo extends BaseEntity { */ @NotNull(message = "完成时效不能为空", groups = { AddGroup.class, EditGroup.class }) private Integer completionNumber; - + /** + * 权重(1一般2紧急3危急) + */ + private String processingWeight; /** * 是否支持转单(0支持,1不支持) */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderReportingTypeEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderReportingTypeEnum.java new file mode 100644 index 00000000..48b898ef --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderReportingTypeEnum.java @@ -0,0 +1,28 @@ +package org.dromara.property.domain.enums; + +/** + * 工单上报类型 + */ +public enum OrderReportingTypeEnum { + TELEPHONE_REPORT("电话上报", "1"), + SCENE_REPORT("现场上报", "2"), + SYSTEM_REPORT("系统上报", "3"), + PHONE_REPORT("手机上报", "4"); + + + private final String name; + private final String value; + + OrderReportingTypeEnum(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/OrderTypeOperationEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderTypeOperationEnum.java new file mode 100644 index 00000000..72e9bb2c --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderTypeOperationEnum.java @@ -0,0 +1,28 @@ +package org.dromara.property.domain.enums; +/** + * @Author:yuyongle + * @Date:2025/7/4 10:35 + * @Description:工单类型运作模式 + **/ +public enum OrderTypeOperationEnum { + DISPATCH_ORDERS_AND_GRAB_ORDERS("派单+抢单", "0"), + DISPATCH("派单", "1"), + AUTOMATE_DISPATCH("自动派单", "2"); + + + private final String name; + private final String value; + + OrderTypeOperationEnum(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/CostHouseChargeDetailVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeDetailVo.java index 777a9e9c..24b326a8 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeDetailVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeDetailVo.java @@ -35,6 +35,10 @@ public class CostHouseChargeDetailVo implements Serializable { */ @ExcelProperty(value = "房屋") private Long roomId; + /** + * 房屋名称 + */ + private String roomName; /** * 业主 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java index 29b63ee0..b2109a73 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java @@ -42,6 +42,11 @@ public class CostHouseChargeVo implements Serializable { */ @ExcelProperty(value = "房屋") private Long roomId; + + /** + * 房屋名称 + */ + private String roomName; /** * 业主 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java index 6e3a2185..815a6ddd 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java @@ -45,6 +45,10 @@ public class CostMeterWaterVo implements Serializable { * 费用类型 */ private String costType; + /** + * 费用名称 + */ + private String costTypeName; /** * 房间id */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java index 87a9e11f..67ab2f1e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java @@ -57,7 +57,10 @@ public class ServiceWorkOrdersInfoVo implements Serializable { */ @ExcelProperty(value = "权重") private String processingWeight; - + /** + * 运作模式(0派单+抢单,1派单,2自动派单) + */ + private String operationMode; /** * 状态 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java index c6c49fab..9b44e8a4 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java @@ -68,7 +68,10 @@ public class ServiceWorkOrdersTypeVo implements Serializable { */ @ExcelProperty(value = "是否支持转单(0支持,1不支持)") private Integer isTransfers; - + /** + * 权重(1一般2紧急3危急) + */ + private String processingWeight; /** * 搜索值 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 67a807cd..ec5db7b3 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 @@ -67,7 +67,7 @@ public class ServiceWorkOrdersVo implements Serializable { /** * 状态 */ - @ExcelProperty(value = "状态") + @ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成,5已评价)") private String status; /** @@ -75,7 +75,10 @@ public class ServiceWorkOrdersVo implements Serializable { */ @ExcelProperty(value = "派单时间") private Date dispatchTime; - + /** + * 运作模式(0派单+抢单,1派单,2自动派单) + */ + private String operationMode; /** * 发起人 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java index caae3fe6..87a23973 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java @@ -20,5 +20,5 @@ public interface TbRoomMapper extends BaseMapperPlus { //查询房间名称 String queryRoomName(Long roomId); - Map queryRoomNameList(@Param("ids") List ids); + List queryRoomNameList(@Param("ids") List ids); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java index ea077fbe..a9a2dc56 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java @@ -9,6 +9,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 房间信息Service接口 @@ -76,5 +77,11 @@ public interface ITbRoomService { * @return 房间名称 */ String queryRoomName(Long roomId); + /** + * 获取详细房间名称 + * @param ids 房间id集合 + * @return 房间名称 + */ + List queryRoomNameList(List ids); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java index 13ef526d..fad7357c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java @@ -73,7 +73,7 @@ public class AssetTypeServiceImpl implements IAssetTypeService { private LambdaQueryWrapper buildQueryWrapper(AssetTypeBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.orderByAsc(AssetType::getId); + lqw.orderByAsc(AssetType::getSort); lqw.like(StringUtils.isNotBlank(bo.getAssetTypeName()), AssetType::getAssetTypeName, bo.getAssetTypeName()); lqw.eq(bo.getSort() != null, AssetType::getSort, bo.getSort()); return lqw; 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 7be26b05..ca8efbed 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 @@ -82,6 +82,7 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService { // 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); 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/CostHouseChargeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java index 76e391c5..2debf50a 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java @@ -55,6 +55,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { private final ResidentPersonMapper residentPersonMapper; @DubboReference private RemoteUserService remoteUserService; + /** * 查询房屋收费 * @@ -66,12 +67,14 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { CostHouseChargeVo costHouseChargeVo = baseMapper.selectVoById(id); CostHouseChargeDetailVo costHouseChargeDetailVo = BeanUtil.copyProperties(costHouseChargeVo, CostHouseChargeDetailVo.class); CostItemsVo costItemsVo = costItemsMapper.selectVoById(costHouseChargeDetailVo.getCostItemsId()); - costHouseChargeDetailVo.setCostItemsVo(ObjectUtil.isNotEmpty(costItemsVo)?costItemsVo:null); + costHouseChargeDetailVo.setCostItemsVo(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo : null); TbRoomVo tbRoomVo = tbRoomMapper.selectVoById(costHouseChargeDetailVo.getRoomId()); - costHouseChargeDetailVo.setRoomVo(ObjectUtil.isNotEmpty(tbRoomVo)?tbRoomVo:null); - ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(costHouseChargeVo.getPersonId()); + costHouseChargeDetailVo.setRoomVo(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo : null); + ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(costHouseChargeVo.getPersonId()); //RemoteUserVo userInfo = remoteUserService.getUserInfoById(costHouseChargeVo.getPersonId()); - costHouseChargeDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo)?residentPersonVo.getUserName():null); + String roomName = tbRoomMapper.queryRoomName(costHouseChargeDetailVo.getRoomId()); + costHouseChargeDetailVo.setRoomName(StringUtils.isNotBlank(roomName) ? roomName : null); + costHouseChargeDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); return costHouseChargeDetailVo; } @@ -91,7 +94,9 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { if (CollUtil.isNotEmpty(residentPeoplelist)) { ResidentPerson residentPerson = residentPeoplelist.stream() .filter(vo -> vo.getId() != null && vo.getId().equals(s.getPersonId())).findFirst().orElse(null); - s.setPersonName(ObjectUtil.isNotEmpty(residentPerson)?residentPerson.getUserName():null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPerson) ? residentPerson.getUserName() : null); + String roomName = tbRoomMapper.queryRoomName(s.getRoomId()); + s.setRoomName(StringUtils.isNotBlank(roomName) ? roomName : null); } }); return TableDataInfo.build(result); @@ -181,7 +186,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { @Transactional(rollbackFor = Exception.class) public Boolean returnFree(CostChargeReturnFeeBo bo) { CostHouseChargeVo costHouseChargeVo = baseMapper.selectVoById(bo.getId()); - Assert.isTrue(ObjectUtil.isNotEmpty(costHouseChargeVo),"该费用不存在"); + Assert.isTrue(ObjectUtil.isNotEmpty(costHouseChargeVo), "该费用不存在"); var CostReturnPayFee = new CostReturnPayFee().setItemId(costHouseChargeVo.getCostItemsId()) .setReturnNo(RandomUtil.randomNumbers(11)) .setReason(bo.getReason()) @@ -189,8 +194,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { .setUserId(costHouseChargeVo.getPersonId()) .setPayNo(costHouseChargeVo.getId().toString()) .setPayAcount(costHouseChargeVo.getAmountReceivable()) - .setState("0") - ; + .setState("0"); boolean flag = costReturnPayFeeMapper.insert(CostReturnPayFee) > 0; CostHouseCharge costHouseCharge = BeanUtil.copyProperties(costHouseChargeVo, CostHouseCharge.class); costHouseCharge.setChargeStatus(ChargeStatusEnum.REFUND_PENDING_REVIEW.getValue()); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java index 87110271..b8e5e537 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java @@ -1,6 +1,8 @@ package org.dromara.property.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -10,6 +12,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.CostMeterTypeVo; +import org.dromara.property.mapper.CostMeterTypeMapper; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.CostMeterWaterBo; import org.dromara.property.domain.vo.CostMeterWaterVo; @@ -35,6 +39,7 @@ import java.util.Collection; public class CostMeterWaterServiceImpl implements ICostMeterWaterService { private final CostMeterWaterMapper baseMapper; + private final CostMeterTypeMapper costMeterTypeMapper; /** * 查询费用-水电抄 @@ -58,6 +63,16 @@ public class CostMeterWaterServiceImpl implements ICostMeterWaterService { public TableDataInfo queryPageList(CostMeterWaterBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + if (CollUtil.isNotEmpty(result.getRecords())){ + //收集抄表类型id + List meterTypeIds = result.getRecords().stream().map(CostMeterWaterVo::getMeterTypeId).toList(); + List costMeterTypeVos = costMeterTypeMapper.selectVoByIds(meterTypeIds); + result.getRecords().stream().forEach(s -> { + //查找抄表类型名称 + CostMeterTypeVo costMeterTypeVo = costMeterTypeVos.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getMeterTypeId())).findFirst().orElse(null); + s.setCostTypeName(ObjectUtil.isNotEmpty(costMeterTypeVo)?costMeterTypeVo.getName():null); + }); + } return TableDataInfo.build(result); } @@ -79,6 +94,7 @@ public class CostMeterWaterServiceImpl implements ICostMeterWaterService { lqw.orderByAsc(CostMeterWater::getId); lqw.eq(bo.getItemId() != null, CostMeterWater::getItemId, bo.getItemId()); lqw.eq(bo.getMeterTypeId() != null, CostMeterWater::getMeterTypeId, bo.getMeterTypeId()); + lqw.eq(StringUtils.isNotBlank(bo.getCostType()), CostMeterWater::getCostType, bo.getCostType()); lqw.like(StringUtils.isNotBlank(bo.getObjName()), CostMeterWater::getObjName, bo.getObjName()); lqw.eq(StringUtils.isNotBlank(bo.getCurDegrees()), CostMeterWater::getCurDegrees, bo.getCurDegrees()); lqw.eq(StringUtils.isNotBlank(bo.getPreDegrees()), CostMeterWater::getPreDegrees, bo.getPreDegrees()); 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 6062d170..807db09b 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 @@ -92,7 +92,7 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { } if (CollUtil.isNotEmpty(roomVoList)) { TbRoomVo tbRoomVo = roomVoList.stream() - .filter(vo -> vo.getId() != null && vo.getId().equals(s.getChargeId())).findFirst().orElse(null); + .filter(vo -> vo.getId() != null && vo.getId().equals(s.getRoomNumber())).findFirst().orElse(null); s.setRoomNumber(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo.getRoomNumber() : null); } costPayFeeAuditVoList.add(s); 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 c986c0b5..1f6eacf5 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 @@ -63,16 +63,16 @@ public class MeetServiceImpl implements IMeetService { @Override public MeetVo queryById(Long id) { MeetVo meetVo = baseMapper.selectVoById(id); - ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); - if(ObjectUtil.isNotEmpty(residentPersonVo)){ - meetVo.setPrincipalsName(residentPersonVo.getUserName()); - meetVo.setPhoneNo(residentPersonVo.getPhone()); - } -// RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetVo.getPrincipals())); -// if (ObjectUtil.isNotEmpty(userInfo)) { -// meetVo.setPrincipalsName(userInfo.getNickName()); -// meetVo.setPhoneNo(userInfo.getPhonenumber()); + // ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); +// if(ObjectUtil.isNotEmpty(residentPersonVo)){ +// meetVo.setPrincipalsName(residentPersonVo.getUserName()); +// meetVo.setPhoneNo(residentPersonVo.getPhone()); // } + RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetVo.getPrincipals())); + if (ObjectUtil.isNotEmpty(userInfo)) { + meetVo.setPrincipalsName(userInfo.getNickName()); + meetVo.setPhoneNo(userInfo.getPhonenumber()); + } String locationName = roomMapper.queryRoomName(Long.valueOf(meetVo.getLocation())); meetVo.setLocationName(locationName); return meetVo; @@ -172,7 +172,7 @@ public class MeetServiceImpl implements IMeetService { @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(MeetBo bo) { Meet add = MapstructUtils.convert(bo, Meet.class); - bo.setStatus(1); + bo.setStatus(0); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java index eea0eb33..7130b2de 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import cn.hutool.core.collection.CollUtil; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -18,9 +19,11 @@ import org.dromara.property.domain.ResidentUnit; import org.dromara.property.mapper.ResidentUnitMapper; import org.dromara.property.service.IResidentUnitService; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 入驻单位Service业务层处理 @@ -50,8 +53,18 @@ public class ResidentUnitServiceImpl implements IResidentUnitService { ResidentUnitVo residentUnitVo = baseMapper.selectVoById(id); //获取入驻位置详情 if(StringUtils.isNotBlank(residentUnitVo.getLocation())){ - String roomName = roomService.queryRoomName(Long.valueOf(residentUnitVo.getLocation())); - residentUnitVo.setLocationDetail(roomName); + // 修改后的代码 + List idList = Arrays.stream(residentUnitVo.getLocation().split(",")) + .map(String::trim) + .map(Long::parseLong) + .collect(Collectors.toList()); + + List roomNames = roomService.queryRoomNameList(idList); + // 元素用,拼接成字符串 + if(CollUtil.isNotEmpty(roomNames)){ + String locationDetail = String.join(",", roomNames); + residentUnitVo.setLocationDetail(locationDetail); + } } Long num = personService.queryPersonCount(residentUnitVo.getId()); residentUnitVo.setNumber(num); 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 2d53d195..af6440aa 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 @@ -2,6 +2,7 @@ package org.dromara.property.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; @@ -16,15 +17,20 @@ import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.property.domain.*; import org.dromara.property.domain.bo.ServiceWorkOrdersBo; import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo; +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.mapper.ResidentPersonMapper; import org.dromara.property.mapper.ServiceWorkOrdersMapper; import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper; import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper; +import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper; import org.dromara.property.service.IServiceWorkOrdersService; import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.vo.RemoteUserVo; @@ -54,6 +60,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { private final ServiceWorkOrdersRecordMapper workOrdersRecordMapper; @DubboReference private RemoteUserService remoteUserService; + private final AttendanceUserGroupMapper attendanceUserGroupMapper; /** * 查询【工单处理】 @@ -71,10 +78,12 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = typesMapper.selectVoById(serviceWorkOrdersVo.getType()); if (Objects.nonNull(serviceWorkOrdersTypeVo)) { serviceWorkOrdersInfoVo.setTypeName(serviceWorkOrdersTypeVo.getOrderTypeName()); + serviceWorkOrdersInfoVo.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null); + } //ResidentPersonVo residentPersonHandler = residentPersonMapper.selectVoById(Long.valueOf(serviceWorkOrdersVo.getHandler())); - RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(serviceWorkOrdersVo.getHandler())); + RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(serviceWorkOrdersVo.getHandler())); if (ObjectUtil.isNotEmpty(userInfo)) { serviceWorkOrdersInfoVo.setHandlerText(userInfo.getNickName()); serviceWorkOrdersInfoVo.setHandlerPhone(userInfo.getPhonenumber()); @@ -89,7 +98,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { serviceWorkOrdersRecordInfoVos.stream().forEach(workOrdersRecordVo -> { RemoteUserVo remoteUserVo = remoteUserVos.stream().filter(vo -> vo.getUserId() != null && vo.getUserId().equals(serviceWorkOrdersVo.getHandler())).findFirst().orElse(null); workOrdersRecordVo.setHandlerName(Objects.nonNull(remoteUserVo) ? remoteUserVo.getNickName() : null); - workOrdersRecordVo.setInitiatorPeople(Objects.nonNull(serviceWorkOrdersTypeVo)?serviceWorkOrdersVo.getInitiatorPeople():null); + workOrdersRecordVo.setInitiatorPeople(Objects.nonNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersVo.getInitiatorPeople() : null); if (workOrdersRecordVo.getStatus().equals("1") || workOrdersRecordVo.getStatus().equals("2")) { serviceWorkOrdersInfoVo.setDispatchTime(workOrdersRecordVo.getCreateTime()); } @@ -123,6 +132,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { 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())); @@ -151,6 +161,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { 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 serviceWorkOrdersVoList; @@ -159,15 +170,15 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { private LambdaQueryWrapper buildQueryWrapper(ServiceWorkOrdersBo bo) { //查询类型下子类型id LambdaQueryWrapper OrdersTypeWrapper = new LambdaQueryWrapper<>(); - OrdersTypeWrapper.eq(ServiceWorkOrdersType::getParentId,bo.getType()); + OrdersTypeWrapper.eq(ServiceWorkOrdersType::getParentId, bo.getType()); List serviceWorkOrdersTypes = typesMapper.selectList(OrdersTypeWrapper); List typeIds = serviceWorkOrdersTypes.stream() .map(ServiceWorkOrdersType::getId) .collect(Collectors.toList()); typeIds.add(bo.getType()); List statusList = new ArrayList<>(); - if(StringUtils.isNotBlank(bo.getStatus())){ - statusList = Arrays.asList(bo.getStatus().split(",")); + if (StringUtils.isNotBlank(bo.getStatus())) { + statusList = Arrays.asList(bo.getStatus().split(",")); } Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); @@ -197,11 +208,14 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { @Override @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(ServiceWorkOrdersBo bo) { + //查询工单类型 + ServiceWorkOrdersType serviceWorkOrdersType = typesMapper.selectById(bo.getType()); ServiceWorkOrders add = MapstructUtils.convert(bo, ServiceWorkOrders.class); LoginUser user = LoginHelper.getLoginUser(); add.setOrderNo("GD" + IdUtil.getSnowflakeNextIdStr()); - add.setStatus("0"); + add.setStatus(WorkOrderStatusEnum.CREATE_ORDER.getValue()); add.setInitiatorPeople(user.getNickname()); + add.setProcessingWeight(serviceWorkOrdersType.getProcessingWeight()); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { @@ -210,11 +224,67 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { serviceWorkOrdersRecord.setOrderId(add.getId()); serviceWorkOrdersRecord.setStatus(add.getStatus()); //serviceWorkOrdersRecord.setHandler(add.getHandler()); - workOrdersRecordMapper.insert(serviceWorkOrdersRecord); + boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; + if (flags) { + if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { + handleServiceWorkOrder(add); + } + } } return flag; } + //自动派单 + private void handleServiceWorkOrder(ServiceWorkOrders serviceWorkOrders) { + LocalDate today = LocalDate.now(); + // 1. 获取今日排班人员(优先查缓存,未命中则查询数据库并缓存) + List attendanceUserGroups = RedisUtils.getCacheList(DateUtil.today()); + if (CollUtil.isEmpty(attendanceUserGroups)) { + attendanceUserGroups = attendanceUserGroupMapper.selectList( + new LambdaQueryWrapper() + .le(AttendanceUserGroup::getStartDate, today) + .ge(AttendanceUserGroup::getEndDate, today) + .orderByAsc(AttendanceUserGroup::getCreateTime) + ); + Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups),"暂无排班人员"); + // 缓存当天排班数据(假设当天不会变) + RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups); + } + + // 2. 获取并更新轮询索引(原子性很重要) + int currentIndex; + Integer lastScheduleId = RedisUtils.getCacheObject(DateUtil.today()+"LastScheduleId"); + if (lastScheduleId == null || lastScheduleId < 0 || lastScheduleId >= attendanceUserGroups.size()) { + currentIndex = 0; // 越界或未设置,重置为0 + } else { + currentIndex = lastScheduleId + 1; + if (currentIndex >= attendanceUserGroups.size()) { + currentIndex = 0; // 循环轮询 + } + } + RedisUtils.setCacheObject(DateUtil.today()+"LastScheduleId", currentIndex); + + // 3. 分配处理人 + AttendanceUserGroup assignedGroup = attendanceUserGroups.get(currentIndex); + Long employeeId = assignedGroup.getEmployeeId(); + + serviceWorkOrders.setHandler(employeeId); + serviceWorkOrders.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); + + // 4. 插入记录 + ServiceWorkOrdersRecord record = new ServiceWorkOrdersRecord(); + record.setOrderId(serviceWorkOrders.getId()); + record.setHandler(employeeId); + record.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); + workOrdersRecordMapper.insert(record); + + // 5. 更新工单 + serviceWorkOrders.setDispatchTime(new Date()); + baseMapper.updateById(serviceWorkOrders); + + log.info("成功派单,工单号:{}", serviceWorkOrders.getOrderNo()); + } + /** * 修改【工单处理】 * @@ -242,17 +312,17 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { * 修改前的数据校验 */ private void validEntityBeforeUpdate(ServiceWorkOrders entity) { - Assert.isTrue(ObjectUtil.isNotEmpty(entity.getStatus()),"状态不能为空!"); + Assert.isTrue(ObjectUtil.isNotEmpty(entity.getStatus()), "状态不能为空!"); LambdaQueryWrapper ordersLambdaQueryWrapper = new LambdaQueryWrapper<>(); ordersLambdaQueryWrapper.eq(ServiceWorkOrdersRecord::getOrderId, entity.getId()); ordersLambdaQueryWrapper.eq(ServiceWorkOrdersRecord::getStatus, entity.getStatus()); boolean exists = workOrdersRecordMapper.exists(ordersLambdaQueryWrapper); //TODO 做一些数据校验,如唯一约束 - ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); - serviceWorkOrdersRecord.setOrderId(entity.getId()); - serviceWorkOrdersRecord.setStatus(entity.getStatus()); - serviceWorkOrdersRecord.setHandler(entity.getHandler()); - workOrdersRecordMapper.insert(serviceWorkOrdersRecord); + ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); + serviceWorkOrdersRecord.setOrderId(entity.getId()); + serviceWorkOrdersRecord.setStatus(entity.getStatus()); + serviceWorkOrdersRecord.setHandler(entity.getHandler()); + workOrdersRecordMapper.insert(serviceWorkOrdersRecord); } /** @@ -497,16 +567,17 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { } - - //小程序端新增 @Override public Boolean insertMServiceWorkOrdersBo(MServiceWorkOrdersBo bo) { + //查询工单类型 + ServiceWorkOrdersType serviceWorkOrdersType = typesMapper.selectById(bo.getType()); ServiceWorkOrders add = MapstructUtils.convert(bo, ServiceWorkOrders.class); LoginUser user = LoginHelper.getLoginUser(); add.setOrderNo("GD" + IdUtil.getSnowflakeNextIdStr()); add.setOrderName("工单名称"); - add.setStatus("0"); + add.setStatus(WorkOrderStatusEnum.CREATE_ORDER.getValue()); + add.setReportingType(OrderReportingTypeEnum.PHONE_REPORT.getValue()); add.setInitiatorPeople(user.getNickname()); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; @@ -515,15 +586,22 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); serviceWorkOrdersRecord.setOrderId(add.getId()); serviceWorkOrdersRecord.setStatus(add.getStatus()); - workOrdersRecordMapper.insert(serviceWorkOrdersRecord); + boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; + if (flags) { + if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { + handleServiceWorkOrder(add); + } + } } return flag; } + public List getList() { LambdaQueryWrapper serviceWorkOrdersWrapper = new LambdaQueryWrapper<>(); return baseMapper.selectList(serviceWorkOrdersWrapper); } + @Override public List> getServiceWorkOrdersHandler(String type) { return switch (type) { diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java index 201661fa..305f579e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java @@ -158,5 +158,13 @@ public class TbRoomServiceImpl implements ITbRoomService { @Override public String queryRoomName(Long roomId) { return baseMapper.queryRoomName(roomId); + } /** + * 获取房间名称 + * @param + * @return 房间名称 + */ + @Override + public List queryRoomNameList(List ids) { + return baseMapper.queryRoomNameList(ids); } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java index 206a798c..5d331c19 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java @@ -9,10 +9,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.common.redis.utils.RedisUtils; import org.dromara.property.domain.AttendanceUserGroup; import org.dromara.property.domain.ServiceWorkOrders; import org.dromara.property.domain.ServiceWorkOrdersRecord; +import org.dromara.property.domain.ServiceWorkOrdersType; +import org.dromara.property.domain.enums.OrderTypeOperationEnum; import org.dromara.property.domain.enums.WorkOrderStatusEnum; +import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper; import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper; import org.dromara.property.mapper.ServiceWorkOrdersMapper; import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper; @@ -40,48 +44,81 @@ import org.springframework.web.bind.annotation.RestController; //@RestController //@RequestMapping("/serviceWorkOrderTasks") public class ServiceWorkOrderTasks { - private ServiceWorkOrdersMapper workOrdersMapper; - private ServiceWorkOrdersRecordMapper workOrdersRecordMapper; - private AttendanceUserGroupMapper attendanceUserGroupMapper; + private final ServiceWorkOrdersMapper workOrdersMapper; + private final ServiceWorkOrdersTypeMapper workOrdersTypeMapper; + private final ServiceWorkOrdersRecordMapper workOrdersRecordMapper; + private final AttendanceUserGroupMapper attendanceUserGroupMapper; /** * 查询状态为创建工单的工单,查询当天排班人员,为工单自动派单 */ @Transactional(rollbackFor = Exception.class) - @Scheduled(cron = "0 0 */1 * * ?") + @Scheduled(cron = "0 0,30 * * * ?") //@GetMapping("/serviceWorkOrderTaskId") private void handleServiceWorkOrder() { - List serviceWorkOrderList = workOrdersMapper.selectList( - new LambdaQueryWrapper() - .eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.CREATE_ORDER.getValue())); - if(CollUtil.isNotEmpty(serviceWorkOrderList)){ - LocalDate today = LocalDate.now(); - List attendanceUserGroups = attendanceUserGroupMapper.selectList( - new LambdaQueryWrapper() - //查询今天上班的人员 - .le(AttendanceUserGroup::getStartDate, today) - .ge(AttendanceUserGroup::getEndDate, today) + LocalDate today = LocalDate.now(); + List attendanceUserGroups = attendanceUserGroupMapper.selectList( + new LambdaQueryWrapper() + //查询今天上班的人员 + .le(AttendanceUserGroup::getStartDate, today) + .ge(AttendanceUserGroup::getEndDate, today) + ); + if (CollUtil.isEmpty(attendanceUserGroups)) { + if (!RedisUtils.isExistsObject("today")) { + //缓存今天排班人员 + RedisUtils.setCacheList("today", attendanceUserGroups); + } + //查询工单类型 + List serviceWorkOrdersTypes = workOrdersTypeMapper.selectList( + new LambdaQueryWrapper() + .eq(ServiceWorkOrdersType::getOperationMode, OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue()) ); - serviceWorkOrderList.stream().forEach(s->{ - if(CollUtil.isNotEmpty(attendanceUserGroups)){ - attendanceUserGroups.stream().forEach(s1->{ + if (CollUtil.isEmpty(serviceWorkOrdersTypes)) { + //收集工单类型id + List typeIds = serviceWorkOrdersTypes.stream().map(ServiceWorkOrdersType::getId).toList(); + List serviceWorkOrderList = workOrdersMapper.selectList( + new LambdaQueryWrapper() + .eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.CREATE_ORDER.getValue()) + .in(ServiceWorkOrders::getType, typeIds) + ); + if (CollUtil.isNotEmpty(serviceWorkOrderList)) { + serviceWorkOrderList.stream().forEach(s -> { + //获取处理人 + List attendanceUserGroupList = RedisUtils.getCacheList("today"); ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); + //获取上次排班人员序号 + if (!RedisUtils.isExistsObject("LastScheduleId")) { + RedisUtils.setCacheObject("LastScheduleId", 0); + serviceWorkOrdersRecord.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + s.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + } else { + Integer lastScheduleId = RedisUtils.getCacheObject("LastScheduleId"); + int lastScheduleIdUpdate = lastScheduleId + 1; + AttendanceUserGroup attendanceUserGroup = attendanceUserGroupList.get(lastScheduleIdUpdate); + if (ObjectUtil.isNotEmpty(attendanceUserGroup)) { + serviceWorkOrdersRecord.setHandler(attendanceUserGroup.getEmployeeId()); + s.setHandler(attendanceUserGroup.getEmployeeId()); + RedisUtils.setCacheObject("LastScheduleId", lastScheduleIdUpdate); + } else { + serviceWorkOrdersRecord.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + s.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + RedisUtils.setCacheObject("LastScheduleId", 0); + } + } + serviceWorkOrdersRecord.setOrderId(s.getId()); serviceWorkOrdersRecord.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); - serviceWorkOrdersRecord.setHandler(s1.getEmployeeId()); + workOrdersRecordMapper.insert(serviceWorkOrdersRecord); s.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); - s.setHandler(s1.getEmployeeId()); + workOrdersMapper.updateById(s); - log.info("派单工单号为:{}",s.getOrderNo()); - log.info("处理人为:{}",s1.getEmployeeId()); + log.info("派单工单号为:{}", s.getOrderNo()); }); - }else { - log.info("当天无排班人员"); + } else { + log.info("派单工单为:{}", serviceWorkOrderList.size()); } - }); - }else { - log.info("派单工单为:{}",serviceWorkOrderList.size()); + } } } @@ -134,10 +171,10 @@ public class ServiceWorkOrderTasks { for (AttendanceUserGroup group : attendanceUserGroups) { Long employeeId = group.getEmployeeId(); // 可选:避免重新派给原处理人 - if (employeeId.equals(latestRecord.getHandler())) { - log.debug("跳过原处理人:{}", employeeId); - continue; - } + if (employeeId.equals(latestRecord.getHandler())) { + log.debug("跳过原处理人:{}", employeeId); + continue; + } // 创建新的派单记录 ServiceWorkOrdersRecord newRecord = new ServiceWorkOrdersRecord(); newRecord.setOrderId(workOrder.getId()); @@ -147,9 +184,9 @@ public class ServiceWorkOrderTasks { workOrdersRecordMapper.insert(newRecord); log.info("工单号:{} 已重新派发给员工ID:{}", workOrder.getOrderNo(), employeeId); // 6. 更新主工单状态(可选:若只保留最新记录状态,也可不更新主表) - workOrder.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); // 仍为已派单 - workOrder.setHandler(employeeId); // 可清空,或设为最后一个人(根据业务) - workOrdersMapper.updateById(workOrder); + workOrder.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); // 仍为已派单 + workOrder.setHandler(employeeId); // 可清空,或设为最后一个人(根据业务) + workOrdersMapper.updateById(workOrder); } }); } diff --git a/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml b/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml index fbe839ae..8be6fae2 100644 --- a/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml +++ b/ruoyi-modules/Property/src/main/resources/mapper/Property/TbRoomMapper.xml @@ -15,9 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where r.id=#{roomId} - SELECT - r.id, concat(c.community_name, b.building_name, f.floor_name, r.room_number) AS room_name FROM tb_room r From 555de9f5aa7abf8425b9a8d0f437c34a43c49100 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Mon, 25 Aug 2025 18:34:30 +0800 Subject: [PATCH 20/30] refactor(property): 1 --- .../bo/smartDevicesBo/TbLightInfoBo.java | 2 +- .../bo/smartDevicesBo/TbMeterConfigBo.java | 2 +- .../bo/smartDevicesBo/TbMeterInfoBo.java | 2 +- .../bo/smartDevicesBo/TbMeterRecordBo.java | 23 +++++++++++-------- .../bo/smartDevicesBo/TbMeterRoomBo.java | 2 +- .../smartDevices}/TbLightInfo.java | 2 +- .../smartDevices}/TbMeterConfig.java | 2 +- .../smartDevices}/TbMeterInfo.java | 2 +- .../smartDevices}/TbMeterRecord.java | 20 ++++++++++------ .../smartDevices}/TbMeterRoom.java | 2 +- .../vo/smartDevicesVo/TbLightInfoVo.java | 4 +--- .../vo/smartDevicesVo/TbMeterConfigVo.java | 2 +- .../vo/smartDevicesVo/TbMeterInfoVo.java | 2 +- .../vo/smartDevicesVo/TbMeterRecordVo.java | 19 ++++++++++----- .../vo/smartDevicesVo/TbMeterRoomVo.java | 2 +- .../smartDevicesMapper/TbLightInfoMapper.java | 2 +- .../TbMeterConfigMapper.java | 2 +- .../smartDevicesMapper/TbMeterInfoMapper.java | 2 +- .../TbMeterRecordMapper.java | 6 +++-- .../smartDevicesMapper/TbMeterRoomMapper.java | 2 +- .../TbLightInfoServiceImpl.java | 2 +- .../TbMeterConfigServiceImpl.java | 2 +- .../TbMeterInfoServiceImpl.java | 2 +- .../TbMeterRecordServiceImpl.java | 6 ++--- .../TbMeterRoomServiceImpl.java | 2 +- 25 files changed, 66 insertions(+), 50 deletions(-) rename ruoyi-modules/Property/src/main/java/org/dromara/property/domain/{ => entity/smartDevices}/TbLightInfo.java (94%) rename ruoyi-modules/Property/src/main/java/org/dromara/property/domain/{ => entity/smartDevices}/TbMeterConfig.java (95%) rename ruoyi-modules/Property/src/main/java/org/dromara/property/domain/{ => entity/smartDevices}/TbMeterInfo.java (95%) rename ruoyi-modules/Property/src/main/java/org/dromara/property/domain/{ => entity/smartDevices}/TbMeterRecord.java (73%) rename ruoyi-modules/Property/src/main/java/org/dromara/property/domain/{ => entity/smartDevices}/TbMeterRoom.java (92%) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java index 93d4461e..6a16cd7f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java index b96d76d0..b7d7a8e5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.EditGroup; import io.github.linpeilie.annotations.AutoMapper; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java index e25ae4fc..aceea63f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterInfo; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java index a88a08cb..abd989aa 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterRecord; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; @@ -8,13 +8,15 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; + +import java.math.BigDecimal; import java.util.Date; /** * 抄记录业务对象 tb_meter_record * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ @Data @EqualsAndHashCode(callSuper = true) @@ -33,6 +35,12 @@ public class TbMeterRecordBo extends BaseEntity { @NotBlank(message = "仪表编号不能为空", groups = { AddGroup.class, EditGroup.class }) private String meterId; + /** + * 设备类型(1-电表,2-水表,3-气表) + */ + @NotNull(message = "仪表类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long meterType; + /** * 抄表员ID */ @@ -49,18 +57,13 @@ public class TbMeterRecordBo extends BaseEntity { * 当前读数 */ @NotNull(message = "当前读数不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long currentReading; + private BigDecimal currentReading; /** * 上次读数 */ @NotNull(message = "上次读数不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long previousReading; - - /** - * 用量 - */ - private Long consumption; + private BigDecimal previousReading; /** * 抄表方式(1手动 2自动 3用户上报) @@ -71,7 +74,7 @@ public class TbMeterRecordBo extends BaseEntity { /** * 抄表照片 */ - private Long imgOssid; + private Long imgOssId; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java index 1d986a4b..b5262897 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.EditGroup; import io.github.linpeilie.annotations.AutoMapper; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbLightInfo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbLightInfo.java similarity index 94% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbLightInfo.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbLightInfo.java index 09a1bcf4..2af8af8d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbLightInfo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbLightInfo.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.tenant.core.TenantEntity; import com.baomidou.mybatisplus.annotation.*; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterConfig.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterConfig.java similarity index 95% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterConfig.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterConfig.java index 6dc59a9c..497e9e1b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterConfig.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterConfig.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterInfo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterInfo.java similarity index 95% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterInfo.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterInfo.java index 6c748a13..cfdc1ab8 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterInfo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterInfo.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.tenant.core.TenantEntity; import com.baomidou.mybatisplus.annotation.*; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRecord.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRecord.java similarity index 73% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRecord.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRecord.java index 7d0f6f25..4c3d6296 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRecord.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRecord.java @@ -1,11 +1,12 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.tenant.core.TenantEntity; 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; import java.io.Serial; @@ -13,7 +14,7 @@ import java.io.Serial; * 抄记录对象 tb_meter_record * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ @Data @EqualsAndHashCode(callSuper = true) @@ -34,6 +35,11 @@ public class TbMeterRecord extends TenantEntity { */ private String meterId; + /** + * 设备类型(1-电表,2-水表,3-气表) + */ + private Long meterType; + /** * 抄表员ID */ @@ -47,17 +53,17 @@ public class TbMeterRecord extends TenantEntity { /** * 当前读数 */ - private Long currentReading; + private BigDecimal currentReading; /** * 上次读数 */ - private Long previousReading; + private BigDecimal previousReading; /** * 用量 */ - private Long consumption; + private BigDecimal consumption; /** * 抄表方式(1手动 2自动 3用户上报) @@ -67,7 +73,7 @@ public class TbMeterRecord extends TenantEntity { /** * 抄表照片 */ - private Long imgOssid; + private Long imgOssId; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRoom.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRoom.java similarity index 92% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRoom.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRoom.java index 8cbe4275..c65b8ae5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRoom.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRoom.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java index ad609103..08a6314b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.vo.smartDevicesVo; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import org.dromara.common.excel.annotation.ExcelDictFormat; @@ -10,8 +10,6 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; -import java.util.Date; - /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java index ba26038e..5904d265 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.vo.smartDevicesVo; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import org.dromara.common.excel.annotation.ExcelDictFormat; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java index 5bd428b8..6e26f2f5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java @@ -2,7 +2,7 @@ package org.dromara.property.domain.vo.smartDevicesVo; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; -import org.dromara.property.domain.TbMeterInfo; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java index e01494f5..8fbec766 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java @@ -1,8 +1,9 @@ package org.dromara.property.domain.vo.smartDevicesVo; +import java.math.BigDecimal; import java.util.Date; -import org.dromara.property.domain.TbMeterRecord; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; @@ -16,7 +17,7 @@ import java.io.Serializable; * 抄记录视图对象 tb_meter_record * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ @Data @ExcelIgnoreUnannotated @@ -38,6 +39,12 @@ public class TbMeterRecordVo implements Serializable { @ExcelProperty(value = "仪表编号") private String meterId; + /** + * 设备类型(1-电表,2-水表,3-气表) + */ + @ExcelProperty(value = "仪表类型") + private Long meterType; + /** * 抄表员ID */ @@ -54,19 +61,19 @@ public class TbMeterRecordVo implements Serializable { * 当前读数 */ @ExcelProperty(value = "当前读数") - private Long currentReading; + private BigDecimal currentReading; /** * 上次读数 */ @ExcelProperty(value = "上次读数") - private Long previousReading; + private BigDecimal previousReading; /** * 用量 */ @ExcelProperty(value = "用量") - private Long consumption; + private BigDecimal consumption; /** * 抄表方式(1手动 2自动 3用户上报) @@ -78,7 +85,7 @@ public class TbMeterRecordVo implements Serializable { * 抄表照片 */ @ExcelProperty(value = "抄表照片") - private Long imgOssid; + private Long imgOssId; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java index 47ca9c6c..c273d81d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.vo.smartDevicesVo; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java index d94a0397..57cc3eaf 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java @@ -1,7 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; import org.apache.ibatis.annotations.Mapper; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import org.dromara.property.domain.vo.smartDevicesVo.TbLightInfoVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java index e6f62996..2351ce3b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java @@ -1,7 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; import org.apache.ibatis.annotations.Mapper; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterConfigVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java index d454c792..9088dabd 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java @@ -1,6 +1,6 @@ package org.dromara.property.mapper.smartDevicesMapper; -import org.dromara.property.domain.TbMeterInfo; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java index 4c227b72..e82a4650 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java @@ -1,6 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; -import org.dromara.property.domain.TbMeterRecord; +import org.apache.ibatis.annotations.Mapper; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; @@ -8,8 +9,9 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; * 抄记录Mapper接口 * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ +@Mapper public interface TbMeterRecordMapper extends BaseMapperPlus { } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java index d25eb64b..fd2d46bc 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java @@ -1,7 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; import org.apache.ibatis.annotations.Mapper; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRoomVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java index dfc34603..27b80192 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java @@ -15,7 +15,7 @@ import org.dromara.property.service.ITbFloorService; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbLightInfoBo; import org.dromara.property.domain.vo.smartDevicesVo.TbLightInfoVo; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import org.dromara.property.mapper.smartDevicesMapper.TbLightInfoMapper; import org.dromara.property.service.smartDevicesService.ITbLightInfoService; import org.springframework.transaction.annotation.Transactional; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java index 79cb1773..97e8c93d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java @@ -11,7 +11,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterConfigBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterConfigVo; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import org.dromara.property.mapper.smartDevicesMapper.TbMeterConfigMapper; import org.dromara.property.service.smartDevicesService.ITbMeterConfigService; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java index 2ee24780..95ad1150 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java @@ -12,7 +12,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo; -import org.dromara.property.domain.TbMeterInfo; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.property.mapper.smartDevicesMapper.TbMeterInfoMapper; import org.dromara.property.service.smartDevicesService.ITbMeterInfoService; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java index de4d9fd7..cd225632 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java @@ -12,7 +12,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRecordBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo; -import org.dromara.property.domain.TbMeterRecord; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import org.dromara.property.mapper.smartDevicesMapper.TbMeterRecordMapper; import org.dromara.property.service.smartDevicesService.ITbMeterRecordService; @@ -75,13 +75,13 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByAsc(TbMeterRecord::getId); lqw.eq(StringUtils.isNotBlank(bo.getMeterId()), TbMeterRecord::getMeterId, bo.getMeterId()); + lqw.eq(bo.getMeterType() != null, TbMeterRecord::getMeterType, bo.getMeterType()); lqw.eq(bo.getReaderId() != null, TbMeterRecord::getReaderId, bo.getReaderId()); lqw.eq(bo.getReadingTime() != null, TbMeterRecord::getReadingTime, bo.getReadingTime()); lqw.eq(bo.getCurrentReading() != null, TbMeterRecord::getCurrentReading, bo.getCurrentReading()); lqw.eq(bo.getPreviousReading() != null, TbMeterRecord::getPreviousReading, bo.getPreviousReading()); - lqw.eq(bo.getConsumption() != null, TbMeterRecord::getConsumption, bo.getConsumption()); lqw.eq(bo.getReadingMethod() != null, TbMeterRecord::getReadingMethod, bo.getReadingMethod()); - lqw.eq(bo.getImgOssid() != null, TbMeterRecord::getImgOssid, bo.getImgOssid()); + lqw.eq(bo.getImgOssId() != null, TbMeterRecord::getImgOssId, bo.getImgOssId()); return lqw; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java index 2c4ebdda..026720d9 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java @@ -11,7 +11,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRoomBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRoomVo; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import org.dromara.property.mapper.smartDevicesMapper.TbMeterRoomMapper; import org.dromara.property.service.smartDevicesService.ITbMeterRoomService; From 360f87ea0dc2af91f7ff580ae565d2fefa772a0e Mon Sep 17 00:00:00 2001 From: bichangxiong <3057647414@qq.com> Date: Mon, 25 Aug 2025 18:35:30 +0800 Subject: [PATCH 21/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/mas?= =?UTF-8?q?ter.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/master.yml b/.gitea/workflows/master.yml index aabf353d..52fde7ea 100644 --- a/.gitea/workflows/master.yml +++ b/.gitea/workflows/master.yml @@ -3,7 +3,7 @@ name: Build and Push to Target Registry # 监听master分支的推送事件 on: push: - branches: [ master ] + branches: [ prod ] jobs: build-and-deploy: From e949122b37ecfc4438676570f809e9348730fe8f Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Tue, 26 Aug 2025 09:47:32 +0800 Subject: [PATCH 22/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E6=94=B6=E8=B4=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/service/impl/CostCarChargeServiceImpl.java | 3 ++- .../ruoyi-nacos/src/main/resources/application.properties | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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-visual/ruoyi-nacos/src/main/resources/application.properties b/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties index ef3ece6a..40aba4ad 100644 --- a/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties +++ b/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties @@ -40,9 +40,9 @@ spring.sql.init.platform=mysql db.num=1 ### Connect URL of DB: -db.url.0=jdbc:mysql://10.20.1.65:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true +db.url.0=jdbc:mysql://192.168.159.129:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true db.user.0=root -db.password.0=By@2025! +db.password.0=123456 ### the maximum retry times for push nacos.config.push.maxRetryTime=50 From a6b0277ff62644e7fb1c3c14d8a334bded587e59 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Tue, 26 Aug 2025 10:26:47 +0800 Subject: [PATCH 23/30] =?UTF-8?q?fix:=E7=BB=BF=E6=A4=8D=E7=A7=9F=E8=B5=81?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/mapper/PlantsPlanProductMapper.java | 1 + .../service/IPlantsPlanProductService.java | 6 ++++++ .../service/impl/PlantsPlanProductServiceImpl.java | 14 ++++++++++++++ .../service/impl/PlantsRentalPlanServiceImpl.java | 4 ++++ .../mapper/Property/PlantsPlanProductMapper.xml | 7 +++++++ 5 files changed, 32 insertions(+) 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/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/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} + + +