新增热门活动
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 6m35s
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 6m35s
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
package org.dromara.property.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.property.domain.vo.PopularActivitiesVo;
|
||||
import org.dromara.property.domain.bo.PopularActivitiesBo;
|
||||
import org.dromara.property.service.IPopularActivitiesService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 热门活动
|
||||
* 前端访问路由地址为:/property/activities
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/activities")
|
||||
public class PopularActivitiesController extends BaseController {
|
||||
|
||||
private final IPopularActivitiesService popularActivitiesService;
|
||||
|
||||
/**
|
||||
* 查询热门活动列表
|
||||
*/
|
||||
@SaCheckPermission("property:activities:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PopularActivitiesVo> list(PopularActivitiesBo bo, PageQuery pageQuery) {
|
||||
return popularActivitiesService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出热门活动列表
|
||||
*/
|
||||
@SaCheckPermission("property:activities:export")
|
||||
@Log(title = "热门活动", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(PopularActivitiesBo bo, HttpServletResponse response) {
|
||||
List<PopularActivitiesVo> list = popularActivitiesService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "热门活动", PopularActivitiesVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取热门活动详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:activities:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PopularActivitiesVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(popularActivitiesService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增热门活动
|
||||
*/
|
||||
@SaCheckPermission("property:activities:add")
|
||||
@Log(title = "热门活动", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PopularActivitiesBo bo) {
|
||||
return toAjax(popularActivitiesService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改热门活动
|
||||
*/
|
||||
@SaCheckPermission("property:activities:edit")
|
||||
@Log(title = "热门活动", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PopularActivitiesBo bo) {
|
||||
return toAjax(popularActivitiesService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除热门活动
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("property:activities:remove")
|
||||
@Log(title = "热门活动", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(popularActivitiesService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 热门活动对象 popular_activities
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("popular_activities")
|
||||
public class PopularActivities extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 头部照片
|
||||
*/
|
||||
private String headImgUrl;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
*/
|
||||
private String activeContent;
|
||||
|
||||
/**
|
||||
* 状态(1.未开始 2.进行中 3.已结束)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,72 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.PopularActivities;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 热门活动业务对象 popular_activities
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PopularActivities.class, reverseConvertGenerate = false)
|
||||
public class PopularActivitiesBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 头部照片
|
||||
*/
|
||||
private String headImgUrl;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@NotNull(message = "结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
*/
|
||||
@NotBlank(message = "活动内容不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String activeContent;
|
||||
|
||||
/**
|
||||
* 状态(1.未开始 2.进行中 3.已结束)
|
||||
*/
|
||||
@NotBlank(message = "状态(1.未开始 2.进行中 3.已结束)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,83 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.PopularActivities;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 热门活动视图对象 popular_activities
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PopularActivities.class)
|
||||
public class PopularActivitiesVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 头部照片
|
||||
*/
|
||||
@ExcelProperty(value = "头部照片")
|
||||
private String headImgUrl;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
*/
|
||||
@ExcelProperty(value = "活动内容")
|
||||
private String activeContent;
|
||||
|
||||
/**
|
||||
* 状态(1.未开始 2.进行中 3.已结束)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "pro_activity_status")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ExcelProperty(value = "搜索值")
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.dromara.property.domain.PopularActivities;
|
||||
import org.dromara.property.domain.vo.PopularActivitiesVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 热门活动Mapper接口
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
public interface PopularActivitiesMapper extends BaseMapperPlus<PopularActivities, PopularActivitiesVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.PopularActivities;
|
||||
import org.dromara.property.domain.vo.PopularActivitiesVo;
|
||||
import org.dromara.property.domain.bo.PopularActivitiesBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 热门活动Service接口
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
public interface IPopularActivitiesService {
|
||||
|
||||
/**
|
||||
* 查询热门活动
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 热门活动
|
||||
*/
|
||||
PopularActivitiesVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询热门活动列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 热门活动分页列表
|
||||
*/
|
||||
TableDataInfo<PopularActivitiesVo> queryPageList(PopularActivitiesBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的热门活动列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 热门活动列表
|
||||
*/
|
||||
List<PopularActivitiesVo> queryList(PopularActivitiesBo bo);
|
||||
|
||||
/**
|
||||
* 新增热门活动
|
||||
*
|
||||
* @param bo 热门活动
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(PopularActivitiesBo bo);
|
||||
|
||||
/**
|
||||
* 修改热门活动
|
||||
*
|
||||
* @param bo 热门活动
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(PopularActivitiesBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除热门活动信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@@ -11,6 +11,7 @@ import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 【工单处理】Service接口
|
||||
@@ -87,4 +88,10 @@ public interface IServiceWorkOrdersService {
|
||||
*/
|
||||
Boolean insertMServiceWorkOrdersBo(MServiceWorkOrdersBo bo);
|
||||
|
||||
/**
|
||||
* 查询工单处理人枚举
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
List<Map<Object, Object>> getServiceWorkOrdersHandler(String type);
|
||||
}
|
||||
|
@@ -1,38 +1,30 @@
|
||||
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 jodd.util.StringUtil;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
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.satoken.utils.LoginHelper;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
import org.dromara.resource.api.RemoteMessageService;
|
||||
import org.dromara.system.api.model.LoginUser;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.CustomerNotices;
|
||||
import org.dromara.property.domain.bo.CustomerNoticesBo;
|
||||
import org.dromara.property.domain.vo.CustomerNoticesVo;
|
||||
import org.dromara.property.domain.CustomerNotices;
|
||||
import org.dromara.property.mapper.CustomerNoticesMapper;
|
||||
import org.dromara.property.service.ICustomerNoticesService;
|
||||
import org.dromara.resource.api.RemoteMessageService;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -47,9 +39,10 @@ import java.util.stream.Collectors;
|
||||
public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
|
||||
private final CustomerNoticesMapper baseMapper;
|
||||
private final ResidentPersonMapper residentPersonMapper;
|
||||
@DubboReference
|
||||
private RemoteMessageService remoteMessageService;
|
||||
@DubboReference
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询客户服务-通知公告
|
||||
@@ -59,23 +52,26 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
*/
|
||||
@Override
|
||||
public CustomerNoticesVo queryById(Long id) {
|
||||
List<ResidentPerson> residentPeople = residentPersonMapper.selectList();
|
||||
CustomerNoticesVo customerNoticesVo = baseMapper.selectVoById(id);
|
||||
if (CollUtil.isNotEmpty(residentPeople)) {
|
||||
ResidentPerson residentPerson = residentPeople.stream()
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(customerNoticesVo.getIssuers())).findFirst().orElse(null);
|
||||
customerNoticesVo.setIssuersName(residentPerson.getUserName());
|
||||
String nickName = remoteUserService.selectNicknameById(customerNoticesVo.getIssuers());
|
||||
customerNoticesVo.setIssuersName(nickName);
|
||||
if (ObjectUtil.isNotEmpty(customerNoticesVo.getNoticePersion())) {
|
||||
List<String> list = Arrays.asList(customerNoticesVo.getNoticePersion().split(","));
|
||||
List<ResidentPerson> filteredList = residentPeople.stream()
|
||||
.filter(person -> list.contains(person.getId().toString()))
|
||||
List<Long> idList = Arrays.stream(customerNoticesVo.getNoticePersion().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.filter(s -> s.matches("\\d+")) // 确保是数字格式
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
String usernames = filteredList.stream()
|
||||
.map(ResidentPerson::getUserName) // 假设ResidentPerson类有一个getUserName方法
|
||||
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(idList);
|
||||
List<RemoteUserVo> userVo = remoteUserVos.stream()
|
||||
.filter(person -> idList.contains(person.getUserId()))
|
||||
.collect(Collectors.toList());
|
||||
String usernames = userVo.stream()
|
||||
.map(RemoteUserVo::getNickName)
|
||||
// 假设ResidentPerson类有一个getUserName方法
|
||||
.collect(Collectors.joining(","));
|
||||
customerNoticesVo.setNoticePersionName(StringUtils.isNotBlank(usernames)?usernames:null);
|
||||
customerNoticesVo.setNoticePersionName(usernames);
|
||||
}
|
||||
}
|
||||
return customerNoticesVo;
|
||||
}
|
||||
|
||||
@@ -90,24 +86,51 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
public TableDataInfo<CustomerNoticesVo> queryPageList(CustomerNoticesBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CustomerNotices> lqw = buildQueryWrapper(bo);
|
||||
Page<CustomerNoticesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
// 将通知人字段和发布人字段装到一个list中,这两个字段都是用户id,放在一个list<Long>中
|
||||
List<Long> allUserIds = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(result.getRecords())) {
|
||||
List<ResidentPerson> residentPeople = residentPersonMapper.selectList();
|
||||
if (CollUtil.isNotEmpty(residentPeople)) {
|
||||
// 提取发布人ID
|
||||
List<Long> issuerIds = result.getRecords().stream()
|
||||
.filter(vo -> ObjectUtil.isNotEmpty(vo.getIssuers()))
|
||||
.map(CustomerNoticesVo::getIssuers)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
allUserIds.addAll(issuerIds);
|
||||
|
||||
// 提取所有通知人ID
|
||||
List<Long> noticePersonIds = result.getRecords().stream()
|
||||
.filter(vo -> StringUtils.isNotBlank(vo.getNoticePersion()))
|
||||
.flatMap(vo -> Arrays.stream(vo.getNoticePersion().split(",")))
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(String::trim)
|
||||
.distinct()
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
allUserIds.addAll(noticePersonIds);
|
||||
// 去重
|
||||
List<Long> uniqueUserIds = allUserIds.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(uniqueUserIds);
|
||||
if (CollUtil.isNotEmpty(remoteUserVos)) {
|
||||
result.getRecords().stream().forEach(s -> {
|
||||
ResidentPerson residentPerson = residentPeople.stream()
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getIssuers())).findFirst().orElse(null);
|
||||
s.setIssuersName(residentPerson.getUserName());
|
||||
RemoteUserVo remoteUserVo = remoteUserVos.stream()
|
||||
.filter(vo -> vo.getUserId() != null && vo.getUserId().equals(s.getIssuers())).findFirst().orElse(null);
|
||||
if(ObjectUtil.isNotEmpty(remoteUserVo)){
|
||||
s.setIssuersName(remoteUserVo.getNickName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(s.getNoticePersion())) {
|
||||
List<String> list = Arrays.asList(s.getNoticePersion().split(","));
|
||||
List<ResidentPerson> filteredList = residentPeople.stream()
|
||||
.filter(person -> list.contains(person.getId().toString()))
|
||||
List<RemoteUserVo> userVo = remoteUserVos.stream()
|
||||
.filter(person -> list.contains(person.getUserId().toString()))
|
||||
.collect(Collectors.toList());
|
||||
String usernames = filteredList.stream()
|
||||
.map(ResidentPerson::getUserName) // 假设ResidentPerson类有一个getUserName方法
|
||||
String usernames = userVo.stream()
|
||||
.map(RemoteUserVo::getNickName)
|
||||
// 假设ResidentPerson类有一个getUserName方法
|
||||
.collect(Collectors.joining(","));
|
||||
s.setIssuersName(usernames);
|
||||
s.setNoticePersionName(usernames);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -152,6 +175,7 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
public Boolean insertByBo(CustomerNoticesBo bo) {
|
||||
CustomerNotices add = MapstructUtils.convert(bo, CustomerNotices.class);
|
||||
validEntityBeforeSave(add);
|
||||
add.setIssuers(LoginHelper.getUserId());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
@@ -188,11 +212,6 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
*/
|
||||
private void validEntityBeforeSave(CustomerNotices entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
LoginUser user = LoginHelper.getLoginUser();
|
||||
ResidentPerson residentPerson = residentPersonMapper.selectOne(new LambdaQueryWrapper<ResidentPerson>()
|
||||
.eq(ResidentPerson::getUserId, user.getUserId()));
|
||||
Assert.isTrue(ObjectUtil.isNotEmpty(residentPerson), "该发布人未入住");
|
||||
entity.setIssuers(residentPerson.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -5,10 +5,7 @@ import org.dromara.property.domain.enums.BookingPayStatusEnum;
|
||||
import org.dromara.property.domain.enums.BookingStatusEnum;
|
||||
import org.dromara.property.domain.enums.MeetAttachStatusEnum;
|
||||
import org.dromara.property.domain.enums.MeetStatusEnum;
|
||||
import org.dromara.property.service.EnumFetcherService;
|
||||
import org.dromara.property.service.IMeetAttachService;
|
||||
import org.dromara.property.service.IMeetBookingService;
|
||||
import org.dromara.property.service.IMeetService;
|
||||
import org.dromara.property.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -32,6 +29,8 @@ public class EnumFetcherServiceImpl implements EnumFetcherService {
|
||||
private IMeetAttachService meetAttachService;
|
||||
@Autowired
|
||||
private IMeetBookingService meetBookingService;
|
||||
@Autowired
|
||||
private IServiceWorkOrdersService serviceWorkOrdersService;
|
||||
|
||||
@Override
|
||||
public List<Map<Object, Object>> getEnumValues(String type) {
|
||||
@@ -54,6 +53,8 @@ public class EnumFetcherServiceImpl implements EnumFetcherService {
|
||||
return getMeetBookingPayStatus();
|
||||
case "getMeetBookingStatus":
|
||||
return getMeetBookingStatus();
|
||||
case "getServiceWorkOrdersHandler":
|
||||
return serviceWorkOrdersService.getServiceWorkOrdersHandler(type);
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown type: " + type);
|
||||
}
|
||||
|
@@ -0,0 +1,136 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.PopularActivitiesBo;
|
||||
import org.dromara.property.domain.vo.PopularActivitiesVo;
|
||||
import org.dromara.property.domain.PopularActivities;
|
||||
import org.dromara.property.mapper.PopularActivitiesMapper;
|
||||
import org.dromara.property.service.IPopularActivitiesService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 热门活动Service业务层处理
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class PopularActivitiesServiceImpl implements IPopularActivitiesService {
|
||||
|
||||
private final PopularActivitiesMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询热门活动
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 热门活动
|
||||
*/
|
||||
@Override
|
||||
public PopularActivitiesVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询热门活动列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 热门活动分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<PopularActivitiesVo> queryPageList(PopularActivitiesBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<PopularActivities> lqw = buildQueryWrapper(bo);
|
||||
Page<PopularActivitiesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的热门活动列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 热门活动列表
|
||||
*/
|
||||
@Override
|
||||
public List<PopularActivitiesVo> queryList(PopularActivitiesBo bo) {
|
||||
LambdaQueryWrapper<PopularActivities> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<PopularActivities> buildQueryWrapper(PopularActivitiesBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<PopularActivities> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(PopularActivities::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), PopularActivities::getTitle, bo.getTitle());
|
||||
lqw.eq(bo.getStartTime() != null, PopularActivities::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, PopularActivities::getEndTime, bo.getEndTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), PopularActivities::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSearchValue()), PopularActivities::getSearchValue, bo.getSearchValue());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增热门活动
|
||||
*
|
||||
* @param bo 热门活动
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(PopularActivitiesBo bo) {
|
||||
PopularActivities add = MapstructUtils.convert(bo, PopularActivities.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改热门活动
|
||||
*
|
||||
* @param bo 热门活动
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(PopularActivitiesBo bo) {
|
||||
PopularActivities update = MapstructUtils.convert(bo, PopularActivities.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(PopularActivities entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除热门活动信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@@ -17,10 +17,7 @@ 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.satoken.utils.LoginHelper;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
import org.dromara.property.domain.ServiceWorkOrders;
|
||||
import org.dromara.property.domain.ServiceWorkOrdersRecord;
|
||||
import org.dromara.property.domain.ServiceWorkOrdersType;
|
||||
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.vo.*;
|
||||
@@ -168,7 +165,10 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
.map(ServiceWorkOrdersType::getId)
|
||||
.collect(Collectors.toList());
|
||||
typeIds.add(bo.getType());
|
||||
List<String> statusList = Arrays.asList(bo.getStatus().split(","));
|
||||
List<String> statusList = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(bo.getStatus())){
|
||||
statusList = Arrays.asList(bo.getStatus().split(","));
|
||||
}
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ServiceWorkOrders> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(ServiceWorkOrders::getId);
|
||||
@@ -518,5 +518,31 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
public List<ServiceWorkOrders> getList() {
|
||||
LambdaQueryWrapper<ServiceWorkOrders> serviceWorkOrdersWrapper = new LambdaQueryWrapper<>();
|
||||
return baseMapper.selectList(serviceWorkOrdersWrapper);
|
||||
|
||||
}
|
||||
@Override
|
||||
public List<Map<Object, Object>> getServiceWorkOrdersHandler(String type) {
|
||||
return switch (type) {
|
||||
case "getServiceWorkOrdersHandler" -> getList().stream()
|
||||
.map(ServiceWorkOrders::getHandler)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.map(handler -> {
|
||||
Map<Object, Object> map = new HashMap<>();
|
||||
map.put("value", handler);
|
||||
// 获取处理人详细信息
|
||||
RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(handler));
|
||||
map.put("name", ObjectUtil.isNotNull(userInfo) ? userInfo.getNickName() : handler);
|
||||
return map;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
default -> throw new IllegalArgumentException("Unknown type: " + type);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.property.mapper.PopularActivitiesMapper">
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user