Compare commits
20 Commits
638a98a4c6
...
master
Author | SHA1 | Date | |
---|---|---|---|
76c0aa74f1 | |||
e61b56b05e | |||
eb1b2084b5 | |||
4d76a4df45 | |||
368eea91e8 | |||
816b90e9e1 | |||
6133d7761d | |||
318da3f0ee | |||
3c8eb59165 | |||
3c480d92f0 | |||
78d97e14ee | |||
c2c1818ba6 | |||
3ebc58f5e3 | |||
07b9e8b722 | |||
b20828a800 | |||
9c0b0bad03 | |||
a16c333759 | |||
a6b0277ff6 | |||
ef0976c621 | |||
e949122b37 |
@@ -125,6 +125,11 @@
|
|||||||
<artifactId>ruoyi-common-websocket</artifactId>
|
<artifactId>ruoyi-common-websocket</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@@ -13,6 +13,7 @@ import org.dromara.common.web.core.BaseController;
|
|||||||
import org.dromara.property.domain.bo.ServiceWorkOrdersBo;
|
import org.dromara.property.domain.bo.ServiceWorkOrdersBo;
|
||||||
import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo;
|
import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo;
|
||||||
import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
||||||
|
import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo;
|
||||||
import org.dromara.property.service.IServiceWorkOrdersService;
|
import org.dromara.property.service.IServiceWorkOrdersService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -35,7 +36,6 @@ public class MServiceWorkOrdersController extends BaseController {
|
|||||||
* 小程序新增【工单处理】
|
* 小程序新增【工单处理】
|
||||||
*/
|
*/
|
||||||
@Log(title = "【小程序新增工单处理】", businessType = BusinessType.INSERT)
|
@Log(title = "【小程序新增工单处理】", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody MServiceWorkOrdersBo bo) {
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody MServiceWorkOrdersBo bo) {
|
||||||
return toAjax(serviceWorkOrdersService.insertMServiceWorkOrdersBo(bo));
|
return toAjax(serviceWorkOrdersService.insertMServiceWorkOrdersBo(bo));
|
||||||
@@ -44,7 +44,7 @@ public class MServiceWorkOrdersController extends BaseController {
|
|||||||
* 小程序查询【工单处理】
|
* 小程序查询【工单处理】
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<ServiceWorkOrdersVo> list(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
|
public TableDataInfo<MServiceWorkOrdersVo> list(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
|
||||||
return serviceWorkOrdersService.queryMobilePageList(bo, pageQuery);
|
return serviceWorkOrdersService.queryMobilePageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.common.core.domain.TreeNode;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
@@ -103,4 +104,17 @@ public class TbMeterInfoController extends BaseController {
|
|||||||
@PathVariable("ids") Long[] ids) {
|
@PathVariable("ids") Long[] ids) {
|
||||||
return toAjax(tbMeterInfoService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(tbMeterInfoService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成 社区/建组/单元/楼栋/(水电气表)树结构
|
||||||
|
*
|
||||||
|
* @param meterType 水电气类型
|
||||||
|
*
|
||||||
|
* @return (水电气表)树结构
|
||||||
|
*/
|
||||||
|
@GetMapping("/tree/{meterType}")
|
||||||
|
public R<List<TreeNode<Long>>> queryMeterInfoTree(@PathVariable("meterType") Long meterType) {
|
||||||
|
return R.ok(tbMeterInfoService.queryMeterInfoTree(meterType));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -103,4 +103,25 @@ public class TbMeterRecordController extends BaseController {
|
|||||||
@PathVariable("ids") Long[] ids) {
|
@PathVariable("ids") Long[] ids) {
|
||||||
return toAjax(tbMeterRecordService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(tbMeterRecordService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用电/水/气趋势分析数据
|
||||||
|
*
|
||||||
|
* @param floorId 楼层id
|
||||||
|
* @param meterId 仪表id
|
||||||
|
* @param meterType 仪表类型
|
||||||
|
* @param day 日期
|
||||||
|
* @param month 月份
|
||||||
|
* @param year 年份
|
||||||
|
*/
|
||||||
|
@GetMapping("/trend")
|
||||||
|
public R<Void> getEnergyTrend(@RequestParam(required = false) String floorId,
|
||||||
|
@RequestParam(required = false) String meterId,
|
||||||
|
@RequestParam Long meterType,
|
||||||
|
@RequestParam String day,
|
||||||
|
@RequestParam String month,
|
||||||
|
@RequestParam String year) {
|
||||||
|
tbMeterRecordService.getEnergyTrend(floorId, meterId, meterType, day, month, year);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -107,10 +107,6 @@ public class ServiceWorkOrdersBo extends BaseEntity {
|
|||||||
* 图片
|
* 图片
|
||||||
*/
|
*/
|
||||||
private String imgUrl;
|
private String imgUrl;
|
||||||
/**
|
|
||||||
* 工单图片
|
|
||||||
*/
|
|
||||||
private String orderImgUrl;
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@@ -105,6 +105,10 @@ public class MServiceWorkOrdersBo extends BaseEntity {
|
|||||||
* 工单图片
|
* 工单图片
|
||||||
*/
|
*/
|
||||||
private String orderImgUrl;
|
private String orderImgUrl;
|
||||||
|
/**
|
||||||
|
* 问题描述
|
||||||
|
*/
|
||||||
|
private String issueDesc;
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@@ -47,7 +47,7 @@ public class TbLightInfoBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 楼层ID
|
* 楼层ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "层ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
@NotNull(message = "楼层ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long floorId;
|
private Long floorId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -9,6 +9,8 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 水电气业务对象 tb_meter_info
|
* 水电气业务对象 tb_meter_info
|
||||||
*
|
*
|
||||||
@@ -23,7 +25,7 @@ public class TbMeterInfoBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 主键id
|
* 主键id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
@NotNull(message = "主键id不能为空", groups = {EditGroup.class})
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,15 +46,42 @@ public class TbMeterInfoBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 设备类型(1-电表,2-水表,3-气表)
|
* 设备类型(1-电表,2-水表,3-气表)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "设备类型(1-电表,2-水表,3-气表)不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "设备类型(1-电表,2-水表,3-气表)不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long meterType;
|
private Long meterType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计量单位(1-度,2-吨,3-立方米)
|
* 计量单位(1-度,2-吨,3-立方米)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "计量单位(1-度,2-吨,3-立方米)不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "计量单位(1-度,2-吨,3-立方米)不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long meterUnit;
|
private Long meterUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采集器IP
|
||||||
|
*/
|
||||||
|
@NotNull(message = "采集器IP不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String hostIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 楼层ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "楼层ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Long floorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区编码
|
||||||
|
*/
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 建筑名称
|
||||||
|
*/
|
||||||
|
private Long buildingId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单元编码
|
||||||
|
*/
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安装位置
|
* 安装位置
|
||||||
*/
|
*/
|
||||||
@@ -61,12 +90,12 @@ public class TbMeterInfoBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 初始读数
|
* 初始读数
|
||||||
*/
|
*/
|
||||||
private Long initReading;
|
private BigDecimal initReading;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最大量程
|
* 最大量程
|
||||||
*/
|
*/
|
||||||
private Long maxRang;
|
private BigDecimal maxRang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通信状态
|
* 通信状态
|
||||||
|
@@ -32,8 +32,8 @@ public class TbMeterRecordBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 仪表编号
|
* 仪表编号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "仪表编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "仪表编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String meterId;
|
private Long meterId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备类型(1-电表,2-水表,3-气表)
|
* 设备类型(1-电表,2-水表,3-气表)
|
||||||
|
@@ -6,6 +6,7 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 水电气对象 tb_meter_info
|
* 水电气对象 tb_meter_info
|
||||||
@@ -60,12 +61,12 @@ public class TbMeterInfo extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 初始读数
|
* 初始读数
|
||||||
*/
|
*/
|
||||||
private Long initReading;
|
private BigDecimal initReading;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最大量程
|
* 最大量程
|
||||||
*/
|
*/
|
||||||
private Long maxRang;
|
private BigDecimal maxRang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通信状态
|
* 通信状态
|
||||||
@@ -82,5 +83,30 @@ public class TbMeterInfo extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区编码
|
||||||
|
*/
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 建筑名称
|
||||||
|
*/
|
||||||
|
private Long buildingId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单元编码
|
||||||
|
*/
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属楼层ID
|
||||||
|
*/
|
||||||
|
private Long floorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采集器IP
|
||||||
|
*/
|
||||||
|
private String hostIp;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ public class TbMeterRecord extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 仪表编号
|
* 仪表编号
|
||||||
*/
|
*/
|
||||||
private String meterId;
|
private Long meterId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备类型(1-电表,2-水表,3-气表)
|
* 设备类型(1-电表,2-水表,3-气表)
|
||||||
|
@@ -0,0 +1,30 @@
|
|||||||
|
package org.dromara.property.domain.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费类型枚举
|
||||||
|
*/
|
||||||
|
public enum ChargeTypeEnum {
|
||||||
|
/**
|
||||||
|
* 房屋收费
|
||||||
|
*/
|
||||||
|
HOUS_CHARGES("房屋收费", "1"),
|
||||||
|
/**
|
||||||
|
* 车辆收费
|
||||||
|
*/
|
||||||
|
CARD_CHARGES("车辆收费", "2");
|
||||||
|
private final String name;
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
ChargeTypeEnum(String name, String value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,33 @@
|
|||||||
|
package org.dromara.property.domain.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lsm
|
||||||
|
* @apiNote MeterRecordTypeEnum
|
||||||
|
* @since 2025/8/27
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum MeterRecordTypeEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动上报
|
||||||
|
*/
|
||||||
|
MANUAL_RECORD(1L),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动上报
|
||||||
|
*/
|
||||||
|
AUTO_RECORD(2L),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户上报
|
||||||
|
*/
|
||||||
|
USER_RECORD(3L);
|
||||||
|
|
||||||
|
private final Long code;
|
||||||
|
|
||||||
|
MeterRecordTypeEnum(Long code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
}
|
@@ -53,8 +53,12 @@ public class CostPayFeeAuditVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 房间号(如101,202)
|
* 房间号(如101,202)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "房间号(如101,202)")
|
@ExcelProperty(value = "房间号")
|
||||||
private String roomNumber;
|
private String roomNumber;
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String carNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 费用项目id
|
* 费用项目id
|
||||||
|
@@ -146,6 +146,7 @@ public class ServiceWorkOrdersVo implements Serializable {
|
|||||||
* 图片
|
* 图片
|
||||||
*/
|
*/
|
||||||
private String imgUrl;
|
private String imgUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@@ -0,0 +1,61 @@
|
|||||||
|
package org.dromara.property.domain.vo.mobile;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.dromara.property.domain.ServiceWorkOrdersRecord;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author yuyongle
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2025/8/26 13:53
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = ServiceWorkOrdersRecord.class)
|
||||||
|
public class MServiceWorkOrdersRecordVo implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单id")
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0创建工单,1已派单2已抢单3处理中,4已完成)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "处理人")
|
||||||
|
private Long handler;
|
||||||
|
/**
|
||||||
|
* 处理人
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "处理人")
|
||||||
|
private String handlerName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
@@ -0,0 +1,166 @@
|
|||||||
|
package org.dromara.property.domain.vo.mobile;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.dromara.property.domain.ServiceWorkOrders;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author yuyongle
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2025/8/26 13:52
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = ServiceWorkOrders.class)
|
||||||
|
public class MServiceWorkOrdersVo implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单编号")
|
||||||
|
private String orderNo;
|
||||||
|
/**
|
||||||
|
* 权重
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "权重")
|
||||||
|
private String processingWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单名称")
|
||||||
|
private String orderName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单类型")
|
||||||
|
private Long type;
|
||||||
|
/**
|
||||||
|
* 上报类型
|
||||||
|
*/
|
||||||
|
private String reportingType;
|
||||||
|
/**
|
||||||
|
* 工单类型名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成,5已评价)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "派单时间")
|
||||||
|
private Date dispatchTime;
|
||||||
|
/**
|
||||||
|
* 运作模式(0派单+抢单,1派单,2自动派单)
|
||||||
|
*/
|
||||||
|
private String operationMode;
|
||||||
|
/**
|
||||||
|
* 发起人
|
||||||
|
*/
|
||||||
|
private String initiatorPeople;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人姓名
|
||||||
|
*/
|
||||||
|
private long handler;
|
||||||
|
/**
|
||||||
|
* 抄送人
|
||||||
|
*/
|
||||||
|
private long ccPeople;
|
||||||
|
/**
|
||||||
|
* 发起人手机号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "发起人手机号")
|
||||||
|
private String initiatorPhone;
|
||||||
|
/**
|
||||||
|
* 处理人姓名文本
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "处理人姓名文本")
|
||||||
|
private String handlerText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人姓名文本
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "处理人电话")
|
||||||
|
private String handlerPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "地址")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划完成时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "计划完成时间")
|
||||||
|
private Date planCompleTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "完成时间")
|
||||||
|
private Date compleTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评价
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "评价")
|
||||||
|
private Integer serviceEvalua;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否超时
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否超时")
|
||||||
|
private String isTimeOut;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评价文本
|
||||||
|
*/
|
||||||
|
private String serviceEvaluaText;
|
||||||
|
/**
|
||||||
|
* 工单图片
|
||||||
|
*/
|
||||||
|
private String orderImgUrl;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String imgUrl;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 工单记录
|
||||||
|
*/
|
||||||
|
List<MServiceWorkOrdersRecordVo> recordVoList;
|
||||||
|
}
|
@@ -10,7 +10,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +54,7 @@ public class TbMeterInfoVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 设备类型(1-电表,2-水表,3-气表)
|
* 设备类型(1-电表,2-水表,3-气表)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "设备类型(1-电表,2-水表,3-气表)" ,converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "设备类型(1-电表,2-水表,3-气表)", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "meter_type")
|
@ExcelDictFormat(dictType = "meter_type")
|
||||||
private Long meterType;
|
private Long meterType;
|
||||||
|
|
||||||
@@ -75,13 +75,13 @@ public class TbMeterInfoVo implements Serializable {
|
|||||||
* 初始读数
|
* 初始读数
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "初始读数")
|
@ExcelProperty(value = "初始读数")
|
||||||
private Long initReading;
|
private BigDecimal initReading;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最大量程
|
* 最大量程
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "最大量程")
|
@ExcelProperty(value = "最大量程")
|
||||||
private Long maxRang;
|
private BigDecimal maxRang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通信状态
|
* 通信状态
|
||||||
@@ -97,6 +97,42 @@ public class TbMeterInfoVo implements Serializable {
|
|||||||
@ExcelDictFormat(dictType = "sis_device_status")
|
@ExcelDictFormat(dictType = "sis_device_status")
|
||||||
private Long runningState;
|
private Long runningState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区编码
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "园区编码")
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 建筑名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "建筑名称")
|
||||||
|
private Long buildingId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单元编码
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "单元编码")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 楼层ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "楼层ID")
|
||||||
|
private Long floorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 楼层
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "楼层")
|
||||||
|
private String floorName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采集器IP
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "采集器IP")
|
||||||
|
private String hostIp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@@ -37,7 +37,7 @@ public class TbMeterRecordVo implements Serializable {
|
|||||||
* 仪表编号
|
* 仪表编号
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "仪表编号")
|
@ExcelProperty(value = "仪表编号")
|
||||||
private String meterId;
|
private Long meterId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备类型(1-电表,2-水表,3-气表)
|
* 设备类型(1-电表,2-水表,3-气表)
|
||||||
|
@@ -17,6 +17,7 @@ import java.util.List;
|
|||||||
public interface PlantsPlanProductMapper extends BaseMapperPlus<PlantsPlanProduct, PlantsPlanProductVo> {
|
public interface PlantsPlanProductMapper extends BaseMapperPlus<PlantsPlanProduct, PlantsPlanProductVo> {
|
||||||
|
|
||||||
void deleteByPlanId(Long planId);
|
void deleteByPlanId(Long planId);
|
||||||
|
void deleteByPlanIds(List<Long> planIds);
|
||||||
|
|
||||||
List<PlantsPlanProductVo> queryProductsInfo(Long planId);
|
List<PlantsPlanProductVo> queryProductsInfo(Long planId);
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package org.dromara.property.mapper.smartDevicesMapper;
|
package org.dromara.property.mapper.smartDevicesMapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.dromara.property.domain.entity.smartDevices.TbMeterInfo;
|
import org.dromara.property.domain.entity.smartDevices.TbMeterInfo;
|
||||||
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
|
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
@@ -8,8 +9,9 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
* 水电气Mapper接口
|
* 水电气Mapper接口
|
||||||
*
|
*
|
||||||
* @author lsm
|
* @author lsm
|
||||||
* @date 2025-07-19
|
* @since 2025-07-19
|
||||||
*/
|
*/
|
||||||
|
@Mapper
|
||||||
public interface TbMeterInfoMapper extends BaseMapperPlus<TbMeterInfo, TbMeterInfoVo> {
|
public interface TbMeterInfoMapper extends BaseMapperPlus<TbMeterInfo, TbMeterInfoVo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
package org.dromara.property.mapper.smartDevicesMapper;
|
package org.dromara.property.mapper.smartDevicesMapper;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.dromara.property.domain.entity.smartDevices.TbMeterRecord;
|
import org.dromara.property.domain.entity.smartDevices.TbMeterRecord;
|
||||||
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo;
|
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 抄记录Mapper接口
|
* 抄记录Mapper接口
|
||||||
*
|
*
|
||||||
@@ -14,4 +18,9 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface TbMeterRecordMapper extends BaseMapperPlus<TbMeterRecord, TbMeterRecordVo> {
|
public interface TbMeterRecordMapper extends BaseMapperPlus<TbMeterRecord, TbMeterRecordVo> {
|
||||||
|
|
||||||
|
List<Map<String, Object>> getHourTrend(@Param("floorId") Long floorId, @Param("meterId") Long meterId, @Param("meterType") Long meterType, @Param("day") String day);
|
||||||
|
|
||||||
|
List<Map<String, Object>> getDayTrend(@Param("floorId") Long floorId, @Param("meterId") Long meterId, @Param("meterType") Long meterType, @Param("year") String year, @Param("month") String month);
|
||||||
|
|
||||||
|
List<Map<String, Object>> getMonthTrend(@Param("floorId") Long floorId, @Param("meterId") Long meterId, @Param("meterType") Long meterType, @Param("year") String year);
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,18 @@
|
|||||||
|
package org.dromara.property.rocketmq;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lsm
|
||||||
|
* @apiNote RocketMqConstants
|
||||||
|
* @since 2025/8/25
|
||||||
|
*/
|
||||||
|
public interface RocketMqConstants {
|
||||||
|
// mq topic
|
||||||
|
String TOPIC = "SmartParks";
|
||||||
|
|
||||||
|
// mq GROUP
|
||||||
|
String METER_GROUP = "METER_GROUP";
|
||||||
|
|
||||||
|
/*-----------------------------------消息tag------------------------------------*/
|
||||||
|
String METER_RECORD = "METER_RECORD_TAG";
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,45 @@
|
|||||||
|
package org.dromara.property.rocketmq.consumer;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.rocketmq.common.message.MessageExt;
|
||||||
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
|
import org.dromara.property.rocketmq.RocketMqConstants;
|
||||||
|
import org.dromara.property.rocketmq.domain.MeterResult;
|
||||||
|
import org.dromara.property.service.smartDevicesService.ITbMeterRecordService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lsm
|
||||||
|
* @apiNote MeterRecordConsumer
|
||||||
|
* @since 2025/8/25
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RocketMQMessageListener(
|
||||||
|
topic = RocketMqConstants.TOPIC,
|
||||||
|
consumerGroup = RocketMqConstants.METER_GROUP,
|
||||||
|
selectorExpression = RocketMqConstants.METER_RECORD
|
||||||
|
)
|
||||||
|
public class MeterRecordConsumer implements RocketMQListener<MessageExt> {
|
||||||
|
|
||||||
|
private final ITbMeterRecordService meterRecordService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(MessageExt ext) {
|
||||||
|
log.info("消费仪表上报数据,数据长度={}", ext.getBody().length);
|
||||||
|
try {
|
||||||
|
List<MeterResult> meterResults = JSONUtil.toList(new String(ext.getBody()), MeterResult.class);
|
||||||
|
meterRecordService.autoWriteMeterRecord(meterResults);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("消费仪表上报数据处理失败,", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,20 @@
|
|||||||
|
package org.dromara.property.rocketmq.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lsm
|
||||||
|
* @apiNote MeterResult
|
||||||
|
* @since 2025/8/27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MeterResult {
|
||||||
|
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
private String recordTime;
|
||||||
|
|
||||||
|
private List<Float> collectionValue;
|
||||||
|
}
|
@@ -67,6 +67,12 @@ public interface IPlantsPlanProductService {
|
|||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据方案id删除方案产品
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
void deleteByPlanIds(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存租赁方案植物
|
* 批量保存租赁方案植物
|
||||||
*
|
*
|
||||||
|
@@ -8,6 +8,7 @@ import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo;
|
|||||||
import org.dromara.property.domain.vo.ServiceWorkOrderAnalysisVo;
|
import org.dromara.property.domain.vo.ServiceWorkOrderAnalysisVo;
|
||||||
import org.dromara.property.domain.vo.ServiceWorkOrdersInfoVo;
|
import org.dromara.property.domain.vo.ServiceWorkOrdersInfoVo;
|
||||||
import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
||||||
|
import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -101,5 +102,5 @@ public interface IServiceWorkOrdersService {
|
|||||||
* @param pageQuery 分页参数
|
* @param pageQuery 分页参数
|
||||||
* @return 【工单处理】分页列表
|
* @return 【工单处理】分页列表
|
||||||
*/
|
*/
|
||||||
TableDataInfo<ServiceWorkOrdersVo> queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery);
|
TableDataInfo<MServiceWorkOrdersVo> queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery);
|
||||||
}
|
}
|
||||||
|
@@ -81,8 +81,9 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService {
|
|||||||
Page<CostCarChargeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<CostCarChargeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
// List<Long> residentPersonIdList = result.getRecords().stream().map(vo -> vo.getPersonId()).distinct().collect(Collectors.toList());
|
// List<Long> residentPersonIdList = result.getRecords().stream().map(vo -> vo.getPersonId()).distinct().collect(Collectors.toList());
|
||||||
// List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(residentPersonIdList);
|
// List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(residentPersonIdList);
|
||||||
|
|
||||||
List<ResidentPerson> residentPeoplelist = residentPersonMapper.selectList();
|
List<ResidentPerson> residentPeoplelist = residentPersonMapper.selectList();
|
||||||
List<String> roomNames = roomService.queryRoomNameList(idList);
|
// List<String> roomNames = roomService.queryRoomNameList(idList);
|
||||||
result.getRecords().stream().forEach(s -> {
|
result.getRecords().stream().forEach(s -> {
|
||||||
if (CollUtil.isNotEmpty(residentPeoplelist)) {
|
if (CollUtil.isNotEmpty(residentPeoplelist)) {
|
||||||
ResidentPerson residentPerson = residentPeoplelist.stream()
|
ResidentPerson residentPerson = residentPeoplelist.stream()
|
||||||
|
@@ -18,6 +18,7 @@ import org.dromara.property.domain.CostHouseCharge;
|
|||||||
import org.dromara.property.domain.CostPayFeeAudit;
|
import org.dromara.property.domain.CostPayFeeAudit;
|
||||||
import org.dromara.property.domain.bo.CostPayFeeAuditBo;
|
import org.dromara.property.domain.bo.CostPayFeeAuditBo;
|
||||||
import org.dromara.property.domain.enums.ChargeStatusEnum;
|
import org.dromara.property.domain.enums.ChargeStatusEnum;
|
||||||
|
import org.dromara.property.domain.enums.ChargeTypeEnum;
|
||||||
import org.dromara.property.domain.vo.*;
|
import org.dromara.property.domain.vo.*;
|
||||||
import org.dromara.property.mapper.*;
|
import org.dromara.property.mapper.*;
|
||||||
import org.dromara.property.service.ICostPayFeeAuditService;
|
import org.dromara.property.service.ICostPayFeeAuditService;
|
||||||
@@ -59,7 +60,18 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
|
|||||||
CostItemsVo costItemsVo = costItemsMapper.selectVoById(costPayFeeAuditVo.getItemId());
|
CostItemsVo costItemsVo = costItemsMapper.selectVoById(costPayFeeAuditVo.getItemId());
|
||||||
costPayFeeAuditVo.setChargeItem(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeItem() : null);
|
costPayFeeAuditVo.setChargeItem(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeItem() : null);
|
||||||
costPayFeeAuditVo.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null);
|
costPayFeeAuditVo.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null);
|
||||||
//TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId());
|
if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) {
|
||||||
|
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(costPayFeeAuditVo.getChargeId());
|
||||||
|
if (ObjectUtil.isNotEmpty(costHouseCharge)) {
|
||||||
|
String queryRoomName = roomMapper.queryRoomName(costHouseCharge.getRoomId());
|
||||||
|
costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(queryRoomName) ? queryRoomName : null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) {
|
||||||
|
CostCarCharge costCarCharge = costCarChargeMapper.selectById(costPayFeeAuditVo.getChargeId());
|
||||||
|
costPayFeeAuditVo.setCarNumber(ObjectUtil.isNotEmpty(costCarCharge) ? costCarCharge.getCarNumber() : null);
|
||||||
|
}
|
||||||
|
// TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId());
|
||||||
//costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(roomVo)? roomVo.getRoomNumber() :null );
|
//costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(roomVo)? roomVo.getRoomNumber() :null );
|
||||||
return costPayFeeAuditVo;
|
return costPayFeeAuditVo;
|
||||||
}
|
}
|
||||||
@@ -175,13 +187,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
|
|||||||
private void validEntityBeforeUpdate(CostPayFeeAudit entity) {
|
private void validEntityBeforeUpdate(CostPayFeeAudit entity) {
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//TODO 做一些数据校验,如唯一约束
|
||||||
if (entity.getState().equals("1")) {
|
if (entity.getState().equals("1")) {
|
||||||
if (entity.getChargeType().equals("1")) {
|
if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) {
|
||||||
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId());
|
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId());
|
||||||
Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项不存在!");
|
Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项不存在!");
|
||||||
costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_WAS_APPROVED.getValue());
|
costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_WAS_APPROVED.getValue());
|
||||||
coinHouseChargeMapper.updateById(costHouseCharge);
|
coinHouseChargeMapper.updateById(costHouseCharge);
|
||||||
}
|
}
|
||||||
if (entity.getChargeType().equals("2")) {
|
if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) {
|
||||||
|
|
||||||
CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId());
|
CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId());
|
||||||
Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空");
|
Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空");
|
||||||
@@ -190,13 +202,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (entity.getState().equals("2")) {
|
if (entity.getState().equals("2")) {
|
||||||
if (entity.getChargeType().equals("1")) {
|
if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) {
|
||||||
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId());
|
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId());
|
||||||
Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项为空");
|
Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项为空");
|
||||||
costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue());
|
costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue());
|
||||||
coinHouseChargeMapper.updateById(costHouseCharge);
|
coinHouseChargeMapper.updateById(costHouseCharge);
|
||||||
}
|
}
|
||||||
if (entity.getChargeType().equals("2")) {
|
if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) {
|
||||||
CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId());
|
CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId());
|
||||||
Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空");
|
Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空");
|
||||||
costCarCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue());
|
costCarCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue());
|
||||||
|
@@ -67,8 +67,8 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService {
|
|||||||
public CustomerFeedbacksVo queryById(Long id) {
|
public CustomerFeedbacksVo queryById(Long id) {
|
||||||
CustomerFeedbacksVo customerFeedbacksVo = baseMapper.selectVoById(id);
|
CustomerFeedbacksVo customerFeedbacksVo = baseMapper.selectVoById(id);
|
||||||
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(customerFeedbacksVo.getFeedbackType());
|
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(customerFeedbacksVo.getFeedbackType());
|
||||||
customerFeedbacksVo.setFeedbackTypeName(StringUtils.isNotBlank(serviceWorkOrdersType.getOrderTypeName()) ? serviceWorkOrdersType.getOrderTypeName() : null);
|
customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotEmpty(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null);
|
||||||
String nikName = remoteUserService.selectNicknameById(customerFeedbacksVo.getFeedbackPersion());
|
String nikName = remoteUserService.selectNicknameById(ObjectUtil.isNotEmpty(customerFeedbacksVo) ?customerFeedbacksVo.getFeedbackPersion():null);
|
||||||
customerFeedbacksVo.setFeedbackPersionName(nikName);
|
customerFeedbacksVo.setFeedbackPersionName(nikName);
|
||||||
return customerFeedbacksVo;
|
return customerFeedbacksVo;
|
||||||
}
|
}
|
||||||
@@ -115,11 +115,11 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService {
|
|||||||
if (CollUtil.isNotEmpty(remoteUserVos)) {
|
if (CollUtil.isNotEmpty(remoteUserVos)) {
|
||||||
RemoteUserVo remoteUserVo = remoteUserVos.stream()
|
RemoteUserVo remoteUserVo = remoteUserVos.stream()
|
||||||
.filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null);
|
.filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null);
|
||||||
customerFeedbacksVo.setFeedbackPersionName(ObjectUtil.isNotNull(remoteUserVo) ? remoteUserVo.getNickName() : null);
|
customerFeedbacksVo.setFeedbackPersionName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(serviceWorkOrdersTypes)) {
|
if (CollUtil.isNotEmpty(serviceWorkOrdersTypes)) {
|
||||||
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypes.stream().filter(vo -> vo.getId() != null && vo.getId().equals(customerFeedbacksVo.getFeedbackType())).findFirst().orElse(null);
|
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypes.stream().filter(vo -> vo.getId() != null && vo.getId().equals(customerFeedbacksVo.getFeedbackType())).findFirst().orElse(null);
|
||||||
customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotNull(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null);
|
customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotEmpty(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,11 +85,13 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
|||||||
public TableDataInfo<MeetBookingVo> queryPageList(MeetBookingBo bo, PageQuery pageQuery) {
|
public TableDataInfo<MeetBookingVo> queryPageList(MeetBookingBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<MeetBooking> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<MeetBooking> lqw = buildQueryWrapper(bo);
|
||||||
Page<MeetBookingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<MeetBookingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
List<MeetBookingVo> meetBookingVoList = new ArrayList<>();
|
||||||
|
if(CollUtil.isNotEmpty(result.getRecords())){
|
||||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
|
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
|
||||||
List<Long> userId = result.getRecords().stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList());
|
List<Long> userId = result.getRecords().stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList());
|
||||||
List<ResidentPersonVo> remoteUserVos = residentPersonMapper.selectVoByIds(userId);
|
List<ResidentPersonVo> remoteUserVos = residentPersonMapper.selectVoByIds(userId);
|
||||||
// List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(userId);
|
// List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(userId);
|
||||||
List<MeetBookingVo> meetBookingVoList = new ArrayList<>();
|
|
||||||
result.getRecords().stream().forEach(s -> {
|
result.getRecords().stream().forEach(s -> {
|
||||||
if (CollUtil.isNotEmpty(residentUnitVolist)) {
|
if (CollUtil.isNotEmpty(residentUnitVolist)) {
|
||||||
ResidentUnitVo residentUnitVo = residentUnitVolist.stream()
|
ResidentUnitVo residentUnitVo = residentUnitVolist.stream()
|
||||||
@@ -104,6 +106,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
|||||||
}
|
}
|
||||||
meetBookingVoList.add(s);
|
meetBookingVoList.add(s);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return TableDataInfo.build(new Page<MeetBookingVo>().setRecords(meetBookingVoList).setTotal(result.getTotal()));
|
return TableDataInfo.build(new Page<MeetBookingVo>().setRecords(meetBookingVoList).setTotal(result.getTotal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
package org.dromara.property.service.impl;
|
package org.dromara.property.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
@@ -12,11 +14,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.property.domain.MeetAttach;
|
||||||
import org.dromara.property.domain.MeetBooking;
|
import org.dromara.property.domain.MeetBooking;
|
||||||
|
import org.dromara.property.domain.vo.MeetAttachVo;
|
||||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||||
import org.dromara.property.mapper.MeetBookingMapper;
|
import org.dromara.property.mapper.*;
|
||||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
|
||||||
import org.dromara.property.mapper.TbRoomMapper;
|
|
||||||
import org.dromara.system.api.RemoteUserService;
|
import org.dromara.system.api.RemoteUserService;
|
||||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -24,7 +26,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.dromara.property.domain.bo.MeetBo;
|
import org.dromara.property.domain.bo.MeetBo;
|
||||||
import org.dromara.property.domain.vo.MeetVo;
|
import org.dromara.property.domain.vo.MeetVo;
|
||||||
import org.dromara.property.domain.Meet;
|
import org.dromara.property.domain.Meet;
|
||||||
import org.dromara.property.mapper.MeetMapper;
|
|
||||||
import org.dromara.property.service.IMeetService;
|
import org.dromara.property.service.IMeetService;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ import java.util.stream.Collectors;
|
|||||||
public class MeetServiceImpl implements IMeetService {
|
public class MeetServiceImpl implements IMeetService {
|
||||||
|
|
||||||
private final MeetMapper baseMapper;
|
private final MeetMapper baseMapper;
|
||||||
|
private final MeetAttachMapper meetAttachMapper;
|
||||||
private final ResidentPersonMapper residentPersonMapper;
|
private final ResidentPersonMapper residentPersonMapper;
|
||||||
private final TbRoomMapper roomMapper;
|
private final TbRoomMapper roomMapper;
|
||||||
private final MeetBookingMapper meetbookMapper;
|
private final MeetBookingMapper meetbookMapper;
|
||||||
@@ -216,6 +218,10 @@ public class MeetServiceImpl implements IMeetService {
|
|||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
boolean exists = meetAttachMapper.exists(new LambdaQueryWrapper<MeetAttach>().in(MeetAttach::getMeetId, ids));
|
||||||
|
Assert.isTrue(!exists, "会议室具有增值服务,不允许单独删除");
|
||||||
|
boolean meetbookExists = meetbookMapper.exists(new LambdaQueryWrapper<MeetBooking>().in(MeetBooking::getMeetId, ids));
|
||||||
|
Assert.isTrue(!meetbookExists, "会议室具有预约记录,不允许单独删除");
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
@@ -159,6 +159,7 @@ public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询租赁方案植物数据
|
* 查询租赁方案植物数据
|
||||||
|
*
|
||||||
* @param planId
|
* @param planId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -166,4 +167,17 @@ public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService {
|
|||||||
public List<PlantsPlanProductVo> queryPlanProductsInfo(Long planId) {
|
public List<PlantsPlanProductVo> queryPlanProductsInfo(Long planId) {
|
||||||
return baseMapper.queryProductsInfo(planId);
|
return baseMapper.queryProductsInfo(planId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据方案id删除方案产品
|
||||||
|
*
|
||||||
|
* @param ids 方案id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteByPlanIds(List<Long> ids) {
|
||||||
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
|
baseMapper.deleteByPlanIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,7 @@ import org.dromara.property.domain.vo.PlantsRentalPlanVo;
|
|||||||
import org.dromara.property.domain.PlantsRentalPlan;
|
import org.dromara.property.domain.PlantsRentalPlan;
|
||||||
import org.dromara.property.mapper.PlantsRentalPlanMapper;
|
import org.dromara.property.mapper.PlantsRentalPlanMapper;
|
||||||
import org.dromara.property.service.IPlantsRentalPlanService;
|
import org.dromara.property.service.IPlantsRentalPlanService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -166,6 +167,7 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService {
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if(isValid){
|
if(isValid){
|
||||||
PlantsRentalOrderBo plantsRentalOrderBo = new PlantsRentalOrderBo();
|
PlantsRentalOrderBo plantsRentalOrderBo = new PlantsRentalOrderBo();
|
||||||
@@ -174,6 +176,8 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService {
|
|||||||
if(CollectionUtils.isNotEmpty(plantsRentalOrderVos)){
|
if(CollectionUtils.isNotEmpty(plantsRentalOrderVos)){
|
||||||
throw new ServiceException("当前选中租赁方案不可删除");
|
throw new ServiceException("当前选中租赁方案不可删除");
|
||||||
}
|
}
|
||||||
|
//删除方案产品数据
|
||||||
|
planProductService.deleteByPlanIds(ids.stream().toList());
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,8 @@ import org.dromara.property.domain.enums.OrderReportingTypeEnum;
|
|||||||
import org.dromara.property.domain.enums.OrderTypeOperationEnum;
|
import org.dromara.property.domain.enums.OrderTypeOperationEnum;
|
||||||
import org.dromara.property.domain.enums.WorkOrderStatusEnum;
|
import org.dromara.property.domain.enums.WorkOrderStatusEnum;
|
||||||
import org.dromara.property.domain.vo.*;
|
import org.dromara.property.domain.vo.*;
|
||||||
|
import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersRecordVo;
|
||||||
|
import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo;
|
||||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||||
import org.dromara.property.mapper.ServiceWorkOrdersMapper;
|
import org.dromara.property.mapper.ServiceWorkOrdersMapper;
|
||||||
import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper;
|
import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper;
|
||||||
@@ -119,23 +121,20 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
|||||||
public TableDataInfo<ServiceWorkOrdersVo> queryPageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
|
public TableDataInfo<ServiceWorkOrdersVo> queryPageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<ServiceWorkOrders> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<ServiceWorkOrders> lqw = buildQueryWrapper(bo);
|
||||||
Page<ServiceWorkOrdersVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<ServiceWorkOrdersVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
if (ObjectUtil.isEmpty(result.getRecords())) {
|
if (ObjectUtil.isNotEmpty(result.getRecords())) {
|
||||||
return TableDataInfo.build(result);
|
|
||||||
}
|
|
||||||
List<Long> typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList());
|
List<Long> typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList());
|
||||||
List<ServiceWorkOrdersTypeVo> serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList);
|
List<ServiceWorkOrdersTypeVo> serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList);
|
||||||
if (ObjectUtil.isEmpty(serviceWorkOrdersTypeVoList)) {
|
if (ObjectUtil.isNotEmpty(serviceWorkOrdersTypeVoList)) {
|
||||||
return TableDataInfo.build(result);
|
|
||||||
}
|
|
||||||
List<ServiceWorkOrdersVo> serviceWorkOrdersVoList = new ArrayList<>();
|
List<ServiceWorkOrdersVo> serviceWorkOrdersVoList = new ArrayList<>();
|
||||||
result.getRecords().stream().forEach(s -> {
|
result.getRecords().stream().forEach(s -> {
|
||||||
ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = serviceWorkOrdersTypeVoList.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getType())).findFirst().orElse(null);
|
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.setTypeName(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOrderTypeName() : null);
|
||||||
s.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null);
|
s.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null);
|
||||||
serviceWorkOrdersVoList.add(s);
|
serviceWorkOrdersVoList.add(s);
|
||||||
});
|
});
|
||||||
return TableDataInfo.build(new Page<ServiceWorkOrdersVo>().setRecords(serviceWorkOrdersVoList).setTotal(result.getTotal()));
|
}
|
||||||
|
}
|
||||||
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -246,14 +245,14 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
|||||||
.ge(AttendanceUserGroup::getEndDate, today)
|
.ge(AttendanceUserGroup::getEndDate, today)
|
||||||
.orderByAsc(AttendanceUserGroup::getCreateTime)
|
.orderByAsc(AttendanceUserGroup::getCreateTime)
|
||||||
);
|
);
|
||||||
Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups),"暂无排班人员");
|
Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups), "暂无排班人员");
|
||||||
// 缓存当天排班数据(假设当天不会变)
|
// 缓存当天排班数据(假设当天不会变)
|
||||||
RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups);
|
RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 获取并更新轮询索引(原子性很重要)
|
// 2. 获取并更新轮询索引(原子性很重要)
|
||||||
int currentIndex;
|
int currentIndex;
|
||||||
Integer lastScheduleId = RedisUtils.getCacheObject(DateUtil.today()+"LastScheduleId");
|
Integer lastScheduleId = RedisUtils.getCacheObject(DateUtil.today() + "LastScheduleId");
|
||||||
if (lastScheduleId == null || lastScheduleId < 0 || lastScheduleId >= attendanceUserGroups.size()) {
|
if (lastScheduleId == null || lastScheduleId < 0 || lastScheduleId >= attendanceUserGroups.size()) {
|
||||||
currentIndex = 0; // 越界或未设置,重置为0
|
currentIndex = 0; // 越界或未设置,重置为0
|
||||||
} else {
|
} else {
|
||||||
@@ -262,7 +261,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
|||||||
currentIndex = 0; // 循环轮询
|
currentIndex = 0; // 循环轮询
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RedisUtils.setCacheObject(DateUtil.today()+"LastScheduleId", currentIndex);
|
RedisUtils.setCacheObject(DateUtil.today() + "LastScheduleId", currentIndex);
|
||||||
|
|
||||||
// 3. 分配处理人
|
// 3. 分配处理人
|
||||||
AttendanceUserGroup assignedGroup = attendanceUserGroups.get(currentIndex);
|
AttendanceUserGroup assignedGroup = attendanceUserGroups.get(currentIndex);
|
||||||
@@ -631,30 +630,66 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
|||||||
* @return 【工单处理】分页列表
|
* @return 【工单处理】分页列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<ServiceWorkOrdersVo> queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
|
public TableDataInfo<MServiceWorkOrdersVo> queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
|
||||||
|
// 当前登录用户
|
||||||
//当前登录用户
|
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
if (!LoginHelper.isSuperAdmin(loginUser.getUserId())) {
|
if (!LoginHelper.isSuperAdmin(loginUser.getUserId())) {
|
||||||
bo.setHandler(loginUser.getUserId());
|
bo.setHandler(loginUser.getUserId());
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<ServiceWorkOrders> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<ServiceWorkOrders> lqw = buildQueryWrapper(bo);
|
||||||
Page<ServiceWorkOrdersVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<ServiceWorkOrdersVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
if (ObjectUtil.isEmpty(result.getRecords())) {
|
|
||||||
return TableDataInfo.build(result);
|
|
||||||
}
|
|
||||||
List<Long> typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList());
|
|
||||||
List<ServiceWorkOrdersTypeVo> serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList);
|
|
||||||
if (ObjectUtil.isEmpty(serviceWorkOrdersTypeVoList)) {
|
|
||||||
return TableDataInfo.build(result);
|
|
||||||
}
|
|
||||||
List<ServiceWorkOrdersVo> 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);
|
// 转换 VO 类型
|
||||||
serviceWorkOrdersVoList.add(s);
|
List<MServiceWorkOrdersVo> mServiceWorkOrdersVos = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(result.getRecords())) {
|
||||||
|
List<Long> typeList = result.getRecords().stream()
|
||||||
|
.map(ServiceWorkOrdersVo::getType)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<ServiceWorkOrdersTypeVo> typeVoList = typesMapper.selectVoByIds(typeList);
|
||||||
|
Map<Long, String> typeMap = typeVoList.stream()
|
||||||
|
.collect(Collectors.toMap(ServiceWorkOrdersTypeVo::getId, ServiceWorkOrdersTypeVo::getOrderTypeName, (a, b) -> a));
|
||||||
|
//收集处理人转化成list
|
||||||
|
List<Long> handlerIdList = result.getRecords().stream().map(ServiceWorkOrdersVo::getHandler)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(handlerIdList);
|
||||||
|
// 转换并设置 typeName
|
||||||
|
mServiceWorkOrdersVos = result.getRecords().stream().map(vo -> {
|
||||||
|
MServiceWorkOrdersVo mVo = BeanUtil.copyProperties(vo, MServiceWorkOrdersVo.class);
|
||||||
|
dataProcessing(mVo, typeMap, remoteUserVos);
|
||||||
|
return mVo;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
// 构建分页结果
|
||||||
|
Page<MServiceWorkOrdersVo> pageResult = new Page<>();
|
||||||
|
pageResult.setRecords(mServiceWorkOrdersVos);
|
||||||
|
pageResult.setTotal(result.getTotal());
|
||||||
|
pageResult.setCurrent(result.getCurrent());
|
||||||
|
pageResult.setSize(result.getSize());
|
||||||
|
return TableDataInfo.build(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理数据
|
||||||
|
*
|
||||||
|
* @param mServiceWorkOrdersVo
|
||||||
|
*/
|
||||||
|
private void dataProcessing(MServiceWorkOrdersVo mServiceWorkOrdersVo, Map<Long, String> typeMap, List<RemoteUserVo> remoteUserVos) {
|
||||||
|
mServiceWorkOrdersVo.setTypeName(typeMap.getOrDefault(mServiceWorkOrdersVo.getType(), null));
|
||||||
|
//通过处理人id查询处理人信息
|
||||||
|
RemoteUserVo remoteUserVo = remoteUserVos.stream().filter(user -> user.getUserId().equals(mServiceWorkOrdersVo.getHandler())).findFirst().orElse(null);
|
||||||
|
mServiceWorkOrdersVo.setHandlerPhone(remoteUserVo != null ? remoteUserVo.getPhonenumber() : null);
|
||||||
|
mServiceWorkOrdersVo.setHandlerText(remoteUserVo != null ? remoteUserVo.getNickName() : null);
|
||||||
|
//查询工单处理记录
|
||||||
|
List<ServiceWorkOrdersRecordVo> serviceWorkOrdersRecordVoList = workOrdersRecordMapper.selectVoList(new LambdaQueryWrapper<ServiceWorkOrdersRecord>().eq(ServiceWorkOrdersRecord::getOrderId, mServiceWorkOrdersVo.getId()));
|
||||||
|
if (CollUtil.isNotEmpty(serviceWorkOrdersRecordVoList)) {
|
||||||
|
List<MServiceWorkOrdersRecordVo> mServiceWorkOrdersRecordVos = BeanUtil.copyToList(serviceWorkOrdersRecordVoList, MServiceWorkOrdersRecordVo.class);
|
||||||
|
mServiceWorkOrdersRecordVos.stream().forEach(workOrdersRecordVo -> {
|
||||||
|
workOrdersRecordVo.setHandlerName(Objects.nonNull(remoteUserVo) ? remoteUserVo.getNickName() : null);
|
||||||
});
|
});
|
||||||
return TableDataInfo.build(new Page<ServiceWorkOrdersVo>().setRecords(serviceWorkOrdersVoList).setTotal(result.getTotal()));
|
mServiceWorkOrdersVo.setRecordVoList(mServiceWorkOrdersRecordVos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.property.domain.bo.TbFloorBo;
|
||||||
import org.dromara.property.domain.vo.TbFloorVo;
|
import org.dromara.property.domain.vo.TbFloorVo;
|
||||||
import org.dromara.property.service.ITbFloorService;
|
import org.dromara.property.service.ITbFloorService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 灯控开关信息Service业务层处理
|
* 灯控开关信息Service业务层处理
|
||||||
@@ -60,7 +62,19 @@ public class TbLightInfoServiceImpl implements ITbLightInfoService {
|
|||||||
public TableDataInfo<TbLightInfoVo> queryPageList(TbLightInfoBo bo, PageQuery pageQuery) {
|
public TableDataInfo<TbLightInfoVo> queryPageList(TbLightInfoBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<TbLightInfo> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<TbLightInfo> lqw = buildQueryWrapper(bo);
|
||||||
Page<TbLightInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<TbLightInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
result.getRecords().forEach(r -> r.setFloorName(floorService.queryById(r.getFloorId()).getFloorName()));
|
|
||||||
|
// 创建楼层ID到楼层名称的映射,避免重复查询
|
||||||
|
List<TbFloorVo> floorVo = floorService.queryList(new TbFloorBo());
|
||||||
|
Map<Long, String> floorMap = floorVo.stream()
|
||||||
|
.collect(Collectors.toMap(TbFloorVo::getId, TbFloorVo::getFloorName, (key1, key2) -> key1));
|
||||||
|
|
||||||
|
// 为每个灯控信息设置楼层名称
|
||||||
|
result.getRecords().forEach(record -> {
|
||||||
|
String floorName = floorMap.get(record.getFloorId());
|
||||||
|
if (floorName != null) {
|
||||||
|
record.setFloorName(floorName);
|
||||||
|
}
|
||||||
|
});
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +165,7 @@ public class TbLightInfoServiceImpl implements ITbLightInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean switchSingleLight(TbLightInfoBo bo){
|
public Boolean switchSingleLight(TbLightInfoBo bo) {
|
||||||
TbLightInfo update = MapstructUtils.convert(bo, TbLightInfo.class);
|
TbLightInfo update = MapstructUtils.convert(bo, TbLightInfo.class);
|
||||||
boolean flag = baseMapper.updateById(update) > 0;
|
boolean flag = baseMapper.updateById(update) > 0;
|
||||||
Assert.isTrue(flag, "修改灯开关失败");
|
Assert.isTrue(flag, "修改灯开关失败");
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
package org.dromara.property.service.impl.smartDevicesImpl;
|
package org.dromara.property.service.impl.smartDevicesImpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import org.dromara.common.core.domain.TreeNode;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.core.utils.TreeUtils;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -9,16 +12,28 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.property.domain.bo.TbFloorBo;
|
||||||
|
import org.dromara.property.domain.vo.TbBuildingVo;
|
||||||
|
import org.dromara.property.domain.vo.TbCommunityVo;
|
||||||
|
import org.dromara.property.domain.vo.TbFloorVo;
|
||||||
|
import org.dromara.property.service.ITbBuildingService;
|
||||||
|
import org.dromara.property.service.ITbCommunityService;
|
||||||
|
import org.dromara.property.service.ITbFloorService;
|
||||||
|
import org.dromara.system.api.model.LoginUser;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo;
|
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo;
|
||||||
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
|
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
|
||||||
import org.dromara.property.domain.entity.smartDevices.TbMeterInfo;
|
import org.dromara.property.domain.entity.smartDevices.TbMeterInfo;
|
||||||
import org.dromara.property.mapper.smartDevicesMapper.TbMeterInfoMapper;
|
import org.dromara.property.mapper.smartDevicesMapper.TbMeterInfoMapper;
|
||||||
import org.dromara.property.service.smartDevicesService.ITbMeterInfoService;
|
import org.dromara.property.service.smartDevicesService.ITbMeterInfoService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 水电气Service业务层处理
|
* 水电气Service业务层处理
|
||||||
@@ -27,11 +42,14 @@ import java.util.Collection;
|
|||||||
* @since 2025-07-19
|
* @since 2025-07-19
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
||||||
|
|
||||||
private final TbMeterInfoMapper baseMapper;
|
private final TbMeterInfoMapper baseMapper;
|
||||||
|
private final ITbFloorService floorService;
|
||||||
|
private final ITbBuildingService buildingService;
|
||||||
|
private final ITbCommunityService communityService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询水电气
|
* 查询水电气
|
||||||
@@ -40,7 +58,7 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
|||||||
* @return 水电气
|
* @return 水电气
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TbMeterInfoVo queryById(Long id){
|
public TbMeterInfoVo queryById(Long id) {
|
||||||
return baseMapper.selectVoById(id);
|
return baseMapper.selectVoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,6 +73,19 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
|||||||
public TableDataInfo<TbMeterInfoVo> queryPageList(TbMeterInfoBo bo, PageQuery pageQuery) {
|
public TableDataInfo<TbMeterInfoVo> queryPageList(TbMeterInfoBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<TbMeterInfo> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<TbMeterInfo> lqw = buildQueryWrapper(bo);
|
||||||
Page<TbMeterInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<TbMeterInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
// 创建楼层ID到楼层名称的映射,避免重复查询
|
||||||
|
List<TbFloorVo> floorList = floorService.queryList(new TbFloorBo());
|
||||||
|
Map<Long, String> floorMap = floorList.stream()
|
||||||
|
.collect(Collectors.toMap(TbFloorVo::getId, TbFloorVo::getFloorName, (key1, key2) -> key1));
|
||||||
|
|
||||||
|
// 为每个灯控信息设置楼层名称
|
||||||
|
result.getRecords().forEach(record -> {
|
||||||
|
String floorName = floorMap.get(record.getFloorId());
|
||||||
|
if (floorName != null) {
|
||||||
|
record.setFloorName(floorName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +105,7 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
|||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<TbMeterInfo> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<TbMeterInfo> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByAsc(TbMeterInfo::getId);
|
lqw.orderByAsc(TbMeterInfo::getId);
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getHostIp()), TbMeterInfo::getHostIp, bo.getHostIp());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getMeterName()), TbMeterInfo::getMeterName, bo.getMeterName());
|
lqw.like(StringUtils.isNotBlank(bo.getMeterName()), TbMeterInfo::getMeterName, bo.getMeterName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getMeterCode()), TbMeterInfo::getMeterCode, bo.getMeterCode());
|
lqw.eq(StringUtils.isNotBlank(bo.getMeterCode()), TbMeterInfo::getMeterCode, bo.getMeterCode());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getFactoryNo()), TbMeterInfo::getFactoryNo, bo.getFactoryNo());
|
lqw.eq(StringUtils.isNotBlank(bo.getFactoryNo()), TbMeterInfo::getFactoryNo, bo.getFactoryNo());
|
||||||
@@ -94,13 +126,15 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
|||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean insertByBo(TbMeterInfoBo bo) {
|
public Boolean insertByBo(TbMeterInfoBo bo) {
|
||||||
TbMeterInfo add = MapstructUtils.convert(bo, TbMeterInfo.class);
|
TbMeterInfo add = MapstructUtils.convert(bo, TbMeterInfo.class);
|
||||||
validEntityBeforeSave(add);
|
assert add != null;
|
||||||
|
TbFloorVo floor = floorService.queryById(add.getFloorId());
|
||||||
|
add.setBuildingId(floor.getBuildingId());
|
||||||
|
add.setCommunityId(floor.getCommunityId());
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
Assert.isTrue(flag, "新增水电气信息失败");
|
||||||
bo.setId(add.getId());
|
|
||||||
}
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +154,7 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
|||||||
/**
|
/**
|
||||||
* 保存前的数据校验
|
* 保存前的数据校验
|
||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(TbMeterInfo entity){
|
private void validEntityBeforeSave(TbMeterInfo entity) {
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//TODO 做一些数据校验,如唯一约束
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,9 +167,76 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if(isValid){
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询水电气树结构
|
||||||
|
*
|
||||||
|
* @param meterType 水电气类型
|
||||||
|
* @return 水电气树结构
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TreeNode<Long>> queryMeterInfoTree(Long meterType) {
|
||||||
|
// 默认加载社区树
|
||||||
|
List<TreeNode<Long>> treeList = new ArrayList<>();
|
||||||
|
List<TbCommunityVo> tbCommunityVos = communityService.queryAll();
|
||||||
|
if (tbCommunityVos == null || tbCommunityVos.isEmpty()) {
|
||||||
|
return treeList;
|
||||||
|
}
|
||||||
|
List<TreeNode<Long>> l1 = tbCommunityVos.stream().map(item -> {
|
||||||
|
TreeNode<Long> node = new TreeNode<>();
|
||||||
|
node.setLevel(1);
|
||||||
|
node.setCode(item.getId());
|
||||||
|
node.setParentCode(0L);
|
||||||
|
node.setLabel(item.getCommunityName());
|
||||||
|
return node;
|
||||||
|
}).toList();
|
||||||
|
treeList.addAll(l1);
|
||||||
|
List<TbBuildingVo> tbBuildingVos = buildingService.queryAll();
|
||||||
|
if (tbBuildingVos == null || tbBuildingVos.isEmpty()) {
|
||||||
|
return treeList;
|
||||||
|
}
|
||||||
|
List<TreeNode<Long>> l2 = tbBuildingVos.stream().map(item -> {
|
||||||
|
TreeNode<Long> node = new TreeNode<>();
|
||||||
|
node.setLevel(2);
|
||||||
|
node.setCode(item.getId());
|
||||||
|
node.setParentCode(item.getCommunityId());
|
||||||
|
node.setLabel(item.getBuildingName());
|
||||||
|
return node;
|
||||||
|
}).toList();
|
||||||
|
treeList.addAll(l2);
|
||||||
|
List<TbFloorVo> tbFloorVos = floorService.queryAll();
|
||||||
|
if (tbFloorVos == null || tbFloorVos.isEmpty()) {
|
||||||
|
return treeList;
|
||||||
|
}
|
||||||
|
List<TreeNode<Long>> l3 = tbFloorVos.stream().map(item -> {
|
||||||
|
TreeNode<Long> node = new TreeNode<>();
|
||||||
|
node.setLevel(3);
|
||||||
|
node.setCode(item.getId());
|
||||||
|
node.setParentCode(item.getBuildingId());
|
||||||
|
node.setLabel(item.getFloorName());
|
||||||
|
return node;
|
||||||
|
}).toList();
|
||||||
|
treeList.addAll(l3);
|
||||||
|
|
||||||
|
TbMeterInfoBo bo = new TbMeterInfoBo();
|
||||||
|
bo.setMeterType(meterType);
|
||||||
|
List<TbMeterInfoVo> meterInfoVos = this.queryList(bo);
|
||||||
|
if (meterInfoVos != null && !meterInfoVos.isEmpty()) {
|
||||||
|
List<TreeNode<Long>> l4 = meterInfoVos.stream().map(item -> {
|
||||||
|
TreeNode<Long> node = new TreeNode<>();
|
||||||
|
node.setLevel(4);
|
||||||
|
node.setCode(item.getId());
|
||||||
|
node.setParentCode(item.getFloorId());
|
||||||
|
node.setLabel(item.getMeterName());
|
||||||
|
return node;
|
||||||
|
}).toList();
|
||||||
|
treeList.addAll(l4);
|
||||||
|
}
|
||||||
|
return TreeUtils.build(treeList, 0L);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
package org.dromara.property.service.impl.smartDevicesImpl;
|
package org.dromara.property.service.impl.smartDevicesImpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
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.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -9,22 +12,29 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo;
|
||||||
|
import org.dromara.property.domain.enums.MeterRecordTypeEnum;
|
||||||
|
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
|
||||||
|
import org.dromara.property.rocketmq.domain.MeterResult;
|
||||||
|
import org.dromara.property.service.smartDevicesService.ITbMeterInfoService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRecordBo;
|
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRecordBo;
|
||||||
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo;
|
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo;
|
||||||
import org.dromara.property.domain.entity.smartDevices.TbMeterRecord;
|
import org.dromara.property.domain.entity.smartDevices.TbMeterRecord;
|
||||||
import org.dromara.property.mapper.smartDevicesMapper.TbMeterRecordMapper;
|
import org.dromara.property.mapper.smartDevicesMapper.TbMeterRecordMapper;
|
||||||
import org.dromara.property.service.smartDevicesService.ITbMeterRecordService;
|
import org.dromara.property.service.smartDevicesService.ITbMeterRecordService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.math.BigDecimal;
|
||||||
import java.util.Map;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 抄记录Service业务层处理
|
* 抄记录Service业务层处理
|
||||||
*
|
*
|
||||||
* @author lsm
|
* @author lsm
|
||||||
* @date 2025-07-19
|
* @since 2025-07-19
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -32,6 +42,7 @@ import java.util.Collection;
|
|||||||
public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
||||||
|
|
||||||
private final TbMeterRecordMapper baseMapper;
|
private final TbMeterRecordMapper baseMapper;
|
||||||
|
private final ITbMeterInfoService tbMeterInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询抄记录
|
* 查询抄记录
|
||||||
@@ -40,7 +51,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
|||||||
* @return 抄记录
|
* @return 抄记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TbMeterRecordVo queryById(Long id){
|
public TbMeterRecordVo queryById(Long id) {
|
||||||
return baseMapper.selectVoById(id);
|
return baseMapper.selectVoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +85,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
|||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<TbMeterRecord> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<TbMeterRecord> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByAsc(TbMeterRecord::getId);
|
lqw.orderByAsc(TbMeterRecord::getId);
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getMeterId()), TbMeterRecord::getMeterId, bo.getMeterId());
|
lqw.eq(bo.getMeterId() != null, TbMeterRecord::getMeterId, bo.getMeterId());
|
||||||
lqw.eq(bo.getMeterType() != null, TbMeterRecord::getMeterType, bo.getMeterType());
|
lqw.eq(bo.getMeterType() != null, TbMeterRecord::getMeterType, bo.getMeterType());
|
||||||
lqw.eq(bo.getReaderId() != null, TbMeterRecord::getReaderId, bo.getReaderId());
|
lqw.eq(bo.getReaderId() != null, TbMeterRecord::getReaderId, bo.getReaderId());
|
||||||
lqw.eq(bo.getReadingTime() != null, TbMeterRecord::getReadingTime, bo.getReadingTime());
|
lqw.eq(bo.getReadingTime() != null, TbMeterRecord::getReadingTime, bo.getReadingTime());
|
||||||
@@ -118,7 +129,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
|||||||
/**
|
/**
|
||||||
* 保存前的数据校验
|
* 保存前的数据校验
|
||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(TbMeterRecord entity){
|
private void validEntityBeforeSave(TbMeterRecord entity) {
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//TODO 做一些数据校验,如唯一约束
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,9 +142,108 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if(isValid){
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动写入抄表记录
|
||||||
|
*
|
||||||
|
* @param results 推送消息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void autoWriteMeterRecord(List<MeterResult> results) {
|
||||||
|
log.info("自动写入抄表记录, msg:{}", results);
|
||||||
|
|
||||||
|
for (MeterResult result : results) {
|
||||||
|
// 取出同一个采集器ip下,所有设备
|
||||||
|
TbMeterInfoBo infoBo = new TbMeterInfoBo();
|
||||||
|
infoBo.setHostIp(result.getIp());
|
||||||
|
List<TbMeterInfoVo> infoList = tbMeterInfoService.queryList(infoBo);
|
||||||
|
|
||||||
|
if (CollUtil.isEmpty(infoList)) {
|
||||||
|
log.info("当前采集器ip下无设备, ip:{}", result.getIp());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取设备id
|
||||||
|
Collection<Long> meterIds = infoList.stream().map(TbMeterInfoVo::getId).toList();
|
||||||
|
|
||||||
|
// 取出上次抄表记录
|
||||||
|
LambdaQueryWrapper<TbMeterRecord> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.in(TbMeterRecord::getMeterId, meterIds)
|
||||||
|
.orderByDesc(TbMeterRecord::getReadingTime)
|
||||||
|
.last("limit " + meterIds.size());
|
||||||
|
List<TbMeterRecord> recordOld = baseMapper.selectList(lqw);
|
||||||
|
|
||||||
|
List<TbMeterRecord> recordNew = new ArrayList<>(infoList.size());
|
||||||
|
boolean hasOldRecords = CollUtil.isNotEmpty(recordOld);
|
||||||
|
|
||||||
|
log.info("当前采集器ip下{}抄表记录, ip:{}", hasOldRecords ? "有" : "无", result.getIp());
|
||||||
|
// 创建meterId到旧记录的映射,提高查找效率
|
||||||
|
Map<Long, TbMeterRecord> oldRecordMap = hasOldRecords ?
|
||||||
|
recordOld.stream().collect(Collectors.toMap(TbMeterRecord::getMeterId, Function.identity())) :
|
||||||
|
Collections.emptyMap();
|
||||||
|
|
||||||
|
for (TbMeterInfoVo info : infoList) {
|
||||||
|
TbMeterRecord record = new TbMeterRecord();
|
||||||
|
record.setMeterId(info.getId());
|
||||||
|
record.setMeterType(info.getMeterType());
|
||||||
|
record.setReaderId(1L);
|
||||||
|
record.setReadingTime(DateUtil.parse(result.getRecordTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
|
||||||
|
// 获取当前读数
|
||||||
|
BigDecimal currentReading = BigDecimal.valueOf(
|
||||||
|
result.getCollectionValue().get(Integer.parseInt(info.getMeterCode()))
|
||||||
|
);
|
||||||
|
record.setCurrentReading(currentReading);
|
||||||
|
|
||||||
|
// 设置上次读数
|
||||||
|
if (hasOldRecords) {
|
||||||
|
TbMeterRecord oldRecord = oldRecordMap.get(info.getId());
|
||||||
|
if (oldRecord != null) {
|
||||||
|
record.setPreviousReading(oldRecord.getCurrentReading());
|
||||||
|
} else {
|
||||||
|
// 如果没有找到对应的旧记录,使用默认值
|
||||||
|
record.setPreviousReading(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
record.setPreviousReading(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
|
||||||
|
record.setReadingMethod(MeterRecordTypeEnum.AUTO_RECORD.getCode());
|
||||||
|
recordNew.add(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean flag = baseMapper.insertBatch(recordNew);
|
||||||
|
Assert.isTrue(flag, "批量写入抄表记录失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用电/水/气趋势分析数据
|
||||||
|
*
|
||||||
|
* @param floorId 楼层id
|
||||||
|
* @param meterId 仪表id
|
||||||
|
* @param meterType 仪表类型
|
||||||
|
* @param day 日期
|
||||||
|
* @param month 月份
|
||||||
|
* @param year 年份
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void getEnergyTrend(String floorId, String meterId, Long meterType, String day, String month, String year) {
|
||||||
|
|
||||||
|
List<Map<String, Object>> hourList = baseMapper.getHourTrend(StrUtil.isBlank(floorId) ? null : Long.parseLong(floorId), StrUtil.isBlank(meterId) ? null : Long.parseLong(meterId), meterType, day);
|
||||||
|
log.info("小时数据:{}", hourList);
|
||||||
|
|
||||||
|
String[] monthArr = month.split("-");
|
||||||
|
List<Map<String, Object>> dayList = baseMapper.getDayTrend(StrUtil.isBlank(floorId) ? null : Long.parseLong(floorId), StrUtil.isBlank(meterId) ? null : Long.parseLong(meterId), meterType, monthArr[0], monthArr[1]);
|
||||||
|
log.info("天数据:{}", dayList);
|
||||||
|
|
||||||
|
List<Map<String, Object>> monthList = baseMapper.getMonthTrend(StrUtil.isBlank(floorId) ? null : Long.parseLong(floorId), StrUtil.isBlank(meterId) ? null : Long.parseLong(meterId), meterType, year);
|
||||||
|
log.info("月数据:{}", monthList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package org.dromara.property.service.smartDevicesService;
|
package org.dromara.property.service.smartDevicesService;
|
||||||
|
|
||||||
|
import org.dromara.common.core.domain.TreeNode;
|
||||||
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
|
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
|
||||||
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo;
|
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
@@ -65,4 +66,13 @@ public interface ITbMeterInfoService {
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询水电气树结构
|
||||||
|
*
|
||||||
|
* @param meterType 水电气类型
|
||||||
|
*
|
||||||
|
* @return 水电气树结构
|
||||||
|
*/
|
||||||
|
List<TreeNode<Long>> queryMeterInfoTree(Long meterType);
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo;
|
|||||||
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRecordBo;
|
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRecordBo;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.property.rocketmq.domain.MeterResult;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -65,4 +66,23 @@ public interface ITbMeterRecordService {
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动写入抄表记录
|
||||||
|
*
|
||||||
|
* @param results 推送消息
|
||||||
|
*/
|
||||||
|
void autoWriteMeterRecord(List<MeterResult> results);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用电/水/气趋势分析数据
|
||||||
|
*
|
||||||
|
* @param floorId 楼层id
|
||||||
|
* @param meterId 仪表id
|
||||||
|
* @param meterType 仪表类型
|
||||||
|
* @param day 日期
|
||||||
|
* @param month 月份
|
||||||
|
* @param year 年份
|
||||||
|
*/
|
||||||
|
void getEnergyTrend(String floorId, String meterId, Long meterType, String day, String month, String year);
|
||||||
}
|
}
|
||||||
|
@@ -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=#{planId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByPlanIds" parameterType="java.util.List">
|
||||||
|
delete from plants_plan_product p where p.plan_id in
|
||||||
|
<foreach collection="list" item="planId" open="(" separator="," close=")">
|
||||||
|
#{planId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="queryProductsInfo" resultMap="planProductMap">
|
<select id="queryProductsInfo" resultMap="planProductMap">
|
||||||
select
|
select
|
||||||
c.id pid,
|
c.id pid,
|
||||||
|
@@ -0,0 +1,60 @@
|
|||||||
|
<?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.smartDevicesMapper.TbMeterRecordMapper">
|
||||||
|
<select id="getHourTrend" resultType="map">
|
||||||
|
SELECT CONCAT_WS(':', HOUR(reading_time), '00') as hour, SUM(consumption) as total_consumption
|
||||||
|
FROM tb_meter_record a
|
||||||
|
LEFT JOIN tb_meter_info b ON a.meter_id = b.id
|
||||||
|
WHERE DATE(reading_time) = #{day}
|
||||||
|
AND b.meter_type = #{meterType}
|
||||||
|
<if test="floorId != '' and floorId != null">
|
||||||
|
AND b.floor_id = #{floorId}
|
||||||
|
</if>
|
||||||
|
<if test="meterId != '' and meterId != null">
|
||||||
|
AND a.meter_id = #{meterId}
|
||||||
|
</if>
|
||||||
|
GROUP BY CONCAT_WS(':', HOUR(reading_time), '00')
|
||||||
|
ORDER BY hour
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getDayTrend" resultType="map">
|
||||||
|
SELECT
|
||||||
|
DAY(reading_time) AS `day`,
|
||||||
|
SUM(consumption) AS total_consumption
|
||||||
|
FROM tb_meter_record a
|
||||||
|
LEFT JOIN tb_meter_info b ON a.meter_id = b.id
|
||||||
|
WHERE YEAR(reading_time) = #{year}
|
||||||
|
AND MONTH(reading_time) = #{month}
|
||||||
|
AND b.meter_type = #{meterType}
|
||||||
|
<if test="floorId != '' and floorId != null">
|
||||||
|
AND b.floor_id = #{floorId}
|
||||||
|
</if>
|
||||||
|
<if test="meterId != '' and meterId != null">
|
||||||
|
AND a.meter_id = #{meterId}
|
||||||
|
</if>
|
||||||
|
GROUP BY DAY(reading_time)
|
||||||
|
ORDER BY `day`;
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getMonthTrend" resultType="map">
|
||||||
|
SELECT
|
||||||
|
MONTH(reading_time) AS `month`,
|
||||||
|
SUM(consumption) AS total_consumption
|
||||||
|
FROM tb_meter_record a
|
||||||
|
LEFT JOIN tb_meter_info b ON a.meter_id = b.id
|
||||||
|
WHERE YEAR(reading_time) = #{year}
|
||||||
|
AND b.meter_type = #{meterType}
|
||||||
|
<if test="floorId != '' and floorId != null">
|
||||||
|
AND b.floor_id = #{floorId}
|
||||||
|
</if>
|
||||||
|
<if test="meterId != '' and meterId != null">
|
||||||
|
AND a.meter_id = #{meterId}
|
||||||
|
</if>
|
||||||
|
GROUP BY MONTH(reading_time)
|
||||||
|
ORDER BY `month`;
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@@ -0,0 +1,85 @@
|
|||||||
|
package org.dromara.sis.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.date.DateField;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.sis.domain.bo.SisPersonLibImgBo;
|
||||||
|
import org.dromara.sis.domain.vo.SisPersonLibImgVo;
|
||||||
|
import org.dromara.sis.sdk.e8.E8PlatformApi;
|
||||||
|
import org.dromara.sis.sdk.e8.domain.QueryDto;
|
||||||
|
import org.dromara.sis.sdk.e8.domain.accessControl.req.AccessRecordFindReq;
|
||||||
|
import org.dromara.sis.sdk.e8.domain.accessControl.res.AccessRecordFindRes;
|
||||||
|
import org.dromara.sis.service.ISisPersonLibImgService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author yuyongle
|
||||||
|
* @version 1.0
|
||||||
|
* @description:
|
||||||
|
* @date 2025/8/27 15:57
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/visitor")
|
||||||
|
public class SisVisitorController {
|
||||||
|
private final E8PlatformApi e8PlatformApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员通行记录
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<AccessRecordFindRes> list(QueryDto dto) {
|
||||||
|
|
||||||
|
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||||
|
List<AccessRecordFindRes> accessRecordFindResList = new ArrayList<>();
|
||||||
|
AccessRecordFindRes accessRecordFindRes = new AccessRecordFindRes();
|
||||||
|
accessRecordFindRes.setDeviceName("4#岗亭09");
|
||||||
|
accessRecordFindRes.setDoorName("4#岗亭09");
|
||||||
|
accessRecordFindRes.setDeviceType(1102);
|
||||||
|
accessRecordFindRes.setReaderName("");
|
||||||
|
accessRecordFindRes.setGatewayType(1);
|
||||||
|
accessRecordFindRes.setCustomerName("德隆吴鹏");
|
||||||
|
accessRecordFindRes.setOrganFullPath("主楼11楼");
|
||||||
|
accessRecordFindRes.setPictureUrl("https://bpic.588ku.com/back_list_pic/23/04/21/ef5e2a3dd5cfc336fdcf2fd000474f0f.jpg");
|
||||||
|
accessRecordFindRes.setCardType(34);
|
||||||
|
accessRecordFindRes.setRecordType(2);
|
||||||
|
accessRecordFindRes.setActionTime(new Date());
|
||||||
|
accessRecordFindResList.add(accessRecordFindRes);
|
||||||
|
tableDataInfo.setRows(accessRecordFindResList);
|
||||||
|
tableDataInfo.setTotal(1);
|
||||||
|
tableDataInfo.setCode(200);
|
||||||
|
return tableDataInfo;
|
||||||
|
//
|
||||||
|
// dto.setPageIndex(1);
|
||||||
|
// dto.setMaxResultCount(20);
|
||||||
|
//
|
||||||
|
// // 10秒内
|
||||||
|
// String starTime = DateUtil.format(DateUtil.offset(new Date(), DateField.SECOND, -10), "yyyy-MM-dd HH:mm:ss");
|
||||||
|
// String endTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||||
|
//
|
||||||
|
// AccessRecordFindReq lift = new AccessRecordFindReq();
|
||||||
|
// lift.setStartTime(starTime);
|
||||||
|
// lift.setEndTime(endTime);
|
||||||
|
// lift.setRecordType(2);
|
||||||
|
// // 9号电梯
|
||||||
|
// lift.setDeviceId(550757939925061L);
|
||||||
|
// dto.setQueryDto(lift);
|
||||||
|
//// TableDataInfo<AccessRecordFindRes> nineLiftList = e8PlatformApi.getPageAccessRecordList(dto);
|
||||||
|
// TableDataInfo<AccessRecordFindRes> pageAccessRecordList = new TableDataInfo();
|
||||||
|
//
|
||||||
|
// return e8PlatformApi.getPageAccessRecordList(dto);
|
||||||
|
//如果pageAccessRecordList报错就捕获并封装
|
||||||
|
}
|
||||||
|
}
|
@@ -9,8 +9,10 @@ public interface RocketMqConstants {
|
|||||||
// mq topic
|
// mq topic
|
||||||
String TOPIC = "SmartParks";
|
String TOPIC = "SmartParks";
|
||||||
|
|
||||||
// mq GROUP
|
// 人比比对消费者组
|
||||||
String GROUP = "SmartParksEqp";
|
String COMPAREGROUP = "SmartParks-compare";
|
||||||
|
// 人脸抓拍消费者组
|
||||||
|
String CAPTUREGROUP = "SmartParks-capture";
|
||||||
|
|
||||||
/*-----------------------------------消息tag------------------------------------*/
|
/*-----------------------------------消息tag------------------------------------*/
|
||||||
String HIKADD = "ADD_HIK_DEVICE_TAG";
|
String HIKADD = "ADD_HIK_DEVICE_TAG";
|
||||||
|
@@ -22,7 +22,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = RocketMqConstants.TOPIC,
|
topic = RocketMqConstants.TOPIC,
|
||||||
consumerGroup = RocketMqConstants.GROUP,
|
consumerGroup = RocketMqConstants.CAPTUREGROUP,
|
||||||
selectorExpression = RocketMqConstants.FACECAPTURE
|
selectorExpression = RocketMqConstants.FACECAPTURE
|
||||||
)
|
)
|
||||||
public class FaceCaptureConsumer implements RocketMQListener<MessageExt> {
|
public class FaceCaptureConsumer implements RocketMQListener<MessageExt> {
|
||||||
|
@@ -21,7 +21,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = RocketMqConstants.TOPIC,
|
topic = RocketMqConstants.TOPIC,
|
||||||
consumerGroup = RocketMqConstants.GROUP,
|
consumerGroup = RocketMqConstants.COMPAREGROUP,
|
||||||
selectorExpression = RocketMqConstants.FACECOMPARE
|
selectorExpression = RocketMqConstants.FACECOMPARE
|
||||||
)
|
)
|
||||||
public class FaceCompareConsumer implements RocketMQListener<MessageExt> {
|
public class FaceCompareConsumer implements RocketMQListener<MessageExt> {
|
||||||
|
@@ -40,9 +40,9 @@ spring.sql.init.platform=mysql
|
|||||||
db.num=1
|
db.num=1
|
||||||
|
|
||||||
### Connect URL of DB:
|
### 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://113.249.101.254:18000/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||||
db.user.0=root
|
db.user.0=root
|
||||||
db.password.0=By@2025!
|
db.password.0=by@2025??
|
||||||
|
|
||||||
### the maximum retry times for push
|
### the maximum retry times for push
|
||||||
nacos.config.push.maxRetryTime=50
|
nacos.config.push.maxRetryTime=50
|
||||||
|
Reference in New Issue
Block a user