diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/manager/RedisSubscribeManager.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/manager/RedisSubscribeManager.java index f8e2a86f..795b448f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/manager/RedisSubscribeManager.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/manager/RedisSubscribeManager.java @@ -83,6 +83,7 @@ public class RedisSubscribeManager { Object object = RedisUtils.getCacheObject("xmjdap:ws"); log.info("开始执行Redis订阅更新定时任务..."); if (object == null) { + cancelAllSubscribes(); return; } long oldTime = Long.parseLong(String.valueOf(object)); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java index 92048eb4..0c1bf8d5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import jakarta.annotation.Resource; import lombok.RequiredArgsConstructor; +import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; @@ -114,7 +115,15 @@ public class DroProjectDroneServiceImpl extends ServiceImpl 0) { + throw new ServiceException("无人机已存在于其他项目"); + } } /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/controller/DeviceController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/controller/DeviceController.java index 34e8d925..891d66cf 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/controller/DeviceController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/controller/DeviceController.java @@ -13,8 +13,7 @@ import org.dromara.contractor.domain.SubConstructionUser; import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserQueryReq; import org.dromara.contractor.service.ISubConstructionUserService; import org.dromara.gps.domain.bo.GpsEquipmentBo; -import org.dromara.gps.domain.vo.ConstructionUser; -import org.dromara.gps.domain.vo.GpsProjectVo; +import org.dromara.gps.domain.vo.*; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import org.dromara.common.idempotent.annotation.RepeatSubmit; @@ -26,7 +25,6 @@ import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; import org.dromara.common.log.enums.BusinessType; import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.gps.domain.vo.DeviceVo; import org.dromara.gps.domain.bo.DeviceBo; import org.dromara.gps.service.IDeviceService; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -114,6 +112,15 @@ public class DeviceController extends BaseController { return toAjax(deviceService.deleteWithValidByIds(List.of(ids), true)); } + /** + * 查询GPS设备用户列表 + */ + @SaCheckPermission("gps:device:getUserList") + @GetMapping("/getUserList") + public R> getUserList(DeviceBo bo) { + return R.ok(deviceService.getUserList(bo)); + } + /** * 项目列表 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Device.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Device.java index 87a6dd15..99a1f446 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Device.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Device.java @@ -15,7 +15,7 @@ import java.io.Serial; */ @Data @EqualsAndHashCode(callSuper = true) -@TableName("device") +@TableName("anqm_device") public class Device extends BaseEntity { @Serial diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java index 5ac034f3..e208d49b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java @@ -15,7 +15,7 @@ import java.io.Serial; */ @Data @EqualsAndHashCode(callSuper = true) -@TableName("location") +@TableName("anqm_location") public class Location extends BaseEntity { @Serial diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/DeviceBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/DeviceBo.java index 651d62f0..2bedc655 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/DeviceBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/DeviceBo.java @@ -97,5 +97,7 @@ public class DeviceBo extends BaseEntity { */ private String batteryOff; + private Integer type; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/AnqmUserVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/AnqmUserVo.java new file mode 100644 index 00000000..40f030ec --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/AnqmUserVo.java @@ -0,0 +1,51 @@ +package org.dromara.gps.domain.vo; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * GPS人机关联视图对象 gps_manmachine + * + * @author Lion Li + * @date 2025-08-28 + */ +@Data +//@ExcelIgnoreUnannotated +//@AutoMapper(target = GpsManmachine.class) +public class AnqmUserVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + *类型(1、历史,0、当前) + */ +// @ExcelProperty(value = "") + private Integer type; + + /** + * + */ +// @ExcelProperty(value = "") + private Long userId; + /** + * 用户名 + */ + private String userName; + /** + * + */ +// @ExcelProperty(value = "") + private Long projectId; + /** + * 用户名 + */ + private String projectName; + + private String devNum; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/DeviceVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/DeviceVo.java index 3881ee62..0e4fea6c 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/DeviceVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/DeviceVo.java @@ -34,6 +34,13 @@ public class DeviceVo implements Serializable { @ExcelProperty(value = "id") private Long id; + /** + * 用户id + */ + private Long userId; + + private String userName; + /** * 设备编号 */ @@ -58,6 +65,8 @@ public class DeviceVo implements Serializable { @ExcelProperty(value = "项目id") private Long projectId; + private String projectName; + /** * 设备采集温度 */ @@ -112,5 +121,7 @@ public class DeviceVo implements Serializable { @ExcelProperty(value = "电池关机时间") private String batteryOff; + private Integer type; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/DeviceMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/DeviceMapper.java index 4d5ea284..585c73ba 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/DeviceMapper.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/DeviceMapper.java @@ -1,9 +1,15 @@ package org.dromara.gps.mapper; +import jakarta.validation.constraints.NotBlank; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.dromara.gps.domain.Device; +import org.dromara.gps.domain.vo.AnqmUserVo; import org.dromara.gps.domain.vo.DeviceVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import java.util.List; + /** * 安全帽设备Mapper接口 * @@ -12,4 +18,17 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; */ public interface DeviceMapper extends BaseMapperPlus { + @Select("SELECT\n" + + " gm.user_id AS userId,\n" + + " su.user_name AS userName, \n" + + " gm.project_id AS projectId,\n" + + " bp.project_name AS projectName \n" + + "FROM\n" + + " anqm_location gm\n" + + " LEFT JOIN sys_user su ON gm.user_id = su.user_id \n" + + "LEFT JOIN bus_project bp ON gm.project_id = bp.id \n" + + "WHERE\n" + + " gm.dev_num = #{devNum}" + + " GROUP BY gm.user_id,gm.project_id") + List getUserList(@Param("devNum") String devNum); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java index cff05bf3..e312a555 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java @@ -23,7 +23,7 @@ public interface LocationMapper extends BaseMapperPlus { "ROW_NUMBER() OVER(" + "PARTITION BY user_id " + "ORDER BY create_time DESC, id DESC) AS rn " + - "FROM location WHERE project_id = #{projectId})" + + "FROM anqm_location WHERE project_id = #{projectId})" + "SELECT user_id AS userId," + "latitude AS latitude, " + "longitude AS longitude " + @@ -37,7 +37,7 @@ public interface LocationMapper extends BaseMapperPlus { " *,\n" + " ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY create_time DESC) AS rn\n" + " FROM\n" + - " location \n " + + " anqm_location \n " + "WHERE \n" + "project_id = #{projectId}\n " + // "AND create_time BETWEEN #{startTime} AND #{endTime} \n" + diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java index 0239d9f7..12276448 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java @@ -1,6 +1,7 @@ package org.dromara.gps.service; import org.dromara.gps.domain.bo.GpsEquipmentBo; +import org.dromara.gps.domain.vo.AnqmUserVo; import org.dromara.gps.domain.vo.DeviceVo; import org.dromara.gps.domain.bo.DeviceBo; import org.dromara.gps.domain.Device; @@ -9,6 +10,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import com.baomidou.mybatisplus.extension.service.IService; import org.dromara.gps.domain.vo.GpsProjectVo; +import org.dromara.gps.domain.vo.GpsUserVo; import java.time.LocalDateTime; import java.util.Collection; @@ -79,4 +81,6 @@ public interface IDeviceService extends IService{ Boolean unbindManmachine(DeviceBo bo); List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); + + List getUserList(DeviceBo bo); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java index e2b994b6..052e064d 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java @@ -15,25 +15,24 @@ import lombok.RequiredArgsConstructor; import org.dromara.gps.domain.AnqmManmachine; import org.dromara.gps.domain.GpsEquipment; import org.dromara.gps.domain.GpsManmachine; -import org.dromara.gps.domain.vo.GpsProjectVo; +import org.dromara.gps.domain.bo.GpsEquipmentBo; +import org.dromara.gps.domain.vo.*; import org.dromara.gps.mapper.AnqmManmachineMapper; import org.dromara.gps.service.ILocationService; import org.dromara.project.domain.vo.project.BusProjectVo; import org.dromara.project.service.IBusProjectService; +import org.dromara.system.domain.vo.SysUserVo; +import org.dromara.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.dromara.gps.domain.bo.DeviceBo; -import org.dromara.gps.domain.vo.DeviceVo; import org.dromara.gps.domain.Device; import org.dromara.gps.mapper.DeviceMapper; import org.dromara.gps.service.IDeviceService; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; /** * 安全帽设备Service业务层处理 @@ -56,6 +55,9 @@ public class DeviceServiceImpl extends ServiceImpl impleme @Autowired private ILocationService locationService; + @Autowired + private ISysUserService userService; + /** * 查询安全帽设备 * @@ -78,6 +80,40 @@ public class DeviceServiceImpl extends ServiceImpl impleme public TableDataInfo queryPageList(DeviceBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + if (bo.getType() == 1){ + List list = result.getRecords().stream() + .filter(gpsEquipment -> gpsEquipment.getProjectId() != null) + .toList(); + list.forEach(item -> { + if (item.getUserId() != null){ + item.setType(1); + SysUserVo sysUserVo = userService.queryById(item.getUserId()); + if (sysUserVo != null) { + item.setUserName(sysUserVo.getNickName()); + } + }else{ + item.setType(2); + } + BusProjectVo busProjectVo = projectService.selectById(item.getProjectId()); + if (busProjectVo != null) { + item.setProjectName(busProjectVo.getProjectName()); + } + }); + result.setRecords(list); + }else if (bo.getType() == 2){ + List list = result.getRecords().stream() + .filter(gpsEquipment -> gpsEquipment.getProjectId() == null).toList(); + list.forEach(item ->{ + if (item.getProjectId() != null) { + BusProjectVo busProjectVo = projectService.selectById(item.getProjectId()); + if (busProjectVo != null) { + item.setProjectName(busProjectVo.getProjectName()); + } + } + item.setType(2); + }); + result.setRecords(list); + } return TableDataInfo.build(result); } @@ -222,4 +258,23 @@ public class DeviceServiceImpl extends ServiceImpl impleme public List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) { return locationService.getUserListByProjectId(projectId,startOfDay,now); } + + @Override + public List getUserList(DeviceBo bo) { + List gpsUserVos = baseMapper.getUserList(bo.getDevNum()); + if (gpsUserVos == null || gpsUserVos.isEmpty()) { + return null; + } + List list = gpsUserVos.stream().filter(Objects::nonNull).toList(); + AnqmManmachine gpsManmachine = anqmManmachineMapper.selectOne(new LambdaQueryWrapper().eq(AnqmManmachine::getClientId, bo.getDevNum())); + for (AnqmUserVo item : list) { + item.setDevNum(bo.getDevNum()); + if (gpsManmachine != null && gpsManmachine.getUserId().equals(item.getUserId())) { + item.setType(0); + }else { + item.setType(1); + } + } + return list; + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java index 6765ab8e..e54ea5e7 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java @@ -16,6 +16,7 @@ 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.out.domain.bo.OutConstructionValueBo; +import org.dromara.out.domain.bo.OutConstructionValueFacilityReq; import org.dromara.out.domain.vo.OutConstructionAllValueVo; import org.dromara.out.domain.vo.OutConstructionValueVo; import org.dromara.out.service.IOutConstructionValueService; @@ -113,4 +114,24 @@ public class OutConstructionValueController extends BaseController { @PathVariable Long[] ids) { return toAjax(outConstructionValueService.deleteWithValidByIds(List.of(ids), true)); } + + /** + * 新增进度计划详情 + */ + @SaCheckPermission("out:constructionValue:edit") + @RepeatSubmit() + @PostMapping("/insert/facility") + public R insertFinishedDetail(@Validated @RequestBody OutConstructionValueFacilityReq req) { + return toAjax(outConstructionValueService.insertFacilityDetail(req)); + } + + /** + * 删除进度计划详情 + */ + @SaCheckPermission("out:constructionValue:edit") + @RepeatSubmit() + @DeleteMapping("/remove/facility") + public R removeDetail(@Validated OutConstructionValueFacilityReq req) { + return toAjax(outConstructionValueService.removeFacilityDetail(req)); + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/bo/OutConstructionValueFacilityReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/bo/OutConstructionValueFacilityReq.java new file mode 100644 index 00000000..38ab9a12 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/bo/OutConstructionValueFacilityReq.java @@ -0,0 +1,42 @@ +package org.dromara.out.domain.bo; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.List; + +/** + * @author lilemy + * @date 2025-10-12 17:51 + */ +@Data +public class OutConstructionValueFacilityReq implements Serializable { + + @Serial + private static final long serialVersionUID = -5491058421687762904L; + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空") + private Long id; + + /** + * 上报日期 + */ + private LocalDate reportDate; + + /** + * 详情主键id + */ + @NotNull(message = "详情主键id不能为空") + private Long detailId; + + /** + * 详情id列表 + */ + private List detailIdList; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java index a500d817..2116e848 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java @@ -166,4 +166,9 @@ public class OutConstructionValueVo implements Serializable { * 对甲产值 */ private BigDecimal ownerValue; + + /** + * 工作类型 + */ + private String workType; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java index 35940fe4..dbe452fe 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java @@ -5,6 +5,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.out.domain.OutConstructionValue; import org.dromara.out.domain.bo.OutConstructionValueBo; +import org.dromara.out.domain.bo.OutConstructionValueFacilityReq; import org.dromara.out.domain.vo.OutConstructionAllValueVo; import org.dromara.out.domain.vo.OutConstructionValueVo; @@ -86,4 +87,20 @@ public interface IOutConstructionValueService extends IService> listGantt(@NotNull(message = "主键不能为空") + @PathVariable Long projectId) { + return R.ok(pgsProgressCategoryService.listGanttByProject(projectId)); + } + /** * 新增分项工程单价 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java index 74fc8b0b..229ccb0a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java @@ -46,7 +46,7 @@ public class PgsProgressPlanDetailController extends BaseController { @RepeatSubmit() @PostMapping("/insert/detail") public R insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) { - return toAjax(pgsProgressPlanDetailService.insertFinishedDetail(req)); + return toAjax(pgsProgressPlanDetailService.insertFinishedDetail(req, true)); } /** @@ -100,7 +100,7 @@ public class PgsProgressPlanDetailController extends BaseController { @RepeatSubmit() @DeleteMapping("/remove/detail") public R removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) { - return toAjax(pgsProgressPlanDetailService.removeDetail(req)); + return toAjax(pgsProgressPlanDetailService.removeDetail(req, true)); } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java index d4c193f2..c79932d5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java @@ -48,7 +48,7 @@ public class PgsProgressPlanDetailAppController extends BaseController { @RepeatSubmit() @PostMapping("/insert/detail") public R insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) { - return toAjax(progressPlanDetailService.insertFinishedDetail(req)); + return toAjax(progressPlanDetailService.insertFinishedDetail(req, true)); } /** @@ -90,7 +90,7 @@ public class PgsProgressPlanDetailAppController extends BaseController { @RepeatSubmit() @DeleteMapping("/remove/detail") public R removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) { - return toAjax(progressPlanDetailService.removeDetail(req)); + return toAjax(progressPlanDetailService.removeDetail(req, true)); } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/domain/vo/progresscategory/PgsProgressCategoryGanttVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/domain/vo/progresscategory/PgsProgressCategoryGanttVo.java new file mode 100644 index 00000000..c4a0d7b1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/domain/vo/progresscategory/PgsProgressCategoryGanttVo.java @@ -0,0 +1,49 @@ +package org.dromara.progress.domain.vo.progresscategory; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * @author lilemy + * @date 2025-10-12 15:15 + */ +@Data +public class PgsProgressCategoryGanttVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1759675635511567284L; + + /** + * id + */ + private Long id; + + /** + * 父级id + */ + private Long parentId; + + /** + * 名称 + */ + private String text; + + /** + * 开始时间 + */ + private LocalDate startDate; + + /** + * 结束时间 + */ + private LocalDate endDate; + + /** + * 进度 + */ + private BigDecimal progress; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java index 583396e3..0ca22b2a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java @@ -165,6 +165,15 @@ public interface IPgsProgressCategoryService extends IService getLeafNodesByTopId(Long topId); + /** + * 获取最底层的叶子节点 + * + * @param topId 顶级节点id + * @param allCategory 所有节点 + * @return 最底层的叶子节点 + */ + List getLeafNodesByTopId(Long topId, List allCategory); + /** * 获取最底层的叶子节点(支持多个顶级id) * @@ -212,4 +221,12 @@ public interface IPgsProgressCategoryService extends IService listGanttByProject(Long projectId); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java index 7b7a593c..b2de11d3 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java @@ -38,7 +38,7 @@ public interface IPgsProgressPlanDetailService extends IService getLeafNodesByTopId(Long topId, List allCategory) { + if (allCategory == null || allCategory.isEmpty()) { + return Collections.emptyList(); + } + + // 1. 找出所有属于该顶级节点的子孙节点(Ancestors 字段包含 ,topId,) + List allChildren = allCategory.stream() + .filter(item -> { + String ancestors = item.getAncestors(); + return ancestors != null && ancestors.contains("," + topId + ","); + }) + .toList(); + + if (allChildren.isEmpty()) { + return Collections.emptyList(); + } + + // 2. 找出所有的 parentId(即有孩子的节点) + Set parentIds = allChildren.stream() + .map(PgsProgressCategory::getParentId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + // 3. 过滤出没有作为别人 parentId 出现的节点 → 叶子节点 + return allChildren.stream() + .filter(item -> !parentIds.contains(item.getId())) + .toList(); + } + /** * 获取最底层的叶子节点(支持多个顶级id) * @@ -1823,4 +1860,69 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl listGanttByProject(Long projectId) { + List ganttList = new ArrayList<>(); + // 获取项目 + BusProject project = projectService.getById(projectId); + if (project == null) { + throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND); + } + // 获取当前项目的所有子项目 + List projectList = projectService.lambdaQuery() + .eq(BusProject::getPId, projectId) + .list(); + projectList.add(project); + if (CollUtil.isEmpty(projectList)) { + return ganttList; + } + List projectIds = projectList.stream().map(BusProject::getId).toList(); + // 获取当前项目所有进度类别 + List progressCategoryList = this.lambdaQuery() + .in(PgsProgressCategory::getProjectId, projectIds) + .eq(PgsProgressCategory::getMatrixId, 0) + .list(); + if (CollUtil.isEmpty(progressCategoryList)) { + return ganttList; + } + // 封装进度类别数据 + List list = progressCategoryList.stream().map(p -> { + // 获取所有子节点 + List children = this.getLeafNodesByTopId(p.getId(), progressCategoryList); + PgsProgressCategoryGanttVo vo = new PgsProgressCategoryGanttVo(); + vo.setId(p.getId()); + vo.setParentId(p.getParentId()); + vo.setText(p.getName()); + vo.setStartDate(null); + vo.setEndDate(null); + vo.setProgress(this.getCompletedPercentage(children) + .divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)); + return vo; + }).toList(); + ganttList.addAll(list); + // 获取当前项目所有计划 + List planList = progressPlanService.lambdaQuery() + .eq(PgsProgressPlan::getProjectId, projectId) + .list(); + List list1 = planList.stream().map(p -> { + PgsProgressCategoryGanttVo vo = new PgsProgressCategoryGanttVo(); + vo.setId(p.getId()); + vo.setParentId(p.getProgressCategoryId()); + vo.setText(p.getProgressCategoryName() + "-" + "计划"); + vo.setStartDate(p.getStartDate()); + vo.setEndDate(p.getEndDate()); + vo.setProgress(BigDecimalUtil.toPercentage(p.getFinishedNumber(), p.getPlanNumber()) + .divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)); + return vo; + }).toList(); + ganttList.addAll(list1); + return ganttList; + } + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java index bd091c4a..b51a55e5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java @@ -156,7 +156,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl finishedDetailIdList = req.getFinishedDetailIdList(); if (CollUtil.isEmpty(finishedDetailIdList)) { return true; @@ -168,7 +168,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl detailIdList = req.getDetailIdList(); if (CollUtil.isEmpty(detailIdList)) { @@ -637,6 +637,10 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl finishedVoList = JSONUtil.toList(finishedDetail, PgsProgressPlanDetailFinishedVo.class); @@ -977,6 +981,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl { + try { + chatServerHandler.sendSystemMessageToUser(bean.getUserId(),"补卡申请已通过","1"); + } catch (Exception e) { + log.error("异步发送系统消息失败,用户ID: {}, 消息: {}", bean.getUserId(), "补卡申请已通过", e); + } + }); + + } + if("3".equals(bean.getGangerOpinion())){ + BusAttendance byId = attendanceService.getById(attendanceId); + byId.setHandle("0"); + attendanceService.updateById(byId); + CompletableFuture.runAsync(() -> { + try { + chatServerHandler.sendSystemMessageToUser(bean.getUserId(),"补卡申请未通过","1"); + } catch (Exception e) { + log.error("异步发送系统消息失败,用户ID: {}, 消息: {}", bean.getUserId(), "补卡申请未通过", e); + } + }); + + } + return b; } /** @@ -312,13 +300,15 @@ public class BusReissueCardServiceImpl extends ServiceImpl "2".equals(q.getIsReply())) + .toList() + .size()); gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / qualityInspectionList.size())); return gisVo; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java index fc4470a9..49a563d6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java @@ -30,12 +30,10 @@ import org.dromara.project.domain.BusProjectTeam; import org.dromara.project.service.IBusProjectService; import org.dromara.project.service.IBusProjectTeamMemberService; import org.dromara.project.service.IBusProjectTeamService; -import org.dromara.quality.domain.enums.QltQualityInspectionStatusEnum; import org.dromara.safety.constant.HseSafetyConstant; import org.dromara.safety.domain.HseSafetyInspection; import org.dromara.safety.domain.HseTeamMeeting; import org.dromara.safety.domain.dto.safetyinspection.*; -import org.dromara.safety.domain.enums.HseSafetyInspectionReviewTypeEnum; import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum; import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo; import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo; @@ -225,18 +223,16 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl "2".equals(q.getIsReply())) + .toList().size()); gisVo.setCorrectSituationCount(passCount); gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / safetyInspectionList.size())); return gisVo; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/enums/XzdClassEnum.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/enums/XzdClassEnum.java new file mode 100644 index 00000000..20e37260 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/enums/XzdClassEnum.java @@ -0,0 +1,19 @@ +package org.dromara.xzd.enums; + + +public enum XzdClassEnum { + + CS_CONTRACT_INFORMATION("xzd_cs_contract_information"); + + + private final String className; + + + public String getClassName() { + return className; + } + + XzdClassEnum(String className) { + this.className = className; + } +}