Merge branch 'master' of http://47.109.37.87:3000/by2025/SmartParks
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -62,7 +62,7 @@ public class ApplicationController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:application:query")
|
||||
//@SaCheckPermission("property:application:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ApplicationVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
@@ -90,7 +90,13 @@ public class ApplicationController extends BaseController {
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApplicationBo bo) {
|
||||
return toAjax(applicationService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*/
|
||||
@PostMapping("/verified")
|
||||
public R<Void> verified(@Validated(EditGroup.class) @RequestBody ApplicationBo bo) {
|
||||
return toAjax(applicationService.verifiedByBo(bo));
|
||||
}
|
||||
/**
|
||||
* 删除资产领用
|
||||
*
|
||||
|
@@ -40,7 +40,7 @@ public class DepotLogController extends BaseController {
|
||||
/**
|
||||
* 查询仓库记录列表
|
||||
*/
|
||||
@SaCheckPermission("property:log:list")
|
||||
//@SaCheckPermission("property:log:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DepotLogVo> list(DepotLogBo bo, PageQuery pageQuery) {
|
||||
return depotLogService.queryPageList(bo, pageQuery);
|
||||
@@ -62,7 +62,7 @@ public class DepotLogController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:log:query")
|
||||
// @SaCheckPermission("property:log:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DepotLogVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
|
@@ -42,12 +42,12 @@ public class Application extends TenantEntity {
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long number;
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 审批人id
|
||||
|
@@ -4,6 +4,8 @@ import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@@ -47,7 +49,7 @@ public class Asset extends TenantEntity {
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
|
@@ -45,7 +45,7 @@ public class Depot extends TenantEntity {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
|
@@ -4,6 +4,8 @@ import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@@ -42,7 +44,7 @@ public class DepotLog extends TenantEntity {
|
||||
/**
|
||||
* 流转类型
|
||||
*/
|
||||
private Long type;
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 流转时间
|
||||
@@ -57,7 +59,7 @@ public class DepotLog extends TenantEntity {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -67,17 +69,17 @@ public class DepotLog extends TenantEntity {
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
private Long priceSum;
|
||||
private BigDecimal priceSum;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long number;
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
|
@@ -0,0 +1,58 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 巡检点签到记录对象 inspection_point_record
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("inspection_point_record")
|
||||
public class InspectionPointRecord extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 巡检点id
|
||||
*/
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 签到人id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 签到时间
|
||||
*/
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 巡检路线巡检点关联对象 inspection_route_point
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("inspection_route_point")
|
||||
public class InspectionRoutePoint extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 巡检路线id
|
||||
*/
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 巡检点id
|
||||
*/
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -41,12 +41,12 @@ public class ApplicationBo extends BaseEntity {
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long number;
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 审批人id
|
||||
|
@@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@@ -46,12 +48,12 @@ public class AssetBo extends BaseEntity {
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
private Long stock;
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
@@ -81,7 +83,7 @@ public class AssetBo extends BaseEntity {
|
||||
/**
|
||||
* 固定资产类型
|
||||
*/
|
||||
private Long type;
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public class AssetTypeBo extends BaseEntity {
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sort;
|
||||
private Integer sort;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -90,6 +90,8 @@ public class CleanOrderBo extends BaseEntity {
|
||||
@NotBlank(message = "结束时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String endTime;
|
||||
|
||||
|
||||
/**
|
||||
* 评价
|
||||
*/
|
||||
@@ -102,6 +104,11 @@ public class CleanOrderBo extends BaseEntity {
|
||||
* 图片
|
||||
*/
|
||||
private String imgUrl;
|
||||
|
||||
/**
|
||||
* 单位id
|
||||
*/
|
||||
@NotNull(message = "单位id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long unitId;
|
||||
|
||||
// /**
|
||||
|
@@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@@ -66,12 +68,12 @@ public class DepotLogBo extends BaseEntity {
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
private Long priceSum;
|
||||
private BigDecimal priceSum;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
|
@@ -0,0 +1,60 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.InspectionPointRecord;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 巡检点签到记录业务对象 inspection_point_record
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = InspectionPointRecord.class, reverseConvertGenerate = false)
|
||||
public class InspectionPointRecordBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 巡检点id
|
||||
*/
|
||||
@NotNull(message = "巡检点id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 签到人id
|
||||
*/
|
||||
@NotNull(message = "签到人id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 签到时间
|
||||
*/
|
||||
@NotNull(message = "签到时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -9,6 +9,8 @@ import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.dromara.property.domain.InspectionRoute;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检路线业务对象 inspection_route
|
||||
*
|
||||
@@ -41,4 +43,9 @@ public class InspectionRouteBo extends BaseEntity {
|
||||
*/
|
||||
@NotNull(message = "排序不能为空", groups = { EditGroup.class })
|
||||
private Integer sort;
|
||||
/**
|
||||
* 巡检路线巡检点关联
|
||||
*/
|
||||
@NotEmpty(message = "巡检点不能为空", groups = { EditGroup.class })
|
||||
List <InspectionRoutePointBo> inspectionRoutePointBoList;
|
||||
}
|
||||
|
@@ -0,0 +1,66 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.InspectionRoutePoint;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 巡检路线巡检点关联业务对象 inspection_route_point
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = InspectionRoutePoint.class, reverseConvertGenerate = false)
|
||||
public class InspectionRoutePointBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 巡检路线id
|
||||
*/
|
||||
// @NotNull(message = "巡检路线id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 巡检点id
|
||||
*/
|
||||
@NotNull(message = "巡检点id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@NotNull(message = "结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -64,13 +64,13 @@ public class ApplicationVo implements Serializable {
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private Long number;
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 审批人id
|
||||
|
@@ -44,7 +44,7 @@ public class AssetTypeVo implements Serializable {
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Long sort;
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.Asset;
|
||||
@@ -64,7 +65,7 @@ public class AssetVo implements Serializable {
|
||||
* 价格
|
||||
*/
|
||||
@ExcelProperty(value = "价格")
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.DepotLog;
|
||||
@@ -41,18 +42,28 @@ public class DepotLogVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "仓库id")
|
||||
private Long depotId;
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
@ExcelProperty(value = "仓库名称")
|
||||
private String depotName;
|
||||
|
||||
/**
|
||||
* 资产id
|
||||
*/
|
||||
@ExcelProperty(value = "资产id")
|
||||
private Long assetId;
|
||||
/**
|
||||
* 资产名称
|
||||
*/
|
||||
@ExcelProperty(value = "资产名称")
|
||||
private String assetName;
|
||||
|
||||
/**
|
||||
* 流转类型
|
||||
*/
|
||||
@ExcelProperty(value = "流转类型")
|
||||
private Long type;
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 流转时间
|
||||
@@ -64,13 +75,17 @@ public class DepotLogVo implements Serializable {
|
||||
* 操作人id
|
||||
*/
|
||||
@ExcelProperty(value = "操作人id")
|
||||
private Long userId;
|
||||
private Long userId; /**
|
||||
* 操作人id
|
||||
*/
|
||||
@ExcelProperty(value = "操作人名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -82,25 +97,30 @@ public class DepotLogVo implements Serializable {
|
||||
* 价格
|
||||
*/
|
||||
@ExcelProperty(value = "价格")
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
@ExcelProperty(value = "总价")
|
||||
private Long priceSum;
|
||||
private BigDecimal priceSum;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private Long number;
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
@ExcelProperty(value = "供应商id")
|
||||
private Long supplierId;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
@ExcelProperty(value = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
@@ -56,7 +56,7 @@ public class DepotVo implements Serializable {
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
@@ -0,0 +1,70 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.InspectionPointRecord;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 巡检点签到记录视图对象 inspection_point_record
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = InspectionPointRecord.class)
|
||||
public class InspectionPointRecordVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 巡检点id
|
||||
*/
|
||||
@ExcelProperty(value = "巡检点id")
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 签到人id
|
||||
*/
|
||||
@ExcelProperty(value = "签到人id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 签到时间
|
||||
*/
|
||||
@ExcelProperty(value = "签到时间")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ExcelProperty(value = "搜索值")
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.InspectionRoutePoint;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 巡检路线巡检点关联视图对象 inspection_route_point
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = InspectionRoutePoint.class)
|
||||
public class InspectionRoutePointVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 巡检路线id
|
||||
*/
|
||||
@ExcelProperty(value = "巡检路线id")
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 巡检点id
|
||||
*/
|
||||
@ExcelProperty(value = "巡检点id")
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ExcelProperty(value = "搜索值")
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.property.domain.InspectionPointRecord;
|
||||
import org.dromara.property.domain.vo.InspectionPointRecordVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 巡检点签到记录Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface InspectionPointRecordMapper extends BaseMapperPlus<InspectionPointRecord, InspectionPointRecordVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.property.domain.InspectionRoutePoint;
|
||||
import org.dromara.property.domain.vo.InspectionRoutePointVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 巡检路线巡检点关联Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-08-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface InspectionRoutePointMapper extends BaseMapperPlus<InspectionRoutePoint, InspectionRoutePointVo> {
|
||||
|
||||
}
|
@@ -66,4 +66,11 @@ public interface IApplicationService {
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
Boolean verifiedByBo(ApplicationBo bo);
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
@@ -11,9 +13,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.property.domain.Asset;
|
||||
import org.dromara.property.domain.DepotLog;
|
||||
import org.dromara.property.domain.vo.AssetVo;
|
||||
import org.dromara.property.mapper.AssetMapper;
|
||||
import org.dromara.property.mapper.DepotLogMapper;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.ApplicationBo;
|
||||
@@ -21,12 +26,11 @@ import org.dromara.property.domain.vo.ApplicationVo;
|
||||
import org.dromara.property.domain.Application;
|
||||
import org.dromara.property.mapper.ApplicationMapper;
|
||||
import org.dromara.property.service.IApplicationService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 资产领用Service业务层处理
|
||||
@@ -42,6 +46,7 @@ public class ApplicationServiceImpl implements IApplicationService {
|
||||
private final ApplicationMapper baseMapper;
|
||||
private final AssetMapper assetMapper;
|
||||
private final RemoteUserService remoteUserService;
|
||||
private final DepotLogMapper depotLogMapper;
|
||||
|
||||
/**
|
||||
* 查询资产领用
|
||||
@@ -50,12 +55,14 @@ public class ApplicationServiceImpl implements IApplicationService {
|
||||
* @return 资产领用
|
||||
*/
|
||||
@Override
|
||||
public ApplicationVo queryById(Long id){
|
||||
public ApplicationVo queryById(Long id) {
|
||||
ApplicationVo applicationVo = baseMapper.selectVoById(id);
|
||||
applicationVo.setUserName(remoteUserService.selectUserNameById(applicationVo.getUserId()));
|
||||
applicationVo.setAcceptanceUserName(remoteUserService.selectUserNameById(applicationVo.getAcceptanceUserId()));
|
||||
if (ObjectUtil.isNotEmpty(applicationVo.getAcceptanceUserId())) {
|
||||
applicationVo.setAcceptanceUserName(remoteUserService.selectUserNameById(applicationVo.getAcceptanceUserId()));
|
||||
}
|
||||
AssetVo assetVo = assetMapper.selectVoById(applicationVo.getAssetId());
|
||||
applicationVo.setAssetName(assetVo==null?"资产不存在" : assetVo.getName());
|
||||
applicationVo.setAssetName(assetVo == null ? "资产不存在" : assetVo.getName());
|
||||
return applicationVo;
|
||||
}
|
||||
|
||||
@@ -70,21 +77,41 @@ public class ApplicationServiceImpl implements IApplicationService {
|
||||
public TableDataInfo<ApplicationVo> queryPageList(ApplicationBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<Application> lqw = buildQueryWrapper(bo);
|
||||
Page<ApplicationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
result.getRecords().forEach(r -> ids.add(r.getUserId()));
|
||||
result.getRecords().forEach(r -> ids.add(r.getAcceptanceUserId()));
|
||||
Map<Long, String> userNamesByIds = remoteUserService.selectUserNamesByIds(ids);
|
||||
result.getRecords().forEach(r ->r.setUserName(userNamesByIds.get(r.getUserId())));
|
||||
result.getRecords().forEach(r ->r.setAcceptanceUserName(userNamesByIds.get(r.getUserId())));
|
||||
// result.getRecords().forEach(r -> r.setUserName(remoteUserService.selectUserNameById(r.getUserId())));
|
||||
// result.getRecords().forEach(r -> r.setAcceptanceUserName(remoteUserService.selectUserNameById(r.getAcceptanceUserId())));
|
||||
|
||||
// 收集用户ID用于批量查询用户名
|
||||
Set<Long> userIds = new HashSet<>();
|
||||
result.getRecords().forEach(r -> {
|
||||
if (r.getUserId() != null) {
|
||||
userIds.add(r.getUserId());
|
||||
}
|
||||
if (r.getAcceptanceUserId() != null) {
|
||||
userIds.add(r.getAcceptanceUserId());
|
||||
}
|
||||
});
|
||||
|
||||
// 批量获取用户名
|
||||
Map<Long, String> userNamesByIds = remoteUserService.selectUserNamesByIds(new ArrayList<>(userIds));
|
||||
|
||||
// 设置用户名(添加空值检查)
|
||||
result.getRecords().forEach(r -> {
|
||||
if (r.getUserId() != null) {
|
||||
r.setUserName(userNamesByIds.get(r.getUserId()));
|
||||
}
|
||||
if (r.getAcceptanceUserId() != null) {
|
||||
r.setAcceptanceUserName(userNamesByIds.get(r.getAcceptanceUserId()));
|
||||
}
|
||||
});
|
||||
|
||||
// 设置资产名称
|
||||
result.getRecords().forEach(r -> {
|
||||
AssetVo assetVo = assetMapper.selectVoById(r.getAssetId());
|
||||
r.setAssetName(assetVo==null?"资产不存在" : assetVo.getName());
|
||||
r.setAssetName(assetVo == null ? "资产不存在" : assetVo.getName());
|
||||
});
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的资产领用列表
|
||||
*
|
||||
@@ -99,7 +126,7 @@ public class ApplicationServiceImpl implements IApplicationService {
|
||||
applicationVos.forEach(r -> r.setAcceptanceUserName(remoteUserService.selectUserNameById(r.getAcceptanceUserId())));
|
||||
applicationVos.forEach(r -> {
|
||||
AssetVo assetVo = assetMapper.selectVoById(r.getAssetId());
|
||||
r.setAssetName(assetVo==null?"资产不存在" : assetVo.getName());
|
||||
r.setAssetName(assetVo == null ? "资产不存在" : assetVo.getName());
|
||||
});
|
||||
return applicationVos;
|
||||
}
|
||||
@@ -140,20 +167,17 @@ public class ApplicationServiceImpl implements IApplicationService {
|
||||
*
|
||||
* @param bo 资产领用
|
||||
* @return 是否修改成功
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ApplicationBo bo) {
|
||||
Application update = MapstructUtils.convert(bo, Application.class);
|
||||
validEntityBeforeSave(update);
|
||||
boolean b = baseMapper.updateById(update) > 0;
|
||||
if (b&&bo.getState()==1){
|
||||
if (b && bo.getState() == 1) {
|
||||
Asset asset = assetMapper.selectById(bo.getAssetId());
|
||||
if (asset.getStock()>=update.getNumber()) {
|
||||
if (asset.getStock() >= update.getNumber()) {
|
||||
UpdateWrapper<Asset> assetUpdateWrapper = new UpdateWrapper<>();
|
||||
assetUpdateWrapper.eq("id",bo.getAssetId())
|
||||
.set("stock",assetMapper.selectVoById(bo.getAssetId()).getStock()-update.getNumber());
|
||||
assetUpdateWrapper.eq("id", bo.getAssetId())
|
||||
.set("stock", assetMapper.selectVoById(bo.getAssetId()).getStock() - update.getNumber());
|
||||
assetMapper.update(assetUpdateWrapper);
|
||||
}
|
||||
|
||||
@@ -164,8 +188,9 @@ public class ApplicationServiceImpl implements IApplicationService {
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(Application entity){
|
||||
private void validEntityBeforeSave(Application entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
entity.setApplicationTime(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,9 +202,47 @@ public class ApplicationServiceImpl implements IApplicationService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean verifiedByBo(ApplicationBo bo) {
|
||||
Application update = MapstructUtils.convert(bo, Application.class);
|
||||
if (bo.getState().equals(1)) {
|
||||
//查询领用资产
|
||||
Asset asset = assetMapper.selectById(bo.getAssetId());
|
||||
Assert.isTrue(ObjectUtil.isNotNull(asset), "领用资产不存在");
|
||||
BigDecimal stock = new BigDecimal(asset.getStock());
|
||||
BigDecimal number = new BigDecimal(bo.getNumber());
|
||||
BigDecimal remain = stock.subtract(number);
|
||||
Assert.isTrue(remain.compareTo(BigDecimal.ZERO) >= 0, "库存不足无法领用");
|
||||
asset.setStock(Long.valueOf(String.valueOf(remain)));
|
||||
boolean b = assetMapper.updateById(asset) > 0;
|
||||
if (b) {
|
||||
DepotLog depotLog = new DepotLog();
|
||||
depotLog.setDepotId(asset.getDepotId());
|
||||
depotLog.setAssetId(asset.getId());
|
||||
depotLog.setType(1);
|
||||
depotLog.setTime(new Date());
|
||||
depotLog.setUserId(LoginHelper.getUserId());
|
||||
depotLog.setPrice(asset.getPrice());
|
||||
depotLog.setNumber(bo.getNumber());
|
||||
depotLog.setPriceSum((asset.getPrice().multiply(new BigDecimal(bo.getNumber()))));
|
||||
depotLog.setSupplierId(asset.getSuppliersId());
|
||||
depotLogMapper.insert(depotLog);
|
||||
}
|
||||
}
|
||||
boolean flag = baseMapper.updateById(update) > 0;
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
@@ -119,7 +119,11 @@ public class AssetServiceImpl implements IAssetService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getModel()), Asset::getModel, bo.getModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecs()), Asset::getSpecs, bo.getSpecs());
|
||||
lqw.eq(bo.getPrice() != null, Asset::getPrice, bo.getPrice());
|
||||
lqw.eq(bo.getStock() != null, Asset::getStock, bo.getStock());
|
||||
if(params.containsKey("stock")){
|
||||
lqw.gt(Asset::getStock, 0);
|
||||
}else {
|
||||
lqw.eq(bo.getStock() != null, Asset::getStock, bo.getStock());
|
||||
}
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), Asset::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getDepotId() != null, Asset::getDepotId, bo.getDepotId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMsg()), Asset::getMsg, bo.getMsg());
|
||||
|
@@ -196,7 +196,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
|
||||
asset.setName(capitalInfo.getCapitalName());
|
||||
asset.setSpecs(capitalInfo.getSpec());
|
||||
asset.setSpecs(capitalInfo.getSpec());
|
||||
asset.setPrice(capitalInfo.getBuyUnitPrice().longValue());
|
||||
asset.setPrice(capitalInfo.getBuyUnitPrice());
|
||||
asset.setSuppliersId(capitalApplication.getSupplier());
|
||||
asset.setStorageTime(new Date());
|
||||
asset.setType(0L);
|
||||
@@ -221,6 +221,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
|
||||
*/
|
||||
private void validEntityBeforeSave(CapitalApplication entity) {
|
||||
entity.setState("0");
|
||||
entity.setApplicationTime(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@@ -9,6 +11,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.Asset;
|
||||
import org.dromara.property.domain.Depot;
|
||||
import org.dromara.property.mapper.AssetMapper;
|
||||
import org.dromara.property.mapper.DepotMapper;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.DepotLogBo;
|
||||
import org.dromara.property.domain.vo.DepotLogVo;
|
||||
@@ -16,9 +23,8 @@ import org.dromara.property.domain.DepotLog;
|
||||
import org.dromara.property.mapper.DepotLogMapper;
|
||||
import org.dromara.property.service.IDepotLogService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 仓库记录Service业务层处理
|
||||
@@ -32,6 +38,9 @@ import java.util.Collection;
|
||||
public class DepotLogServiceImpl implements IDepotLogService {
|
||||
|
||||
private final DepotLogMapper baseMapper;
|
||||
private final AssetMapper assetsMapper;
|
||||
private final DepotMapper depotMapper;
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询仓库记录
|
||||
@@ -40,8 +49,10 @@ public class DepotLogServiceImpl implements IDepotLogService {
|
||||
* @return 仓库记录
|
||||
*/
|
||||
@Override
|
||||
public DepotLogVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
public DepotLogVo queryById(Long id) {
|
||||
DepotLogVo depotLogVo = baseMapper.selectVoById(id);
|
||||
handleData(depotLogVo,null,null,null);
|
||||
return depotLogVo;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,6 +66,41 @@ public class DepotLogServiceImpl implements IDepotLogService {
|
||||
public TableDataInfo<DepotLogVo> queryPageList(DepotLogBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DepotLog> lqw = buildQueryWrapper(bo);
|
||||
Page<DepotLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
// 收集用户ID用于批量查询用户名
|
||||
Set<Long> userIds = new HashSet<>();
|
||||
Set<Long> assetIds = new HashSet<>();
|
||||
Set<Long> depotIds = new HashSet<>();
|
||||
result.getRecords().forEach(r -> {
|
||||
if (r.getUserId() != null) {
|
||||
userIds.add(r.getUserId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(r.getAssetId())) {
|
||||
assetIds.add(r.getAssetId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(r.getDepotId())) {
|
||||
depotIds.add(r.getDepotId());
|
||||
}
|
||||
});
|
||||
|
||||
// 批量获取用户名
|
||||
Map<Long, String> userNamesByIds = remoteUserService.selectUserNamesByIds(new ArrayList<>(userIds));
|
||||
//批量获取资产名
|
||||
Map<Long, String> assetNamesByIds = assetsMapper.selectList(
|
||||
new LambdaQueryWrapper<Asset>()
|
||||
.select(Asset::getId, Asset::getName)
|
||||
.in(Asset::getId, assetIds)
|
||||
).stream()
|
||||
.collect(Collectors.toMap(Asset::getId, Asset::getName));
|
||||
//批量获取厂库名
|
||||
Map<Long, String> depotNamesByIds = depotMapper.selectList(
|
||||
new LambdaQueryWrapper<Depot>()
|
||||
.select(Depot::getId, Depot::getDepotName)
|
||||
.in(Depot::getId, depotIds)
|
||||
).stream()
|
||||
.collect(Collectors.toMap(Depot::getId, Depot::getDepotName));
|
||||
result.getRecords().stream().forEach(s -> {
|
||||
handleData(s, userNamesByIds, assetNamesByIds, depotNamesByIds);
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -87,6 +133,33 @@ public class DepotLogServiceImpl implements IDepotLogService {
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*/
|
||||
private void handleData(DepotLogVo depotLogVo, Map<Long, String> userNamesByIds, Map<Long, String> assetNamesByIds, Map<Long, String> depotNamesByIds) {
|
||||
//批量获取资产名
|
||||
if(CollUtil.isEmpty(assetNamesByIds)){
|
||||
assetNamesByIds = assetsMapper.selectList(
|
||||
new LambdaQueryWrapper<Asset>()
|
||||
.select(Asset::getId, Asset::getName)
|
||||
).stream()
|
||||
.collect(Collectors.toMap(Asset::getId, Asset::getName));
|
||||
}
|
||||
|
||||
//批量获取厂库名
|
||||
if(CollUtil.isEmpty(depotNamesByIds)){
|
||||
depotNamesByIds = depotMapper.selectList(
|
||||
new LambdaQueryWrapper<Depot>()
|
||||
.select(Depot::getId, Depot::getDepotName)
|
||||
).stream()
|
||||
.collect(Collectors.toMap(Depot::getId, Depot::getDepotName));
|
||||
}
|
||||
|
||||
depotLogVo.setAssetName(CollUtil.isNotEmpty(assetNamesByIds)?assetNamesByIds.get(depotLogVo.getAssetId()):null);
|
||||
depotLogVo.setDepotName(CollUtil.isNotEmpty(depotNamesByIds)?depotNamesByIds.get(depotLogVo.getDepotName()):null);
|
||||
depotLogVo.setUserName(CollUtil.isNotEmpty(userNamesByIds)?userNamesByIds.get(depotLogVo.getUserId()):remoteUserService.selectNicknameById(depotLogVo.getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库记录
|
||||
*
|
||||
@@ -120,7 +193,7 @@ public class DepotLogServiceImpl implements IDepotLogService {
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DepotLog entity){
|
||||
private void validEntityBeforeSave(DepotLog entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@@ -133,7 +206,7 @@ public class DepotLogServiceImpl implements IDepotLogService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
|
@@ -10,9 +10,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.InspectionRoute;
|
||||
import org.dromara.property.domain.InspectionRoutePoint;
|
||||
import org.dromara.property.domain.bo.InspectionRouteBo;
|
||||
import org.dromara.property.domain.vo.InspectionRouteVo;
|
||||
import org.dromara.property.mapper.InspectionRouteMapper;
|
||||
import org.dromara.property.mapper.InspectionRoutePointMapper;
|
||||
import org.dromara.property.service.IInspectionRouteService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -20,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 巡检路线Service业务层处理
|
||||
@@ -33,6 +36,7 @@ import java.util.Collection;
|
||||
public class InspectionRouteServiceImpl implements IInspectionRouteService {
|
||||
|
||||
private final InspectionRouteMapper baseMapper;
|
||||
private final InspectionRoutePointMapper routePointMapper;
|
||||
|
||||
/**
|
||||
* 查询巡检路线
|
||||
@@ -94,6 +98,14 @@ public class InspectionRouteServiceImpl implements IInspectionRouteService {
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
List<InspectionRoutePoint> routePointList = bo.getInspectionRoutePointBoList().stream()
|
||||
.map(pointBo -> {
|
||||
InspectionRoutePoint point = MapstructUtils.convert(pointBo, InspectionRoutePoint.class);
|
||||
point.setRouteId(add.getId());
|
||||
return point;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
routePointMapper.insertBatch(routePointList);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
@@ -174,6 +174,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
lqw.eq(bo.getCompleTime() != null, ServiceWorkOrders::getCompleTime, bo.getCompleTime());
|
||||
lqw.eq(Objects.nonNull(bo.getServiceEvalua()), ServiceWorkOrders::getServiceEvalua, bo.getServiceEvalua());
|
||||
lqw.eq(Objects.nonNull(bo.getType()), ServiceWorkOrders::getType, bo.getType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProcessingWeight()), ServiceWorkOrders::getProcessingWeight, bo.getProcessingWeight());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSearchValue()), ServiceWorkOrders::getSearchValue, bo.getSearchValue());
|
||||
return lqw;
|
||||
}
|
||||
|
@@ -6,9 +6,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.sis.domain.bo.SisElevatorFloorRefBo;
|
||||
import org.dromara.sis.domain.vo.SisElevatorFloorRefVo;
|
||||
import org.dromara.sis.service.ISisElevatorFloorRefService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@@ -40,8 +37,6 @@ public class SisElevatorInfoController extends BaseController {
|
||||
|
||||
private final ISisElevatorInfoService sisElevatorInfoService;
|
||||
|
||||
private final ISisElevatorFloorRefService sisElevatorFloorRefService;
|
||||
|
||||
/**
|
||||
* 查询电梯基本信息列表
|
||||
*/
|
||||
@@ -108,26 +103,4 @@ public class SisElevatorInfoController extends BaseController {
|
||||
@PathVariable("elevatorIds") Long[] elevatorIds) {
|
||||
return toAjax(sisElevatorInfoService.deleteWithValidByIds(List.of(elevatorIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电梯⇄楼层关联
|
||||
*
|
||||
* @param bo 电梯⇄楼层关联
|
||||
*/
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/ref/add")
|
||||
public R<Void> addRef(@Validated(AddGroup.class) @RequestBody SisElevatorFloorRefBo bo) {
|
||||
return toAjax(sisElevatorFloorRefService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电梯⇄楼层关联
|
||||
*
|
||||
* @param id 电梯id
|
||||
*/
|
||||
@GetMapping("/ref/{id}")
|
||||
public R<List<SisElevatorFloorRefVo>> queryRef(@NotNull(message = "电梯id不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(sisElevatorFloorRefService.queryByAuthGroupId(id));
|
||||
}
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -18,7 +19,7 @@ import java.util.Date;
|
||||
* 授权组视图对象 sis_auth_group
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@@ -52,5 +53,19 @@ public class SisAuthGroupVo implements Serializable {
|
||||
@ExcelProperty(value = "是否启用(0:禁用,1启用)")
|
||||
private Boolean isEnable;
|
||||
|
||||
/**
|
||||
* 门禁id
|
||||
*/
|
||||
private Collection<Long> acIds;
|
||||
|
||||
/**
|
||||
* 电梯
|
||||
*/
|
||||
private Collection<Long> eleIds;
|
||||
|
||||
/**
|
||||
* 门禁id
|
||||
*/
|
||||
private Collection<Long> floorIds;
|
||||
|
||||
}
|
||||
|
@@ -1,35 +0,0 @@
|
||||
package org.dromara.sis.dubbo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.sis.api.RemotePrecautionary;
|
||||
import org.dromara.sis.api.domain.RemotePrecautionaryVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Slf4j
|
||||
@DubboService
|
||||
@RequiredArgsConstructor
|
||||
public class RemotePrecautionaryImpl implements RemotePrecautionary {
|
||||
private final PrecautionaryMapper precautionaryMapper;
|
||||
|
||||
@Override
|
||||
public List<RemotePrecautionaryVo> getList() {
|
||||
Page<Precautionary> Page = new Page<>(1, 10);
|
||||
QueryWrapper<Precautionary> wrapper = new QueryWrapper<>();
|
||||
wrapper.orderByAsc("time");
|
||||
return precautionaryMapper.selectVoPage(Page, wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map count() {
|
||||
List<Precautionary> precautionaries = precautionaryMapper.selectList();
|
||||
Stream<Long> longStream = precautionaries.stream().map(Precautionary::getType);
|
||||
return Map.of();
|
||||
}
|
||||
}
|
@@ -79,7 +79,7 @@ public interface ISisAuthGroupRefService {
|
||||
/**
|
||||
* 通过权限组id,删除授权设备列表
|
||||
*
|
||||
* @param groupId 权限id
|
||||
* @param groupIds 权限id
|
||||
*/
|
||||
Boolean deleteByGroupId(Long groupId);
|
||||
Boolean deleteByGroupId(Collection<Long> groupIds);
|
||||
}
|
||||
|
@@ -109,9 +109,17 @@ public interface ISisAuthRecordService {
|
||||
/**
|
||||
* 批量删除授权记录
|
||||
*
|
||||
* @param ids 入驻员工ids
|
||||
* @param ids 入驻员工ids
|
||||
* @param e8Ids e8id
|
||||
*/
|
||||
Boolean deleteByPersonIds(Collection<Long> ids, Collection<Long> e8Ids);
|
||||
|
||||
/**
|
||||
* 根据权限组ID,查询授权记录
|
||||
*
|
||||
* @param groupIds 权限组ID
|
||||
*/
|
||||
Boolean queryByGroupIds(Collection<Long> groupIds);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -75,4 +75,12 @@ public interface ISisElevatorFloorChannelRefService {
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
Boolean batchInsert(Long elevatorId, Collection<SisElevatorFloorChannelRef> bo);
|
||||
|
||||
|
||||
/**
|
||||
* 通过楼层id,查询通道信息
|
||||
*
|
||||
* @param floorIds 楼层ids
|
||||
*/
|
||||
List<SisElevatorFloorChannelRefVo> queryByFloorIds(Collection<Long> floorIds);
|
||||
}
|
||||
|
@@ -74,6 +74,13 @@ public interface ISisElevatorFloorRefService {
|
||||
*/
|
||||
List<SisElevatorFloorRefVo> queryByAuthGroupId(Long authGroupId);
|
||||
|
||||
/**
|
||||
* 根据权限组id,删除电梯⇄楼层关联信息
|
||||
*
|
||||
* @param authGroupIds 权限组ids
|
||||
*/
|
||||
Boolean deleteByAuthGroupId(Collection<Long> authGroupIds);
|
||||
|
||||
/**
|
||||
* 批量更新电梯⇄楼层通道关联信息
|
||||
*
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package org.dromara.sis.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
@@ -32,7 +33,7 @@ import java.util.Collection;
|
||||
* 权限组⇄设备关联Service业务层处理
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-23
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -107,10 +108,7 @@ public class SisAuthGroupRefServiceImpl implements ISisAuthGroupRefService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(Long authGroupId, Collection<Long> acIds, Collection<Long> eleIds, Collection<Long> floorIds) {
|
||||
// 删除权限组⇄设备关联关系
|
||||
this.deleteByGroupId(authGroupId);
|
||||
|
||||
// 电梯设备
|
||||
List<SisElevatorInfoVo> eleVoList = elevatorInfoService.queryListByIds(eleIds);
|
||||
this.deleteByGroupId(List.of(authGroupId));
|
||||
|
||||
log.info("开始写入授权组门禁,acIds:{}", acIds);
|
||||
boolean check = false;
|
||||
@@ -124,30 +122,34 @@ public class SisAuthGroupRefServiceImpl implements ISisAuthGroupRefService {
|
||||
}
|
||||
log.info("写入授权组门禁完成");
|
||||
|
||||
log.info("开始写入授权组电梯,eleIds:{}", eleIds);
|
||||
for (SisElevatorInfoVo ele : eleVoList) {
|
||||
SisAuthGroupRef groupRef = new SisAuthGroupRef();
|
||||
groupRef.setAuthGroupId(authGroupId);
|
||||
groupRef.setDeviceType(2L);
|
||||
groupRef.setDeviceId(ele.getElevatorId());
|
||||
check = baseMapper.insert(groupRef) > 0;
|
||||
Assert.isTrue(check, "写入授权组电梯失败!");
|
||||
if (CollUtil.isNotEmpty(eleIds)) {
|
||||
// 电梯设备
|
||||
List<SisElevatorInfoVo> eleVoList = elevatorInfoService.queryListByIds(eleIds);
|
||||
|
||||
log.info("开始写入授权组电梯楼层,floorIds:{}", floorIds);
|
||||
// 获取该电梯所在单元的楼层信息
|
||||
List<RemoteFloorVo> floorVoList = remoteFloorService.queryByBuildingId(ele.getBuildingId());
|
||||
// 该单元所有楼层id
|
||||
List<Long> allFloors = floorVoList.stream().map(RemoteFloorVo::getId).toList();
|
||||
// 对比找出授权楼层id
|
||||
List<Long> authFloors = floorIds.stream().filter(allFloors::contains).toList();
|
||||
SisElevatorFloorRefBo refBo = new SisElevatorFloorRefBo();
|
||||
refBo.setAuthGroupId(authGroupId);
|
||||
refBo.setElevatorId(ele.getElevatorId());
|
||||
refBo.setFloorIds(authFloors);
|
||||
sisElevatorFloorRefService.insertByBo(refBo);
|
||||
log.info("开始写入授权组电梯,eleIds:{}", eleIds);
|
||||
for (SisElevatorInfoVo ele : eleVoList) {
|
||||
SisAuthGroupRef groupRef = new SisAuthGroupRef();
|
||||
groupRef.setAuthGroupId(authGroupId);
|
||||
groupRef.setDeviceType(2L);
|
||||
groupRef.setDeviceId(ele.getElevatorId());
|
||||
check = baseMapper.insert(groupRef) > 0;
|
||||
Assert.isTrue(check, "写入授权组电梯失败!");
|
||||
|
||||
log.info("开始写入授权组电梯楼层,floorIds:{}", floorIds);
|
||||
// 获取该电梯所在单元的楼层信息
|
||||
List<RemoteFloorVo> floorVoList = remoteFloorService.queryByBuildingId(ele.getBuildingId());
|
||||
// 该单元所有楼层id
|
||||
List<Long> allFloors = floorVoList.stream().map(RemoteFloorVo::getId).toList();
|
||||
// 对比找出授权楼层id
|
||||
List<Long> authFloors = floorIds.stream().filter(allFloors::contains).toList();
|
||||
SisElevatorFloorRefBo refBo = new SisElevatorFloorRefBo();
|
||||
refBo.setAuthGroupId(authGroupId);
|
||||
refBo.setElevatorId(ele.getElevatorId());
|
||||
refBo.setFloorIds(authFloors);
|
||||
sisElevatorFloorRefService.insertByBo(refBo);
|
||||
}
|
||||
log.info("写入授权组电梯完成");
|
||||
}
|
||||
log.info("写入授权组电梯完成");
|
||||
|
||||
return check;
|
||||
}
|
||||
|
||||
@@ -201,12 +203,13 @@ public class SisAuthGroupRefServiceImpl implements ISisAuthGroupRefService {
|
||||
/**
|
||||
* 通过权限组id,删除授权设备列表
|
||||
*
|
||||
* @param groupId 权限id
|
||||
* @param groupIds 权限id
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteByGroupId(Long groupId) {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteByGroupId(Collection<Long> groupIds) {
|
||||
LambdaQueryWrapper<SisAuthGroupRef> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(SisAuthGroupRef::getAuthGroupId, groupId);
|
||||
lqw.in(SisAuthGroupRef::getAuthGroupId, groupIds);
|
||||
return baseMapper.delete(lqw) > 0;
|
||||
}
|
||||
}
|
||||
|
@@ -10,6 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sis.domain.SisElevatorFloorRef;
|
||||
import org.dromara.sis.domain.vo.SisAuthGroupRefVo;
|
||||
import org.dromara.sis.domain.vo.SisElevatorFloorRefVo;
|
||||
import org.dromara.sis.service.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.sis.domain.bo.SisAuthGroupBo;
|
||||
@@ -35,8 +38,9 @@ public class SisAuthGroupServiceImpl implements ISisAuthGroupService {
|
||||
|
||||
private final SisAuthGroupMapper baseMapper;
|
||||
|
||||
private final ISisAuthRecordService sisAuthRecordService;
|
||||
private final ISisAuthGroupRefService sisAuthGroupRefService;
|
||||
|
||||
private final ISisElevatorFloorRefService sisElevatorFloorRefService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -47,7 +51,21 @@ public class SisAuthGroupServiceImpl implements ISisAuthGroupService {
|
||||
*/
|
||||
@Override
|
||||
public SisAuthGroupVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
|
||||
// 门禁设备
|
||||
List<SisAuthGroupRefVo> groupRefs = sisAuthGroupRefService.queryListByGroupId(id);
|
||||
Collection<Long> acIds = groupRefs.stream().filter(vo -> vo.getDeviceType() == 1).map(SisAuthGroupRefVo::getDeviceId).toList();
|
||||
|
||||
// 楼层
|
||||
List<SisElevatorFloorRefVo> floorRefs = sisElevatorFloorRefService.queryByAuthGroupId(id);
|
||||
Collection<Long> floorIds = floorRefs.stream().map(SisElevatorFloorRefVo::getFloorId).toList();
|
||||
|
||||
SisAuthGroupVo vo = baseMapper.selectVoById(id);
|
||||
|
||||
vo.setAcIds(acIds);
|
||||
vo.setFloorIds(floorIds);
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,6 +140,7 @@ public class SisAuthGroupServiceImpl implements ISisAuthGroupService {
|
||||
Assert.isTrue(flag, "修改授权组失败");
|
||||
|
||||
if (flag) {
|
||||
assert update != null;
|
||||
flag = sisAuthGroupRefService.insertByBo(update.getId(), bo.getAcIds(), bo.getEleIds(), bo.getFloorIds());
|
||||
}
|
||||
|
||||
@@ -143,10 +162,25 @@ public class SisAuthGroupServiceImpl implements ISisAuthGroupService {
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
boolean auth = sisAuthRecordService.queryByGroupIds(ids);
|
||||
Assert.isTrue(!auth, "授权组已分配");
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
|
||||
boolean flag = baseMapper.deleteByIds(ids) > 0;
|
||||
Assert.isTrue(flag, "删除授权组失败");
|
||||
|
||||
if (flag) {
|
||||
// 删除授权组⇄授权设备关联表
|
||||
Boolean ref = sisAuthGroupRefService.deleteByGroupId(ids);
|
||||
Assert.isTrue(ref, "删除授权组⇄授权设备失败");
|
||||
|
||||
// 删除授权组⇄电梯⇄楼层
|
||||
Boolean floor = sisElevatorFloorRefService.deleteByAuthGroupId(ids);
|
||||
Assert.isTrue(floor, "删除授权组⇄电梯⇄楼层失败");
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
@@ -320,6 +320,10 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
*/
|
||||
@Override
|
||||
public SisAuthRecordVo checkAuth(Long personId) {
|
||||
List<SisAuthRecordVo> authVoList = baseMapper.checkAuth(personId);
|
||||
if (CollUtil.isEmpty(authVoList)) {
|
||||
return null;
|
||||
}
|
||||
return baseMapper.checkAuth(personId).get(0);
|
||||
}
|
||||
|
||||
@@ -371,4 +375,17 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据权限组ID,查询授权记录
|
||||
*
|
||||
* @param groupIds 权限组IDs
|
||||
*/
|
||||
@Override
|
||||
public Boolean queryByGroupIds(Collection<Long> groupIds){
|
||||
LambdaQueryWrapper<SisAuthRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(SisAuthRecord::getGroupId, groupIds);
|
||||
List<SisAuthRecordVo> authVoList = baseMapper.selectVoList(lqw);
|
||||
return CollUtil.isNotEmpty(authVoList);
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ package org.dromara.sis.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -26,7 +25,7 @@ import java.util.Collection;
|
||||
* 电梯⇄楼层⇄通道关联Service业务层处理
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-08-04
|
||||
* @since 2025-08-04
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@@ -155,4 +154,16 @@ public class SisElevatorFloorChannelRefServiceImpl implements ISisElevatorFloorC
|
||||
Assert.isTrue(flag, "批量增加电梯⇄楼层⇄通道关联信息失败");
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过楼层id,查询通道信息
|
||||
*
|
||||
* @param floorIds 楼层ids
|
||||
*/
|
||||
@Override
|
||||
public List<SisElevatorFloorChannelRefVo> queryByFloorIds(Collection<Long> floorIds){
|
||||
LambdaQueryWrapper<SisElevatorFloorChannelRef> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(SisElevatorFloorChannelRef::getFloorId, floorIds);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
}
|
||||
|
@@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sis.domain.SisElevatorFloorChannelRef;
|
||||
import org.dromara.sis.domain.vo.SisElevatorFloorChannelRefVo;
|
||||
import org.dromara.sis.service.ISisElevatorFloorChannelRefService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.sis.domain.bo.SisElevatorFloorRefBo;
|
||||
import org.dromara.sis.domain.vo.SisElevatorFloorRefVo;
|
||||
@@ -18,9 +20,12 @@ import org.dromara.sis.mapper.SisElevatorFloorRefMapper;
|
||||
import org.dromara.sis.service.ISisElevatorFloorRefService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 电梯⇄楼层关联Service业务层处理
|
||||
@@ -34,6 +39,7 @@ import java.util.Collection;
|
||||
public class SisElevatorFloorRefServiceImpl implements ISisElevatorFloorRefService {
|
||||
|
||||
private final SisElevatorFloorRefMapper baseMapper;
|
||||
private final ISisElevatorFloorChannelRefService sisElevatorFloorChannelRefService;
|
||||
|
||||
/**
|
||||
* 查询电梯⇄楼层关联
|
||||
@@ -94,15 +100,33 @@ public class SisElevatorFloorRefServiceImpl implements ISisElevatorFloorRefServi
|
||||
Collection<Long> ids = list.stream().map(SisElevatorFloorRefVo::getId).toList();
|
||||
baseMapper.deleteByIds(ids);
|
||||
|
||||
boolean flag = false;
|
||||
for (Long num : bo.getFloorIds()){
|
||||
// 通道关系
|
||||
List<SisElevatorFloorChannelRefVo> channelInfo = sisElevatorFloorChannelRefService.queryByFloorIds(bo.getFloorIds());
|
||||
|
||||
// 创建Map提高查找效率,避免在循环中重复流操作
|
||||
Map<Long, SisElevatorFloorChannelRefVo> channelInfoMap = channelInfo.stream()
|
||||
.collect(Collectors.toMap(SisElevatorFloorChannelRefVo::getFloorId, Function.identity()));
|
||||
|
||||
List<SisElevatorFloorRef> refInfo = new ArrayList<>();
|
||||
|
||||
for (Long num : bo.getFloorIds()) {
|
||||
SisElevatorFloorRef add = new SisElevatorFloorRef();
|
||||
add.setFloorId(num);
|
||||
add.setAuthGroupId(bo.getAuthGroupId());
|
||||
add.setElevatorId(bo.getElevatorId());
|
||||
flag = baseMapper.insert(add) > 0;
|
||||
Assert.isTrue(flag, "新增电梯⇄楼层关联关系失败");
|
||||
|
||||
// 存在通道关系同时写入
|
||||
SisElevatorFloorChannelRefVo channelRef = channelInfoMap.get(num);
|
||||
if (channelRef != null) {
|
||||
add.setOutChannel(channelRef.getOutChannel());
|
||||
add.setInChannel(channelRef.getInChannel());
|
||||
}
|
||||
|
||||
refInfo.add(add);
|
||||
}
|
||||
|
||||
boolean flag = baseMapper.insertBatch(refInfo);
|
||||
Assert.isTrue(flag, "电梯楼层关联关系写入失败!");
|
||||
return flag;
|
||||
}
|
||||
|
||||
@@ -142,34 +166,53 @@ public class SisElevatorFloorRefServiceImpl implements ISisElevatorFloorRefServi
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据电梯id,获取电梯⇄楼层关联信息
|
||||
* 根据权限组id,获取电梯⇄楼层关联信息
|
||||
*
|
||||
* @param authGroupId 电梯id
|
||||
*/
|
||||
@Override
|
||||
public List<SisElevatorFloorRefVo> queryByAuthGroupId(Long authGroupId) {
|
||||
LambdaQueryWrapper<SisElevatorFloorRef> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(SisElevatorFloorRef::getElevatorId, authGroupId);
|
||||
lqw.eq(SisElevatorFloorRef::getAuthGroupId, authGroupId);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据权限组id,删除电梯⇄楼层关联信息
|
||||
*
|
||||
* @param authGroupIds 权限组ids
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteByAuthGroupId(Collection<Long> authGroupIds) {
|
||||
LambdaQueryWrapper<SisElevatorFloorRef> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(SisElevatorFloorRef::getAuthGroupId, authGroupIds);
|
||||
return baseMapper.delete(lqw) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新电梯⇄楼层通道关联信息
|
||||
*
|
||||
* @param info 通道信息
|
||||
* @param info 通道信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean batchUpdateChannel(Collection<SisElevatorFloorChannelRef> info){
|
||||
public Boolean batchUpdateChannel(Collection<SisElevatorFloorChannelRef> info) {
|
||||
LambdaQueryWrapper<SisElevatorFloorRef> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(SisElevatorFloorRef::getFloorId, info.stream().map(SisElevatorFloorChannelRef::getFloorId).toList());
|
||||
List<SisElevatorFloorRef> list = baseMapper.selectList(lqw);
|
||||
|
||||
// 创建Map提高查找效率,避免在循环中重复流操作
|
||||
Map<Long, SisElevatorFloorChannelRef> floorInfoMap = info.stream()
|
||||
.collect(Collectors.toMap(SisElevatorFloorChannelRef::getFloorId, Function.identity()));
|
||||
|
||||
for (SisElevatorFloorRef item : list){
|
||||
item.setInChannel(info.stream().filter(x -> x.getFloorId().equals(item.getFloorId())).findFirst().get().getInChannel());
|
||||
for (SisElevatorFloorRef item : list) {
|
||||
SisElevatorFloorChannelRef floorInfo = floorInfoMap.get(item.getFloorId());
|
||||
if (floorInfo != null) {
|
||||
item.setInChannel(floorInfo.getInChannel());
|
||||
item.setOutChannel(floorInfo.getOutChannel());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return baseMapper.updateBatchById(list);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user