添加获取大屏数据相关接口
This commit is contained in:
@ -15,11 +15,9 @@ import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixCreateByGeoJsonReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixCreateReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixQueryReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixUpdateReq;
|
||||
import org.dromara.facility.domain.vo.FacMatrixVo;
|
||||
import org.dromara.facility.domain.req.matrix.*;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
import org.dromara.facility.domain.vo.matrix.MatrixDetailGisVo;
|
||||
import org.dromara.facility.service.IFacMatrixService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -72,6 +70,15 @@ public class FacMatrixController extends BaseController {
|
||||
return R.ok(facMatrixService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取大屏方阵详情
|
||||
*/
|
||||
@SaCheckPermission("facility:matrix:query")
|
||||
@GetMapping("/gis")
|
||||
public R<MatrixDetailGisVo> getMatrixDetailGis(MatrixDetailGisReq req) {
|
||||
return R.ok(facMatrixService.getMatrixDetailGis(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过GeoJson新增设施-方阵
|
||||
*/
|
||||
|
@ -0,0 +1,24 @@
|
||||
package org.dromara.facility.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 16:34
|
||||
*/
|
||||
@Getter
|
||||
public enum FinishStatusEnum {
|
||||
|
||||
UNFINISH("未完成", "0"),
|
||||
FINISH("已完成", "1");
|
||||
|
||||
private final String text;
|
||||
|
||||
private final String value;
|
||||
|
||||
FinishStatusEnum(String text, String value) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.dromara.facility.domain.req.matrix;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 16:27
|
||||
*/
|
||||
@Data
|
||||
public class MatrixDetailGisReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6514291289474982208L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 方阵id
|
||||
*/
|
||||
private Long matrixId;
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package org.dromara.facility.domain.vo;
|
||||
package org.dromara.facility.domain.vo.matrix;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
@ -0,0 +1,78 @@
|
||||
package org.dromara.facility.domain.vo.matrix;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 16:19
|
||||
*/
|
||||
@Data
|
||||
public class MatrixDetailGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 138750225601876373L;
|
||||
|
||||
/**
|
||||
* 总箱变数量
|
||||
*/
|
||||
private Long boxTransformerCount;
|
||||
|
||||
/**
|
||||
* 已完成箱变数量
|
||||
*/
|
||||
private Long boxTransformerFinishCount;
|
||||
|
||||
/**
|
||||
* 总逆变器数量
|
||||
*/
|
||||
private Long inverterCount;
|
||||
|
||||
/**
|
||||
* 已完成逆变器数量
|
||||
*/
|
||||
private Long inverterFinishCount;
|
||||
|
||||
/**
|
||||
* 总光伏板数量
|
||||
*/
|
||||
private Long photovoltaicPanelCount;
|
||||
|
||||
/**
|
||||
* 已完成光伏板数量
|
||||
*/
|
||||
private Long photovoltaicPanelFinishCount;
|
||||
|
||||
/**
|
||||
* 光伏板总点位数量
|
||||
*/
|
||||
private Long pointCount;
|
||||
|
||||
/**
|
||||
* 已完成光伏板点位数量
|
||||
*/
|
||||
private Long pointFinishCount;
|
||||
|
||||
/**
|
||||
* 光伏板总立柱数量
|
||||
*/
|
||||
private Long columnCount;
|
||||
|
||||
/**
|
||||
* 已完成光伏板立柱数量
|
||||
*/
|
||||
private Long columnFinishCount;
|
||||
|
||||
/**
|
||||
* 光伏板总支架数量
|
||||
*/
|
||||
private Long supportCount;
|
||||
|
||||
/**
|
||||
* 已完成光伏板支架数量
|
||||
*/
|
||||
private Long supportFinishCount;
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package org.dromara.facility.mapper;
|
||||
|
||||
import org.dromara.facility.domain.FacMatrix;
|
||||
import org.dromara.facility.domain.vo.FacMatrixVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
|
@ -6,11 +6,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.facility.domain.FacMatrix;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixCreateByGeoJsonReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixCreateReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixQueryReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixUpdateReq;
|
||||
import org.dromara.facility.domain.vo.FacMatrixVo;
|
||||
import org.dromara.facility.domain.req.matrix.*;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
import org.dromara.facility.domain.vo.matrix.MatrixDetailGisVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -48,6 +46,14 @@ public interface IFacMatrixService extends IService<FacMatrix> {
|
||||
*/
|
||||
List<FacMatrixVo> queryList(MatrixQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取大屏方阵详情信息
|
||||
*
|
||||
* @param req 获取大屏方阵详情信息参数
|
||||
* @return 大屏方阵详情信息
|
||||
*/
|
||||
MatrixDetailGisVo getMatrixDetailGis(MatrixDetailGisReq req);
|
||||
|
||||
/**
|
||||
* 新增设施-方阵
|
||||
*
|
||||
|
@ -13,18 +13,14 @@ import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.facility.domain.FacBoxTransformer;
|
||||
import org.dromara.facility.domain.FacInverter;
|
||||
import org.dromara.facility.domain.FacMatrix;
|
||||
import org.dromara.facility.domain.FacPhotovoltaicPanel;
|
||||
import org.dromara.facility.domain.*;
|
||||
import org.dromara.facility.domain.enums.FinishStatusEnum;
|
||||
import org.dromara.facility.domain.req.geojson.Feature;
|
||||
import org.dromara.facility.domain.req.geojson.FeatureByPoint;
|
||||
import org.dromara.facility.domain.req.geojson.Geometry;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixCreateByGeoJsonReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixCreateReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixQueryReq;
|
||||
import org.dromara.facility.domain.req.matrix.MatrixUpdateReq;
|
||||
import org.dromara.facility.domain.vo.FacMatrixVo;
|
||||
import org.dromara.facility.domain.req.matrix.*;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
import org.dromara.facility.domain.vo.matrix.MatrixDetailGisVo;
|
||||
import org.dromara.facility.mapper.FacMatrixMapper;
|
||||
import org.dromara.facility.service.*;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
@ -58,6 +54,18 @@ public class FacMatrixServiceImpl extends ServiceImpl<FacMatrixMapper, FacMatrix
|
||||
@Resource
|
||||
private IFacPhotovoltaicPanelPartsService photovoltaicPanelPartsService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IFacPhotovoltaicPanelPointService photovoltaicPanelPointService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IFacPhotovoltaicPanelColumnService photovoltaicPanelColumnService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IFacPhotovoltaicPanelSupportService photovoltaicPanelSupportService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IFacBoxTransformerService boxTransformerService;
|
||||
@ -106,6 +114,95 @@ public class FacMatrixServiceImpl extends ServiceImpl<FacMatrixMapper, FacMatrix
|
||||
return matrixList.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取大屏方阵详情信息
|
||||
*
|
||||
* @param req 获取大屏方阵详情信息参数
|
||||
* @return 大屏方阵详情信息
|
||||
*/
|
||||
@Override
|
||||
public MatrixDetailGisVo getMatrixDetailGis(MatrixDetailGisReq req) {
|
||||
Long projectId = req.getProjectId();
|
||||
if (projectId == null || projectService.getById(projectId) == null) {
|
||||
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
Long matrixId = req.getMatrixId();
|
||||
MatrixDetailGisVo matrixDetailGisVo = new MatrixDetailGisVo();
|
||||
// 获取箱变数量
|
||||
List<FacBoxTransformer> boxTransformerList = boxTransformerService.lambdaQuery()
|
||||
.select(FacBoxTransformer::getId, FacBoxTransformer::getStatus)
|
||||
.eq(FacBoxTransformer::getProjectId, projectId)
|
||||
.eq(ObjectUtils.isNotEmpty(matrixId), FacBoxTransformer::getMatrixId, matrixId)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(boxTransformerList)) {
|
||||
matrixDetailGisVo.setBoxTransformerCount((long) boxTransformerList.size());
|
||||
matrixDetailGisVo.setBoxTransformerFinishCount(boxTransformerList.stream()
|
||||
.filter(boxTransformer ->
|
||||
FinishStatusEnum.FINISH.getValue().equals(boxTransformer.getStatus())).count());
|
||||
}
|
||||
// 获取逆变器数量
|
||||
List<FacInverter> inverterList = inverterService.lambdaQuery()
|
||||
.select(FacInverter::getId, FacInverter::getStatus)
|
||||
.eq(FacInverter::getProjectId, projectId)
|
||||
.eq(ObjectUtils.isNotEmpty(matrixId), FacInverter::getMatrixId, matrixId)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(inverterList)) {
|
||||
matrixDetailGisVo.setInverterCount((long) inverterList.size());
|
||||
matrixDetailGisVo.setInverterFinishCount(inverterList.stream()
|
||||
.filter(inverter ->
|
||||
FinishStatusEnum.FINISH.getValue().equals(inverter.getStatus())).count());
|
||||
}
|
||||
// 获取光伏板数量
|
||||
List<FacPhotovoltaicPanel> photovoltaicPanelList = photovoltaicPanelService.lambdaQuery()
|
||||
.select(FacPhotovoltaicPanel::getId, FacPhotovoltaicPanel::getStatus)
|
||||
.eq(FacPhotovoltaicPanel::getProjectId, projectId)
|
||||
.eq(ObjectUtils.isNotEmpty(matrixId), FacPhotovoltaicPanel::getMatrixId, matrixId)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(photovoltaicPanelList)) {
|
||||
matrixDetailGisVo.setPhotovoltaicPanelCount((long) photovoltaicPanelList.size());
|
||||
matrixDetailGisVo.setPhotovoltaicPanelFinishCount(photovoltaicPanelList.stream()
|
||||
.filter(photovoltaicPanel ->
|
||||
FinishStatusEnum.FINISH.getValue().equals(photovoltaicPanel.getStatus())).count());
|
||||
}
|
||||
// 获取光伏板点数量
|
||||
List<FacPhotovoltaicPanelPoint> photovoltaicPanelPointList = photovoltaicPanelPointService.lambdaQuery()
|
||||
.select(FacPhotovoltaicPanelPoint::getId, FacPhotovoltaicPanelPoint::getStatus)
|
||||
.eq(FacPhotovoltaicPanelPoint::getProjectId, projectId)
|
||||
.eq(ObjectUtils.isNotEmpty(matrixId), FacPhotovoltaicPanelPoint::getMatrixId, matrixId)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(photovoltaicPanelPointList)) {
|
||||
matrixDetailGisVo.setPointCount((long) photovoltaicPanelPointList.size());
|
||||
matrixDetailGisVo.setPointFinishCount(photovoltaicPanelPointList.stream()
|
||||
.filter(photovoltaicPanelPoint ->
|
||||
FinishStatusEnum.FINISH.getValue().equals(photovoltaicPanelPoint.getStatus())).count());
|
||||
}
|
||||
// 获取支架数量
|
||||
List<FacPhotovoltaicPanelSupport> photovoltaicPanelSupportList = photovoltaicPanelSupportService.lambdaQuery()
|
||||
.select(FacPhotovoltaicPanelSupport::getId, FacPhotovoltaicPanelSupport::getStatus)
|
||||
.eq(FacPhotovoltaicPanelSupport::getProjectId, projectId)
|
||||
.eq(ObjectUtils.isNotEmpty(matrixId), FacPhotovoltaicPanelSupport::getMatrixId, matrixId)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(photovoltaicPanelSupportList)) {
|
||||
matrixDetailGisVo.setSupportCount((long) photovoltaicPanelSupportList.size());
|
||||
matrixDetailGisVo.setSupportFinishCount(photovoltaicPanelSupportList.stream()
|
||||
.filter(photovoltaicPanelSupport ->
|
||||
FinishStatusEnum.FINISH.getValue().equals(photovoltaicPanelSupport.getStatus())).count());
|
||||
}
|
||||
// 获取立柱数量
|
||||
List<FacPhotovoltaicPanelColumn> photovoltaicPanelColumnList = photovoltaicPanelColumnService.lambdaQuery()
|
||||
.select(FacPhotovoltaicPanelColumn::getId, FacPhotovoltaicPanelColumn::getStatus)
|
||||
.eq(FacPhotovoltaicPanelColumn::getProjectId, projectId)
|
||||
.eq(ObjectUtils.isNotEmpty(matrixId), FacPhotovoltaicPanelColumn::getMatrixId, matrixId)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(photovoltaicPanelColumnList)) {
|
||||
matrixDetailGisVo.setColumnCount((long) photovoltaicPanelColumnList.size());
|
||||
matrixDetailGisVo.setColumnFinishCount(photovoltaicPanelColumnList.stream()
|
||||
.filter(photovoltaicPanelColumn ->
|
||||
FinishStatusEnum.FINISH.getValue().equals(photovoltaicPanelColumn.getStatus())).count());
|
||||
}
|
||||
return matrixDetailGisVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设施-方阵
|
||||
*
|
||||
|
@ -16,9 +16,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryCreateReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryGisReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryQueryReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryUpdateReq;
|
||||
import org.dromara.machinery.domain.vo.BusMachineryVo;
|
||||
import org.dromara.machinery.domain.vo.MachineryGisVo;
|
||||
import org.dromara.machinery.service.IBusMachineryService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -59,6 +61,15 @@ public class BusMachineryController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "机械", BusMachineryVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏机械列表
|
||||
*/
|
||||
@SaCheckPermission("machinery:machinery:list")
|
||||
@GetMapping("/list/gis")
|
||||
public R<List<MachineryGisVo>> queryGisList(MachineryGisReq req) {
|
||||
return R.ok(busMachineryService.queryGisList(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机械详细信息
|
||||
*
|
||||
|
@ -0,0 +1,25 @@
|
||||
package org.dromara.machinery.domain.req.machinery;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 10:26
|
||||
*/
|
||||
@Data
|
||||
public class MachineryGisReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5157791260034938544L;
|
||||
|
||||
/**
|
||||
* 项目主键
|
||||
*/
|
||||
@NotNull(message = "项目主键不能为空")
|
||||
private Long projectId;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.dromara.machinery.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 10:27
|
||||
*/
|
||||
@Data
|
||||
public class MachineryGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -724470814094084721L;
|
||||
|
||||
/**
|
||||
* 机械名称
|
||||
*/
|
||||
private String machineryName;
|
||||
|
||||
/**
|
||||
* 机械数量
|
||||
*/
|
||||
private Long machineryCount;
|
||||
|
||||
}
|
@ -7,9 +7,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.machinery.domain.BusMachinery;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryCreateReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryGisReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryQueryReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryUpdateReq;
|
||||
import org.dromara.machinery.domain.vo.BusMachineryVo;
|
||||
import org.dromara.machinery.domain.vo.MachineryGisVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -47,6 +49,14 @@ public interface IBusMachineryService extends IService<BusMachinery> {
|
||||
*/
|
||||
List<BusMachineryVo> queryList(MachineryQueryReq req);
|
||||
|
||||
/**
|
||||
* 查询机械大屏数据列表
|
||||
*
|
||||
* @param req 筛选条件
|
||||
* @return 大屏数据列表
|
||||
*/
|
||||
List<MachineryGisVo> queryGisList(MachineryGisReq req);
|
||||
|
||||
/**
|
||||
* 新增机械
|
||||
*
|
||||
|
@ -18,12 +18,15 @@ import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.machinery.domain.BusMachinery;
|
||||
import org.dromara.machinery.domain.BusMachineryDetail;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryCreateReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryGisReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryQueryReq;
|
||||
import org.dromara.machinery.domain.req.machinery.MachineryUpdateReq;
|
||||
import org.dromara.machinery.domain.vo.BusMachineryVo;
|
||||
import org.dromara.machinery.domain.vo.MachineryGisVo;
|
||||
import org.dromara.machinery.mapper.BusMachineryMapper;
|
||||
import org.dromara.machinery.service.IBusMachineryDetailService;
|
||||
import org.dromara.machinery.service.IBusMachineryService;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -92,6 +95,29 @@ public class BusMachineryServiceImpl extends ServiceImpl<BusMachineryMapper, Bus
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询机械大屏数据列表
|
||||
*
|
||||
* @param req 筛选条件
|
||||
* @return 大屏数据列表
|
||||
*/
|
||||
@Override
|
||||
public List<MachineryGisVo> queryGisList(MachineryGisReq req) {
|
||||
Long projectId = req.getProjectId();
|
||||
BusProject project = projectService.getById(projectId);
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
List<BusMachinery> list = this.lambdaQuery()
|
||||
.eq(BusMachinery::getProjectId, projectId).list();
|
||||
return list.stream().map(machinery -> {
|
||||
MachineryGisVo machineryGisVo = new MachineryGisVo();
|
||||
machineryGisVo.setMachineryName(machinery.getMachineryName());
|
||||
machineryGisVo.setMachineryCount(machinery.getNumber());
|
||||
return machineryGisVo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增机械
|
||||
*
|
||||
|
@ -16,9 +16,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsCreateReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsGisReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsQueryReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsUpdateReq;
|
||||
import org.dromara.materials.domain.vo.BusMaterialsVo;
|
||||
import org.dromara.materials.domain.vo.MaterialsGisVo;
|
||||
import org.dromara.materials.service.IBusMaterialsService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -59,6 +61,15 @@ public class BusMaterialsController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "材料名称", BusMaterialsVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏材料信息
|
||||
*/
|
||||
@SaCheckPermission("materials:materials:list")
|
||||
@GetMapping("/list/gis")
|
||||
public R<List<MaterialsGisVo>> queryGisList(MaterialsGisReq req) {
|
||||
return R.ok(busMaterialsService.queryGisList(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取材料详细信息
|
||||
*
|
||||
|
@ -1,13 +1,13 @@
|
||||
package org.dromara.machinery.domain.enums;
|
||||
package org.dromara.materials.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/11 13:53
|
||||
* @date 2025/4/28 11:00
|
||||
*/
|
||||
@Getter
|
||||
public enum MaterialsInventoryOutputEnum {
|
||||
public enum MaterialsInventoryOutPutEnum {
|
||||
|
||||
PUT("入库", "0"),
|
||||
OUT("出库", "1");
|
||||
@ -16,7 +16,7 @@ public enum MaterialsInventoryOutputEnum {
|
||||
|
||||
private final String value;
|
||||
|
||||
MaterialsInventoryOutputEnum(String text, String value) {
|
||||
MaterialsInventoryOutPutEnum(String text, String value) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package org.dromara.materials.domain.req.materials;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 10:38
|
||||
*/
|
||||
@Data
|
||||
public class MaterialsGisReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -7069030786285421399L;
|
||||
|
||||
/**
|
||||
* 项目主键
|
||||
*/
|
||||
@NotNull(message = "项目主键不能为空")
|
||||
private Long projectId;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package org.dromara.materials.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 10:39
|
||||
*/
|
||||
@Data
|
||||
public class MaterialsGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 871786102998065916L;
|
||||
|
||||
/**
|
||||
* 材料名称
|
||||
*/
|
||||
private String materialsName;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
private String weightId;
|
||||
|
||||
/**
|
||||
* 预计材料数量
|
||||
*/
|
||||
private String quantityCount;
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
private Long putCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
private Long outCount;
|
||||
|
||||
}
|
@ -7,9 +7,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.materials.domain.BusMaterials;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsCreateReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsGisReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsQueryReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsUpdateReq;
|
||||
import org.dromara.materials.domain.vo.BusMaterialsVo;
|
||||
import org.dromara.materials.domain.vo.MaterialsGisVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -47,6 +49,14 @@ public interface IBusMaterialsService extends IService<BusMaterials> {
|
||||
*/
|
||||
List<BusMaterialsVo> queryList(MaterialsQueryReq req);
|
||||
|
||||
/**
|
||||
* 查询材料大屏信息列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 材料大屏信息列表
|
||||
*/
|
||||
List<MaterialsGisVo> queryGisList(MaterialsGisReq req);
|
||||
|
||||
/**
|
||||
* 新增材料名称
|
||||
*
|
||||
|
@ -13,9 +13,9 @@ import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.machinery.domain.enums.MaterialsInventoryOutputEnum;
|
||||
import org.dromara.materials.domain.BusMaterials;
|
||||
import org.dromara.materials.domain.BusMaterialsInventory;
|
||||
import org.dromara.materials.domain.enums.MaterialsInventoryOutPutEnum;
|
||||
import org.dromara.materials.domain.req.materialsinventory.MaterialsInventoryCreateReq;
|
||||
import org.dromara.materials.domain.req.materialsinventory.MaterialsInventoryQueryReq;
|
||||
import org.dromara.materials.domain.req.materialsinventory.MaterialsInventoryUpdateReq;
|
||||
@ -108,7 +108,7 @@ public class BusMaterialsInventoryServiceImpl extends ServiceImpl<BusMaterialsIn
|
||||
.orderByDesc(BusMaterialsInventory::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if (lastMaterialsInventory != null) {
|
||||
if (MaterialsInventoryOutputEnum.OUT.getValue().equals(req.getOutPut())) {
|
||||
if (MaterialsInventoryOutPutEnum.OUT.getValue().equals(req.getOutPut())) {
|
||||
long left = lastMaterialsInventory.getResidue() - req.getNumber();
|
||||
if (left < 0) {
|
||||
throw new ServiceException("库存不足", HttpStatus.BAD_REQUEST);
|
||||
|
@ -18,14 +18,18 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.materials.domain.BusMaterials;
|
||||
import org.dromara.materials.domain.BusMaterialsInventory;
|
||||
import org.dromara.materials.domain.enums.MaterialsInventoryOutPutEnum;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsCreateReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsGisReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsQueryReq;
|
||||
import org.dromara.materials.domain.req.materials.MaterialsUpdateReq;
|
||||
import org.dromara.materials.domain.vo.BusMaterialsVo;
|
||||
import org.dromara.materials.domain.vo.MaterialsGisVo;
|
||||
import org.dromara.materials.mapper.BusMaterialsMapper;
|
||||
import org.dromara.materials.service.IBusCompanyService;
|
||||
import org.dromara.materials.service.IBusMaterialsInventoryService;
|
||||
import org.dromara.materials.service.IBusMaterialsService;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -35,6 +39,7 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 材料名称Service业务层处理
|
||||
@ -97,6 +102,50 @@ public class BusMaterialsServiceImpl extends ServiceImpl<BusMaterialsMapper, Bus
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询材料大屏信息列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 材料大屏信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialsGisVo> queryGisList(MaterialsGisReq req) {
|
||||
Long projectId = req.getProjectId();
|
||||
BusProject project = projectService.getById(projectId);
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
List<BusMaterials> materialsList = this.lambdaQuery()
|
||||
.eq(BusMaterials::getProjectId, projectId).list();
|
||||
if (CollUtil.isEmpty(materialsList)) {
|
||||
return List.of();
|
||||
}
|
||||
List<BusMaterialsInventory> materialsInventoryList = materialsInventoryService.lambdaQuery()
|
||||
.eq(BusMaterialsInventory::getProjectId, projectId).list();
|
||||
Map<Long, List<BusMaterialsInventory>> inventoryMap = materialsInventoryList.stream()
|
||||
.collect(Collectors.groupingBy(BusMaterialsInventory::getMaterialsId));
|
||||
return materialsList.stream().map(materials -> {
|
||||
MaterialsGisVo materialsGisVo = new MaterialsGisVo();
|
||||
BeanUtils.copyProperties(materials, materialsGisVo);
|
||||
Long id = materials.getId();
|
||||
long putCount = 0L;
|
||||
long outCount = 0L;
|
||||
if (CollUtil.isNotEmpty(inventoryMap) && inventoryMap.containsKey(id)) {
|
||||
List<BusMaterialsInventory> inventoryList = inventoryMap.get(id);
|
||||
for (BusMaterialsInventory record : inventoryList) {
|
||||
if (MaterialsInventoryOutPutEnum.PUT.getValue().equals(record.getOutPut())) {
|
||||
putCount += record.getNumber() != null ? record.getNumber() : 0;
|
||||
} else if (MaterialsInventoryOutPutEnum.OUT.getValue().equals(record.getOutPut())) {
|
||||
outCount += record.getNumber() != null ? record.getNumber() : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
materialsGisVo.setPutCount(putCount);
|
||||
materialsGisVo.setOutCount(outCount);
|
||||
return materialsGisVo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增材料名称
|
||||
*
|
||||
|
@ -19,6 +19,7 @@ import org.dromara.project.domain.exportvo.BusConstructionUserExportVo;
|
||||
import org.dromara.project.domain.req.constructionuser.*;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserAttendanceMonthResp;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserAttendanceTotalResp;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserGisResp;
|
||||
import org.dromara.project.domain.vo.BusConstructionUserVo;
|
||||
import org.dromara.project.service.IBusConstructionUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -91,6 +92,15 @@ public class BusConstructionUserController extends BaseController {
|
||||
return R.ok(busConstructionUserService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询施工人员大屏数据
|
||||
*/
|
||||
@SaCheckPermission("project:constructionUser:query")
|
||||
@GetMapping("/gis")
|
||||
public R<ConstructionUserGisResp> getGisData(ConstructionUserGisReq req) {
|
||||
return R.ok(busConstructionUserService.getGisData(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工人员
|
||||
*/
|
||||
|
@ -0,0 +1,118 @@
|
||||
package org.dromara.project.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsCreateReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsGisReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsQueryReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsUpdateReq;
|
||||
import org.dromara.project.domain.resp.projectnews.ProjectNewsGisResp;
|
||||
import org.dromara.project.domain.vo.BusProjectNewsVo;
|
||||
import org.dromara.project.service.IBusProjectNewsService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目新闻
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/project/projectNews")
|
||||
public class BusProjectNewsController extends BaseController {
|
||||
|
||||
private final IBusProjectNewsService busProjectNewsService;
|
||||
|
||||
/**
|
||||
* 查询项目新闻列表
|
||||
*/
|
||||
@SaCheckPermission("project:projectNews:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusProjectNewsVo> list(ProjectNewsQueryReq req, PageQuery pageQuery) {
|
||||
return busProjectNewsService.queryPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目新闻列表
|
||||
*/
|
||||
@SaCheckPermission("project:projectNews:export")
|
||||
@Log(title = "项目新闻", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ProjectNewsQueryReq req, HttpServletResponse response) {
|
||||
List<BusProjectNewsVo> list = busProjectNewsService.queryList(req);
|
||||
ExcelUtil.exportExcel(list, "项目新闻", BusProjectNewsVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏项目新闻列表
|
||||
*/
|
||||
@GetMapping("/list/gis")
|
||||
public R<List<ProjectNewsGisResp>> listGis(ProjectNewsGisReq req) {
|
||||
return R.ok(busProjectNewsService.queryGisList(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目新闻详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("project:projectNews:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusProjectNewsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busProjectNewsService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目新闻
|
||||
*/
|
||||
@SaCheckPermission("project:projectNews:add")
|
||||
@Log(title = "项目新闻", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody ProjectNewsCreateReq req) {
|
||||
return R.ok(busProjectNewsService.insertByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目新闻
|
||||
*/
|
||||
@SaCheckPermission("project:projectNews:edit")
|
||||
@Log(title = "项目新闻", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProjectNewsUpdateReq req) {
|
||||
return toAjax(busProjectNewsService.updateByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目新闻
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("project:projectNews:remove")
|
||||
@Log(title = "项目新闻", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busProjectNewsService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package org.dromara.project.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 项目新闻对象 bus_project_news
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_project_news")
|
||||
public class BusProjectNews extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String file;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deletedAt;
|
||||
|
||||
/**
|
||||
* 是否删除(0正常 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long isDelete;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package org.dromara.project.domain.req.constructionuser;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 9:40
|
||||
*/
|
||||
@Data
|
||||
public class ConstructionUserGisReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2487357135566518535L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目主键不能为空")
|
||||
private Long projectId;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package org.dromara.project.domain.req.projectnews;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 11:52
|
||||
*/
|
||||
@Data
|
||||
public class ProjectNewsCreateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 7116830397516873096L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String file;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package org.dromara.project.domain.req.projectnews;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 14:07
|
||||
*/
|
||||
@Data
|
||||
public class ProjectNewsGisReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -291705026028532102L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package org.dromara.project.domain.req.projectnews;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 11:52
|
||||
*/
|
||||
@Data
|
||||
public class ProjectNewsQueryReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1453496535743326174L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package org.dromara.project.domain.req.projectnews;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 11:53
|
||||
*/
|
||||
@Data
|
||||
public class ProjectNewsUpdateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5988430319051945969L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String file;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package org.dromara.project.domain.resp.constructionuser;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 9:33
|
||||
*/
|
||||
@Data
|
||||
public class ConstructionUserGisResp implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -3496633845665259321L;
|
||||
|
||||
/**
|
||||
* 施工人员数量
|
||||
*/
|
||||
private Long peopleCount;
|
||||
|
||||
/**
|
||||
* 出勤人员数量
|
||||
*/
|
||||
private Long attendanceCount;
|
||||
|
||||
/**
|
||||
* 出勤率
|
||||
*/
|
||||
private String attendanceRate;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.dromara.project.domain.resp.projectnews;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 14:11
|
||||
*/
|
||||
@Data
|
||||
public class ProjectNewsGisResp implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -751096185387401970L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package org.dromara.project.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.project.domain.BusProjectNews;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 项目新闻视图对象 bus_project_news
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusProjectNews.class)
|
||||
public class BusProjectNewsVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@ExcelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@ExcelProperty(value = "附件")
|
||||
private String file;
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.project.mapper;
|
||||
|
||||
import org.dromara.project.domain.BusProjectNews;
|
||||
import org.dromara.project.domain.vo.BusProjectNewsVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 项目新闻Mapper接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
public interface BusProjectNewsMapper extends BaseMapperPlus<BusProjectNews, BusProjectNewsVo> {
|
||||
|
||||
}
|
@ -64,6 +64,14 @@ public interface IBusAttendanceService extends IService<BusAttendance> {
|
||||
*/
|
||||
List<BusAttendanceVo> queryList(AttendanceQueryReq req);
|
||||
|
||||
/**
|
||||
* 根据项目id查询出勤人列表
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 出勤人列表
|
||||
*/
|
||||
List<Long> listAttendancePeopleByProjectId(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取考勤视图对象
|
||||
*
|
||||
|
@ -10,6 +10,7 @@ import org.dromara.project.domain.exportvo.BusConstructionUserExportVo;
|
||||
import org.dromara.project.domain.req.constructionuser.*;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserAttendanceMonthResp;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserAttendanceTotalResp;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserGisResp;
|
||||
import org.dromara.project.domain.vo.BusConstructionUserVo;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -65,6 +66,14 @@ public interface IBusConstructionUserService extends IService<BusConstructionUse
|
||||
*/
|
||||
List<BusConstructionUserExportVo> queryList(ConstructionUserQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取施工人员大屏数据
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 施工人员大屏数据
|
||||
*/
|
||||
ConstructionUserGisResp getGisData(ConstructionUserGisReq req);
|
||||
|
||||
/**
|
||||
* 新增施工人员
|
||||
*
|
||||
|
@ -0,0 +1,109 @@
|
||||
package org.dromara.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.project.domain.BusProjectNews;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsCreateReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsGisReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsQueryReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsUpdateReq;
|
||||
import org.dromara.project.domain.resp.projectnews.ProjectNewsGisResp;
|
||||
import org.dromara.project.domain.vo.BusProjectNewsVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目新闻Service接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
public interface IBusProjectNewsService extends IService<BusProjectNews> {
|
||||
|
||||
/**
|
||||
* 查询项目新闻
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 项目新闻
|
||||
*/
|
||||
BusProjectNewsVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询项目新闻列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 项目新闻分页列表
|
||||
*/
|
||||
TableDataInfo<BusProjectNewsVo> queryPageList(ProjectNewsQueryReq req, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的项目新闻列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 项目新闻列表
|
||||
*/
|
||||
List<BusProjectNewsVo> queryList(ProjectNewsQueryReq req);
|
||||
|
||||
/**
|
||||
* 查询大屏项目新闻列表
|
||||
*
|
||||
* @param req 列表查询条件
|
||||
* @return 大屏项目新闻列表
|
||||
*/
|
||||
List<ProjectNewsGisResp> queryGisList(ProjectNewsGisReq req);
|
||||
|
||||
/**
|
||||
* 新增项目新闻
|
||||
*
|
||||
* @param req 项目新闻
|
||||
* @return 新增项目新闻id
|
||||
*/
|
||||
Long insertByBo(ProjectNewsCreateReq req);
|
||||
|
||||
/**
|
||||
* 修改项目新闻
|
||||
*
|
||||
* @param req 项目新闻
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ProjectNewsUpdateReq req);
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目新闻信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 获取项目新闻存储视图对象
|
||||
*
|
||||
* @param projectNews 项目新闻存储对象
|
||||
* @return 项目新闻存储视图对象
|
||||
*/
|
||||
BusProjectNewsVo getVo(BusProjectNews projectNews);
|
||||
|
||||
/**
|
||||
* 获取项目新闻存储查询条件封装
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusProjectNews> buildQueryWrapper(ProjectNewsQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取项目新闻存储分页对象视图
|
||||
*
|
||||
* @param projectNewsPage 项目新闻存储分页对象
|
||||
* @return 项目新闻存储分页对象视图
|
||||
*/
|
||||
Page<BusProjectNewsVo> getVoPage(Page<BusProjectNews> projectNewsPage);
|
||||
|
||||
}
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.constant.DateConstant;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.enums.FormatsType;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
@ -60,6 +61,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
@Resource
|
||||
private IBusConstructionBlacklistService constructionBlacklistService;
|
||||
|
||||
// 出勤状态(正常、迟到、早退)
|
||||
private static final Set<String> ATTENDANCE_STATUS = new HashSet<>(Arrays.asList(AttendanceClockStatusEnum.NORMAL.getValue(),
|
||||
AttendanceClockStatusEnum.LATE.getValue(), AttendanceClockStatusEnum.LEAVEEARLY.getValue()));
|
||||
|
||||
/**
|
||||
* 查询考勤
|
||||
*
|
||||
@ -289,6 +294,41 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
return this.list(lqw).stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目id查询出勤人列表
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 出勤人列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> listAttendancePeopleByProjectId(Long projectId) {
|
||||
// 今天所有用户的打卡记录
|
||||
List<BusAttendance> attendanceList = this.lambdaQuery()
|
||||
.eq(BusAttendance::getProjectId, projectId)
|
||||
.eq(BusAttendance::getClockDate, DateUtils.dateTimeNow(FormatsType.YYYY_MM_DD))
|
||||
.list();
|
||||
if (CollUtil.isEmpty(attendanceList)) {
|
||||
return List.of();
|
||||
}
|
||||
Map<Long, List<BusAttendance>> attendanceMap = attendanceList.stream()
|
||||
.collect(Collectors.groupingBy(BusAttendance::getUserId));
|
||||
List<Long> attendedUserIds = new ArrayList<>();
|
||||
for (Map.Entry<Long, List<BusAttendance>> entry : attendanceMap.entrySet()) {
|
||||
Long userId = entry.getKey();
|
||||
List<BusAttendance> records = entry.getValue();
|
||||
// 要求必须有2条打卡记录
|
||||
if (records.size() != 2) {
|
||||
continue;
|
||||
}
|
||||
boolean allValid = records.stream()
|
||||
.allMatch(record -> ATTENDANCE_STATUS.contains(record.getClockStatus()));
|
||||
if (allValid) {
|
||||
attendedUserIds.add(userId);
|
||||
}
|
||||
}
|
||||
return attendedUserIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考勤视图对象
|
||||
*
|
||||
|
@ -29,6 +29,7 @@ import org.dromara.project.domain.req.constructionuser.*;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserAttendanceByDay;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserAttendanceMonthResp;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserAttendanceTotalResp;
|
||||
import org.dromara.project.domain.resp.constructionuser.ConstructionUserGisResp;
|
||||
import org.dromara.project.domain.vo.BusConstructionUserVo;
|
||||
import org.dromara.project.domain.vo.BusContractorVo;
|
||||
import org.dromara.project.mapper.BusConstructionUserMapper;
|
||||
@ -255,6 +256,34 @@ public class BusConstructionUserServiceImpl extends ServiceImpl<BusConstructionU
|
||||
return constructionUserExportVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取施工人员大屏数据
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 施工人员大屏数据
|
||||
*/
|
||||
@Override
|
||||
public ConstructionUserGisResp getGisData(ConstructionUserGisReq req) {
|
||||
// 参数校验
|
||||
Long projectId = req.getProjectId();
|
||||
BusProject project = projectService.getById(projectId);
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 获取大屏数据
|
||||
ConstructionUserGisResp resp = new ConstructionUserGisResp();
|
||||
// 获取施工人员总数
|
||||
Long count = this.lambdaQuery()
|
||||
.eq(BusConstructionUser::getProjectId, projectId).count();
|
||||
resp.setPeopleCount(count);
|
||||
// 获取考勤数据
|
||||
List<Long> attendancePeopleList = attendanceService.listAttendancePeopleByProjectId(projectId);
|
||||
resp.setAttendanceCount((long) attendancePeopleList.size());
|
||||
// 计算考勤率
|
||||
resp.setAttendanceRate(count == 0 ? "0" : String.format("%.2f", attendancePeopleList.size() * 100.0 / count));
|
||||
return resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工人员
|
||||
*
|
||||
|
@ -0,0 +1,242 @@
|
||||
package org.dromara.project.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.project.domain.BusProjectNews;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsCreateReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsGisReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsQueryReq;
|
||||
import org.dromara.project.domain.req.projectnews.ProjectNewsUpdateReq;
|
||||
import org.dromara.project.domain.resp.projectnews.ProjectNewsGisResp;
|
||||
import org.dromara.project.domain.vo.BusProjectNewsVo;
|
||||
import org.dromara.project.mapper.BusProjectNewsMapper;
|
||||
import org.dromara.project.service.IBusProjectNewsService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目新闻Service业务层处理
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@Service
|
||||
public class BusProjectNewsServiceImpl extends ServiceImpl<BusProjectNewsMapper, BusProjectNews>
|
||||
implements IBusProjectNewsService {
|
||||
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
|
||||
/**
|
||||
* 查询项目新闻
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 项目新闻
|
||||
*/
|
||||
@Override
|
||||
public BusProjectNewsVo queryById(Long id) {
|
||||
BusProjectNews projectNews = this.getById(id);
|
||||
if (projectNews == null) {
|
||||
throw new ServiceException("对应项目新闻存储信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
return this.getVo(projectNews);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询项目新闻列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 项目新闻分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusProjectNewsVo> queryPageList(ProjectNewsQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusProjectNews> projectNewsPage = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(projectNewsPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的项目新闻列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 项目新闻列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusProjectNewsVo> queryList(ProjectNewsQueryReq req) {
|
||||
LambdaQueryWrapper<BusProjectNews> lqw = this.buildQueryWrapper(req);
|
||||
return this.list(lqw).stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏项目新闻列表
|
||||
*
|
||||
* @param req 列表查询条件
|
||||
* @return 大屏项目新闻列表
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectNewsGisResp> queryGisList(ProjectNewsGisReq req) {
|
||||
Long projectId = req.getProjectId();
|
||||
if (projectId == null || projectService.getById(projectId) == null) {
|
||||
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
List<BusProjectNews> projectNewsList = this.lambdaQuery()
|
||||
.select(BusProjectNews::getId, BusProjectNews::getTitle)
|
||||
.eq(BusProjectNews::getProjectId, projectId)
|
||||
.list();
|
||||
return projectNewsList.stream().map(projectNews -> {
|
||||
ProjectNewsGisResp projectNewsGisResp = new ProjectNewsGisResp();
|
||||
BeanUtils.copyProperties(projectNews, projectNewsGisResp);
|
||||
return projectNewsGisResp;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目新闻
|
||||
*
|
||||
* @param req 项目新闻
|
||||
* @return 新增项目新闻id
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBo(ProjectNewsCreateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusProjectNews projectNews = new BusProjectNews();
|
||||
BeanUtils.copyProperties(req, projectNews);
|
||||
// 数据校验
|
||||
validEntityBeforeSave(projectNews, true);
|
||||
// 操作数据库
|
||||
boolean save = this.save(projectNews);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增项目新闻存储失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
return projectNews.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目新闻
|
||||
*
|
||||
* @param req 项目新闻
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ProjectNewsUpdateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusProjectNews projectNews = new BusProjectNews();
|
||||
BeanUtils.copyProperties(req, projectNews);
|
||||
// 数据校验
|
||||
validEntityBeforeSave(projectNews, false);
|
||||
// 判断是否存在
|
||||
BusProjectNews oldProjectNews = this.getById(projectNews.getId());
|
||||
if (oldProjectNews == null) {
|
||||
throw new ServiceException("修改项目新闻存储失败,数据不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 操作数据库
|
||||
boolean update = this.updateById(projectNews);
|
||||
if (!update) {
|
||||
throw new ServiceException("修改项目新闻存储失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusProjectNews entity, Boolean create) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
Long projectId = entity.getProjectId();
|
||||
if (create) {
|
||||
if (projectId == null) {
|
||||
throw new ServiceException("项目id不能为空", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
if (projectId != null && projectService.getById(projectId) == null) {
|
||||
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目新闻信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<BusProjectNews> projectNewsList = this.listByIds(ids);
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
List<Long> projectId = projectNewsList.stream().map(BusProjectNews::getProjectId).toList();
|
||||
projectService.validAuth(projectId, userId);
|
||||
}
|
||||
return this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目新闻存储视图对象
|
||||
*
|
||||
* @param projectNews 项目新闻存储对象
|
||||
* @return 项目新闻存储视图对象
|
||||
*/
|
||||
@Override
|
||||
public BusProjectNewsVo getVo(BusProjectNews projectNews) {
|
||||
// 对象转封装类
|
||||
BusProjectNewsVo projectNewsVo = new BusProjectNewsVo();
|
||||
if (projectNews == null) {
|
||||
return projectNewsVo;
|
||||
}
|
||||
BeanUtils.copyProperties(projectNews, projectNewsVo);
|
||||
return projectNewsVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目新闻存储查询条件封装
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusProjectNews> buildQueryWrapper(ProjectNewsQueryReq req) {
|
||||
LambdaQueryWrapper<BusProjectNews> lqw = new LambdaQueryWrapper<>();
|
||||
Long projectId = req.getProjectId();
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), BusProjectNews::getProjectId, projectId);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目新闻存储分页对象视图
|
||||
*
|
||||
* @param projectNewsPage 项目新闻存储分页对象
|
||||
* @return 项目新闻存储分页对象视图
|
||||
*/
|
||||
@Override
|
||||
public Page<BusProjectNewsVo> getVoPage(Page<BusProjectNews> projectNewsPage) {
|
||||
List<BusProjectNews> projectNewsList = projectNewsPage.getRecords();
|
||||
Page<BusProjectNewsVo> projectNewsVoPage = new Page<>(
|
||||
projectNewsPage.getCurrent(),
|
||||
projectNewsPage.getSize(),
|
||||
projectNewsPage.getTotal());
|
||||
if (CollUtil.isEmpty(projectNewsList)) {
|
||||
return projectNewsVoPage;
|
||||
}
|
||||
List<BusProjectNewsVo> projectNewsVoList = projectNewsList.stream().map(this::getVo).toList();
|
||||
projectNewsVoPage.setRecords(projectNewsVoList);
|
||||
return projectNewsVoPage;
|
||||
}
|
||||
|
||||
}
|
@ -16,9 +16,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionCreateReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionGisReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionQueryReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionUpdateReq;
|
||||
import org.dromara.quality.domain.vo.BusQualityInspectionVo;
|
||||
import org.dromara.quality.domain.vo.QualityInspectionListGisVo;
|
||||
import org.dromara.quality.service.IBusQualityInspectionService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -59,6 +61,14 @@ public class BusQualityInspectionController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "质量-检查工单", BusQualityInspectionVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏质量信息
|
||||
*/
|
||||
@GetMapping("/gis")
|
||||
public R<QualityInspectionListGisVo> queryGisList(QualityInspectionGisReq req) {
|
||||
return R.ok(busQualityInspectionService.queryGisList(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键导出质量-检查工单
|
||||
*/
|
||||
|
@ -11,8 +11,7 @@ public enum QualityInspectionStatusEnum {
|
||||
|
||||
INFORM("通知", "1"),
|
||||
RECTIFICATION("整改", "2"),
|
||||
VERIFICATION("验证", "3"),
|
||||
PASS("通过", "4");
|
||||
VERIFICATION("验证", "3");
|
||||
|
||||
private final String text;
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
package org.dromara.quality.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 14:59
|
||||
*/
|
||||
@Getter
|
||||
public enum QualityInspectionVerificationTypeEnum {
|
||||
|
||||
PASS("通过", "1"),
|
||||
UNPASS("未通过", "2");
|
||||
|
||||
private final String text;
|
||||
|
||||
private final String value;
|
||||
|
||||
QualityInspectionVerificationTypeEnum(String text, String value) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package org.dromara.quality.domain.req.qualityinspection;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 14:40
|
||||
*/
|
||||
@Data
|
||||
public class QualityInspectionGisReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1643422493177660330L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private Integer pageSize = 20;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package org.dromara.quality.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 14:36
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QualityInspectionGis {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 巡检类型
|
||||
*/
|
||||
private String inspectionType;
|
||||
|
||||
/**
|
||||
* 巡检标题
|
||||
*/
|
||||
private String inspectionHeadline;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package org.dromara.quality.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 14:22
|
||||
*/
|
||||
@Data
|
||||
public class QualityInspectionListGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1100954070125585535L;
|
||||
|
||||
/**
|
||||
* 巡检列表
|
||||
*/
|
||||
private List<QualityInspectionGis> list;
|
||||
|
||||
/**
|
||||
* 巡检总数
|
||||
*/
|
||||
private Long count;
|
||||
|
||||
/**
|
||||
* 巡检情况
|
||||
*/
|
||||
private String correctSituation;
|
||||
|
||||
}
|
@ -8,9 +8,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.quality.domain.BusQualityInspection;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionCreateReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionGisReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionQueryReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionUpdateReq;
|
||||
import org.dromara.quality.domain.vo.BusQualityInspectionVo;
|
||||
import org.dromara.quality.domain.vo.QualityInspectionListGisVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -48,6 +50,14 @@ public interface IBusQualityInspectionService extends IService<BusQualityInspect
|
||||
*/
|
||||
List<BusQualityInspectionVo> queryList(QualityInspectionQueryReq req);
|
||||
|
||||
/**
|
||||
* 查询大屏质量-检查工单列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 质量-检查工单列表
|
||||
*/
|
||||
QualityInspectionListGisVo queryGisList(QualityInspectionGisReq req);
|
||||
|
||||
/**
|
||||
* 新增质量-检查工单
|
||||
*
|
||||
|
@ -20,6 +20,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.oss.core.OssClient;
|
||||
import org.dromara.common.oss.exception.OssException;
|
||||
import org.dromara.common.oss.factory.OssFactory;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.project.domain.BusConstructionUser;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.service.IBusConstructionUserService;
|
||||
@ -27,10 +28,14 @@ import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.quality.constant.QualityConstant;
|
||||
import org.dromara.quality.domain.BusQualityInspection;
|
||||
import org.dromara.quality.domain.enums.QualityInspectionStatusEnum;
|
||||
import org.dromara.quality.domain.enums.QualityInspectionVerificationTypeEnum;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionCreateReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionGisReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionQueryReq;
|
||||
import org.dromara.quality.domain.req.qualityinspection.QualityInspectionUpdateReq;
|
||||
import org.dromara.quality.domain.vo.BusQualityInspectionVo;
|
||||
import org.dromara.quality.domain.vo.QualityInspectionGis;
|
||||
import org.dromara.quality.domain.vo.QualityInspectionListGisVo;
|
||||
import org.dromara.quality.mapper.BusQualityInspectionMapper;
|
||||
import org.dromara.quality.service.IBusQualityInspectionService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
@ -120,6 +125,49 @@ public class BusQualityInspectionServiceImpl extends ServiceImpl<BusQualityInspe
|
||||
return this.list(lqw).stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏质量-检查工单列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 质量-检查工单列表
|
||||
*/
|
||||
@Override
|
||||
public QualityInspectionListGisVo queryGisList(QualityInspectionGisReq req) {
|
||||
Long projectId = req.getProjectId();
|
||||
if (projectId == null || projectService.getById(projectId) == null) {
|
||||
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
QualityInspectionListGisVo gisVo = new QualityInspectionListGisVo();
|
||||
List<BusQualityInspection> qualityInspectionList = this.lambdaQuery()
|
||||
.eq(BusQualityInspection::getProjectId, projectId)
|
||||
.list();
|
||||
if (CollUtil.isEmpty(qualityInspectionList)) {
|
||||
return gisVo;
|
||||
}
|
||||
// 获取最新的检查工单
|
||||
List<BusQualityInspection> topList = qualityInspectionList.stream()
|
||||
.sorted(Comparator.comparing(BusQualityInspection::getCreateTime).reversed())
|
||||
.limit(req.getPageSize())
|
||||
.toList();
|
||||
List<QualityInspectionGis> gisList = topList.stream().map(qualityInspection -> {
|
||||
QualityInspectionGis gis = new QualityInspectionGis();
|
||||
BeanUtils.copyProperties(qualityInspection, gis);
|
||||
return gis;
|
||||
}).toList();
|
||||
// 获取整改情况
|
||||
long passCount = 0L;
|
||||
for (BusQualityInspection qualityInspection : qualityInspectionList) {
|
||||
if (QualityInspectionStatusEnum.VERIFICATION.getValue().equals(qualityInspection.getInspectionStatus())
|
||||
&& QualityInspectionVerificationTypeEnum.PASS.getValue().equals(qualityInspection.getVerificationType())) {
|
||||
passCount++;
|
||||
}
|
||||
}
|
||||
gisVo.setList(gisList);
|
||||
gisVo.setCount((long) qualityInspectionList.size());
|
||||
gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / qualityInspectionList.size()));
|
||||
return gisVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质量-检查工单
|
||||
*
|
||||
@ -192,8 +240,12 @@ public class BusQualityInspectionServiceImpl extends ServiceImpl<BusQualityInspe
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<BusQualityInspection> qualityInspectionList = this.listByIds(ids);
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
List<Long> projectId = qualityInspectionList.stream().map(BusQualityInspection::getProjectId).toList();
|
||||
projectService.validAuth(projectId, userId);
|
||||
}
|
||||
return this.removeBatchByIds(ids);
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
package org.dromara.safety.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
@ -14,8 +14,8 @@ import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingCreateFileReq;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingCreateFolderReq;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingQueryReq;
|
||||
import org.dromara.safety.domain.resp.documentsafetymeeting.DocumentSafetyMeetingRecycleBinResp;
|
||||
import org.dromara.safety.domain.vo.BusDocumentSafetyMeetingVo;
|
||||
import org.dromara.safety.domain.vo.documentsafetymeeting.BusDocumentSafetyMeetingVo;
|
||||
import org.dromara.safety.domain.vo.documentsafetymeeting.DocumentSafetyMeetingRecycleBinVo;
|
||||
import org.dromara.safety.service.IBusDocumentSafetyMeetingService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -30,12 +30,12 @@ import java.util.List;
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/safety/documentSafetyMeeting")
|
||||
public class BusDocumentSafetyMeetingController extends BaseController {
|
||||
|
||||
private final IBusDocumentSafetyMeetingService busDocumentSafetyMeetingService;
|
||||
@Resource
|
||||
private IBusDocumentSafetyMeetingService busDocumentSafetyMeetingService;
|
||||
|
||||
/**
|
||||
* 查询安全会议纪要列表
|
||||
@ -51,7 +51,7 @@ public class BusDocumentSafetyMeetingController extends BaseController {
|
||||
*/
|
||||
@SaCheckPermission("safety:documentSafetyMeeting:list")
|
||||
@GetMapping("/recycleBin/list")
|
||||
public TableDataInfo<DocumentSafetyMeetingRecycleBinResp> list(DocumentSafetyMeetingQueryReq req, PageQuery pageQuery) {
|
||||
public TableDataInfo<DocumentSafetyMeetingRecycleBinVo> list(DocumentSafetyMeetingQueryReq req, PageQuery pageQuery) {
|
||||
return busDocumentSafetyMeetingService.queryRecycleBinPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionCreateReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionGisReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionQueryReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.BusSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.SafetyInspectionListGisVo;
|
||||
import org.dromara.safety.service.IBusSafetyInspectionService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -70,6 +72,14 @@ public class BusSafetyInspectionController extends BaseController {
|
||||
busSafetyInspectionService.exportWordById(id, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏安全信息
|
||||
*/
|
||||
@GetMapping("/gis")
|
||||
public R<SafetyInspectionListGisVo> queryGisList(SafetyInspectionGisReq req) {
|
||||
return R.ok(busSafetyInspectionService.queryGisList(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安全巡检工单详细信息
|
||||
*
|
||||
|
@ -18,7 +18,7 @@ import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingCreateReq;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingQueryReq;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusTeamMeetingVo;
|
||||
import org.dromara.safety.domain.vo.teammeeting.BusTeamMeetingVo;
|
||||
import org.dromara.safety.service.IBusTeamMeetingService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -0,0 +1,24 @@
|
||||
package org.dromara.safety.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 15:49
|
||||
*/
|
||||
@Getter
|
||||
public enum SafetyInspectionReviewTypeEnum {
|
||||
|
||||
PASS("通过", "1"),
|
||||
UNPASS("未通过", "2");
|
||||
|
||||
private final String text;
|
||||
|
||||
private final String value;
|
||||
|
||||
SafetyInspectionReviewTypeEnum(String text, String value) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package org.dromara.safety.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 15:47
|
||||
*/
|
||||
@Getter
|
||||
public enum SafetyInspectionStatusEnum {
|
||||
|
||||
INFORM("通知", "1"),
|
||||
RECTIFICATION("整改", "2"),
|
||||
REVIEW("复查", "3");
|
||||
|
||||
private final String text;
|
||||
|
||||
private final String value;
|
||||
|
||||
SafetyInspectionStatusEnum(String text, String value) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package org.dromara.safety.domain.req.safetyinspection;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 15:31
|
||||
*/
|
||||
@Data
|
||||
public class SafetyInspectionGisReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 873967698184867248L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private Integer pageSize = 20;
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package org.dromara.safety.domain.vo;
|
||||
package org.dromara.safety.domain.vo.documentsafetymeeting;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
@ -1,4 +1,4 @@
|
||||
package org.dromara.safety.domain.resp.documentsafetymeeting;
|
||||
package org.dromara.safety.domain.vo.documentsafetymeeting;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -11,7 +11,7 @@ import java.util.Date;
|
||||
* @date 2025/4/14 17:44
|
||||
*/
|
||||
@Data
|
||||
public class DocumentSafetyMeetingRecycleBinResp implements Serializable {
|
||||
public class DocumentSafetyMeetingRecycleBinVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1302984678621164410L;
|
@ -1,4 +1,4 @@
|
||||
package org.dromara.safety.domain.vo;
|
||||
package org.dromara.safety.domain.vo.safetyinspection;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
@ -0,0 +1,40 @@
|
||||
package org.dromara.safety.domain.vo.safetyinspection;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.safety.domain.vo.teammeeting.TeamMeetingGis;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 15:26
|
||||
*/
|
||||
@Data
|
||||
public class SafetyInspectionListGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8788573264526273230L;
|
||||
|
||||
/**
|
||||
* 站班会列表
|
||||
*/
|
||||
private List<TeamMeetingGis> teamMeetingList;
|
||||
|
||||
/**
|
||||
* 站班会总数
|
||||
*/
|
||||
private Long teamMeetingCount;
|
||||
|
||||
/**
|
||||
* 安全巡检总数
|
||||
*/
|
||||
private Long safetyInspectionCount;
|
||||
|
||||
/**
|
||||
* 整改情况
|
||||
*/
|
||||
private String correctSituation;
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package org.dromara.safety.domain.vo;
|
||||
package org.dromara.safety.domain.vo.teammeeting;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
@ -0,0 +1,38 @@
|
||||
package org.dromara.safety.domain.vo.teammeeting;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/4/28 15:27
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TeamMeetingGis {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 开会时间
|
||||
*/
|
||||
private Date meetingDate;
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package org.dromara.safety.mapper;
|
||||
|
||||
import org.dromara.safety.domain.BusDocumentSafetyMeeting;
|
||||
import org.dromara.safety.domain.vo.BusDocumentSafetyMeetingVo;
|
||||
import org.dromara.safety.domain.vo.documentsafetymeeting.BusDocumentSafetyMeetingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.dromara.safety.mapper;
|
||||
|
||||
import org.dromara.safety.domain.BusSafetyInspection;
|
||||
import org.dromara.safety.domain.vo.BusSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.BusSafetyInspectionVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.dromara.safety.mapper;
|
||||
|
||||
import org.dromara.safety.domain.BusTeamMeeting;
|
||||
import org.dromara.safety.domain.vo.BusTeamMeetingVo;
|
||||
import org.dromara.safety.domain.vo.teammeeting.BusTeamMeetingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
|
@ -9,8 +9,8 @@ import org.dromara.safety.domain.BusDocumentSafetyMeeting;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingCreateFileReq;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingCreateFolderReq;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingQueryReq;
|
||||
import org.dromara.safety.domain.resp.documentsafetymeeting.DocumentSafetyMeetingRecycleBinResp;
|
||||
import org.dromara.safety.domain.vo.BusDocumentSafetyMeetingVo;
|
||||
import org.dromara.safety.domain.vo.documentsafetymeeting.DocumentSafetyMeetingRecycleBinVo;
|
||||
import org.dromara.safety.domain.vo.documentsafetymeeting.BusDocumentSafetyMeetingVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -47,7 +47,7 @@ public interface IBusDocumentSafetyMeetingService extends IService<BusDocumentSa
|
||||
* @param pageQuery 分页参数
|
||||
* @return 安全会议纪要分页列表
|
||||
*/
|
||||
TableDataInfo<DocumentSafetyMeetingRecycleBinResp> queryRecycleBinPageList(DocumentSafetyMeetingQueryReq req, PageQuery pageQuery);
|
||||
TableDataInfo<DocumentSafetyMeetingRecycleBinVo> queryRecycleBinPageList(DocumentSafetyMeetingQueryReq req, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 新增安全会议纪要文件夹
|
||||
|
@ -8,9 +8,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.BusSafetyInspection;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionCreateReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionGisReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionQueryReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.BusSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.SafetyInspectionListGisVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -48,6 +50,14 @@ public interface IBusSafetyInspectionService extends IService<BusSafetyInspectio
|
||||
*/
|
||||
List<BusSafetyInspectionVo> queryList(SafetyInspectionQueryReq req);
|
||||
|
||||
/**
|
||||
* 查询大屏安全信息
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 安全信息
|
||||
*/
|
||||
SafetyInspectionListGisVo queryGisList(SafetyInspectionGisReq req);
|
||||
|
||||
/**
|
||||
* 新增安全巡检工单
|
||||
*
|
||||
|
@ -9,7 +9,7 @@ import org.dromara.safety.domain.BusTeamMeeting;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingCreateReq;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingQueryReq;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusTeamMeetingVo;
|
||||
import org.dromara.safety.domain.vo.teammeeting.BusTeamMeetingVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
@ -24,8 +24,8 @@ import org.dromara.safety.domain.enums.DocumentTypeEnum;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingCreateFileReq;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingCreateFolderReq;
|
||||
import org.dromara.safety.domain.req.documentsafetymeeting.DocumentSafetyMeetingQueryReq;
|
||||
import org.dromara.safety.domain.resp.documentsafetymeeting.DocumentSafetyMeetingRecycleBinResp;
|
||||
import org.dromara.safety.domain.vo.BusDocumentSafetyMeetingVo;
|
||||
import org.dromara.safety.domain.vo.documentsafetymeeting.DocumentSafetyMeetingRecycleBinVo;
|
||||
import org.dromara.safety.domain.vo.documentsafetymeeting.BusDocumentSafetyMeetingVo;
|
||||
import org.dromara.safety.mapper.BusDocumentSafetyMeetingMapper;
|
||||
import org.dromara.safety.service.IBusDocumentSafetyMeetingService;
|
||||
import org.dromara.system.domain.vo.SysOssUploadVo;
|
||||
@ -97,13 +97,13 @@ public class BusDocumentSafetyMeetingServiceImpl extends ServiceImpl<BusDocument
|
||||
* @return 安全会议纪要分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DocumentSafetyMeetingRecycleBinResp> queryRecycleBinPageList(DocumentSafetyMeetingQueryReq req, PageQuery pageQuery) {
|
||||
public TableDataInfo<DocumentSafetyMeetingRecycleBinVo> queryRecycleBinPageList(DocumentSafetyMeetingQueryReq req, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusDocumentSafetyMeeting> lqw = this.buildQueryWrapper(req);
|
||||
lqw.eq(BusDocumentSafetyMeeting::getFileStatus, DocumentStatusEnum.DELETE.getValue());
|
||||
Page<BusDocumentSafetyMeeting> result = this.page(pageQuery.build(), lqw);
|
||||
List<BusDocumentSafetyMeeting> documentSafetyMeetingList = result.getRecords();
|
||||
// 添加分页信息
|
||||
Page<DocumentSafetyMeetingRecycleBinResp> documentSafetyMeetingVoPage = new Page<>(
|
||||
Page<DocumentSafetyMeetingRecycleBinVo> documentSafetyMeetingVoPage = new Page<>(
|
||||
result.getCurrent(),
|
||||
result.getSize(),
|
||||
result.getTotal());
|
||||
@ -111,8 +111,8 @@ public class BusDocumentSafetyMeetingServiceImpl extends ServiceImpl<BusDocument
|
||||
return TableDataInfo.build(documentSafetyMeetingVoPage);
|
||||
}
|
||||
// 对象列表 => 封装对象列表
|
||||
List<DocumentSafetyMeetingRecycleBinResp> list = documentSafetyMeetingList.stream().map(documentSafetyMeeting -> {
|
||||
DocumentSafetyMeetingRecycleBinResp resp = new DocumentSafetyMeetingRecycleBinResp();
|
||||
List<DocumentSafetyMeetingRecycleBinVo> list = documentSafetyMeetingList.stream().map(documentSafetyMeeting -> {
|
||||
DocumentSafetyMeetingRecycleBinVo resp = new DocumentSafetyMeetingRecycleBinVo();
|
||||
BeanUtils.copyProperties(documentSafetyMeeting, resp);
|
||||
return resp;
|
||||
}).toList();
|
||||
|
@ -28,12 +28,19 @@ import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
import org.dromara.safety.constant.SafetyConstant;
|
||||
import org.dromara.safety.domain.BusSafetyInspection;
|
||||
import org.dromara.safety.domain.BusTeamMeeting;
|
||||
import org.dromara.safety.domain.enums.SafetyInspectionReviewTypeEnum;
|
||||
import org.dromara.safety.domain.enums.SafetyInspectionStatusEnum;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionCreateReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionGisReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionQueryReq;
|
||||
import org.dromara.safety.domain.req.safetyinspection.SafetyInspectionUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.BusSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.SafetyInspectionListGisVo;
|
||||
import org.dromara.safety.domain.vo.teammeeting.TeamMeetingGis;
|
||||
import org.dromara.safety.mapper.BusSafetyInspectionMapper;
|
||||
import org.dromara.safety.service.IBusSafetyInspectionService;
|
||||
import org.dromara.safety.service.IBusTeamMeetingService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysDictDataService;
|
||||
@ -41,7 +48,6 @@ import org.dromara.system.service.ISysOssService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.dromara.utils.DocumentUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -85,7 +91,7 @@ public class BusSafetyInspectionServiceImpl extends ServiceImpl<BusSafetyInspect
|
||||
private ISysOssService ossService;
|
||||
|
||||
@Resource
|
||||
private ResourceLoader resourceLoader;
|
||||
private IBusTeamMeetingService teamMeetingService;
|
||||
|
||||
/**
|
||||
* 查询安全巡检工单
|
||||
@ -127,6 +133,49 @@ public class BusSafetyInspectionServiceImpl extends ServiceImpl<BusSafetyInspect
|
||||
return safetyInspection.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏安全信息
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 安全信息
|
||||
*/
|
||||
@Override
|
||||
public SafetyInspectionListGisVo queryGisList(SafetyInspectionGisReq req) {
|
||||
Long projectId = req.getProjectId();
|
||||
if (projectId == null || projectService.getById(projectId) == null) {
|
||||
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
SafetyInspectionListGisVo gisVo = new SafetyInspectionListGisVo();
|
||||
List<BusTeamMeeting> teamMeetings = teamMeetingService.lambdaQuery()
|
||||
.eq(BusTeamMeeting::getProjectId, projectId)
|
||||
.list();
|
||||
// 获取最新的班组列表
|
||||
List<BusTeamMeeting> topList = teamMeetings.stream()
|
||||
.sorted(Comparator.comparing(BusTeamMeeting::getCreateTime).reversed())
|
||||
.limit(req.getPageSize())
|
||||
.toList();
|
||||
List<TeamMeetingGis> gisList = topList.stream().map(qualityInspection -> {
|
||||
TeamMeetingGis gis = new TeamMeetingGis();
|
||||
BeanUtils.copyProperties(qualityInspection, gis);
|
||||
return gis;
|
||||
}).toList();
|
||||
// 获取整改情况
|
||||
List<BusSafetyInspection> safetyInspectionList = this.lambdaQuery()
|
||||
.eq(BusSafetyInspection::getProjectId, projectId).list();
|
||||
long passCount = 0L;
|
||||
for (BusSafetyInspection safetyInspection : safetyInspectionList) {
|
||||
if (SafetyInspectionStatusEnum.REVIEW.getValue().equals(safetyInspection.getStatus())
|
||||
&& SafetyInspectionReviewTypeEnum.PASS.getValue().equals(safetyInspection.getReviewType())) {
|
||||
passCount++;
|
||||
}
|
||||
}
|
||||
gisVo.setTeamMeetingList(gisList);
|
||||
gisVo.setTeamMeetingCount((long) teamMeetings.size());
|
||||
gisVo.setSafetyInspectionCount((long) safetyInspectionList.size());
|
||||
gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / safetyInspectionList.size()));
|
||||
return gisVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增安全巡检工单
|
||||
*
|
||||
|
@ -26,7 +26,7 @@ import org.dromara.safety.domain.BusTeamMeeting;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingCreateReq;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingQueryReq;
|
||||
import org.dromara.safety.domain.req.teammeeting.TeamMeetingUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusTeamMeetingVo;
|
||||
import org.dromara.safety.domain.vo.teammeeting.BusTeamMeetingVo;
|
||||
import org.dromara.safety.mapper.BusTeamMeetingMapper;
|
||||
import org.dromara.safety.service.IBusTeamMeetingService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.project.mapper.BusProjectNewsMapper">
|
||||
|
||||
</mapper>
|
@ -939,3 +939,21 @@ CREATE TABLE `bus_project_file`
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_project_id` (`project_id` ASC) USING BTREE comment '项目id'
|
||||
) comment = '项目文件存储' collate = utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `bus_project_news`;
|
||||
CREATE TABLE `bus_project_news`
|
||||
(
|
||||
`id` bigint not null auto_increment comment '主键id',
|
||||
`project_id` bigint not null comment '项目id',
|
||||
`title` varchar(64) null comment '标题',
|
||||
`content` longtext null comment '内容',
|
||||
`file` varchar(512) null comment '附件',
|
||||
`create_by` varchar(64) null comment '创建者',
|
||||
`update_by` varchar(64) null comment '更新者',
|
||||
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
|
||||
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
`deleted_at` datetime null comment '删除时间',
|
||||
`is_delete` tinyint(4) default 0 not null comment '是否删除(0正常 1删除)',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_project_id` (`project_id` ASC) USING BTREE comment '项目id'
|
||||
) comment = '项目新闻' COLLATE = utf8mb4_unicode_ci;
|
||||
|
Reference in New Issue
Block a user