diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PointInfoController.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PointInfoController.java index 22d5a2c..64d04af 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PointInfoController.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PointInfoController.java @@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.*; import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.platform.domain.vo.PointSelectVo; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import org.dromara.common.idempotent.annotation.RepeatSubmit; @@ -102,4 +103,12 @@ public class PointInfoController extends BaseController { @PathVariable String[] ids) { return toAjax(pointInfoService.deleteWithValidByIds(List.of(ids), true)); } + + + @SaCheckPermission("platform:pointInfo:queryPointNames") + @GetMapping("/queryPointNames") + public R> queryPointNames() { + List rs = pointInfoService.queryPointNames(); + return R.ok(rs); + } } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DailyInspectionReportVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DailyInspectionReportVo.java index 77bcaea..a547e0a 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DailyInspectionReportVo.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DailyInspectionReportVo.java @@ -4,6 +4,7 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.common.tenant.core.TenantEntity; import org.dromara.platform.domain.Attachment; import org.dromara.platform.domain.DailyInspectionReport; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; @@ -28,7 +29,7 @@ import java.util.List; @Data @ExcelIgnoreUnannotated @AutoMapper(target = DailyInspectionReport.class) -public class DailyInspectionReportVo implements Serializable { +public class DailyInspectionReportVo extends TenantEntity implements Serializable { @Serial private static final long serialVersionUID = 1L; diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PointSelectVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PointSelectVo.java new file mode 100644 index 0000000..c7b1e5d --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PointSelectVo.java @@ -0,0 +1,19 @@ +package org.dromara.platform.domain.vo; + +import lombok.Data; + +@Data +public class PointSelectVo { + private String id; + // 点位名称 + private String pointName; + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPointInfoService.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPointInfoService.java index 602ea10..9c41220 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPointInfoService.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPointInfoService.java @@ -4,6 +4,7 @@ import org.dromara.platform.domain.vo.PointInfoVo; import org.dromara.platform.domain.bo.PointInfoBo; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.platform.domain.vo.PointSelectVo; import java.util.Collection; import java.util.List; @@ -65,4 +66,10 @@ public interface IPointInfoService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 获取点位信息 下拉框 + * @return + */ + List queryPointNames(); } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IProjectInfoService.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IProjectInfoService.java index 1d721f6..572b455 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IProjectInfoService.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IProjectInfoService.java @@ -95,5 +95,11 @@ public interface IProjectInfoService { * @param projectName * @return */ -// ProjectInfo getProjectInfoByName(String projectName); + + /** + * 根据项目名称查询合同乙方单位名称(巡检单位) + * @param projectName + * @return + */ + String getContractPartyANameByProjectName(String projectName); } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DailyInspectionReportServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DailyInspectionReportServiceImpl.java index 302fe23..cf4e6d6 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DailyInspectionReportServiceImpl.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DailyInspectionReportServiceImpl.java @@ -1,5 +1,7 @@ package org.dromara.platform.service.impl; +import jakarta.annotation.Resource; +import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -8,8 +10,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; +import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.platform.domain.Attachment; import org.dromara.platform.domain.AttachmentSerializer; +import org.dromara.platform.service.IProjectInfoService; import org.springframework.stereotype.Service; import org.dromara.platform.domain.bo.DailyInspectionReportBo; import org.dromara.platform.domain.vo.DailyInspectionReportVo; @@ -17,9 +21,11 @@ import org.dromara.platform.domain.DailyInspectionReport; import org.dromara.platform.mapper.DailyInspectionReportMapper; import org.dromara.platform.service.IDailyInspectionReportService; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 巡检日报Service业务层处理 @@ -33,6 +39,9 @@ public class DailyInspectionReportServiceImpl implements IDailyInspectionReportS private final DailyInspectionReportMapper baseMapper; + @Resource + private IProjectInfoService projectInfoService; + /** * 查询巡检日报 * @@ -52,7 +61,7 @@ public class DailyInspectionReportServiceImpl implements IDailyInspectionReportS if (StringUtils.isNotBlank(inspectionPhoto)) { AttachmentSerializer serializer = new AttachmentSerializer(); List inspectionPhotos = serializer.deserializeAttachments(inspectionPhoto); - dailyInspectionReportVo.setAttachments(inspectionPhotos); + dailyInspectionReportVo.setInspectionPhotos(inspectionPhotos); } return dailyInspectionReportVo; } @@ -68,6 +77,12 @@ public class DailyInspectionReportServiceImpl implements IDailyInspectionReportS public TableDataInfo queryPageList(DailyInspectionReportBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + List records = result.getRecords(); + List sortedRecords = records.stream() + .sorted(Comparator.comparing(DailyInspectionReportVo::getCreateTime).reversed()) + .collect(Collectors.toList()); + result.setRecords(sortedRecords); + return TableDataInfo.build(result); } @@ -110,9 +125,17 @@ public class DailyInspectionReportServiceImpl implements IDailyInspectionReportS @Override public Boolean insertByBo(DailyInspectionReportBo bo) { DailyInspectionReport add = MapstructUtils.convert(bo, DailyInspectionReport.class); - add.setInspectionUnit("测试巡检单位"); + String projectName = bo.getProjectName(); + String inspectionUnit = projectInfoService.getContractPartyANameByProjectName(projectName); + add.setInspectionUnit(inspectionUnit); add.setType("前端(默认)"); validEntityBeforeSave(add); + LoginUser loginUser = LoginHelper.getLoginUser(); + String nickname = loginUser.getNickname(); + add.setInspectionPeople(nickname); + String deptName = loginUser.getDeptName(); + add.setIoCompany(deptName); + List attachments = bo.getAttachments(); AttachmentSerializer serializer1 = new AttachmentSerializer(); String serializedAttachment = serializer1.serializeAttachments(attachments); diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java index 1adf700..67996a2 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java @@ -17,9 +17,11 @@ import org.dromara.platform.domain.DocumentInfo; import org.dromara.platform.mapper.DocumentInfoMapper; import org.dromara.platform.service.IDocumentInfoService; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 文档信息Service业务层处理 @@ -62,6 +64,12 @@ public class DocumentInfoServiceImpl implements IDocumentInfoService { public TableDataInfo queryPageList(DocumentInfoBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + + List records = result.getRecords(); + List sortedRecords = records.stream() + .sorted(Comparator.comparing(DocumentInfoVo::getCreateTime).reversed()) + .collect(Collectors.toList()); + result.setRecords(sortedRecords); return TableDataInfo.build(result); } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PointInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PointInfoServiceImpl.java index d2a72f2..5112dae 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PointInfoServiceImpl.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PointInfoServiceImpl.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; +import org.dromara.platform.domain.vo.PointSelectVo; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.dromara.platform.domain.bo.PointInfoBo; import org.dromara.platform.domain.vo.PointInfoVo; @@ -15,6 +17,7 @@ import org.dromara.platform.domain.PointInfo; import org.dromara.platform.mapper.PointInfoMapper; import org.dromara.platform.service.IPointInfoService; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Collection; @@ -140,4 +143,18 @@ public class PointInfoServiceImpl implements IPointInfoService { } return baseMapper.deleteByIds(ids) > 0; } + + @Override + public List queryPointNames() { + List pointInfos = baseMapper.selectList(); + + List pointSelectVos = new ArrayList<>(); + for (PointInfo pointInfo : pointInfos) { + PointSelectVo pointSelectVo = new PointSelectVo(); + BeanUtils.copyProperties(pointInfo, pointSelectVo); + pointSelectVos.add(pointSelectVo); + } + + return pointSelectVos; + } } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ProjectInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ProjectInfoServiceImpl.java index 3186536..fd5deda 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ProjectInfoServiceImpl.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ProjectInfoServiceImpl.java @@ -205,4 +205,13 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { List contractInfos = contractInfoMapper.selectList(queryWrapper); return contractInfos; } + + @Override + public String getContractPartyANameByProjectName(String projectName) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ContractInfo::getProjectName, projectName); + ContractInfo contractInfo = contractInfoMapper.selectOne(queryWrapper); + String partyA = contractInfo.getPartyA(); + return partyA; + } } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java index 14e0b73..dcc2afb 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java @@ -121,6 +121,16 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService { AttachmentSerializer serializer = new AttachmentSerializer(); String serializedAttachment = serializer.serializeAttachments(attachments); add.setFaultImage(serializedAttachment); + //WorkOrderInfoBo 新增字段 bussinkey + //key = 唯一的值 表名+uuid uuid +// add.setBusinessKey(key); +// StartProcessBo startProcessBo = new StartProcessBo(); +// // 设置流程对应的业务表 +// startProcessBo.setTableName("leave_table"); +// // 设置业务主键 +// startProcessBo.setBusinessKey(key); +// // 启动流程实例 +// Map result = actTaskService.startWorkFlow(startProcessBo); boolean flag = baseMapper.insert(add) > 0; if (flag) { bo.setId(add.getId());