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
# Conflicts: # ruoyi-modules/Sis/src/main/java/org/dromara/sis/dubbo/RemotePrecautionaryImpl.java # ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAccessControlServiceImpl.java
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) {
|
||||
|
@@ -103,4 +103,13 @@ public class ServiceWorkOrdersTypeController extends BaseController {
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(serviceWorkOrdersTypeService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【工单类型】树结构
|
||||
*/
|
||||
@SaCheckPermission("system:workOrdersType:list")
|
||||
@GetMapping("/typeTree")
|
||||
public R<List<ServiceWorkOrdersTypeVo>> typeTree() {
|
||||
return R.ok(serviceWorkOrdersTypeService.typeTree()) ;
|
||||
}
|
||||
}
|
||||
|
@@ -70,8 +70,10 @@ public class TbVisitorManagementController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/getcode")
|
||||
public R<String> getcode(QrCodeInfo qrCodeInfo) {
|
||||
Long string = (Long) StpUtil.getLoginId();
|
||||
qrCodeInfo.setUserid(string);
|
||||
String userid =StpUtil.getLoginId().toString();
|
||||
String[] split = userid.split(":");
|
||||
Long s1 = Long.valueOf(split[1]);
|
||||
qrCodeInfo.setUserid(s1);
|
||||
String s = remoteConfigService.selectQrTimeOut();
|
||||
int i = Integer.parseInt(s);
|
||||
UUID value = UUID.randomUUID();
|
||||
@@ -123,7 +125,7 @@ public class TbVisitorManagementController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增访客管理
|
||||
* 小程序新增访客管理
|
||||
*/
|
||||
@SaCheckPermission("property:visitorManagement:add")
|
||||
@Log(title = "访客管理", businessType = BusinessType.INSERT)
|
||||
@@ -137,6 +139,18 @@ public class TbVisitorManagementController extends BaseController {
|
||||
return toAjax(tbVisitorManagementService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* pc端新增访客管理
|
||||
*/
|
||||
@SaCheckPermission("property:visitorManagement::addVisitorManagement")
|
||||
@Log(title = "访客管理", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping
|
||||
public R<Void> addVistorManagement(@Validated(AddGroup.class) @RequestBody TbVisitorManagementBo bo) {
|
||||
return toAjax(tbVisitorManagementService.insertVistorManagementByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改访客管理
|
||||
*/
|
||||
|
@@ -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;
|
||||
|
||||
|
||||
}
|
@@ -62,4 +62,9 @@ public class ServiceWorkOrdersType extends TenantEntity {
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
*上级类型id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
||||
}
|
@@ -60,4 +60,9 @@ public class ServiceWorkOrdersTypeBo extends BaseEntity {
|
||||
*/
|
||||
private Integer isTransfers;
|
||||
|
||||
/**
|
||||
*上级类型id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ public class TbVisitorManagementBo extends BaseEntity {
|
||||
/**
|
||||
* qr码id
|
||||
*/
|
||||
@NotNull(message = "qr码id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "qr码id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long qrCodeId;
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
|
||||
|
||||
}
|
@@ -8,7 +8,8 @@ import org.dromara.property.domain.ServiceWorkOrdersType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -75,4 +76,14 @@ public class ServiceWorkOrdersTypeVo implements Serializable {
|
||||
@ExcelProperty(value = "搜索值")
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 上级类型id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 子级类型
|
||||
*/
|
||||
private List<ServiceWorkOrdersTypeVo> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -65,4 +65,10 @@ public interface IServiceWorkOrdersTypeService {
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 查询【工单类型】树结构
|
||||
* @return 工单类型树结构
|
||||
*/
|
||||
List<ServiceWorkOrdersTypeVo> typeTree();
|
||||
}
|
||||
|
@@ -56,6 +56,9 @@ public interface ITbVisitorManagementService {
|
||||
*/
|
||||
Boolean insertByBo(TbVisitorManagementBo bo);
|
||||
|
||||
|
||||
Boolean insertVistorManagementByBo(TbVisitorManagementBo 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());
|
||||
|
@@ -2,6 +2,7 @@ package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -44,6 +45,7 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
||||
|
||||
private final AttendanceGroupMapper attendanceGroupMapper;
|
||||
|
||||
|
||||
// private final AttendanceArrangementGroupMapper arrangementGroupMapper;
|
||||
|
||||
private final AttendanceWeekSetMapper weekSetMapper;
|
||||
@@ -125,7 +127,7 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
||||
vo.setShift(attendanceShift);
|
||||
|
||||
|
||||
}else if (Objects.equals(attendanceGroup.getAttendanceType(), StatusConstant.SHIFTSCHEDULE)) {
|
||||
} else if (Objects.equals(attendanceGroup.getAttendanceType(), StatusConstant.SHIFTSCHEDULE)) {
|
||||
//3.2排班制
|
||||
|
||||
//将startDate作为第一天,endDate作为最后一天,循环判断当前日期是第几天,取出当前天数的班次信息。
|
||||
@@ -163,7 +165,6 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
||||
}
|
||||
|
||||
|
||||
|
||||
//根据cycleDay查询出当前日期的班次信息
|
||||
AttendanceScheduleCycle cycle = scheduleCycleMapper.selectOne(Wrappers.<AttendanceScheduleCycle>lambdaQuery().eq(AttendanceScheduleCycle::getGroupId, groupId).eq(AttendanceScheduleCycle::getDayNumber, cycleDay));
|
||||
//将cycle存到vo中
|
||||
@@ -260,84 +261,153 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
||||
public TableDataInfo<AttendanceArrangementVo> queryList(AttendanceArrangementBo bo) {
|
||||
|
||||
LocalDate month = bo.getMonth().atEndOfMonth();
|
||||
// 1. 拿到日历的开始时间和结束时间
|
||||
LocalDate calendarStartDate = month.withDayOfMonth(1);
|
||||
LocalDate calendarEndDate = month.withDayOfMonth(calendarStartDate.lengthOfMonth());
|
||||
|
||||
// 2. 根据日历的开始时间和结束时间查询出每一天的排班信息
|
||||
// 2.1 循环日历的开始时间和结束时间,判断 calendarStartDate 在哪些排班中
|
||||
List<AttendanceArrangementVo> result = new ArrayList<>();
|
||||
//使用mybatisplus的between查询在calendarStartDate和calendarEndDate之间的排班信息
|
||||
List<AttendanceArrangementVo> startResult = baseMapper.selectVoList(Wrappers.<AttendanceArrangement>lambdaQuery()
|
||||
.between(AttendanceArrangement::getStartDate, calendarStartDate.atStartOfDay(ZoneId.systemDefault()).toInstant(),
|
||||
calendarEndDate.atStartOfDay(ZoneId.systemDefault()).plusDays(1).toInstant().minusSeconds(1)));
|
||||
|
||||
//查询结束时间在calendarStartDate和calendarEndDate之间的排班信息
|
||||
List<AttendanceArrangement> endResult = baseMapper.selectList(Wrappers.<AttendanceArrangement>lambdaQuery()
|
||||
.between(AttendanceArrangement::getEndDate, calendarStartDate.atStartOfDay(ZoneId.systemDefault()).toInstant(),
|
||||
calendarEndDate.atStartOfDay(ZoneId.systemDefault()).plusDays(1).toInstant().minusSeconds(1)));
|
||||
|
||||
for (LocalDate date = calendarStartDate; date.isBefore(calendarEndDate); date = date.plusDays(1)) {
|
||||
// 2.2 根据当前日期查询在开始时间和结束时间之间的排班信息
|
||||
//查询当前日期在哪些排班中,当前日期大于等于排班开始日期,小于等于排班结束日期
|
||||
// 查询指定日期在哪些排班中
|
||||
List<AttendanceArrangement> arrangementList = baseMapper.selectList(
|
||||
Wrappers.<AttendanceArrangement>lambdaQuery()
|
||||
.between(AttendanceArrangement::getStartDate, date.atStartOfDay(ZoneId.systemDefault()).toInstant(),
|
||||
date.atStartOfDay(ZoneId.systemDefault()).plusDays(1).toInstant().minusSeconds(1)));
|
||||
//合并两个list,并去重
|
||||
List<AttendanceArrangementVo> result = new ArrayList<>(startResult.stream().distinct().toList());
|
||||
result.addAll(endResult.stream().map(vo -> {
|
||||
AttendanceArrangementVo newVo = MapstructUtils.convert(vo, AttendanceArrangementVo.class);
|
||||
newVo.setStartDate(vo.getStartDate());
|
||||
newVo.setEndDate(vo.getEndDate());
|
||||
return newVo;
|
||||
}).toList());
|
||||
|
||||
// //根据arrangementList查询出排班的id
|
||||
// List<Long> scheduleIdList = arrangementList.stream().map(AttendanceArrangement::getId).toList();
|
||||
// //根据排班的id查询出排班的人员详细信息
|
||||
// List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().in(AttendanceUserGroup::getScheduleId, scheduleIdList));
|
||||
//去掉result中id重复的排班信息
|
||||
result = result.stream().distinct().toList();
|
||||
|
||||
|
||||
// 根据排班查询出考勤组id
|
||||
List<Long> groupIds = arrangementList.stream()
|
||||
.map(AttendanceArrangement::getGroupId)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
// 如果当前日期没有排班,则跳过当前日期
|
||||
if (groupIds.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 循环 groupIds,循环和 AttendanceGroup 中的 id 做对比,如果有相同的,则取出 attendanceGroup 中的所有数据
|
||||
for (Long groupId : groupIds) {
|
||||
AttendanceGroup attendanceGroup = attendanceGroupMapper.selectById(groupId);
|
||||
if (attendanceGroup != null) {
|
||||
// 创建 AttendanceArrangementVo 对象并设置属性
|
||||
AttendanceArrangementVo vo = new AttendanceArrangementVo();
|
||||
vo.setStartDate(arrangementList.get(0).getStartDate());
|
||||
vo.setEndDate(arrangementList.get(0).getEndDate());
|
||||
|
||||
//获取到第一个排班的id
|
||||
Long arrangementId = arrangementList.get(0).getId();
|
||||
//根据arrangementId查询出人员组的详细信息
|
||||
AttendanceGroup group = attendanceGroupMapper.selectById(arrangementId);
|
||||
//将group存到vo中
|
||||
vo.setAttendanceGroup(group);
|
||||
|
||||
//根据arrangementList查询出排班的id
|
||||
List<Long> scheduleIdList = arrangementList.stream().map(AttendanceArrangement::getId).distinct().toList();
|
||||
//根据排班的id查询出排班的人员详细信息
|
||||
List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().in(AttendanceUserGroup::getScheduleId, scheduleIdList));
|
||||
|
||||
|
||||
//新建attendanceGroup对象,将排班信息和考勤组信息添加到vo中
|
||||
vo.setAttendanceGroup(attendanceGroup);
|
||||
//将排班人员信息添加到排班信息中
|
||||
vo.setUserGroupList(userGroupList);
|
||||
|
||||
result.add(vo);
|
||||
//根据排班查询出考勤组id
|
||||
List<Long> groupIds = result.stream().map(AttendanceArrangementVo::getGroupId).distinct().toList();
|
||||
// 循环 groupIds,循环和 AttendanceGroup 中的 id 做对比,如果有相同的,则取出 attendanceGroup 中的所有数据
|
||||
for (Long groupId : groupIds) {
|
||||
AttendanceGroup attendanceGroup = attendanceGroupMapper.selectById(groupId);
|
||||
if (attendanceGroup != null) {
|
||||
// 循环排班列表,将排班信息和考勤组信息添加到vo中
|
||||
for (AttendanceArrangementVo vo : result) {
|
||||
if (vo.getGroupId().equals(groupId)) {
|
||||
vo.setAttendanceGroup(attendanceGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 循环排班列表,查询排班人员信息
|
||||
for (AttendanceArrangementVo vo : result) {
|
||||
// 根据排班查询出人员组的详细信息
|
||||
List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().eq(AttendanceUserGroup::getScheduleId, vo.getId()));
|
||||
// 将排班人员信息添加到排班信息中
|
||||
vo.setUserGroupList(userGroupList);
|
||||
|
||||
}
|
||||
|
||||
// LocalDate month = bo.getMonth().atEndOfMonth();
|
||||
// // 1. 拿到日历的开始时间和结束时间
|
||||
// LocalDate calendarStartDate = month.withDayOfMonth(1);
|
||||
// LocalDate calendarEndDate = month.withDayOfMonth(calendarStartDate.lengthOfMonth());
|
||||
//
|
||||
// // 2. 根据日历的开始时间和结束时间查询出每一天的排班信息
|
||||
// // 2.1 循环日历的开始时间和结束时间,判断 calendarStartDate 在哪些排班中
|
||||
// List<AttendanceArrangementVo> result = new ArrayList<>();
|
||||
//
|
||||
//
|
||||
// //查询所有排班信息
|
||||
// List<AttendanceArrangement> arrangementList1 = baseMapper.selectList();
|
||||
// //取出排班的开始时间和结束时间
|
||||
// List<LocalDate> startDateList = arrangementList1.stream().map(AttendanceArrangement::getStartDate).toList();
|
||||
// List<LocalDate> endDateList = arrangementList1.stream().map(AttendanceArrangement::getEndDate).toList();
|
||||
//
|
||||
// int count = 0;
|
||||
//
|
||||
// for (LocalDate date = calendarStartDate; date.isBefore(calendarEndDate); date = date.plusDays(1)) {
|
||||
// // 2.2 根据当前日期查询在开始时间和结束时间之间的排班信息
|
||||
// //查询当前日期在哪些排班中,当前日期大于等于排班开始日期,小于等于排班结束日期
|
||||
//
|
||||
// if (count >= startDateList.size() || count >= endDateList.size()){
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//// // 查询指定日期在哪些排班中
|
||||
//// List<AttendanceArrangement> arrangementList = baseMapper.selectList(
|
||||
//// Wrappers.<AttendanceArrangement>lambdaQuery()
|
||||
//// .between(AttendanceArrangement::getStartDate, date.atStartOfDay(ZoneId.systemDefault()).toInstant(),
|
||||
//// date.atStartOfDay(ZoneId.systemDefault()).plusDays(1).toInstant().minusSeconds(1)));
|
||||
//
|
||||
//
|
||||
// // 查询指定日期在哪些排班中
|
||||
// List<AttendanceArrangement> arrangementList = baseMapper.selectList(
|
||||
// Wrappers.<AttendanceArrangement>lambdaQuery()
|
||||
// .between(AttendanceArrangement::getStartDate, startDateList.get(count).atStartOfDay(ZoneId.systemDefault()).toInstant(),
|
||||
// endDateList.get(count).atStartOfDay(ZoneId.systemDefault()).plusDays(1).toInstant().minusSeconds(1)));
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//// //根据arrangementList查询出排班的id
|
||||
//// List<Long> scheduleIdList = arrangementList.stream().map(AttendanceArrangement::getId).toList();
|
||||
//// //根据排班的id查询出排班的人员详细信息
|
||||
//// List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().in(AttendanceUserGroup::getScheduleId, scheduleIdList));
|
||||
//
|
||||
//
|
||||
// // 根据排班查询出考勤组id
|
||||
// List<Long> groupIds = arrangementList.stream()
|
||||
// .map(AttendanceArrangement::getGroupId)
|
||||
// .distinct()
|
||||
// .toList();
|
||||
//
|
||||
// // 如果当前日期没有排班,则跳过当前日期
|
||||
// if (groupIds.isEmpty()) {
|
||||
// count++;
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// // 循环 groupIds,循环和 AttendanceGroup 中的 id 做对比,如果有相同的,则取出 attendanceGroup 中的所有数据
|
||||
// for (Long groupId : groupIds) {
|
||||
// AttendanceGroup attendanceGroup = attendanceGroupMapper.selectById(groupId);
|
||||
// if (attendanceGroup != null) {
|
||||
// // 创建 AttendanceArrangementVo 对象并设置属性
|
||||
// AttendanceArrangementVo vo = new AttendanceArrangementVo();
|
||||
// vo.setId(arrangementList.get(0).getId());
|
||||
// vo.setStartDate(arrangementList.get(0).getStartDate());
|
||||
// vo.setEndDate(arrangementList.get(0).getEndDate());
|
||||
//
|
||||
// //获取到第一个排班的id
|
||||
// Long arrangementId = arrangementList.get(0).getId();
|
||||
// //根据arrangementId查询出人员组的详细信息
|
||||
// AttendanceGroup group = attendanceGroupMapper.selectById(arrangementId);
|
||||
// //将group存到vo中
|
||||
// vo.setAttendanceGroup(group);
|
||||
//
|
||||
// //根据arrangementList查询出排班的id
|
||||
// List<Long> scheduleIdList = arrangementList.stream().map(AttendanceArrangement::getId).distinct().toList();
|
||||
// //根据排班的id查询出排班的人员详细信息
|
||||
// List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().in(AttendanceUserGroup::getScheduleId, scheduleIdList));
|
||||
//
|
||||
//
|
||||
// //新建attendanceGroup对象,将排班信息和考勤组信息添加到vo中
|
||||
// vo.setAttendanceGroup(attendanceGroup);
|
||||
// //将排班人员信息添加到排班信息中
|
||||
// vo.setUserGroupList(userGroupList);
|
||||
//
|
||||
// result.add(vo);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// count++;
|
||||
// }
|
||||
return TableDataInfo.build(result);
|
||||
|
||||
// // 计算交集的开始时间(取较晚的开始时间)和结束时间(取较早的结束时间)
|
||||
// Date overlapStart = calendarStartDate.after(startDate)
|
||||
// ? calendarStartDate : startDate;
|
||||
// Date overlapEnd = calendarEndTimeDate.before(endDate)
|
||||
// ? calendarEndTimeDate : endDate;
|
||||
|
||||
//根据交集的时间范围查询排班信息
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ import org.dromara.property.service.IServiceWorkOrdersTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -138,4 +139,35 @@ public class ServiceWorkOrdersTypeServiceImpl implements IServiceWorkOrdersTypeS
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【工单类型】树结构
|
||||
* @return 工单类型树结构
|
||||
*/
|
||||
@Override
|
||||
public List<ServiceWorkOrdersTypeVo> typeTree() {
|
||||
List<ServiceWorkOrdersTypeVo> list = baseMapper.selectVoList();
|
||||
return buildTree(list,null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归构建树结构
|
||||
* @param types 所有类型列表
|
||||
* @param parentId 父节点id
|
||||
* @return 树结构列表
|
||||
*/
|
||||
public static List<ServiceWorkOrdersTypeVo> buildTree(List<ServiceWorkOrdersTypeVo> types, Long parentId) {
|
||||
List<ServiceWorkOrdersTypeVo> tree = new ArrayList<>();
|
||||
for (ServiceWorkOrdersTypeVo type : types) {
|
||||
Long currentParentId = type.getParentId();
|
||||
if ((parentId == null && currentParentId == null) ||
|
||||
(parentId != null && parentId.equals(currentParentId))) {
|
||||
List<ServiceWorkOrdersTypeVo> children = buildTree(types, type.getId());
|
||||
type.getChildren().addAll(children);
|
||||
tree.add(type);
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
}
|
||||
|
@@ -93,7 +93,7 @@ public class TbVisitorManagementServiceImpl implements ITbVisitorManagementServi
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增访客管理
|
||||
* 小程序新增访客管理
|
||||
*
|
||||
* @param bo 访客管理
|
||||
* @return 是否新增成功
|
||||
@@ -111,6 +111,26 @@ public class TbVisitorManagementServiceImpl implements ITbVisitorManagementServi
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pc端新增访客管理
|
||||
*
|
||||
* @param bo 访客管理
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertVistorManagementByBo(TbVisitorManagementBo bo) {
|
||||
// QrCodeInfo info = RedisUtils.getCacheObject("Qrcode" + bo.getQrCodeId());
|
||||
TbVisitorManagement add = MapstructUtils.convert(bo, TbVisitorManagement.class);
|
||||
validEntityBeforeSave(add);
|
||||
// add.setCreateById(info.getUserid());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改访客管理
|
||||
*
|
||||
|
Reference in New Issue
Block a user