Merge branch 'master' of http://47.109.37.87:3000/by2025/SmartParks
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -40,7 +40,7 @@ public class CustomerContingenPlanController extends BaseController {
|
||||
/**
|
||||
* 查询客户服务-应急预案列表
|
||||
*/
|
||||
@SaCheckPermission("system:contingenPlan:list")
|
||||
// @SaCheckPermission("system:contingenPlan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CustomerContingenPlanVo> list(CustomerContingenPlanBo bo, PageQuery pageQuery) {
|
||||
return customerContingenPlanService.queryPageList(bo, pageQuery);
|
||||
|
@@ -3,7 +3,7 @@ package org.dromara.property.controller;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.property.domain.vo.ServeceCustomerCountVo;
|
||||
import org.dromara.property.domain.vo.ServiceWorkOrderAnalysisVo;
|
||||
import org.dromara.property.service.IServiceWorkOrdersService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/7/21 15:25
|
||||
* @Description:客户服务控制器
|
||||
* @Description:工单看板控制器
|
||||
**/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@@ -25,7 +25,7 @@ public class CustomerServeceController extends BaseController {
|
||||
* 查询客户服务工单看板统计
|
||||
*/
|
||||
@GetMapping("/counts")
|
||||
public R<ServeceCustomerCountVo> counts() {
|
||||
public R<ServiceWorkOrderAnalysisVo> counts() {
|
||||
return R.ok(serviceWorkOrdersService.counts());
|
||||
}
|
||||
|
||||
|
@@ -57,6 +57,10 @@ public class CustomerFeedbacks extends TenantEntity {
|
||||
*/
|
||||
private String feedbackImg;
|
||||
|
||||
/**
|
||||
* 是否转至工单
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 是否转至工单
|
||||
*/
|
||||
|
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -13,7 +12,7 @@ import java.io.Serial;
|
||||
* 入驻员工对象 resident_person
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -89,6 +88,11 @@ public class ResidentPerson extends TenantEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 权限组
|
||||
*/
|
||||
private Long authGroupId;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
|
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -13,7 +12,7 @@ import java.io.Serial;
|
||||
* 入驻单位对象 resident_unit
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -79,6 +78,11 @@ public class ResidentUnit extends TenantEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 权限组
|
||||
*/
|
||||
private Long authGroupId;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
|
@@ -42,7 +42,7 @@ public class ServiceWorkOrders extends TenantEntity {
|
||||
/**
|
||||
* 工单类型
|
||||
*/
|
||||
private Long type;
|
||||
private Long type;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@@ -59,7 +59,7 @@ public class CustomerFeedbacksBo extends BaseEntity {
|
||||
/**
|
||||
* 反馈图片
|
||||
*/
|
||||
@NotBlank(message = "反馈图片不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "反馈图片不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String feedbackImg;
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public class CustomerFeedbacksBo extends BaseEntity {
|
||||
private String isWorkOrder;
|
||||
|
||||
/**
|
||||
* 状态(1待处理2处理中3处理完成)
|
||||
* 状态(0待处理1处理中2处理完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
@@ -9,13 +9,12 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 入驻员工业务对象 resident_person
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -86,7 +85,13 @@ public class ResidentPersonBo extends BaseEntity {
|
||||
* 状态
|
||||
*/
|
||||
// @NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long state=1l;
|
||||
private Long state=1L;
|
||||
|
||||
/**
|
||||
* 权限组
|
||||
*/
|
||||
@NotNull(message = "权限组不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long authGroupId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
@@ -9,13 +9,12 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 入驻单位业务对象 resident_unit
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -80,7 +79,13 @@ public class ResidentUnitBo extends BaseEntity {
|
||||
* 员工人数
|
||||
*/
|
||||
// @NotNull(message = "员工人数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long number=0l;
|
||||
private Long number=0L;
|
||||
|
||||
/**
|
||||
* 权限组
|
||||
*/
|
||||
@NotNull(message = "权限组不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long authGroupId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
@@ -1,18 +1,14 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +16,7 @@ import java.util.Date;
|
||||
* 入驻员工视图对象 resident_person
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@@ -108,5 +104,11 @@ public class ResidentPersonVo implements Serializable {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 权限组id
|
||||
*/
|
||||
@ExcelProperty(value = "权限组id")
|
||||
private Long authGroupId;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,18 +1,14 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.ResidentUnit;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +16,7 @@ import java.util.Date;
|
||||
* 入驻单位视图对象 resident_unit
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@@ -107,5 +103,10 @@ public class ResidentUnitVo implements Serializable {
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 权限组id
|
||||
*/
|
||||
@ExcelProperty(value = "权限组id")
|
||||
private Long authGroupId;
|
||||
|
||||
}
|
||||
|
@@ -1,52 +0,0 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/7/21 15:29
|
||||
* @Description:客户服务工单统计看板
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ServeceCustomerCountVo implements Serializable {
|
||||
/**
|
||||
* 工单总数
|
||||
*/
|
||||
private Integer workOrdersTotal;
|
||||
/**
|
||||
* 未派工单总数
|
||||
*/
|
||||
private Integer notWorkOrdersTotal;
|
||||
/**
|
||||
* 未半结超时工单
|
||||
*/
|
||||
private Integer novertimeOrdersTotal;
|
||||
/**
|
||||
* 处理中工单
|
||||
*/
|
||||
private Integer InHandOrdersTotal;
|
||||
/**
|
||||
* 当月工单超时率
|
||||
*/
|
||||
private Double novertimeOrdersRate;
|
||||
/**
|
||||
* 当月工单数
|
||||
*/
|
||||
private Integer monthOrdersTotal;
|
||||
/**
|
||||
* 超时工单数
|
||||
*/
|
||||
private Integer outTimeOrdersTotal;
|
||||
/**
|
||||
* 当月满意度
|
||||
*/
|
||||
private Double monthoSatisfaction;
|
||||
/**
|
||||
* 满意数
|
||||
*/
|
||||
private Integer satisfaction;
|
||||
}
|
@@ -0,0 +1,115 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class ServiceWorkOrderAnalysisVo {
|
||||
/**
|
||||
* 工单看板当前周折线图
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class LineChartVo {
|
||||
private String date;
|
||||
private String dayOfWeek;
|
||||
private long count;
|
||||
|
||||
public LineChartVo(String date, String dayOfWeek, long count) {
|
||||
this.date = date;
|
||||
this.dayOfWeek = dayOfWeek;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单看板饼型图
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class PieChartVo {
|
||||
private String type; // 工单类型
|
||||
private Long quantity; // 工单类型
|
||||
private double percentage; // 占比
|
||||
|
||||
public PieChartVo(String type, Long quantity, double percentage) {
|
||||
this.type = type;
|
||||
this.quantity = quantity;
|
||||
this.percentage = percentage;
|
||||
}
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
|
||||
// Builder Pattern for ServiceWorkOrderAnalysisVo
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class ServiceWorkOrderCount {
|
||||
private int workOrdersTotal;
|
||||
private int notWorkOrdersTotal;
|
||||
private int novertimeOrdersTotal;
|
||||
private int inHandOrdersTotal;
|
||||
private double novertimeOrdersRate;
|
||||
private int monthOrdersTotal;
|
||||
private int outTimeOrdersTotal;
|
||||
private double monthoSatisfaction;
|
||||
private int satisfaction;
|
||||
private List<LineChartVo> recentWeekWorkOrders;
|
||||
private List<PieChartVo> workOrderTypeDistribution;
|
||||
|
||||
// Setters
|
||||
public ServiceWorkOrderCount setWorkOrdersTotal(int workOrdersTotal) {
|
||||
this.workOrdersTotal = workOrdersTotal;
|
||||
return this;
|
||||
}
|
||||
// ...其他Setter...
|
||||
|
||||
public ServiceWorkOrderCount setRecentWeekWorkOrders(List<LineChartVo> recentWeekWorkOrders) {
|
||||
this.recentWeekWorkOrders = recentWeekWorkOrders;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ServiceWorkOrderCount setWorkOrderTypeDistribution(List<PieChartVo> workOrderTypeDistribution) {
|
||||
this.workOrderTypeDistribution = workOrderTypeDistribution;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ServiceWorkOrderAnalysisVo build() {
|
||||
ServiceWorkOrderAnalysisVo vo = new ServiceWorkOrderAnalysisVo();
|
||||
vo.workOrdersTotal = this.workOrdersTotal;
|
||||
vo.notWorkOrdersTotal = this.notWorkOrdersTotal;
|
||||
vo.novertimeOrdersTotal = this.novertimeOrdersTotal;
|
||||
vo.inHandOrdersTotal = this.inHandOrdersTotal;
|
||||
vo.novertimeOrdersRate = this.novertimeOrdersRate;
|
||||
vo.monthOrdersTotal = this.monthOrdersTotal;
|
||||
vo.outTimeOrdersTotal = this.outTimeOrdersTotal;
|
||||
vo.monthoSatisfaction = this.monthoSatisfaction;
|
||||
vo.satisfaction = this.satisfaction;
|
||||
vo.recentWeekWorkOrders = this.recentWeekWorkOrders;
|
||||
vo.workOrderTypeDistribution = this.workOrderTypeDistribution;
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
private int workOrdersTotal;
|
||||
private int notWorkOrdersTotal;
|
||||
private int novertimeOrdersTotal;
|
||||
private int inHandOrdersTotal;
|
||||
private double novertimeOrdersRate;
|
||||
private int monthOrdersTotal;
|
||||
private int outTimeOrdersTotal;
|
||||
private double monthoSatisfaction;
|
||||
private int satisfaction;
|
||||
private List<LineChartVo> recentWeekWorkOrders;
|
||||
private List<PieChartVo> workOrderTypeDistribution;
|
||||
|
||||
// Constructor is private to enforce use of builder pattern
|
||||
public ServiceWorkOrderAnalysisVo() {
|
||||
}
|
||||
|
||||
// Getters...
|
||||
}
|
@@ -3,7 +3,7 @@ package org.dromara.property.service;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.property.domain.bo.ServiceWorkOrdersBo;
|
||||
import org.dromara.property.domain.vo.ServeceCustomerCountVo;
|
||||
import org.dromara.property.domain.vo.ServiceWorkOrderAnalysisVo;
|
||||
import org.dromara.property.domain.vo.ServiceWorkOrdersInfoVo;
|
||||
import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
||||
|
||||
@@ -72,6 +72,6 @@ public interface IServiceWorkOrdersService {
|
||||
* 工单服务看板
|
||||
* @return
|
||||
*/
|
||||
ServeceCustomerCountVo counts();
|
||||
ServiceWorkOrderAnalysisVo counts();
|
||||
|
||||
}
|
||||
|
@@ -76,27 +76,23 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
|
||||
if (CollUtil.isEmpty(result.getRecords())) {
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
List<Long> itemIdList = result.getRecords().stream()
|
||||
.map(vo -> vo.getItemId())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<Long> roomIdList = result.getRecords().stream()
|
||||
.map(vo -> vo.getChargeId())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<CostItemsVo> costItemsVoList = costItemsMapper.selectVoByIds(itemIdList);
|
||||
List<TbRoomVo> roomVoList = roomMapper.selectVoByIds(roomIdList);
|
||||
|
||||
List<CostItemsVo> costItemsVoList = costItemsMapper.selectVoList();
|
||||
List<TbRoomVo> roomVoList = roomMapper.selectVoList();
|
||||
List<CostPayFeeAuditVo> costPayFeeAuditVoList = new ArrayList<>();
|
||||
result.getRecords().stream().forEach(s -> {
|
||||
CostItemsVo costItemsVo = costItemsVoList.stream()
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getItemId())).findFirst().orElse(null);
|
||||
s.setChargeItem(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeItem() : null);
|
||||
s.setCostType(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getCostType() : null);
|
||||
s.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null);
|
||||
TbRoomVo tbRoomVo = roomVoList.stream()
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getChargeId())).findFirst().orElse(null);
|
||||
s.setRoomNumber(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo.getRoomNumber() : null);
|
||||
|
||||
if (CollUtil.isNotEmpty(costItemsVoList)) {
|
||||
CostItemsVo costItemsVo = costItemsVoList.stream()
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getItemId())).findFirst().orElse(null);
|
||||
s.setChargeItem(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeItem() : null);
|
||||
s.setCostType(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getCostType() : null);
|
||||
s.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(roomVoList)) {
|
||||
TbRoomVo tbRoomVo = roomVoList.stream()
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getChargeId())).findFirst().orElse(null);
|
||||
s.setRoomNumber(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo.getRoomNumber() : null);
|
||||
}
|
||||
costPayFeeAuditVoList.add(s);
|
||||
});
|
||||
Page<CostPayFeeAuditVo> costPayFeeAuditVoPage = new Page<CostPayFeeAuditVo>()
|
||||
|
@@ -47,7 +47,12 @@ public class CustomerContingenPlanServiceImpl implements ICustomerContingenPlanS
|
||||
*/
|
||||
@Override
|
||||
public CustomerContingenPlanVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
CustomerContingenPlanVo customerContingenPlanVo = baseMapper.selectVoById(id);
|
||||
ResidentPerson residentPerson = residentPersonMapper.selectById(customerContingenPlanVo.getInitiat());
|
||||
customerContingenPlanVo.setInitiatName(ObjectUtil.isNotEmpty(residentPerson)?residentPerson.getUserName():null);
|
||||
ResidentPerson dutyPerson = residentPersonMapper.selectById(customerContingenPlanVo.getDutyPersion());
|
||||
customerContingenPlanVo.setDutyPersionName(ObjectUtil.isNotEmpty(residentPerson)?dutyPerson.getUserName():null);
|
||||
return customerContingenPlanVo;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,10 +70,10 @@ public class CustomerContingenPlanServiceImpl implements ICustomerContingenPlanS
|
||||
if (CollUtil.isNotEmpty(residentPeoplelist)) {
|
||||
result.getRecords().stream().forEach(s -> {
|
||||
ResidentPerson residentInitiatVo = residentPeoplelist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getInitiat())).findFirst().orElse(null);
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getInitiat())).findFirst().orElse(null);
|
||||
s.setInitiatName(ObjectUtil.isNotEmpty(residentInitiatVo)?residentInitiatVo.getUserName():null);
|
||||
ResidentPerson residentDutyVo = residentPeoplelist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getDutyPersion())).findFirst().orElse(null);
|
||||
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getDutyPersion())).findFirst().orElse(null);
|
||||
s.setDutyPersionName(ObjectUtil.isNotEmpty(residentDutyVo)?residentDutyVo.getUserName():null);
|
||||
});
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.TableDataInfo;
|
||||
@@ -9,6 +11,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.mapper.ResidentPersonMapper;
|
||||
import org.dromara.resource.api.RemoteMessageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.CustomerNoticesBo;
|
||||
import org.dromara.property.domain.vo.CustomerNoticesVo;
|
||||
@@ -16,9 +20,11 @@ import org.dromara.property.domain.CustomerNotices;
|
||||
import org.dromara.property.mapper.CustomerNoticesMapper;
|
||||
import org.dromara.property.service.ICustomerNoticesService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 客户服务-通知公告Service业务层处理
|
||||
@@ -32,6 +38,9 @@ import java.util.Collection;
|
||||
public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
|
||||
private final CustomerNoticesMapper baseMapper;
|
||||
private final ResidentPersonMapper residentPersonMapper;
|
||||
@DubboReference
|
||||
private RemoteMessageService remoteMessageService;
|
||||
|
||||
/**
|
||||
* 查询客户服务-通知公告
|
||||
@@ -97,6 +106,16 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
if(bo.getIsAll().equals("0")){
|
||||
remoteMessageService.publishAll(bo.getTitle());
|
||||
}
|
||||
if(bo.getIsAll().equals("1") && ObjectUtil.isNotEmpty(bo.getNoticePersion())){
|
||||
String[] noticePersion = bo.getNoticePersion().split(",");
|
||||
List<Long> userIdList = Arrays.stream(noticePersion)
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
remoteMessageService.publishMessage(userIdList,bo.getTitle());
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
@@ -110,7 +129,7 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
@Override
|
||||
public Boolean updateByBo(CustomerNoticesBo bo) {
|
||||
CustomerNotices update = MapstructUtils.convert(bo, CustomerNotices.class);
|
||||
validEntityBeforeSave(update);
|
||||
validEntityBeforeUpdate(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
@@ -120,7 +139,12 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService {
|
||||
private void validEntityBeforeSave(CustomerNotices entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeUpdate(CustomerNotices entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
/**
|
||||
* 校验并批量删除客户服务-通知公告信息
|
||||
*
|
||||
|
@@ -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.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -58,12 +59,12 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
MeetBookingDetailVo meetBookingDetailVo = BeanUtil.copyProperties(meetBookingVo, MeetBookingDetailVo.class);
|
||||
MeetVo meetVo = meetMapper.selectVoById(meetBookingDetailVo.getMeetId());
|
||||
String locationName = roomMapper.queryRoomName(Long.valueOf(meetVo.getLocation()));
|
||||
meetBookingDetailVo.setLocationName(locationName);
|
||||
meetBookingDetailVo.setLocationName(ObjectUtil.isNotEmpty(locationName)?locationName:null);
|
||||
ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(Long.valueOf(meetBookingVo.getPerson()));
|
||||
meetBookingDetailVo.setPersonName(residentPersonVo.getUserName());
|
||||
meetBookingDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo)?residentPersonVo.getUserName():null);
|
||||
meetBookingDetailVo.setPhone(residentPersonVo.getPhone());
|
||||
ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(Long.valueOf(meetBookingVo.getUnit()));
|
||||
meetBookingDetailVo.setUnitName(residentUnitVo.getName());
|
||||
meetBookingDetailVo.setUnitName(ObjectUtil.isNotEmpty(residentPersonVo)?residentUnitVo.getName():null);
|
||||
return meetBookingDetailVo;
|
||||
}
|
||||
|
||||
@@ -78,30 +79,25 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
public TableDataInfo<MeetBookingVo> queryPageList(MeetBookingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<MeetBooking> lqw = buildQueryWrapper(bo);
|
||||
Page<MeetBookingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
List<String> units = result.getRecords().stream()
|
||||
.map(vo -> vo.getUnit())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<String> persons = result.getRecords().stream()
|
||||
.map(vo -> vo.getPerson())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoByIds(units);
|
||||
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoByIds(persons);
|
||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
|
||||
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoList();
|
||||
|
||||
List<MeetBookingVo> meetBookingVoList = new ArrayList<>();
|
||||
result.getRecords().stream().forEach(s -> {
|
||||
ResidentUnitVo residentUnitVo = residentUnitVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null);
|
||||
s.setUnitName(residentUnitVo.getName());
|
||||
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null);
|
||||
s.setPersonName(residentPersonVo.getUserName());
|
||||
s.setPhone(residentPersonVo.getPhone());
|
||||
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(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(residentPersonsVolist)) {
|
||||
ResidentPersonVo residentPersonVo = residentPersonsVolist.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);
|
||||
}
|
||||
meetBookingVoList.add(s);
|
||||
});
|
||||
return TableDataInfo.build(new Page<MeetBookingVo>().setRecords(meetBookingVoList));
|
||||
return TableDataInfo.build(new Page<MeetBookingVo>().setRecords(meetBookingVoList).setTotal(result.getTotal()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,25 +121,21 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
}
|
||||
List<MeetBookingAppointmentVo> meetBookingAppointmentVoList = MapstructUtils.convert(meetBookings, MeetBookingAppointmentVo.class);
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH");
|
||||
List<String> units = meetBookingAppointmentVoList.stream()
|
||||
.map(vo -> vo.getUnit())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<String> persons = meetBookingAppointmentVoList.stream()
|
||||
.map(vo -> vo.getPerson())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoByIds(units);
|
||||
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoByIds(persons);
|
||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
|
||||
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoList();
|
||||
meetBookingAppointmentVoList.stream().forEach(
|
||||
s -> {
|
||||
ResidentUnitVo residentUnitVo = residentUnitVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null);
|
||||
s.setUnitName(residentUnitVo.getName());
|
||||
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null);
|
||||
s.setPersonName(residentPersonVo.getUserName());
|
||||
s.setPhone(residentPersonVo.getPhone());
|
||||
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());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(residentPersonsVolist)) {
|
||||
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null);
|
||||
s.setPersonName(residentPersonVo.getUserName());
|
||||
s.setPhone(residentPersonVo.getPhone());
|
||||
}
|
||||
String str = df.format(s.getScheduledStarttime());
|
||||
int a = Integer.parseInt(str);
|
||||
s.setSlots(a <= 12 ? "上午" : "下午");
|
||||
@@ -188,23 +180,19 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
String[] weekStr = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
|
||||
List<MeetBookingWeekVo> meetBookingWeekList = new ArrayList<>();
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH");
|
||||
List<String> units = meetBookingVoList.stream()
|
||||
.map(vo -> vo.getUnit())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<String> persons = meetBookingVoList.stream()
|
||||
.map(vo -> vo.getPerson())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoByIds(units);
|
||||
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoByIds(persons);
|
||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
|
||||
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoList();
|
||||
meetBookingWeekVoList.stream().forEach(s -> {
|
||||
ResidentUnitVo residentUnitVo = residentUnitVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null);
|
||||
s.setUnitName(residentUnitVo.getName());
|
||||
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null);
|
||||
s.setPersonName(residentPersonVo.getUserName());
|
||||
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());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(residentPersonsVolist)) {
|
||||
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream()
|
||||
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null);
|
||||
s.setPersonName(residentPersonVo.getUserName());
|
||||
}
|
||||
//设置指定的Date对象不设置默认返回当天的星期
|
||||
calendar.setTime(s.getScheduledStarttime());
|
||||
//获取当前时间的星期
|
||||
|
@@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.idev.excel.event.Order;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -49,6 +48,7 @@ import java.util.stream.Collectors;
|
||||
public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
|
||||
private final ServiceWorkOrdersMapper baseMapper;
|
||||
private final ServiceWorkOrdersTypeMapper serviceWorkOrdersTypeMapper;
|
||||
private final ServiceWorkOrdersTypeMapper typesMapper;
|
||||
private final ResidentPersonMapper residentPersonMapper;
|
||||
private final ServiceWorkOrdersRecordMapper workOrdersRecordMapper;
|
||||
@@ -248,13 +248,15 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
|
||||
/**
|
||||
* 工单服务看板
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServeceCustomerCountVo counts() {
|
||||
public ServiceWorkOrderAnalysisVo counts() {
|
||||
List<ServiceWorkOrders> serviceWorkOrdersList = baseMapper.selectList(new QueryWrapper<>());
|
||||
|
||||
// 总工单数
|
||||
// 原有逻辑不变...
|
||||
// 总工单数
|
||||
int workOrdersTotal = serviceWorkOrdersList.size();
|
||||
|
||||
// 待派送工单(status = "0")
|
||||
@@ -293,7 +295,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
.filter(order -> order.getServiceEvalua() != null && order.getServiceEvalua()>= 4)
|
||||
.count();
|
||||
|
||||
// 当月满意度(当月工单中满意的占比)
|
||||
// 当月满意度(当月工单中满意的占比)
|
||||
int monthSatisfactionCount = (int) serviceWorkOrdersList.stream()
|
||||
.filter(order -> currentMonth.equals(order.getCreateTime())
|
||||
&& order.getServiceEvalua() != null
|
||||
@@ -302,8 +304,14 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
|
||||
double monthoSatisfaction = monthOrdersTotal == 0 ? 0.0 :
|
||||
(double) monthSatisfactionCount / monthOrdersTotal * 100;
|
||||
ServiceWorkOrderAnalysisVo serviceWorkOrderAnalysisVo =new ServiceWorkOrderAnalysisVo();
|
||||
// 获取近一周的工单统计
|
||||
List<ServiceWorkOrderAnalysisVo.LineChartVo> recentWeekData = getRecentWeekWorkOrders(serviceWorkOrdersList);
|
||||
|
||||
return new ServeceCustomerCountVo()
|
||||
// 计算工单类型分布
|
||||
List<ServiceWorkOrderAnalysisVo.PieChartVo> workOrderTypeDistribution = calculateWorkOrderTypeDistribution(serviceWorkOrdersList);
|
||||
|
||||
return new ServiceWorkOrderAnalysisVo.ServiceWorkOrderCount()
|
||||
.setWorkOrdersTotal(workOrdersTotal)
|
||||
.setNotWorkOrdersTotal(notWorkOrdersTotal)
|
||||
.setNovertimeOrdersTotal(novertimeOrdersTotal)
|
||||
@@ -312,6 +320,66 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
.setMonthOrdersTotal(monthOrdersTotal)
|
||||
.setOutTimeOrdersTotal(outTimeOrdersTotal)
|
||||
.setMonthoSatisfaction(monthoSatisfaction)
|
||||
.setSatisfaction(satisfaction);
|
||||
.setSatisfaction(satisfaction)
|
||||
.setRecentWeekWorkOrders(recentWeekData)
|
||||
.setWorkOrderTypeDistribution(workOrderTypeDistribution)
|
||||
.build();
|
||||
}
|
||||
|
||||
// 近一周工单统计方法
|
||||
private List<ServiceWorkOrderAnalysisVo.LineChartVo> getRecentWeekWorkOrders(List<ServiceWorkOrders> serviceWorkOrdersList) {
|
||||
LocalDate today = LocalDate.now();
|
||||
List<LocalDate> dateList = new ArrayList<>();
|
||||
for (int i = 6; i >= 0; i--) {
|
||||
dateList.add(today.minusDays(i));
|
||||
}
|
||||
|
||||
Map<String, Long> workOrdersByDate = serviceWorkOrdersList.stream()
|
||||
.filter(order -> {
|
||||
try {
|
||||
LocalDate createTime = LocalDate.parse((CharSequence) order.getCreateTime());
|
||||
return !createTime.isBefore(today.minusDays(7));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.collect(Collectors.groupingBy(
|
||||
order -> LocalDate.parse((CharSequence) order.getCreateTime()).format(DateTimeFormatter.ISO_LOCAL_DATE),
|
||||
Collectors.counting()
|
||||
));
|
||||
|
||||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
DateTimeFormatter dayOfWeekFormatter = DateTimeFormatter.ofPattern("E");
|
||||
|
||||
List<ServiceWorkOrderAnalysisVo.LineChartVo> result = new ArrayList<>();
|
||||
for (LocalDate date : dateList) {
|
||||
String dateStr = date.format(dateFormatter);
|
||||
String dayOfWeek = date.format(dayOfWeekFormatter);
|
||||
result.add(new ServiceWorkOrderAnalysisVo.LineChartVo(dateStr, dayOfWeek, workOrdersByDate.getOrDefault(dateStr, 0L)));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 计算工单类型分布
|
||||
private List<ServiceWorkOrderAnalysisVo.PieChartVo> calculateWorkOrderTypeDistribution(List<ServiceWorkOrders> serviceWorkOrdersList) {
|
||||
// 按 typeId 分组统计数量
|
||||
Map<Long, Long> workOrderTypeCounts = serviceWorkOrdersList.stream()
|
||||
.collect(Collectors.groupingBy(ServiceWorkOrders::getType, Collectors.counting()));
|
||||
|
||||
long total = serviceWorkOrdersList.size();
|
||||
List<ServiceWorkOrderAnalysisVo.PieChartVo> result = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<Long, Long> entry : workOrderTypeCounts.entrySet()) {
|
||||
Long typeId = entry.getKey();
|
||||
Long count = entry.getValue();
|
||||
// 查询类型名称
|
||||
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(typeId);
|
||||
String typeName = serviceWorkOrdersType != null ? serviceWorkOrdersType.getOrderTypeName() : "未知类型";
|
||||
// 计算占比(保留两位小数)
|
||||
double percentage = Math.round(((double) count / total) * 10000) / 100.0;
|
||||
result.add(new ServiceWorkOrderAnalysisVo.PieChartVo(typeName, count, percentage));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,106 @@
|
||||
package org.dromara.sis.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.sis.domain.vo.SisAuthGroupVo;
|
||||
import org.dromara.sis.domain.bo.SisAuthGroupBo;
|
||||
import org.dromara.sis.service.ISisAuthGroupService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 授权组
|
||||
* 前端访问路由地址为:/sis/authGroup
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/authGroup")
|
||||
public class SisAuthGroupController extends BaseController {
|
||||
|
||||
private final ISisAuthGroupService sisAuthGroupService;
|
||||
|
||||
/**
|
||||
* 查询授权组列表
|
||||
*/
|
||||
@SaCheckPermission("sis:authGroup:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SisAuthGroupVo> list(SisAuthGroupBo bo, PageQuery pageQuery) {
|
||||
return sisAuthGroupService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出授权组列表
|
||||
*/
|
||||
@SaCheckPermission("sis:authGroup:export")
|
||||
@Log(title = "授权组", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SisAuthGroupBo bo, HttpServletResponse response) {
|
||||
List<SisAuthGroupVo> list = sisAuthGroupService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "授权组", SisAuthGroupVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取授权组详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("sis:authGroup:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SisAuthGroupVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(sisAuthGroupService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增授权组
|
||||
*/
|
||||
@SaCheckPermission("sis:authGroup:add")
|
||||
@Log(title = "授权组", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SisAuthGroupBo bo) {
|
||||
return toAjax(sisAuthGroupService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改授权组
|
||||
*/
|
||||
@SaCheckPermission("sis:authGroup:edit")
|
||||
@Log(title = "授权组", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SisAuthGroupBo bo) {
|
||||
return toAjax(sisAuthGroupService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除授权组
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("sis:authGroup:remove")
|
||||
@Log(title = "授权组", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(sisAuthGroupService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package org.dromara.sis.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 授权组对象 sis_auth_group
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sis_auth_group")
|
||||
public class SisAuthGroup extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 权限名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 面向对象(1-单位、2-个人)
|
||||
*/
|
||||
private Long groupType;
|
||||
|
||||
/**
|
||||
* 是否启用(0:禁用,1启用)
|
||||
*/
|
||||
private Boolean isEnable;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package org.dromara.sis.domain.bo;
|
||||
|
||||
import org.dromara.sis.domain.SisAuthGroup;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 授权组业务对象 sis_auth_group
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = SisAuthGroup.class, reverseConvertGenerate = false)
|
||||
public class SisAuthGroupBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 权限名称
|
||||
*/
|
||||
@NotBlank(message = "权限名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 面向对象(1-单位、2-个人)
|
||||
*/
|
||||
@NotNull(message = "面向对象(1-单位、2-个人)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long groupType;
|
||||
|
||||
/**
|
||||
* 是否启用(0:禁用,1启用)
|
||||
*/
|
||||
private Boolean isEnable;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package org.dromara.sis.domain.vo;
|
||||
|
||||
import org.dromara.sis.domain.SisAuthGroup;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 授权组视图对象 sis_auth_group
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = SisAuthGroup.class)
|
||||
public class SisAuthGroupVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 权限名称
|
||||
*/
|
||||
@ExcelProperty(value = "权限名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 面向对象(1-单位、2-个人)
|
||||
*/
|
||||
@ExcelProperty(value = "面向对象(1-单位、2-个人)")
|
||||
private Long groupType;
|
||||
|
||||
/**
|
||||
* 是否启用(0:禁用,1启用)
|
||||
*/
|
||||
@ExcelProperty(value = "是否启用(0:禁用,1启用)")
|
||||
private Boolean isEnable;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package org.dromara.sis.mapper;
|
||||
|
||||
import org.dromara.sis.domain.SisAuthGroup;
|
||||
import org.dromara.sis.domain.vo.SisAuthGroupVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 授权组Mapper接口
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface SisAuthGroupMapper extends BaseMapperPlus<SisAuthGroup, SisAuthGroupVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package org.dromara.sis.service;
|
||||
|
||||
import org.dromara.sis.domain.SisAuthGroup;
|
||||
import org.dromara.sis.domain.vo.SisAuthGroupVo;
|
||||
import org.dromara.sis.domain.bo.SisAuthGroupBo;
|
||||
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 lsm
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface ISisAuthGroupService {
|
||||
|
||||
/**
|
||||
* 查询授权组
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 授权组
|
||||
*/
|
||||
SisAuthGroupVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询授权组列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 授权组分页列表
|
||||
*/
|
||||
TableDataInfo<SisAuthGroupVo> queryPageList(SisAuthGroupBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的授权组列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 授权组列表
|
||||
*/
|
||||
List<SisAuthGroupVo> queryList(SisAuthGroupBo bo);
|
||||
|
||||
/**
|
||||
* 新增授权组
|
||||
*
|
||||
* @param bo 授权组
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(SisAuthGroupBo bo);
|
||||
|
||||
/**
|
||||
* 修改授权组
|
||||
*
|
||||
* @param bo 授权组
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(SisAuthGroupBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除授权组信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@@ -0,0 +1,134 @@
|
||||
package org.dromara.sis.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.sis.domain.bo.SisAuthGroupBo;
|
||||
import org.dromara.sis.domain.vo.SisAuthGroupVo;
|
||||
import org.dromara.sis.domain.SisAuthGroup;
|
||||
import org.dromara.sis.mapper.SisAuthGroupMapper;
|
||||
import org.dromara.sis.service.ISisAuthGroupService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 授权组Service业务层处理
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SisAuthGroupServiceImpl implements ISisAuthGroupService {
|
||||
|
||||
private final SisAuthGroupMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询授权组
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 授权组
|
||||
*/
|
||||
@Override
|
||||
public SisAuthGroupVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询授权组列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 授权组分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SisAuthGroupVo> queryPageList(SisAuthGroupBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SisAuthGroup> lqw = buildQueryWrapper(bo);
|
||||
Page<SisAuthGroupVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的授权组列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 授权组列表
|
||||
*/
|
||||
@Override
|
||||
public List<SisAuthGroupVo> queryList(SisAuthGroupBo bo) {
|
||||
LambdaQueryWrapper<SisAuthGroup> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SisAuthGroup> buildQueryWrapper(SisAuthGroupBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SisAuthGroup> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(SisAuthGroup::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), SisAuthGroup::getName, bo.getName());
|
||||
lqw.eq(bo.getGroupType() != null, SisAuthGroup::getGroupType, bo.getGroupType());
|
||||
lqw.eq(bo.getIsEnable() != null, SisAuthGroup::getIsEnable, bo.getIsEnable());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增授权组
|
||||
*
|
||||
* @param bo 授权组
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(SisAuthGroupBo bo) {
|
||||
SisAuthGroup add = MapstructUtils.convert(bo, SisAuthGroup.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改授权组
|
||||
*
|
||||
* @param bo 授权组
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(SisAuthGroupBo bo) {
|
||||
SisAuthGroup update = MapstructUtils.convert(bo, SisAuthGroup.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SisAuthGroup entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除授权组信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user