From 6398a28974c3f5608b02cfea12ecc6e822d61a8d Mon Sep 17 00:00:00 2001 From: zt Date: Wed, 15 Oct 2025 20:36:12 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DesDesignChangeServiceImpl.java | 3 +- .../impl/DesVolumeFileServiceImpl.java | 18 +- .../service/impl/MatMaterialsServiceImpl.java | 2 + .../app/BusWorkWageAppController.java | 51 ++++ .../dto/workwage/BusWorkWageQueryReq.java | 3 + .../domain/vo/workwage/BusWorkWageVo.java | 8 + .../service/impl/BusLeaveServiceImpl.java | 1 + .../impl/BusReissueCardServiceImpl.java | 12 +- .../controller/HseFileFolderController.java | 22 +- .../dto/fileFolder/FileFolderCreateDTO.java | 8 + .../domain/dto/fileFolder/ListQueryDto.java | 4 + .../safety/service/IHseFileFolderService.java | 13 + .../impl/HseFileFolderServiceImpl.java | 285 +++++++++++++++++- .../mapper/safety/HseFileFolderMapper.xml | 2 +- 14 files changed, 404 insertions(+), 28 deletions(-) create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusWorkWageAppController.java diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/DesDesignChangeServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/DesDesignChangeServiceImpl.java index 30ccf7cc..709abae7 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/DesDesignChangeServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/DesDesignChangeServiceImpl.java @@ -628,6 +628,7 @@ public class DesDesignChangeServiceImpl extends ServiceImpl wrapper = new LambdaUpdateWrapper<>(); wrapper.set(DesVolumeFile::getType, DesVolumeFile.WASTE) + .eq(DesVolumeFile::getType, DesVolumeFile.BLUEPRINT) .eq(DesVolumeFile::getVolumeCatalogId, volumeCatalog.getDesign()); String saveFile = designChange.getSaveFile(); if (StringUtils.isNotBlank(saveFile)) { @@ -658,7 +659,7 @@ public class DesDesignChangeServiceImpl extends ServiceImpl blueprintFiles = baseMapper.selectList(new LambdaQueryWrapper() diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsServiceImpl.java index c3272099..8c8b6ab9 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsServiceImpl.java @@ -330,6 +330,8 @@ public class MatMaterialsServiceImpl extends ServiceImpl> list(BusWorkWageQueryReq req) { + return R.ok(busWorkWageService.queryList(req)); + } + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/workwage/BusWorkWageQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/workwage/BusWorkWageQueryReq.java index 6004064d..425352fb 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/workwage/BusWorkWageQueryReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/workwage/BusWorkWageQueryReq.java @@ -1,6 +1,8 @@ package org.dromara.project.domain.dto.workwage; import lombok.Data; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; import java.io.Serial; import java.io.Serializable; @@ -31,6 +33,7 @@ public class BusWorkWageQueryReq implements Serializable { */ private String workType; + /** * 是否是特种兵(1是 2否) */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/workwage/BusWorkWageVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/workwage/BusWorkWageVo.java index cccae135..8a2ba1b1 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/workwage/BusWorkWageVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/workwage/BusWorkWageVo.java @@ -6,6 +6,8 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; import org.dromara.project.domain.BusWorkWage; import java.io.Serial; @@ -47,6 +49,12 @@ public class BusWorkWageVo implements Serializable { @ExcelDictFormat(dictType = "type_of_work") private String workType; + /** + * 工种 + */ + @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "workType",other = "type_of_work") + private String workTypeName; + /** * 是否是特种兵(1是 2否) */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusLeaveServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusLeaveServiceImpl.java index 3b8132e6..60fb1112 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusLeaveServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusLeaveServiceImpl.java @@ -505,6 +505,7 @@ public class BusLeaveServiceImpl extends ServiceImpl @Override public TableDataInfo listByLoginUser(BusLeaveQueryReq req, PageQuery pageQuery) { LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.orderByDesc(BusLeave::getCreateTime); lqw.eq(ObjectUtils.isNotEmpty(req.getUserId()), BusLeave::getUserId, req.getUserId()); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusReissueCardServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusReissueCardServiceImpl.java index 74040f47..1db35ad8 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusReissueCardServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusReissueCardServiceImpl.java @@ -214,9 +214,9 @@ public class BusReissueCardServiceImpl extends ServiceImpl { try { chatServerHandler.sendSystemMessageToUser(bean.getUserId(),"补卡申请已通过","1"); @@ -511,9 +511,9 @@ public class BusReissueCardServiceImpl extends ServiceImpl { try { chatServerHandler.sendSystemMessageToUser(bean.getUserId(),"补卡申请已通过","1"); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseFileFolderController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseFileFolderController.java index f1ca736c..f808546b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseFileFolderController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseFileFolderController.java @@ -13,6 +13,7 @@ import org.dromara.safety.domain.dto.fileFolder.FileFolderCreateDTO; import org.dromara.safety.domain.dto.fileFolder.FileFolderMoveDTO; import org.dromara.safety.domain.dto.fileFolder.ListQueryDto; import org.dromara.safety.domain.vo.fileFolder.FileFolderTreeVO; +import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; @@ -29,6 +30,7 @@ import org.dromara.safety.domain.vo.HseFileFolderVo; import org.dromara.safety.domain.bo.HseFileFolderBo; import org.dromara.safety.service.IHseFileFolderService; import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; /** * 会议纪要 @@ -61,6 +63,7 @@ public class HseFileFolderController extends BaseController { // 1. 查询所有子项(利用path前缀匹配,一次性加载所有层级) List allItems = hseFileFolderService.list(new LambdaQueryWrapper() + .eq(HseFileFolder::getProjectId, dto.getProjectId()) .like(HseFileFolder::getPath, "," + dto.getParentId() + ",") // 包含父ID的所有子项 .eq(dto.getType()!=null,HseFileFolder::getType, dto.getType()) .orderByDesc(HseFileFolder::getId) @@ -122,8 +125,25 @@ public class HseFileFolderController extends BaseController { return R.ok(hseFileFolderService.moveFileOrFolder(dto.getId(), dto.getTargetParentId())); } + /** + * 上传ZIP文件并自动解压到指定目录(支持多层级) + */ + @PostMapping("/uploadAndUnzip") + public R uploadAndUnzip( + @RequestParam("file") MultipartFile file, + @RequestParam("parentId") Long parentId, + @RequestParam("projectId") Long projectId) { - + try { + // 实际应用中,userId和deptId通常从登录信息中获取 + String result = hseFileFolderService.uploadAndUnzip(file, parentId, projectId); + return R.ok(result); + } catch (IllegalArgumentException e) { + return R.fail(e.getMessage()); + } catch (Exception e) { + return R.fail("文件处理失败:" + e.getMessage()); + } + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/FileFolderCreateDTO.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/FileFolderCreateDTO.java index ed883521..6761b24b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/FileFolderCreateDTO.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/FileFolderCreateDTO.java @@ -16,6 +16,8 @@ public class FileFolderCreateDTO { @NotBlank(message = "名称不能为空") private String name; + private Long projectId; + /** * 父级ID(0表示根目录) */ @@ -32,6 +34,12 @@ public class FileFolderCreateDTO { */ private Integer sort=0; + + /** + * 文件id + */ + private Long fileId; + /** * 文件后缀 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/ListQueryDto.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/ListQueryDto.java index b0f9a631..fa43cee7 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/ListQueryDto.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/fileFolder/ListQueryDto.java @@ -19,4 +19,8 @@ public class ListQueryDto { private Integer type; + @NotNull(message = "项目不能为空") + private Long projectId; + + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseFileFolderService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseFileFolderService.java index 178923bf..07fb38de 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseFileFolderService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseFileFolderService.java @@ -9,6 +9,8 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.PageQuery; import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; + import java.util.Collection; import java.util.List; @@ -87,4 +89,15 @@ public interface IHseFileFolderService extends IService{ * 移动文件或文件夹到指定目录 */ boolean moveFileOrFolder(Long id, Long targetParentId); + + /** + * 上传并解压ZIP文件 + */ + String uploadAndUnzip(MultipartFile file, Long parentId, Long projectId) throws Exception; + + /** + * 获取指定目录的树形结构(一次性加载所有层级) + * @return 树形结构列表 + */ + String unzip(Long id, Long parentId); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseFileFolderServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseFileFolderServiceImpl.java index 5f3cb302..9375b72e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseFileFolderServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseFileFolderServiceImpl.java @@ -19,11 +19,14 @@ import org.dromara.safety.domain.HseFileFolder; import org.dromara.safety.mapper.HseFileFolderMapper; import org.dromara.safety.service.IHseFileFolderService; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.io.File; +import java.io.FileInputStream; +import java.nio.charset.Charset; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; /** * 会议纪要Service业务层处理 @@ -44,7 +47,7 @@ public class HseFileFolderServiceImpl extends ServiceImpl ids, Boolean isValid) { - if(isValid){ + if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 } return baseMapper.deleteByIds(ids) > 0; @@ -151,8 +154,9 @@ public class HseFileFolderServiceImpl extends ServiceImpl folderQuery = Wrappers.lambdaQuery(); + folderQuery.eq(HseFileFolder::getProjectId, projectId) + .eq(HseFileFolder::getParentId, currentParentId) + .eq(HseFileFolder::getName, folderName) + .eq(HseFileFolder::getType, 1); // 文件夹类型 + + HseFileFolder existingFolder = getOne(folderQuery); + + if (existingFolder == null) { + // 创建新的文件夹 + HseFileFolder newFolder = new HseFileFolder(); + newFolder.setProjectId(projectId); + newFolder.setName(folderName); + newFolder.setParentId(currentParentId); + newFolder.setType(1); // 文件夹 + newFolder.setLevel(parentLevel + i + 1); + newFolder.setSort(0); + newFolder.setPath(currentPath); + + // 先保存获取ID + save(newFolder); + + // 更新路径,格式为 ,parentId,childId, + newFolder.setPath(currentPath + newFolder.getId() + ","); + updateById(newFolder); + + currentParentId = newFolder.getId(); + currentPath = newFolder.getPath(); + folderCount++; + } else { + currentParentId = existingFolder.getId(); + currentPath = existingFolder.getPath(); + } + } + + // 创建文件记录 + HseFileFolder fileRecord = new HseFileFolder(); + fileRecord.setProjectId(projectId); + fileRecord.setName(fileName); + fileRecord.setParentId(currentParentId); + fileRecord.setType(2); // 文件类型 + fileRecord.setLevel(parentLevel + pathParts.length); + // 文件路径格式为 ,parentId,fileId, + fileRecord.setPath(currentPath + fileRecord.getId() + ","); + + // 设置文件扩展名 + int dotIndex = fileName.lastIndexOf("."); + if (dotIndex > 0 && dotIndex < fileName.length() - 1) { + fileRecord.setFileSuffix(fileName.substring(dotIndex + 1)); + } + + // TODO: 这里应该与实际文件存储服务集成,设置真实的文件路径 + fileRecord.setFilePath(""); // 实际应用中应设置真实文件存储路径 + + save(fileRecord); + + // 更新文件的路径(因为ID是自增的,需要先保存再更新路径) + fileRecord.setPath(currentPath + fileRecord.getId() + ","); + updateById(fileRecord); + + fileCount++; + + zis.closeEntry(); + } + } + + return String.format("解压完成,共创建 %d 个文件夹,%d 个文件", folderCount, fileCount); + } + + + @Override + @Transactional + public String unzip(Long id, Long parentId) { + // 1. 参数验证 + if (id == null) { + throw new ServiceException("文件ID不能为空"); + } + + // 2. 获取要解压的ZIP文件 + HseFileFolder zipFile = getById(id); + if (zipFile == null) { + throw new ServiceException("指定的文件不存在"); + } + + // 3. 验证是否为ZIP文件 + if (!"zip".equalsIgnoreCase(zipFile.getFileSuffix())) { + throw new ServiceException("只能解压ZIP格式的文件"); + } + + // 4. 验证文件路径是否存在 + if (StringUtils.isBlank(zipFile.getFilePath())) { + throw new ServiceException("文件存储路径不存在"); + } + + // 5. 验证目标目录是否存在且为文件夹 + HseFileFolder parentFolder = null; + if (parentId != null && parentId != 0) { + parentFolder = getById(parentId); + if (parentFolder == null || parentFolder.getType() != 1) { + throw new ServiceException("指定的目标目录不存在或不是文件夹"); + } + } + + // 6. 下载ZIP文件到临时位置 + try { + // 从URL下载文件 + String fileUrl = zipFile.getFilePath(); + File tempZipFile = downloadFileToTemp(fileUrl); + + if (tempZipFile == null || !tempZipFile.exists()) { + throw new ServiceException("下载文件失败"); + } + + try { + // 7. 解压ZIP文件 + String unzipResult = doUnzipFile(tempZipFile, parentId, zipFile.getProjectId(), parentFolder); + return unzipResult; + } finally { + // 8. 清理临时文件 + if (tempZipFile.exists()) { + tempZipFile.delete(); + } + } + } catch (Exception e) { + throw new ServiceException("解压文件失败: " + e.getMessage()); + } + } + + /** + * 从URL下载文件到临时位置 + * + * @param fileUrl 文件URL + * @return 临时文件 + * @throws Exception 下载过程中的异常 + */ + private File downloadFileToTemp(String fileUrl) throws Exception { + // 创建临时文件 + File tempFile = File.createTempFile("download_", ".zip"); + + // 使用Apache HttpClient或其他HTTP客户端下载文件 + // 这里简化处理,实际项目中应根据具体文件存储服务实现 + + // 示例实现(需要根据实际文件存储服务调整): + /* + try (CloseableHttpClient httpClient = HttpClients.createDefault()) { + HttpGet httpGet = new HttpGet(fileUrl); + try (CloseableHttpResponse response = httpClient.execute(httpGet)) { + HttpEntity entity = response.getEntity(); + if (entity != null) { + try (InputStream inputStream = entity.getContent(); + FileOutputStream outputStream = new FileOutputStream(tempFile)) { + byte[] buffer = new byte[8192]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + } + } + } + } + */ + + // 如果使用MinIO或其他存储服务,需要相应调整实现 + + // 占位实现,实际需要根据文件存储服务来实现 + throw new ServiceException("未实现文件下载功能,请根据实际文件存储服务完善此方法"); + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/safety/HseFileFolderMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/safety/HseFileFolderMapper.xml index 2745bb26..f5b9356b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/safety/HseFileFolderMapper.xml +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/safety/HseFileFolderMapper.xml @@ -13,6 +13,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time = NOW() WHERE path LIKE CONCAT(#{oldPath}, '%') - AND parent_id != #{parentId} + AND id != #{parentId} From d92d37c6460cea095be1b82e6bdb6d10fc4987d3 Mon Sep 17 00:00:00 2001 From: dfdg <2710245601@qq.com> Date: Wed, 15 Oct 2025 21:59:27 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8Ews=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectBigScreenController.java | 10 ++++++++++ .../bigscreen/domain/dto/ProjectUpdateDto.java | 16 ++++++++++++++++ .../bigscreen/listener/RedisMessageListener.java | 6 +++--- .../service/impl/GpsEquipmentServiceImpl.java | 10 +++++----- .../org/dromara/project/domain/BusProject.java | 6 ++++++ .../domain/dto/project/BusProjectCreateReq.java | 5 +++++ .../domain/dto/project/BusProjectUpdateReq.java | 5 +++++ .../project/domain/vo/project/BusProjectVo.java | 3 +++ .../project/service/IBusProjectService.java | 3 +++ .../service/impl/BusProjectServiceImpl.java | 11 +++++++++++ .../dromara/system/service/ISysUserService.java | 2 ++ .../system/service/impl/SysUserServiceImpl.java | 6 ++++++ .../IXzdPurchaseContractInformationService.java | 2 ++ 13 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/dto/ProjectUpdateDto.java diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java index 3a873c37..c6f51585 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import jakarta.annotation.Resource; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; +import org.dromara.bigscreen.domain.dto.ProjectUpdateDto; import org.dromara.bigscreen.domain.dto.TanchuangInfoReq; import org.dromara.bigscreen.domain.dto.Ys7DeviceUpdateReq; import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo; @@ -402,6 +403,15 @@ public class ProjectBigScreenController extends BaseController { return R.ok(projectService.getProjectMapList()); } + /** + * 查询地图项目分类 + */ + @SaCheckPermission("project:big:screen") + @PostMapping("/updatePosition") + public R updatePosition(@RequestBody ProjectUpdateDto dto) { + return toAjax(projectService.updatePosition(dto)); + } + /** * 查询项目地域分散图 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/dto/ProjectUpdateDto.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/dto/ProjectUpdateDto.java new file mode 100644 index 00000000..26e93cb2 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/dto/ProjectUpdateDto.java @@ -0,0 +1,16 @@ +package org.dromara.bigscreen.domain.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +public class ProjectUpdateDto implements Serializable { + + + private Long projectId; // 项目id + + private String position; // 图片 + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/listener/RedisMessageListener.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/listener/RedisMessageListener.java index e91a41f7..90b6ab33 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/listener/RedisMessageListener.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/listener/RedisMessageListener.java @@ -80,12 +80,12 @@ public class RedisMessageListener implements MessageListener { private String buildPushMessage(String key, String message, Long projectId) { JSONObject messageObj = new JSONObject(); messageObj.put("type", "wrj_DATA_UPDATE"); - messageObj.put("projectId",projectId); + messageObj.put("projectId",projectId.toString()); messageObj.put("clientId",key); // 位置信息 JSONObject locationObj = new JSONObject(); - locationObj.put("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude")); // 纬度 - locationObj.put("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude")); // 经度 + locationObj.put("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude").toString()); // 纬度 + locationObj.put("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude").toString()); // 经度 messageObj.put("location", locationObj); return messageObj.toString(); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/GpsEquipmentServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/GpsEquipmentServiceImpl.java index 480ca088..98e54505 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/GpsEquipmentServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/GpsEquipmentServiceImpl.java @@ -272,14 +272,14 @@ public class GpsEquipmentServiceImpl extends ServiceImpl punchrangeList; + /** + * 位置信息 + */ + private String position; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/project/BusProjectVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/project/BusProjectVo.java index 3585b6b8..f0240958 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/project/BusProjectVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/project/BusProjectVo.java @@ -209,4 +209,7 @@ public class BusProjectVo implements Serializable { */ private String projectGeneralize; + + private String position; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectService.java index 9a34b7bd..dc1278d4 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectService.java @@ -3,6 +3,7 @@ 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.bigscreen.domain.dto.ProjectUpdateDto; import org.dromara.bigscreen.domain.dto.TanchuangInfoReq; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -239,4 +240,6 @@ public interface IBusProjectService extends IService { Map> getProjectCapacity(); Map> getInfoData(TanchuangInfoReq req); + + Boolean updatePosition(ProjectUpdateDto dto); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusProjectServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusProjectServiceImpl.java index 14c2f80f..84831ccc 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusProjectServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusProjectServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.PhoneUtil; import cn.hutool.core.util.RandomUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -14,6 +15,7 @@ import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; +import org.dromara.bigscreen.domain.dto.ProjectUpdateDto; import org.dromara.bigscreen.domain.dto.TanchuangInfoReq; import org.dromara.common.core.constant.CacheNames; import org.dromara.common.core.constant.HttpStatus; @@ -1184,6 +1186,7 @@ public class BusProjectServiceImpl extends ServiceImpl map2 = new HashMap<>(); map2.put("lng", project.getLng()); map2.put("lat", project.getLat()); + map2.put("position",project.getPosition()); map2.put("projectId", project.getId().toString()); map1.put(project.getProjectName(), map2); //当满足条件时删除该元素 @@ -1240,6 +1243,14 @@ public class BusProjectServiceImpl extends ServiceImpl().set(BusProject::getPosition, dto.getPosition()).eq(BusProject::getId, dto.getProjectId())) >0; + } + /** * 构造分项工程树 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java index 3a731768..e8635461 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java @@ -280,4 +280,6 @@ public interface ISysUserService { List selectUserByRoleIdAndProjectId(Long roleId,Long projectId); List selectUserByRoleIdsAndProjectId(List roleIds,Long projectId); + + String queryNameById(Long id); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java index fd53fa3a..dfe19444 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java @@ -1272,6 +1272,12 @@ public class SysUserServiceImpl implements ISysUserService, UserService { return List.of(); } + @Override + public String queryNameById(Long id) { + SysUserVo sysUserVo = baseMapper.selectVoById(id); + return sysUserVo != null ? sysUserVo.getNickName() : null; + } + @Override public UserDTO selectUser(Long userId) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/IXzdPurchaseContractInformationService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/IXzdPurchaseContractInformationService.java index 5bec8c1c..85bdd48f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/IXzdPurchaseContractInformationService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/IXzdPurchaseContractInformationService.java @@ -69,4 +69,6 @@ public interface IXzdPurchaseContractInformationService extends IService ids, Boolean isValid); + + String queryCodeById(Long id); } From d8838f8e01c63cafa39fcc60989452cb8ad68150 Mon Sep 17 00:00:00 2001 From: dfdg <2710245601@qq.com> Date: Wed, 15 Oct 2025 22:01:22 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=90=88=E5=90=8C?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/vo/XzdCsContractChangeVo.java | 3 + .../impl/XzdCsContractChangeServiceImpl.java | 15 ++ ...urchaseContractInformationServiceImpl.java | 5 + .../controller/XzdJsCgJinduController.java | 2 +- .../controller/XzdJsCgJungonController.java | 2 +- .../XzdJsCgJungonEditController.java | 2 +- .../controller/XzdJsZhfwJinduController.java | 2 +- .../settlement/domain/XzdJsCgJungonEdit.java | 9 +- .../xzd/settlement/domain/XzdJsZhfwJindu.java | 7 + .../settlement/domain/bo/XzdJsCgJinduBo.java | 6 +- .../settlement/domain/bo/XzdJsCgJungonBo.java | 8 +- .../domain/bo/XzdJsCgJungonEditBo.java | 13 +- .../domain/bo/XzdJsZhfwJinduBo.java | 12 +- .../settlement/domain/vo/XzdJsCgJinduVo.java | 6 +- .../domain/vo/XzdJsCgJungonEditVo.java | 18 +- .../settlement/domain/vo/XzdJsCgJungonVo.java | 6 +- .../domain/vo/XzdJsZhfwJinduVo.java | 10 +- .../service/impl/XzdJsCgJinduServiceImpl.java | 82 ++++++++- .../impl/XzdJsCgJungonEditServiceImpl.java | 128 +++++++++++++- .../impl/XzdJsCgJungonServiceImpl.java | 165 +++++++++++++++++- .../impl/XzdJsZhfwJinduServiceImpl.java | 56 ++++++ 21 files changed, 518 insertions(+), 39 deletions(-) diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/domain/vo/XzdCsContractChangeVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/domain/vo/XzdCsContractChangeVo.java index 9c24fdb6..8ba4c07c 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/domain/vo/XzdCsContractChangeVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/domain/vo/XzdCsContractChangeVo.java @@ -172,18 +172,21 @@ public class XzdCsContractChangeVo implements Serializable { */ @ExcelProperty(value = "变更后项目经理") private Long afterChangeProjectManager; + private String afterChangeProjectManagerName; /** * 变更后项目责任人 */ @ExcelProperty(value = "变更后项目责任人") private Long afterChangeProjectLeader; + private String afterChangeProjectLeaderName; /** * 变更后现场经理 */ @ExcelProperty(value = "变更后现场经理") private Long afterChangeSiteManager; + private String afterChangeSiteManagerName; /** * 变更后合同备注 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/service/impl/XzdCsContractChangeServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/service/impl/XzdCsContractChangeServiceImpl.java index 5ee34a13..a55c573c 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/service/impl/XzdCsContractChangeServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/comprehensive/service/impl/XzdCsContractChangeServiceImpl.java @@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import org.dromara.system.domain.vo.SysDeptVo; +import org.dromara.system.service.ISysUserService; import org.dromara.system.service.impl.SysDeptServiceImpl; import org.dromara.system.service.impl.SysOssServiceImpl; import org.dromara.xzd.comprehensive.domain.XzdCsContractInformation; @@ -56,6 +57,8 @@ public class XzdCsContractChangeServiceImpl extends ServiceImpl 0; } + @Override + public String queryCodeById(Long id) { + return baseMapper.selectVoById(id).getContractCode(); + } + public void setValue(List infos){ for (XzdPurchaseContractInformationVo item : infos) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJinduController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJinduController.java index c3e34322..54335a28 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJinduController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJinduController.java @@ -61,7 +61,7 @@ public class XzdJsCgJinduController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("settlement:jsCgJindu:query") +// @SaCheckPermission("settlement:jsCgJindu:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonController.java index 3b8a98fa..b67c261c 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonController.java @@ -61,7 +61,7 @@ public class XzdJsCgJungonController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("settlement:jsCgJungon:query") +// @SaCheckPermission("settlement:jsCgJungon:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonEditController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonEditController.java index 2bd5a708..0867cecf 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonEditController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsCgJungonEditController.java @@ -61,7 +61,7 @@ public class XzdJsCgJungonEditController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("settlement:jsCgJungonEdit:query") +// @SaCheckPermission("settlement:jsCgJungonEdit:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsZhfwJinduController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsZhfwJinduController.java index 120ea8bf..fdc1dc76 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsZhfwJinduController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/controller/XzdJsZhfwJinduController.java @@ -61,7 +61,7 @@ public class XzdJsZhfwJinduController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("settlement:jsZhfwJindu:query") +// @SaCheckPermission("settlement:jsZhfwJindu:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsCgJungonEdit.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsCgJungonEdit.java index 5a08b92d..bfa32c79 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsCgJungonEdit.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsCgJungonEdit.java @@ -47,7 +47,7 @@ public class XzdJsCgJungonEdit extends BaseEntity { /** * 决算单号(带*,必填) */ - private String finalAccountCode; + private Long finalAccountCode; /** * 合同名称 @@ -57,7 +57,7 @@ public class XzdJsCgJungonEdit extends BaseEntity { /** * 合同编号 */ - private String contractCode; + private Long contractCode; /** * 调整后决算金额(带*,必填) @@ -89,5 +89,10 @@ public class XzdJsCgJungonEdit extends BaseEntity { */ private String procurementMode; + /** + * 文件ID + */ + private String fileId; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsZhfwJindu.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsZhfwJindu.java index 4ef772f3..d62615b4 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsZhfwJindu.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/XzdJsZhfwJindu.java @@ -1,5 +1,8 @@ package org.dromara.xzd.settlement.domain; +import jakarta.validation.constraints.NotNull; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; @@ -63,6 +66,10 @@ public class XzdJsZhfwJindu extends BaseEntity { * 计量开始 */ private LocalDate measureStart; + /** + * 计量结束 + */ + private LocalDate measureEnd; /** * 审批金额 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJinduBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJinduBo.java index 4a028a1b..55c94d70 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJinduBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJinduBo.java @@ -35,7 +35,7 @@ public class XzdJsCgJinduBo extends BaseEntity { /** * 单据编码(带*,必填) */ - @NotBlank(message = "单据编码(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "单据编码(带*,必填)不能为空", groups = {EditGroup.class }) private String docCode; /** @@ -53,6 +53,7 @@ public class XzdJsCgJinduBo extends BaseEntity { /** * 合同编码(带查询,关联合同表) */ + @NotNull(message = "合同编码不能为空", groups = { AddGroup.class, EditGroup.class }) private Long contractCode; /** @@ -75,12 +76,13 @@ public class XzdJsCgJinduBo extends BaseEntity { /** * 项目(带*,必填) */ - @NotBlank(message = "项目(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotNull(message = "项目(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) private Long project; /** * 审批金额(默认0.00) */ + @NotNull(message = "审批金额不能为空", groups = { AddGroup.class, EditGroup.class }) private BigDecimal approveAmount; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonBo.java index b092d629..2849b567 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonBo.java @@ -8,8 +8,11 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; + import java.math.BigDecimal; import java.time.LocalDate; +import java.util.List; /** * 采购合同竣工结算业务对象 xzd_js_cg_jungon @@ -31,7 +34,7 @@ public class XzdJsCgJungonBo extends BaseEntity { /** * 单据编号(带*,必填) */ - @NotBlank(message = "单据编号(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "单据编号(带*,必填)不能为空", groups = {EditGroup.class }) private String docCode; /** @@ -49,6 +52,7 @@ public class XzdJsCgJungonBo extends BaseEntity { /** * 合同编号(带*,关联合同表) */ + @NotNull(message = "合同编号不能为空", groups = { AddGroup.class, EditGroup.class }) private Long contractCode; /** @@ -142,5 +146,7 @@ public class XzdJsCgJungonBo extends BaseEntity { */ private String fileId; + List kkyjlx; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonEditBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonEditBo.java index 595eca8d..6a91e0eb 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonEditBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsCgJungonEditBo.java @@ -8,8 +8,11 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; + import java.math.BigDecimal; import java.time.LocalDate; +import java.util.List; /** * 采购合同竣工结算调整业务对象 xzd_js_cg_jungon_edit @@ -31,7 +34,7 @@ public class XzdJsCgJungonEditBo extends BaseEntity { /** * 单据编号(带*,必填) */ - @NotBlank(message = "单据编号(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "单据编号(带*,必填)不能为空", groups = { EditGroup.class }) private String docCode; /** @@ -60,7 +63,7 @@ public class XzdJsCgJungonEditBo extends BaseEntity { /** * 合同编号 */ - private String contractCode; + private Long contractCode; /** * 调整后决算金额(带*,必填) @@ -94,5 +97,11 @@ public class XzdJsCgJungonEditBo extends BaseEntity { */ private String procurementMode; + /** + * 文件ID + */ + private String fileId; + + List kkyjlx; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsZhfwJinduBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsZhfwJinduBo.java index 5be284fc..84a4e75a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsZhfwJinduBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/bo/XzdJsZhfwJinduBo.java @@ -1,5 +1,6 @@ package org.dromara.xzd.settlement.domain.bo; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; import org.dromara.xzd.settlement.domain.XzdJsZhfwJindu; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; @@ -10,6 +11,7 @@ import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; import java.math.BigDecimal; import java.time.LocalDate; +import java.util.List; /** * 综合服务合同进度结算业务对象 xzd_js_zhfw_jindu @@ -31,7 +33,7 @@ public class XzdJsZhfwJinduBo extends BaseEntity { /** * 单据编码(带*,必填) */ - @NotBlank(message = "单据编码(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotBlank(message = "单据编码(带*,必填)不能为空", groups = { EditGroup.class }) private String docCode; /** @@ -49,6 +51,7 @@ public class XzdJsZhfwJinduBo extends BaseEntity { /** * 合同编码 */ + @NotNull(message = "合同编码不能为空", groups = { AddGroup.class, EditGroup.class }) private Long contractCode; /** @@ -65,7 +68,13 @@ public class XzdJsZhfwJinduBo extends BaseEntity { /** * 计量开始 */ + @NotNull(message = "计量开始不能为空", groups = { AddGroup.class, EditGroup.class }) private LocalDate measureStart; + /** + * 计量结束 + */ + @NotNull(message = "计量结束不能为空", groups = { AddGroup.class, EditGroup.class }) + private LocalDate measureEnd; /** * 审批金额 @@ -157,5 +166,6 @@ public class XzdJsZhfwJinduBo extends BaseEntity { */ private String fileId; + List kkyjlx; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJinduVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJinduVo.java index 0e0a1712..534282eb 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJinduVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJinduVo.java @@ -8,12 +8,13 @@ import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; import java.io.Serial; import java.io.Serializable; import java.time.LocalDate; import java.util.Date; - +import java.util.List; /** @@ -63,6 +64,7 @@ public class XzdJsCgJinduVo implements Serializable { @ExcelProperty(value = "合同编码", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "带=查询,关联合同表") private Long contractCode; + private String contractCodeName; /** * 合同名称(关联合同后显示) @@ -218,5 +220,5 @@ public class XzdJsCgJinduVo implements Serializable { @ExcelProperty(value = "文件ID") private String fileId; - + List kkyjlx; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java index c15d1b93..3b420dfa 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java @@ -8,12 +8,13 @@ import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; import java.io.Serial; import java.io.Serializable; import java.time.LocalDate; import java.util.Date; - +import java.util.List; /** @@ -62,7 +63,7 @@ public class XzdJsCgJungonEditVo implements Serializable { */ @ExcelProperty(value = "决算单号", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "带=*,必填") - private String finalAccountCode; + private Long finalAccountCode; /** * 合同名称 @@ -74,7 +75,9 @@ public class XzdJsCgJungonEditVo implements Serializable { * 合同编号 */ @ExcelProperty(value = "合同编号") - private String contractCode; + private Long contractCode; + private String contractCodeName; + /** * 调整后决算金额(带*,必填) @@ -89,12 +92,14 @@ public class XzdJsCgJungonEditVo implements Serializable { @ExcelProperty(value = "工程项目", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "带=*,必填") private Long projectId; + private String projectName; /** * 默认财务组织 */ @ExcelProperty(value = "默认财务组织") private Long defaultFinanceOrg; + private String defaultFinanceOrgName; /** * 调整说明 @@ -114,5 +119,12 @@ public class XzdJsCgJungonEditVo implements Serializable { @ExcelProperty(value = "集采模式") private String procurementMode; + /** + * 文件ID + */ + private String fileId; + + List kkyjlx; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonVo.java index 03c74884..b0c400c3 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonVo.java @@ -8,12 +8,13 @@ import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; import java.io.Serial; import java.io.Serializable; import java.time.LocalDate; import java.util.Date; - +import java.util.List; /** @@ -63,6 +64,7 @@ public class XzdJsCgJungonVo implements Serializable { @ExcelProperty(value = "合同编号", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "带=*,关联合同表") private Long contractCode; + private String contractCodeName; /** * 合同名称(关联合同后显示) @@ -186,5 +188,7 @@ public class XzdJsCgJungonVo implements Serializable { @ExcelProperty(value = "文件ID") private String fileId; + List kkyjlx; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsZhfwJinduVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsZhfwJinduVo.java index dce075ff..f77ab1f5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsZhfwJinduVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsZhfwJinduVo.java @@ -1,6 +1,8 @@ package org.dromara.xzd.settlement.domain.vo; import java.math.BigDecimal; + +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; import org.dromara.xzd.settlement.domain.XzdJsZhfwJindu; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; @@ -13,7 +15,7 @@ import java.io.Serial; import java.io.Serializable; import java.time.LocalDate; import java.util.Date; - +import java.util.List; /** @@ -82,6 +84,11 @@ public class XzdJsZhfwJinduVo implements Serializable { @ExcelProperty(value = "计量开始") private LocalDate measureStart; + /** + * 计量结束 + */ + private LocalDate measureEnd; + /** * 审批金额 */ @@ -192,5 +199,6 @@ public class XzdJsZhfwJinduVo implements Serializable { @ExcelProperty(value = "文件ID") private String fileId; + List kkyjlx; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJinduServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJinduServiceImpl.java index fa55e401..df315fdd 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJinduServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJinduServiceImpl.java @@ -12,7 +12,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import org.dromara.common.utils.BatchNumberGenerator; +import org.dromara.system.service.impl.SysOssServiceImpl; import org.dromara.xzd.comprehensive.domain.vo.XzdCsContractChangeVo; +import org.dromara.xzd.comprehensive.domain.vo.XzdCsContractInformationVo; +import org.dromara.xzd.contractManagement.purchaseManagement.service.IXzdPurchaseContractInformationService; import org.dromara.xzd.domain.XzdContractClause; import org.dromara.xzd.domain.XzdDeductionItems; import org.dromara.xzd.domain.XzdSettlementRules; @@ -31,10 +34,9 @@ import org.dromara.xzd.settlement.domain.vo.XzdJsCgJinduVo; import org.dromara.xzd.settlement.domain.XzdJsCgJindu; import org.dromara.xzd.settlement.mapper.XzdJsCgJinduMapper; import org.dromara.xzd.settlement.service.IXzdJsCgJinduService; +import org.springframework.transaction.annotation.Transactional; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; /** * 采购合同进度结算Service业务层处理 @@ -48,11 +50,20 @@ public class XzdJsCgJinduServiceImpl extends ServiceImpl 0; if (flag) { bo.setId(add.getId()); @@ -167,9 +180,24 @@ public class XzdJsCgJinduServiceImpl extends ServiceImpl().eq(XzdJsDeductionItems::getMainDocId, update.getId())); + //生成奖励与扣款数据 + String tableName = XzdClassEnum.JS_CG_JINDU.getClassName(); + if (bo.getKkyjlx() == null || bo.getKkyjlx().isEmpty()) { + throw new ServiceException("扣款与奖励项不能为空"); + } + //合同条款-扣款与奖励项 + for (XzdJsDeductionItems kkyjlx : bo.getKkyjlx()) { + kkyjlx.setTableName(tableName); + kkyjlx.setMainDocId(update.getId()); + } + //新增奖励与扣款数据 + deductionItemsService.saveBatch(bo.getKkyjlx()); return baseMapper.updateById(update) > 0; } @@ -188,10 +216,26 @@ public class XzdJsCgJinduServiceImpl extends ServiceImpl ids, Boolean isValid) { if(isValid){ //TODO 做一些业务上的校验,判断是否需要校验 } + List deleteIds = new ArrayList<>(); + for (Long id : ids) { + XzdJsCgJinduVo vo = baseMapper.selectVoById(id); + if (vo != null){ + //删除附件 + if (vo.getFileId()!= null && !vo.getFileId().isEmpty()){ + List list = Arrays.stream(vo.getFileId().split(",")).map(Long::valueOf).toList(); + deleteIds.addAll(list); + } + } + } + if (!deleteIds.isEmpty()) { + sysOssService.deleteWithValidByIds(deleteIds, false); + } + deductionItemsService.remove(new LambdaQueryWrapper().in(XzdJsDeductionItems::getMainDocId, ids)); return baseMapper.deleteByIds(ids) > 0; } @@ -207,12 +251,32 @@ public class XzdJsCgJinduServiceImpl extends ServiceImpl dtoR = iXzdCorrespondentList.getCustomerByid(item.getSettlementUnit()); - if (dtoR!=null){ - if (dtoR.getData().getXzdCustomerinformation() != null){ - item.setSettlementUnitName(dtoR.getData().getXzdCustomerinformation().getUnitName()); + if (item.getSettlementUnit() != null){ + String name = iXzdCorrespondentList.queryNameById(item.getSettlementUnit()); + if (name!=null){ + item.setSettlementUnitName(name); + } } } + + /** + * 获取结算扣款与奖励项内容 + * @param vo + */ + private void getHttk(XzdJsCgJinduVo vo) { + //结算扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.eq(XzdJsDeductionItems::getMainDocId, vo.getId()); + List list = deductionItemsService.list(lambdaQueryWrapper2); + vo.setKkyjlx(list); + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java index c0a1d14c..99c93622 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.xzd.settlement.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +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.TableDataInfo; @@ -9,6 +10,20 @@ 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.utils.BatchNumberGenerator; +import org.dromara.system.domain.vo.SysDeptVo; +import org.dromara.system.service.impl.SysDeptServiceImpl; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.purchaseManagement.service.IXzdPurchaseContractInformationService; +import org.dromara.xzd.enums.XzdClassEnum; +import org.dromara.xzd.service.IXzdCorrespondentList; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; +import org.dromara.xzd.settlement.domain.vo.XzdJsCgJinduVo; +import org.dromara.xzd.settlement.domain.vo.XzdJsCgJungonVo; +import org.dromara.xzd.settlement.service.IXzdJsDeductionItemsService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.dromara.xzd.settlement.domain.bo.XzdJsCgJungonEditBo; import org.dromara.xzd.settlement.domain.vo.XzdJsCgJungonEditVo; @@ -16,9 +31,7 @@ import org.dromara.xzd.settlement.domain.XzdJsCgJungonEdit; import org.dromara.xzd.settlement.mapper.XzdJsCgJungonEditMapper; import org.dromara.xzd.settlement.service.IXzdJsCgJungonEditService; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; /** * 采购合同竣工结算调整Service业务层处理 @@ -32,6 +45,23 @@ public class XzdJsCgJungonEditServiceImpl extends ServiceImpl queryPageList(XzdJsCgJungonEditBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + result.getRecords().forEach(this::getName); return TableDataInfo.build(result); } @@ -66,7 +100,9 @@ public class XzdJsCgJungonEditServiceImpl extends ServiceImpl queryList(XzdJsCgJungonEditBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List vos = baseMapper.selectVoList(lqw); + vos.forEach(this::getName); + return vos; } private LambdaQueryWrapper buildQueryWrapper(XzdJsCgJungonEditBo bo) { @@ -78,7 +114,7 @@ public class XzdJsCgJungonEditServiceImpl extends ServiceImpl 0; if (flag) { bo.setId(add.getId()); } + String tableName = XzdClassEnum.JS_CG_JUNGON.getClassName(); + if (bo.getKkyjlx() == null || bo.getKkyjlx().isEmpty()) { + throw new ServiceException("扣款与奖励项不能为空"); + } + //合同条款-扣款与奖励项 + for (XzdJsDeductionItems kkyjlx : bo.getKkyjlx()) { + kkyjlx.setTableName(tableName); + kkyjlx.setMainDocId(add.getId()); + } + deductionItemsService.saveBatch(bo.getKkyjlx()); return flag; } @@ -114,6 +162,20 @@ public class XzdJsCgJungonEditServiceImpl extends ServiceImpl().eq(XzdJsDeductionItems::getMainDocId, update.getId())); + //生成奖励与扣款数据 + String tableName = XzdClassEnum.JS_CG_JUNGON.getClassName(); + if (bo.getKkyjlx() == null || bo.getKkyjlx().isEmpty()) { + throw new ServiceException("扣款与奖励项不能为空"); + } + //合同条款-扣款与奖励项 + for (XzdJsDeductionItems kkyjlx : bo.getKkyjlx()) { + kkyjlx.setTableName(tableName); + kkyjlx.setMainDocId(update.getFinalAccountCode()); + } + //新增奖励与扣款数据 + deductionItemsService.saveBatch(bo.getKkyjlx()); return baseMapper.updateById(update) > 0; } @@ -136,6 +198,60 @@ public class XzdJsCgJungonEditServiceImpl extends ServiceImpl deleteIds = new ArrayList<>(); + for (Long id : ids) { + XzdJsCgJungonEditVo vo = baseMapper.selectVoById(id); + if (vo != null){ + //删除附件 + if (vo.getFileId()!= null && !vo.getFileId().isEmpty()){ + List list = Arrays.stream(vo.getFileId().split(",")).map(Long::valueOf).toList(); + deleteIds.addAll(list); + } + } + } + if (!deleteIds.isEmpty()) { + sysOssService.deleteWithValidByIds(deleteIds, false); + } return baseMapper.deleteByIds(ids) > 0; } + + /** + * 获取部分字段名称 + * @param item + */ + private void getName(XzdJsCgJungonEditVo item) { + //项目名称 + if (item.getProjectId() != null){ + String projectName = xzdProjectService.queryNameById(item.getProjectId()); + if (projectName != null){ + item.setProjectName(projectName); + } + } + //合同编码 + if (item.getContractCode() != null){ + String code = xzdPurchaseContractInformationService.queryCodeById(item.getContractCode()); + if (code != null){ + item.setContractCodeName(code); + } + } + //部门名称 + if (item.getDefaultFinanceOrg() != null){ + SysDeptVo sysDeptVo = sysDeptService.selectDeptById(item.getDefaultFinanceOrg()); + if (sysDeptVo != null){ + item.setDefaultFinanceOrgName(sysDeptVo.getDeptName()); + } + } + } + + /** + * 获取扣款与奖励项 + * @param vo + */ + private void getHttk(XzdJsCgJungonEditVo vo) { + //结算扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.eq(XzdJsDeductionItems::getMainDocId, vo.getId()); + List list = deductionItemsService.list(lambdaQueryWrapper2); + vo.setKkyjlx(list); + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonServiceImpl.java index 71360c22..e6b2102f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.xzd.settlement.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +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.TableDataInfo; @@ -9,16 +10,26 @@ 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.utils.BatchNumberGenerator; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.purchaseManagement.service.IXzdPurchaseContractInformationService; +import org.dromara.xzd.enums.XzdClassEnum; +import org.dromara.xzd.service.IXzdCorrespondentList; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; +import org.dromara.xzd.settlement.domain.vo.XzdJsCgJinduVo; +import org.dromara.xzd.settlement.service.IXzdJsDeductionItemsService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.dromara.xzd.settlement.domain.bo.XzdJsCgJungonBo; import org.dromara.xzd.settlement.domain.vo.XzdJsCgJungonVo; import org.dromara.xzd.settlement.domain.XzdJsCgJungon; import org.dromara.xzd.settlement.mapper.XzdJsCgJungonMapper; import org.dromara.xzd.settlement.service.IXzdJsCgJungonService; +import org.springframework.transaction.annotation.Transactional; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; /** * 采购合同竣工结算Service业务层处理 @@ -32,6 +43,24 @@ public class XzdJsCgJungonServiceImpl extends ServiceImpl queryPageList(XzdJsCgJungonBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + result.getRecords().forEach(this::getName); return TableDataInfo.build(result); } @@ -66,7 +99,9 @@ public class XzdJsCgJungonServiceImpl extends ServiceImpl queryList(XzdJsCgJungonBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List vos = baseMapper.selectVoList(lqw); + vos.forEach(this::getName); + return vos; } private LambdaQueryWrapper buildQueryWrapper(XzdJsCgJungonBo bo) { @@ -104,13 +139,27 @@ public class XzdJsCgJungonServiceImpl extends ServiceImpl 0; if (flag) { bo.setId(add.getId()); } + + String tableName = XzdClassEnum.JS_CG_JUNGON.getClassName(); + if (bo.getKkyjlx() == null || bo.getKkyjlx().isEmpty()) { + throw new ServiceException("扣款与奖励项不能为空"); + } + //合同条款-扣款与奖励项 + for (XzdJsDeductionItems kkyjlx : bo.getKkyjlx()) { + kkyjlx.setTableName(tableName); + kkyjlx.setMainDocId(add.getId()); + } + deductionItemsService.saveBatch(bo.getKkyjlx()); return flag; } @@ -121,9 +170,24 @@ public class XzdJsCgJungonServiceImpl extends ServiceImpl().eq(XzdJsDeductionItems::getMainDocId, update.getId())); + //生成奖励与扣款数据 + String tableName = XzdClassEnum.JS_CG_JINDU.getClassName(); + if (bo.getKkyjlx() == null || bo.getKkyjlx().isEmpty()) { + throw new ServiceException("扣款与奖励项不能为空"); + } + //合同条款-扣款与奖励项 + for (XzdJsDeductionItems kkyjlx : bo.getKkyjlx()) { + kkyjlx.setTableName(tableName); + kkyjlx.setMainDocId(update.getId()); + } + //新增奖励与扣款数据 + deductionItemsService.saveBatch(bo.getKkyjlx()); return baseMapper.updateById(update) > 0; } @@ -142,10 +206,101 @@ public class XzdJsCgJungonServiceImpl extends ServiceImpl ids, Boolean isValid) { if(isValid){ //TODO 做一些业务上的校验,判断是否需要校验 } + List deleteIds = new ArrayList<>(); + for (Long id : ids) { + XzdJsCgJungonVo vo = baseMapper.selectVoById(id); + if (vo != null){ + //删除附件 + if (vo.getFileId()!= null && !vo.getFileId().isEmpty()){ + List list = Arrays.stream(vo.getFileId().split(",")).map(Long::valueOf).toList(); + deleteIds.addAll(list); + } + } + } + if (!deleteIds.isEmpty()) { + sysOssService.deleteWithValidByIds(deleteIds, false); + } + deductionItemsService.remove(new LambdaQueryWrapper().in(XzdJsDeductionItems::getMainDocId, ids)); return baseMapper.deleteByIds(ids) > 0; } + + /** + * 获取部分字段名称 + * @param item + */ + private void getName(XzdJsCgJungonVo item) { + //项目名称 + if (item.getProjectId() != null){ + String projectName = xzdProjectService.queryNameById(item.getProjectId()); + if (projectName != null){ + item.setProjectName(projectName); + } + } + if (item.getContractCode() != null){ + String code = xzdPurchaseContractInformationService.queryCodeById(item.getContractCode()); + if (code != null){ + item.setContractCodeName(code); + } + } + //甲方单位(客户信息列表) + if (item.getPartyA() != null){ + String byid = iXzdCorrespondentList.queryNameById(item.getPartyA()); + if (byid!=null){ + item.setPartyAName(byid); + } + } + //乙方单位(供应商信息列表) + if (item.getPartyB() != null){ + String unitName = xzdSupplierInfoService.queryNameById(item.getPartyB()); + if (unitName != null){ + + item.setPartyBName(unitName); + } + } + //业主单位(客户信息列表) + if (item.getOwnerUnit() != null){ + String byid = iXzdCorrespondentList.queryNameById(item.getOwnerUnit()); + if (byid!=null){ + item.setOwnerUnitName(byid); + } + } + //监理单位(客户信息列表) + if (item.getSupervisionUnit() != null){ + String byid = iXzdCorrespondentList.queryNameById(item.getSupervisionUnit()); + if (byid!=null){ + item.setSupervisionUnitName(byid); + } + } + //施工单位(客户信息列表) + if (item.getConstructionUnit() != null){ + String byid = iXzdCorrespondentList.queryNameById(item.getConstructionUnit()); + if (byid!=null){ + item.setConstructionUnitName(byid); + } + } + //审核单位(客户信息列表) + if (item.getAuditUnit() != null){ + String byid = iXzdCorrespondentList.queryNameById(item.getAuditUnit()); + if (byid!=null){ + item.setAuditUnitName(byid); + } + } + } + + /** + * 获取扣款与奖励项 + * @param vo + */ + private void getHttk(XzdJsCgJungonVo vo) { + //结算扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.eq(XzdJsDeductionItems::getMainDocId, vo.getId()); + List list = deductionItemsService.list(lambdaQueryWrapper2); + vo.setKkyjlx(list); + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsZhfwJinduServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsZhfwJinduServiceImpl.java index 168fdd5b..707d6a53 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsZhfwJinduServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsZhfwJinduServiceImpl.java @@ -9,6 +9,14 @@ 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.system.domain.vo.SysDeptVo; +import org.dromara.system.service.impl.SysDeptServiceImpl; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; +import org.dromara.xzd.settlement.domain.vo.XzdJsCgJungonEditVo; +import org.dromara.xzd.settlement.service.IXzdJsDeductionItemsService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.dromara.xzd.settlement.domain.bo.XzdJsZhfwJinduBo; import org.dromara.xzd.settlement.domain.vo.XzdJsZhfwJinduVo; @@ -32,6 +40,20 @@ public class XzdJsZhfwJinduServiceImpl extends ServiceImpl 0; } + + + /** + * 获取部分字段名称 + * @param item + */ +// private void getName(XzdJsZhfwJinduVo item) { +// //项目名称 +// if (item.getProjectId() != null){ +// String projectName = xzdProjectService.queryNameById(item.getProjectId()); +// if (projectName != null){ +// item.setProjectName(projectName); +// } +// } +// //部门名称 +// if (item.getDefaultFinanceOrg() != null){ +// SysDeptVo sysDeptVo = sysDeptService.selectDeptById(item.getDefaultFinanceOrg()); +// if (sysDeptVo != null){ +// item.setDefaultFinanceOrgName(sysDeptVo.getDeptName()); +// } +// } +// } + + /** + * 获取扣款与奖励项 + * @param vo + */ + private void getHttk(XzdJsZhfwJinduVo vo) { + //结算扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.eq(XzdJsDeductionItems::getMainDocId, vo.getId()); + List list = deductionItemsService.list(lambdaQueryWrapper2); + vo.setKkyjlx(list); + } } From 9f1da9e6c0ec037e54b309bd923c2e090972be8a Mon Sep 17 00:00:00 2001 From: lg Date: Wed, 15 Oct 2025 22:50:38 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=BB=93=E7=AE=97=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/XzdPurchaseContractSuspendBo.java | 2 +- .../vo/XzdPurchaseContractSuspendVo.java | 49 ++- ...XzdPurchaseContractSuspendServiceImpl.java | 66 +++- .../domain/XzdPurchaseContractAlteration.java | 11 +- .../bo/XzdPurchaseContractAlterationBo.java | 16 +- .../vo/XzdPurchaseContractAlterationVo.java | 66 +++- ...PurchaseContractAlterationServiceImpl.java | 99 +++-- .../XzdSubcontractChangeController.java | 105 ++++++ .../domain/XzdSubcontractChange.java | 218 +++++++++++ .../domain/bo/XzdSubcontractChangeBo.java | 244 ++++++++++++ .../domain/vo/XzdSubcontractChangeVo.java | 325 ++++++++++++++++ .../mapper/XzdSubcontractChangeMapper.java | 15 + .../service/IXzdSubcontractChangeService.java | 70 ++++ .../impl/XzdSubcontractChangeServiceImpl.java | 355 ++++++++++++++++++ .../domain/XzdSubcontract.java | 2 +- .../domain/bo/XzdSubcontractBo.java | 4 +- .../domain/vo/XzdSubcontractVo.java | 25 +- .../impl/XzdSubcontractServiceImpl.java | 7 +- .../XzdSubcontractTerminationController.java | 105 ++++++ .../domain/XzdSubcontractTermination.java | 118 ++++++ .../bo/XzdSubcontractTerminationBo.java | 116 ++++++ .../vo/XzdSubcontractTerminationVo.java | 175 +++++++++ .../XzdSubcontractTerminationMapper.java | 15 + .../IXzdSubcontractTerminationService.java | 70 ++++ .../XzdSubcontractTerminationServiceImpl.java | 177 +++++++++ .../vo/XzdPurchaseContractInformationVo.java | 23 ++ ...urchaseContractInformationServiceImpl.java | 9 +- .../xzd/controller/XzdCorrespondentList.java | 4 +- .../domain/XzdGuaranteeChangeInfo.java | 4 + .../domain/bo/XzdGuaranteeChangeInfoBo.java | 9 +- .../domain/vo/XzdGuaranteeChangeInfoVo.java | 5 + .../XzdGuaranteeChangeInfoServiceImpl.java | 5 +- .../org/dromara/xzd/enums/XzdClassEnum.java | 2 + .../service/impl/XzdCorrespondentListImp.java | 20 +- ...entOfSubcontractingContractController.java | 105 ++++++ .../SettlementOfSubcontractingContract.java | 168 +++++++++ .../SettlementOfSubcontractingContractBo.java | 170 +++++++++ .../SettlementOfSubcontractingContractVo.java | 221 +++++++++++ ...tlementOfSubcontractingContractMapper.java | 15 + ...lementOfSubcontractingContractService.java | 70 ++++ ...ntOfSubcontractingContractServiceImpl.java | 228 +++++++++++ ...tOfSubcontractingCompletionController.java | 121 ++++++ .../SettlementOfSubcontractingCompletion.java | 173 +++++++++ ...ettlementOfSubcontractingCompletionBo.java | 179 +++++++++ ...ettlementOfSubcontractingCompletionVo.java | 254 +++++++++++++ ...ementOfSubcontractingCompletionMapper.java | 15 + ...mentOfSubcontractingCompletionService.java | 76 ++++ ...OfSubcontractingCompletionServiceImpl.java | 307 +++++++++++++++ ...tOfSubcontractingAdjustmentController.java | 105 ++++++ .../SettlementOfSubcontractingAdjustment.java | 98 +++++ ...ettlementOfSubcontractingAdjustmentBo.java | 96 +++++ ...ettlementOfSubcontractingAdjustmentVo.java | 118 ++++++ ...ementOfSubcontractingAdjustmentMapper.java | 15 + ...mentOfSubcontractingAdjustmentService.java | 70 ++++ ...OfSubcontractingAdjustmentServiceImpl.java | 170 +++++++++ 55 files changed, 5250 insertions(+), 60 deletions(-) create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/controller/XzdSubcontractChangeController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/XzdSubcontractChange.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/bo/XzdSubcontractChangeBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/vo/XzdSubcontractChangeVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/mapper/XzdSubcontractChangeMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/IXzdSubcontractChangeService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/impl/XzdSubcontractChangeServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/controller/XzdSubcontractTerminationController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/XzdSubcontractTermination.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/bo/XzdSubcontractTerminationBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/vo/XzdSubcontractTerminationVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/mapper/XzdSubcontractTerminationMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/IXzdSubcontractTerminationService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/impl/XzdSubcontractTerminationServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/controller/SettlementOfSubcontractingContractController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/SettlementOfSubcontractingContract.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/bo/SettlementOfSubcontractingContractBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/vo/SettlementOfSubcontractingContractVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/mapper/SettlementOfSubcontractingContractMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/ISettlementOfSubcontractingContractService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/impl/SettlementOfSubcontractingContractServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/controller/SettlementOfSubcontractingCompletionController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/mapper/SettlementOfSubcontractingCompletionMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/ISettlementOfSubcontractingCompletionService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/controller/SettlementOfSubcontractingAdjustmentController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/SettlementOfSubcontractingAdjustment.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/bo/SettlementOfSubcontractingAdjustmentBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/vo/SettlementOfSubcontractingAdjustmentVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/mapper/SettlementOfSubcontractingAdjustmentMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/ISettlementOfSubcontractingAdjustmentService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/impl/SettlementOfSubcontractingAdjustmentServiceImpl.java diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/bo/XzdPurchaseContractSuspendBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/bo/XzdPurchaseContractSuspendBo.java index 48737ef0..9c7e1cd0 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/bo/XzdPurchaseContractSuspendBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/bo/XzdPurchaseContractSuspendBo.java @@ -56,7 +56,7 @@ public class XzdPurchaseContractSuspendBo extends BaseEntity { /** * 终止日期 */ - private Date terminationDate; + private LocalDate terminationDate; /** * 项目名称 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/vo/XzdPurchaseContractSuspendVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/vo/XzdPurchaseContractSuspendVo.java index 981c55a4..9a57c3d1 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/vo/XzdPurchaseContractSuspendVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/domain/vo/XzdPurchaseContractSuspendVo.java @@ -1,8 +1,13 @@ package org.dromara.xzd.contractManagement.caigoucontractTermination.domain.vo; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.Date; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; import org.dromara.xzd.contractManagement.caigoucontractTermination.domain.XzdPurchaseContractSuspend; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; @@ -35,12 +40,17 @@ public class XzdPurchaseContractSuspendVo implements Serializable { @ExcelProperty(value = "主键ID") private Long id; + /** + * 采购合同信息ID(合同编号) + */ + @ExcelDictFormat(readConverterExp = "合=同编号") + private Long contractInformationId; + /** * 采购合同信息ID(合同编码) */ - @ExcelProperty(value = "采购合同信息ID", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "合=同编码") - private Long contractInformationId; + private String contractInformationIdName; /** * 单据编码 @@ -70,7 +80,7 @@ public class XzdPurchaseContractSuspendVo implements Serializable { * 终止日期 */ @ExcelProperty(value = "终止日期") - private Date terminationDate; + private LocalDate terminationDate; /** * 项目名称 @@ -84,12 +94,25 @@ public class XzdPurchaseContractSuspendVo implements Serializable { @ExcelProperty(value = "乙方单位") private Long artyBUnit; + /** + * 乙方单位名称 + */ + @ExcelProperty(value = "乙方单位名称") + private String artyBUnitName; + /** * 甲方单位 */ @ExcelProperty(value = "甲方单位") private Long partyAUnit; + /** + * 甲方单位名称 + */ + @ExcelProperty(value = "甲方单位名称") + private String partyAUnitName; + + /** * 终止原因 */ @@ -157,4 +180,24 @@ public class XzdPurchaseContractSuspendVo implements Serializable { private String auditStatus; + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + /** + * 创建者 + */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + @TableField(fill = FieldFill.INSERT) + private Long createByName; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/service/impl/XzdPurchaseContractSuspendServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/service/impl/XzdPurchaseContractSuspendServiceImpl.java index c428ba1f..ce3669e5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/service/impl/XzdPurchaseContractSuspendServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigoucontractTermination/service/impl/XzdPurchaseContractSuspendServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.xzd.contractManagement.caigoucontractTermination.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -12,6 +13,14 @@ import lombok.RequiredArgsConstructor; import org.dromara.system.service.impl.SysOssServiceImpl; import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.XzdBidPreProjectVo; import org.dromara.xzd.contractManagement.purchaseManagement.domain.XzdPurchaseContractInformation; +import org.dromara.xzd.contractManagement.purchaseManagement.domain.vo.XzdPurchaseContractInformationVo; +import org.dromara.xzd.contractManagement.purchaseManagement.service.IXzdPurchaseContractInformationService; +import org.dromara.xzd.domain.XzdSettlementRules; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; +import org.dromara.xzd.service.IXzdCorrespondentList; +import org.dromara.xzd.service.IXzdSettlementRulesService; +import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.vo.SettlementOfSubcontractingCompletionVo; import org.dromara.xzd.utilS.AreaUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -40,6 +49,17 @@ public class XzdPurchaseContractSuspendServiceImpl extends ServiceImpl res = List.of(vo); + setValue(res); + return res.getFirst(); + } + + private void setValue(List res) { + + for (XzdPurchaseContractSuspendVo item : res) { +// //项目名称 +// if (item.getProject() != null){ +// String projectName = xzdProjectService.queryNameById(item.getProject()); +// if (projectName != null){ +// item.setProjectName(projectName); +// } +// } + //甲方单位(客户信息列表) + R byid = iXzdCorrespondentList.getCustomerByid(item.getPartyAUnit()); + if (byid!=null){ + if (byid.getData().getXzdCustomerinformation() != null){ + item.setPartyAUnitName(byid.getData().getXzdCustomerinformation().getUnitName()); + } + } + //乙方单位(供应商信息列表) + if (item.getArtyBUnit() != null){ + String unitName = xzdSupplierInfoService.queryNameById(item.getArtyBUnit()); + if (unitName != null){ + item.setArtyBUnitName(unitName); + } + } +// 采购合同信息编码 + if (item.getContractInformationId() != null){ + XzdPurchaseContractInformationVo queryById = xzdPurchaseContractInformationService.queryById(item.getContractInformationId()); + if (queryById != null){ + item.setContractInformationIdName(queryById.getContractCode()); + } + } + + } } /** @@ -67,6 +125,7 @@ public class XzdPurchaseContractSuspendServiceImpl extends ServiceImpl queryPageList(XzdPurchaseContractSuspendBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + setValue(result.getRecords()); return TableDataInfo.build(result); } @@ -121,9 +180,9 @@ public class XzdPurchaseContractSuspendServiceImpl extends ServiceImpl().gt(XzdPurchaseContractSuspend::getCreateTime, LocalDate.now())); String s = areaUtil.generateDateBasedNumber(); - boolean flag = baseMapper.insert(add) > 0; - add.setReceiptsCode(s+"-"+(l+1)); + + boolean flag = baseMapper.insert(add) > 0; if (flag) { bo.setId(add.getId()); } @@ -162,7 +221,6 @@ public class XzdPurchaseContractSuspendServiceImpl extends ServiceImpl yskx; + + /** + * 扣款与奖励项 + */ + private List kkyjlx; + + /** + * 合同条款 + */ + private List httk; + + /** + * 支付条款 + */ + private List zftk; + + /** + * 合同主要条款约定 + */ + private XzdContractDepositInfo htzytkyd; + + +// /** +// * 采购合同信息 +// */ +// private XzdPurchaseContractInformationVo xzdPurchaseContractInformationVo; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigouhetongbiangeng/service/impl/XzdPurchaseContractAlterationServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigouhetongbiangeng/service/impl/XzdPurchaseContractAlterationServiceImpl.java index 1888ab8c..0d1924db 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigouhetongbiangeng/service/impl/XzdPurchaseContractAlterationServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/caigouhetongbiangeng/service/impl/XzdPurchaseContractAlterationServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.xzd.contractManagement.caigouhetongbiangeng.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -12,10 +13,8 @@ import lombok.RequiredArgsConstructor; import org.dromara.system.service.impl.SysOssServiceImpl; import org.dromara.xzd.contractManagement.purchaseManagement.domain.vo.XzdPurchaseContractInformationVo; import org.dromara.xzd.contractManagement.purchaseManagement.service.IXzdPurchaseContractInformationService; -import org.dromara.xzd.domain.XzdContractAdvanceInfo; -import org.dromara.xzd.domain.XzdContractClause; -import org.dromara.xzd.domain.XzdDeductionItems; -import org.dromara.xzd.domain.XzdSettlementRules; +import org.dromara.xzd.domain.*; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; import org.dromara.xzd.enums.XzdClassEnum; import org.dromara.xzd.service.IXzdContractAdvanceInfoService; import org.dromara.xzd.service.IXzdContractClauseService; @@ -64,6 +63,13 @@ public class XzdPurchaseContractAlterationServiceImpl extends ServiceImpl list = List.of(xzdPurchaseContractAlterationVo); + setValue(list); return xzdPurchaseContractAlterationVo; } + public void setValue(List infos){ + + for (XzdPurchaseContractAlterationVo item : infos) { + + //合同文本-预收款项 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdContractAdvanceInfo::getContractDetailsId, item.getId()); + List advanceInfos = xzdContractAdvanceInfoService.list(lambdaQueryWrapper); + item.setYskx(advanceInfos); + + //合同条款-扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper1.eq(XzdDeductionItems::getContractDetailsId, item.getId()); + List list = xzdDeductionItemsService.list(lambdaQueryWrapper1); + item.setKkyjlx(list); + + //合同条款-合同条款 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.eq(XzdContractClause::getContractDetailsId, item.getId()); + List list1 = xzdContractClauseService.list(lambdaQueryWrapper2); + item.setHttk(list1); + + //支付条款 + LambdaQueryWrapper lambdaQueryWrapper3 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper3.eq(XzdSettlementRules::getContractDetailsId, item.getId()); + List list2 = xzdSettlementRulesService.list(lambdaQueryWrapper3); + item.setZftk(list2); + + //合同文本-合同主要条款约定 + LambdaQueryWrapper lambdaQueryWrapper4 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper4.eq(XzdContractDepositInfo::getContractDetailsId, item.getId()); + XzdContractDepositInfo list3 = xzdContractDepositInfoService.getOne(lambdaQueryWrapper4); + item.setHtzytkyd(list3); + + + } + + } + /** * 分页查询采购合同变更列表 * @@ -113,6 +157,11 @@ public class XzdPurchaseContractAlterationServiceImpl extends ServiceImpl 0; /** * 预收款项 */ - HashMap hashMap = new HashMap<>(); - hashMap.put("contract_detailsId", add.getId()); List yskx = bo.getYskx(); yskx.forEach(item -> { item.setTableName(tableName); @@ -187,7 +235,6 @@ public class XzdPurchaseContractAlterationServiceImpl extends ServiceImpl 0; if (flag) { bo.setId(add.getId()); } @@ -273,23 +320,23 @@ public class XzdPurchaseContractAlterationServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.in(XzdContractAdvanceInfo::getContractDetailsId, ids); - xzdContractAdvanceInfoService.remove(lambdaQueryWrapper); - //合同条款-扣款与奖励项 - LambdaQueryWrapper lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); - lambdaQueryWrapper1.in(XzdDeductionItems::getContractDetailsId, ids); - xzdDeductionItemsService.remove(lambdaQueryWrapper1); - //合同条款-合同条款 - LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); - lambdaQueryWrapper2.in(XzdContractClause::getContractDetailsId, ids); - xzdContractClauseService.remove(lambdaQueryWrapper2); - //支付条款 - LambdaQueryWrapper lambdaQueryWrapper3 = new LambdaQueryWrapper<>(); - lambdaQueryWrapper3.in(XzdSettlementRules::getContractDetailsId, ids); - xzdSettlementRulesService.remove(lambdaQueryWrapper3); } + //合同文本-预收款项 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(XzdContractAdvanceInfo::getContractDetailsId, ids); + xzdContractAdvanceInfoService.remove(lambdaQueryWrapper); + //合同条款-扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper1.in(XzdDeductionItems::getContractDetailsId, ids); + xzdDeductionItemsService.remove(lambdaQueryWrapper1); + //合同条款-合同条款 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.in(XzdContractClause::getContractDetailsId, ids); + xzdContractClauseService.remove(lambdaQueryWrapper2); + //支付条款 + LambdaQueryWrapper lambdaQueryWrapper3 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper3.in(XzdSettlementRules::getContractDetailsId, ids); + xzdSettlementRulesService.remove(lambdaQueryWrapper3); if(isValid){ //TODO 做一些业务上的校验,判断是否需要校验 } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/controller/XzdSubcontractChangeController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/controller/XzdSubcontractChangeController.java new file mode 100644 index 00000000..1254a5dd --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/controller/XzdSubcontractChangeController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.contractManagement.fenbaohetongbiangg.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.vo.XzdSubcontractChangeVo; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.bo.XzdSubcontractChangeBo; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.service.IXzdSubcontractChangeService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 分包合同变更 + * + * @author Lion Li + * @date 2025-10-14 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/fenbaohetongbiangg/subcontractChange") +public class XzdSubcontractChangeController extends BaseController { + + private final IXzdSubcontractChangeService xzdSubcontractChangeService; + + /** + * 查询分包合同变更列表 + */ + @SaCheckPermission("fenbaohetongbiangg:subcontractChange:list") + @GetMapping("/list") + public TableDataInfo list(XzdSubcontractChangeBo bo, PageQuery pageQuery) { + return xzdSubcontractChangeService.queryPageList(bo, pageQuery); + } + + /** + * 导出分包合同变更列表 + */ + @SaCheckPermission("fenbaohetongbiangg:subcontractChange:export") + @Log(title = "分包合同变更", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(XzdSubcontractChangeBo bo, HttpServletResponse response) { + List list = xzdSubcontractChangeService.queryList(bo); + ExcelUtil.exportExcel(list, "分包合同变更", XzdSubcontractChangeVo.class, response); + } + + /** + * 获取分包合同变更详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fenbaohetongbiangg:subcontractChange:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(xzdSubcontractChangeService.queryById(id)); + } + + /** + * 新增分包合同变更 + */ + @SaCheckPermission("fenbaohetongbiangg:subcontractChange:add") + @Log(title = "分包合同变更", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody XzdSubcontractChangeBo bo) { + return toAjax(xzdSubcontractChangeService.insertByBo(bo)); + } + + /** + * 修改分包合同变更 + */ + @SaCheckPermission("fenbaohetongbiangg:subcontractChange:edit") + @Log(title = "分包合同变更", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody XzdSubcontractChangeBo bo) { + return toAjax(xzdSubcontractChangeService.updateByBo(bo)); + } + + /** + * 删除分包合同变更 + * + * @param ids 主键串 + */ + @SaCheckPermission("fenbaohetongbiangg:subcontractChange:remove") + @Log(title = "分包合同变更", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(xzdSubcontractChangeService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/XzdSubcontractChange.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/XzdSubcontractChange.java new file mode 100644 index 00000000..912ee735 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/XzdSubcontractChange.java @@ -0,0 +1,218 @@ +package org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 分包合同变更对象 xzd_subcontract_change + * + * @author Lion Li + * @date 2025-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("xzd_subcontract_change") +public class XzdSubcontractChange extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同类型(字典) + */ + private String contractType; + + /** + * 变更类型(字典) + */ + private String changeType; + + /** + * 项目 + */ + private String project; + + /** + * 经营模式 + */ + private String businessModel; + + /** + * 组织 + */ + private String organization; + + /** + * 甲方单位 + */ + private String partyAUnit; + + /** + * 乙方单位 + */ + private String partyBUnit; + + /** + * 原合同造价 + */ + private BigDecimal originalContractCost; + + /** + * 变更价税合计 + */ + private BigDecimal changeTaxInclusiveTotal; + + /** + * 变更后总造价 + */ + private BigDecimal postChangeTotalCost; + + /** + * 累计变更金额 + */ + private BigDecimal cumulativeChangeAmount; + + /** + * 可用目标成本 + */ + private BigDecimal availableTargetCost; + + /** + * 目标成本 + */ + private BigDecimal targetCost; + + /** + * 目标成本项 + */ + private String targetCostItem; + + /** + * 警示 + */ + private String warning; + + /** + * 支付条款 + */ + private String paymentTerms; + + /** + * 备注 + */ + private String remarks; + + /** + * 是否用印 + */ + private Long isStamped; + + /** + * 变更后项目经理 + */ + private Long postChangeProjectManager; + + /** + * 变更后项目责任人 + */ + private Long postChangeProjectOwner; + + /** + * 变更后现场经理 + */ + private Long postChangeSiteManager; + + /** + * 变更后合同备注 + */ + private String postChangeContractRemarks; + + /** + * 项目大类(字典) + */ + private String projectCategory; + + /** + * 项目类型(字典) + */ + private String projectType; + + /** + * 付款额不能超合同额 + */ + private Long isPaymentNotExceedContract; + + /** + * 付款额不能超合同额支付比 + */ + private BigDecimal paymentNotExceedRatio; + + /** + * 预结算/结算额不能超合同额 + */ + private Long isPreSettlementNotExceedContract; + + /** + * 预结算/结算额不能超合同额比例 + */ + private BigDecimal preSettlementNotExceedRatio; + + /** + * 实时刷新 + */ + private Long isRealTimeRefresh; + + /** + * 合同累计变更金额 + */ + private BigDecimal contractCumulativeChangeAmount; + + /** + * 文件id (多个文件逗号分隔) + */ + private String fileId; + + /** + * 单据引用ID + */ + private Long danjuId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/bo/XzdSubcontractChangeBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/bo/XzdSubcontractChangeBo.java new file mode 100644 index 00000000..c60ffd21 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/bo/XzdSubcontractChangeBo.java @@ -0,0 +1,244 @@ +package org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.bo; + +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.XzdSubcontractChange; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import org.dromara.xzd.domain.XzdContractAdvanceInfo; +import org.dromara.xzd.domain.XzdContractClause; +import org.dromara.xzd.domain.XzdDeductionItems; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.List; + +/** + * 分包合同变更业务对象 xzd_subcontract_change + * + * @author Lion Li + * @date 2025-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = XzdSubcontractChange.class, reverseConvertGenerate = false) +public class XzdSubcontractChangeBo extends BaseEntity { + + /** + * + */ + @NotNull(message = "不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 单据编码 + */ + @NotBlank(message = "单据编码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String documentCode; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同类型(字典) + */ + private String contractType; + + /** + * 变更类型(字典) + */ + private String changeType; + + /** + * 项目 + */ + private String project; + + /** + * 经营模式 + */ + private String businessModel; + + /** + * 组织 + */ + private String organization; + + /** + * 甲方单位 + */ + private String partyAUnit; + + /** + * 乙方单位 + */ + private String partyBUnit; + + /** + * 原合同造价 + */ + private BigDecimal originalContractCost; + + /** + * 变更价税合计 + */ + private BigDecimal changeTaxInclusiveTotal; + + /** + * 变更后总造价 + */ + private BigDecimal postChangeTotalCost; + + /** + * 累计变更金额 + */ + private BigDecimal cumulativeChangeAmount; + + /** + * 可用目标成本 + */ + private BigDecimal availableTargetCost; + + /** + * 目标成本 + */ + private BigDecimal targetCost; + + /** + * 目标成本项 + */ + private String targetCostItem; + + /** + * 警示 + */ + private String warning; + + /** + * 支付条款 + */ + private String paymentTerms; + + /** + * 备注 + */ + private String remarks; + + /** + * 是否用印 + */ + private Long isStamped; + + /** + * 变更后项目经理 + */ + private Long postChangeProjectManager; + + /** + * 变更后项目责任人 + */ + private Long postChangeProjectOwner; + + /** + * 变更后现场经理 + */ + private Long postChangeSiteManager; + + /** + * 变更后合同备注 + */ + private String postChangeContractRemarks; + + /** + * 项目大类(字典) + */ + private String projectCategory; + + /** + * 项目类型(字典) + */ + private String projectType; + + /** + * 付款额不能超合同额 + */ + private Long isPaymentNotExceedContract; + + /** + * 付款额不能超合同额支付比 + */ + private BigDecimal paymentNotExceedRatio; + + /** + * 预结算/结算额不能超合同额 + */ + private Long isPreSettlementNotExceedContract; + + /** + * 预结算/结算额不能超合同额比例 + */ + private BigDecimal preSettlementNotExceedRatio; + + /** + * 实时刷新 + */ + private Long isRealTimeRefresh; + + /** + * 合同累计变更金额 + */ + private BigDecimal contractCumulativeChangeAmount; + + /** + * 文件id (多个文件逗号分隔) + */ + private String fileId; + + /** + * 单据引用ID + */ + private Long danjuId; + + + private LocalDate startTime; + private LocalDate endTime; + + + /** + * 预收款项 + */ + private List yskx; + + /** + * 扣款与奖励项 + */ + private List kkyjlx; + + /** + * 合同条款 + */ + private List httk; + + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/vo/XzdSubcontractChangeVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/vo/XzdSubcontractChangeVo.java new file mode 100644 index 00000000..02de849e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/domain/vo/XzdSubcontractChangeVo.java @@ -0,0 +1,325 @@ +package org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.vo; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.XzdSubcontractChange; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.XzdSubcontract; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.vo.XzdSubcontractVo; +import org.dromara.xzd.domain.*; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + + +/** + * 分包合同变更视图对象 xzd_subcontract_change + * + * @author Lion Li + * @date 2025-10-14 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = XzdSubcontractChange.class) +public class XzdSubcontractChangeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 单据编码 + */ + @ExcelProperty(value = "单据编码") + private String documentCode; + + /** + * 标题 + */ + @ExcelProperty(value = "标题") + private String title; + + /** + * 单据日期 + */ + @ExcelProperty(value = "单据日期") + private LocalDate documentDate; + + /** + * 合同编码 + */ + @ExcelProperty(value = "合同编码") + private Long contractCode; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 合同类型(字典) + */ + @ExcelProperty(value = "合同类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "字=典") + private String contractType; + + /** + * 变更类型(字典) + */ + @ExcelProperty(value = "变更类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "字=典") + private String changeType; + + /** + * 项目 + */ + @ExcelProperty(value = "项目") + private String project; + + /** + * 经营模式 + */ + @ExcelProperty(value = "经营模式") + private String businessModel; + + /** + * 组织 + */ + @ExcelProperty(value = "组织") + private String organization; + + /** + * 甲方单位 + */ + @ExcelProperty(value = "甲方单位") + private String partyAUnit; + + /** + * 乙方单位 + */ + @ExcelProperty(value = "乙方单位") + private String partyBUnit; + + /** + * 原合同造价 + */ + @ExcelProperty(value = "原合同造价") + private BigDecimal originalContractCost; + + /** + * 变更价税合计 + */ + @ExcelProperty(value = "变更价税合计") + private BigDecimal changeTaxInclusiveTotal; + + /** + * 变更后总造价 + */ + @ExcelProperty(value = "变更后总造价") + private BigDecimal postChangeTotalCost; + + /** + * 累计变更金额 + */ + @ExcelProperty(value = "累计变更金额") + private BigDecimal cumulativeChangeAmount; + + /** + * 可用目标成本 + */ + @ExcelProperty(value = "可用目标成本") + private BigDecimal availableTargetCost; + + /** + * 目标成本 + */ + @ExcelProperty(value = "目标成本") + private BigDecimal targetCost; + + /** + * 目标成本项 + */ + @ExcelProperty(value = "目标成本项") + private String targetCostItem; + + /** + * 警示 + */ + @ExcelProperty(value = "警示") + private String warning; + + /** + * 支付条款 + */ + @ExcelProperty(value = "支付条款") + private String paymentTerms; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remarks; + + /** + * 是否用印 + */ + @ExcelProperty(value = "是否用印") + private Long isStamped; + + /** + * 变更后项目经理 + */ + @ExcelProperty(value = "变更后项目经理") + private Long postChangeProjectManager; + + /** + * 变更后项目责任人 + */ + @ExcelProperty(value = "变更后项目责任人") + private Long postChangeProjectOwner; + + /** + * 变更后现场经理 + */ + @ExcelProperty(value = "变更后现场经理") + private Long postChangeSiteManager; + + /** + * 变更后合同备注 + */ + @ExcelProperty(value = "变更后合同备注") + private String postChangeContractRemarks; + + /** + * 项目大类(字典) + */ + @ExcelProperty(value = "项目大类", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "字=典") + private String projectCategory; + + /** + * 项目类型(字典) + */ + @ExcelProperty(value = "项目类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "字=典") + private String projectType; + + /** + * 付款额不能超合同额 + */ + @ExcelProperty(value = "付款额不能超合同额") + private Long isPaymentNotExceedContract; + + /** + * 付款额不能超合同额支付比 + */ + @ExcelProperty(value = "付款额不能超合同额支付比") + private BigDecimal paymentNotExceedRatio; + + /** + * 预结算/结算额不能超合同额 + */ + @ExcelProperty(value = "预结算/结算额不能超合同额") + private Long isPreSettlementNotExceedContract; + + /** + * 预结算/结算额不能超合同额比例 + */ + @ExcelProperty(value = "预结算/结算额不能超合同额比例") + private BigDecimal preSettlementNotExceedRatio; + + /** + * 实时刷新 + */ + @ExcelProperty(value = "实时刷新") + private Long isRealTimeRefresh; + + /** + * 合同累计变更金额 + */ + @ExcelProperty(value = "合同累计变更金额") + private BigDecimal contractCumulativeChangeAmount; + + /** + * 文件id (多个文件逗号分隔) + */ + @ExcelProperty(value = "文件id ", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "多=个文件逗号分隔") + private String fileId; + + /** + * 单据引用ID + */ + @ExcelProperty(value = "单据引用ID") + private Long danjuId; + + + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + /** + * 创建者 + */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + @TableField(fill = FieldFill.INSERT) + private Long createByName; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + + + /** + * 预收款项 + */ + private List yskx; + + /** + * 扣款与奖励项 + */ + private List kkyjlx; + + /** + * 合同条款 + */ + private List httk; + + /** + * 支付条款 + */ + private List zftk; + + /** + * 合同主要条款约定 + */ + private XzdContractDepositInfo htzytkyd; + + + + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/mapper/XzdSubcontractChangeMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/mapper/XzdSubcontractChangeMapper.java new file mode 100644 index 00000000..33f96a4d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/mapper/XzdSubcontractChangeMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.contractManagement.fenbaohetongbiangg.mapper; + +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.XzdSubcontractChange; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.vo.XzdSubcontractChangeVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 分包合同变更Mapper接口 + * + * @author Lion Li + * @date 2025-10-14 + */ +public interface XzdSubcontractChangeMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/IXzdSubcontractChangeService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/IXzdSubcontractChangeService.java new file mode 100644 index 00000000..4288226d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/IXzdSubcontractChangeService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.contractManagement.fenbaohetongbiangg.service; + +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.vo.XzdSubcontractChangeVo; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.bo.XzdSubcontractChangeBo; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.XzdSubcontractChange; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 分包合同变更Service接口 + * + * @author Lion Li + * @date 2025-10-14 + */ +public interface IXzdSubcontractChangeService extends IService{ + + /** + * 查询分包合同变更 + * + * @param id 主键 + * @return 分包合同变更 + */ + XzdSubcontractChangeVo queryById(Long id); + + /** + * 分页查询分包合同变更列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同变更分页列表 + */ + TableDataInfo queryPageList(XzdSubcontractChangeBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的分包合同变更列表 + * + * @param bo 查询条件 + * @return 分包合同变更列表 + */ + List queryList(XzdSubcontractChangeBo bo); + + /** + * 新增分包合同变更 + * + * @param bo 分包合同变更 + * @return 是否新增成功 + */ + Boolean insertByBo(XzdSubcontractChangeBo bo); + + /** + * 修改分包合同变更 + * + * @param bo 分包合同变更 + * @return 是否修改成功 + */ + Boolean updateByBo(XzdSubcontractChangeBo bo); + + /** + * 校验并批量删除分包合同变更信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/impl/XzdSubcontractChangeServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/impl/XzdSubcontractChangeServiceImpl.java new file mode 100644 index 00000000..2b5c83fb --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongbiangg/service/impl/XzdSubcontractChangeServiceImpl.java @@ -0,0 +1,355 @@ +package org.dromara.xzd.contractManagement.fenbaohetongbiangg.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +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.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +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.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.caigouhetongbiangeng.domain.vo.XzdPurchaseContractAlterationVo; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.vo.XzdSubcontractVo; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.service.IXzdSubcontractService; +import org.dromara.xzd.contractManagement.purchaseManagement.service.IXzdPurchaseContractInformationService; +import org.dromara.xzd.domain.*; +import org.dromara.xzd.enums.XzdClassEnum; +import org.dromara.xzd.service.IXzdContractAdvanceInfoService; +import org.dromara.xzd.service.IXzdContractClauseService; +import org.dromara.xzd.service.IXzdDeductionItemsService; +import org.dromara.xzd.service.impl.XzdContractAdvanceInfoServiceImpl; +import org.dromara.xzd.service.impl.XzdContractClauseServiceImpl; +import org.dromara.xzd.service.impl.XzdDeductionItemsServiceImpl; +import org.dromara.xzd.service.impl.XzdSettlementRulesServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.bo.XzdSubcontractChangeBo; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.vo.XzdSubcontractChangeVo; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.domain.XzdSubcontractChange; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.mapper.XzdSubcontractChangeMapper; +import org.dromara.xzd.contractManagement.fenbaohetongbiangg.service.IXzdSubcontractChangeService; + +import java.util.*; + +/** + * 分包合同变更Service业务层处理 + * + * @author Lion Li + * @date 2025-10-14 + */ +@RequiredArgsConstructor +@Service +public class XzdSubcontractChangeServiceImpl extends ServiceImpl implements IXzdSubcontractChangeService { + + private final XzdSubcontractChangeMapper baseMapper; + + private final IXzdContractAdvanceInfoService iXzdContractAdvanceInfoService; + + private final IXzdDeductionItemsService iXzdDeductionItemsService; + + private final IXzdContractClauseService iXzdContractClauseService; + + private final IXzdSubcontractService iXzdSubcontractService; + + private final SysOssServiceImpl sysOssService; + + @Autowired + private XzdContractAdvanceInfoServiceImpl xzdContractAdvanceInfoService; + @Autowired + private XzdDeductionItemsServiceImpl xzdDeductionItemsService; + @Autowired + private XzdContractClauseServiceImpl xzdContractClauseService; + @Autowired + private XzdSettlementRulesServiceImpl xzdSettlementRulesService; + + + /** + * 查询分包合同变更 + * + * @param id 主键 + * @return 分包合同变更 + */ + @Override + public XzdSubcontractChangeVo queryById(Long id) { + XzdSubcontractChangeVo xzdSubcontractChangeVo = baseMapper.selectVoById(id); + List list = List.of(xzdSubcontractChangeVo); + setValue(list); + + return xzdSubcontractChangeVo; + } + + private void setValue(List lists) { + for (XzdSubcontractChangeVo item : lists) { + + //合同文本-预收款项 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdContractAdvanceInfo::getContractDetailsId, item.getId()); + List advanceInfos = xzdContractAdvanceInfoService.list(lambdaQueryWrapper); + item.setYskx(advanceInfos); + + //合同条款-扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper1.eq(XzdDeductionItems::getContractDetailsId, item.getId()); + List list = xzdDeductionItemsService.list(lambdaQueryWrapper1); + item.setKkyjlx(list); + + //合同条款-合同条款 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.eq(XzdContractClause::getContractDetailsId, item.getId()); + List list1 = xzdContractClauseService.list(lambdaQueryWrapper2); + item.setHttk(list1); + + //支付条款 + LambdaQueryWrapper lambdaQueryWrapper3 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper3.eq(XzdSettlementRules::getContractDetailsId, item.getId()); + List list2 = xzdSettlementRulesService.list(lambdaQueryWrapper3); + item.setZftk(list2); + +// //合同文本-合同主要条款约定 +// LambdaQueryWrapper lambdaQueryWrapper4 = new LambdaQueryWrapper<>(); +// lambdaQueryWrapper4.eq(XzdContractDepositInfo::getContractDetailsId, item.getId()); +// XzdContractDepositInfo list3 = xzdContractDepositInfoService.getOne(lambdaQueryWrapper4); +// item.setHtzytkyd(list3); + + + } + } + + /** + * 分页查询分包合同变更列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同变更分页列表 + */ + @Override + public TableDataInfo queryPageList(XzdSubcontractChangeBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的分包合同变更列表 + * + * @param bo 查询条件 + * @return 分包合同变更列表 + */ + @Override + public List queryList(XzdSubcontractChangeBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(XzdSubcontractChangeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(XzdSubcontractChange::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentCode()), XzdSubcontractChange::getDocumentCode, bo.getDocumentCode()); + lqw.eq(StringUtils.isNotBlank(bo.getTitle()), XzdSubcontractChange::getTitle, bo.getTitle()); + lqw.eq(bo.getDocumentDate() != null, XzdSubcontractChange::getDocumentDate, bo.getDocumentDate()); + lqw.ge(bo.getStartTime() != null, XzdSubcontractChange::getDocumentDate, bo.getStartTime()); + lqw.le(bo.getEndTime() != null, XzdSubcontractChange::getDocumentDate, bo.getEndTime()); + + + + lqw.eq(bo.getContractCode() != null, XzdSubcontractChange::getContractCode, bo.getContractCode()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), XzdSubcontractChange::getContractName, bo.getContractName()); + lqw.eq(StringUtils.isNotBlank(bo.getContractType()), XzdSubcontractChange::getContractType, bo.getContractType()); + lqw.eq(StringUtils.isNotBlank(bo.getChangeType()), XzdSubcontractChange::getChangeType, bo.getChangeType()); + lqw.eq(StringUtils.isNotBlank(bo.getProject()), XzdSubcontractChange::getProject, bo.getProject()); + lqw.eq(StringUtils.isNotBlank(bo.getBusinessModel()), XzdSubcontractChange::getBusinessModel, bo.getBusinessModel()); + lqw.eq(StringUtils.isNotBlank(bo.getOrganization()), XzdSubcontractChange::getOrganization, bo.getOrganization()); + lqw.eq(StringUtils.isNotBlank(bo.getPartyAUnit()), XzdSubcontractChange::getPartyAUnit, bo.getPartyAUnit()); + lqw.eq(StringUtils.isNotBlank(bo.getPartyBUnit()), XzdSubcontractChange::getPartyBUnit, bo.getPartyBUnit()); + lqw.eq(bo.getOriginalContractCost() != null, XzdSubcontractChange::getOriginalContractCost, bo.getOriginalContractCost()); + lqw.eq(bo.getChangeTaxInclusiveTotal() != null, XzdSubcontractChange::getChangeTaxInclusiveTotal, bo.getChangeTaxInclusiveTotal()); + lqw.eq(bo.getPostChangeTotalCost() != null, XzdSubcontractChange::getPostChangeTotalCost, bo.getPostChangeTotalCost()); + lqw.eq(bo.getCumulativeChangeAmount() != null, XzdSubcontractChange::getCumulativeChangeAmount, bo.getCumulativeChangeAmount()); + lqw.eq(bo.getAvailableTargetCost() != null, XzdSubcontractChange::getAvailableTargetCost, bo.getAvailableTargetCost()); + lqw.eq(bo.getTargetCost() != null, XzdSubcontractChange::getTargetCost, bo.getTargetCost()); + lqw.eq(StringUtils.isNotBlank(bo.getTargetCostItem()), XzdSubcontractChange::getTargetCostItem, bo.getTargetCostItem()); + lqw.eq(StringUtils.isNotBlank(bo.getWarning()), XzdSubcontractChange::getWarning, bo.getWarning()); + lqw.eq(StringUtils.isNotBlank(bo.getPaymentTerms()), XzdSubcontractChange::getPaymentTerms, bo.getPaymentTerms()); + lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), XzdSubcontractChange::getRemarks, bo.getRemarks()); + lqw.eq(bo.getIsStamped() != null, XzdSubcontractChange::getIsStamped, bo.getIsStamped()); + lqw.eq(bo.getPostChangeProjectManager() != null, XzdSubcontractChange::getPostChangeProjectManager, bo.getPostChangeProjectManager()); + lqw.eq(bo.getPostChangeProjectOwner() != null, XzdSubcontractChange::getPostChangeProjectOwner, bo.getPostChangeProjectOwner()); + lqw.eq(bo.getPostChangeSiteManager() != null, XzdSubcontractChange::getPostChangeSiteManager, bo.getPostChangeSiteManager()); + lqw.eq(StringUtils.isNotBlank(bo.getPostChangeContractRemarks()), XzdSubcontractChange::getPostChangeContractRemarks, bo.getPostChangeContractRemarks()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectCategory()), XzdSubcontractChange::getProjectCategory, bo.getProjectCategory()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectType()), XzdSubcontractChange::getProjectType, bo.getProjectType()); + lqw.eq(bo.getIsPaymentNotExceedContract() != null, XzdSubcontractChange::getIsPaymentNotExceedContract, bo.getIsPaymentNotExceedContract()); + lqw.eq(bo.getPaymentNotExceedRatio() != null, XzdSubcontractChange::getPaymentNotExceedRatio, bo.getPaymentNotExceedRatio()); + lqw.eq(bo.getIsPreSettlementNotExceedContract() != null, XzdSubcontractChange::getIsPreSettlementNotExceedContract, bo.getIsPreSettlementNotExceedContract()); + lqw.eq(bo.getPreSettlementNotExceedRatio() != null, XzdSubcontractChange::getPreSettlementNotExceedRatio, bo.getPreSettlementNotExceedRatio()); + lqw.eq(bo.getIsRealTimeRefresh() != null, XzdSubcontractChange::getIsRealTimeRefresh, bo.getIsRealTimeRefresh()); + lqw.eq(bo.getContractCumulativeChangeAmount() != null, XzdSubcontractChange::getContractCumulativeChangeAmount, bo.getContractCumulativeChangeAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), XzdSubcontractChange::getFileId, bo.getFileId()); + lqw.eq(bo.getDanjuId() != null, XzdSubcontractChange::getDanjuId, bo.getDanjuId()); + return lqw; + } + + /** + * 新增分包合同变更 + * + * @param bo 分包合同变更 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(XzdSubcontractChangeBo bo) { + XzdSubcontractChange add = MapstructUtils.convert(bo, XzdSubcontractChange.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + String tableName = XzdClassEnum.CAIGOUHETONG_INFORMATION.getClassName(); + + /** + * 预收款项 + */ + HashMap hashMap = new HashMap<>(); + hashMap.put("contract_detailsId", add.getId()); + List yskx = bo.getYskx(); + yskx.forEach(item -> { + item.setTableName(tableName); + item.setContractDetailsId(add.getId()); + }); + iXzdContractAdvanceInfoService.saveBatch(yskx); + /** + * 扣款与奖励项 + */ + List kkyjlx = bo.getKkyjlx(); + kkyjlx.forEach(item -> { + item.setTableName(tableName); + item.setContractDetailsId(add.getId()); + }); + iXzdDeductionItemsService.saveBatch(kkyjlx); + /** + * 合同条款 + */ + List httk = bo.getHttk(); + httk.forEach(item -> { + item.setTableName(tableName); + item.setContractDetailsId(add.getId()); + }); + iXzdContractClauseService.saveBatch(httk); + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改分包合同变更 + * + * @param bo 分包合同变更 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(XzdSubcontractChangeBo bo) { + XzdSubcontractChange add = MapstructUtils.convert(bo, XzdSubcontractChange.class); + /** + * 预收款项 优先删除数据在添加 + */ + String tableName = XzdClassEnum.PURCHASE_CONTRACT_INFORMATION.getClassName(); + HashMap hashMap = new HashMap<>(); + hashMap.put("contract_details_id", add.getId()); + XzdSubcontractChangeVo xzdSubcontractChangeVo = baseMapper.selectVoById(add.getId()); + if (xzdSubcontractChangeVo == null){ + throw new ServiceException("数据不存在"); + } + List yskx = bo.getYskx(); + iXzdContractAdvanceInfoService.getBaseMapper().deleteByMap(hashMap); + if (yskx != null){ + yskx.forEach(item -> { + item.setTableName(tableName); + item.setContractDetailsId(add.getId()); + }); + iXzdContractAdvanceInfoService.saveBatch(yskx); + } + /** + * 扣款与奖励项 + */ + List kkyjlx = bo.getKkyjlx(); + iXzdDeductionItemsService.getBaseMapper().deleteByMap(hashMap); + if(kkyjlx != null){ + kkyjlx.forEach(item -> { + item.setTableName(tableName); + item.setContractDetailsId(add.getId()); + }); + iXzdDeductionItemsService.saveBatch(kkyjlx); + } + /** + * 合同条款 + */ + List httk = bo.getHttk(); + iXzdContractClauseService.getBaseMapper().deleteByMap(hashMap); + if (httk != null){ + httk.forEach(item -> { + item.setTableName(tableName); + item.setContractDetailsId(add.getId()); + }); + iXzdContractClauseService.saveBatch(httk); + } + + + + + return baseMapper.updateById(add) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(XzdSubcontractChange entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除分包合同变更信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + + } + for (Long id : ids) { + XzdSubcontractChangeVo vo = baseMapper.selectVoById(id); + if (vo != null){ + //删除附件 + if (vo.getFileId()!= null && !vo.getFileId().isEmpty()){ + List deleteIds = Arrays.stream(vo.getFileId().split(",")).map(Long::valueOf).toList(); + if (!deleteIds.isEmpty()) { + sysOssService.deleteWithValidByIds(deleteIds, false); + } + } + } + } + + //合同文本-预收款项 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(XzdContractAdvanceInfo::getContractDetailsId, ids); + xzdContractAdvanceInfoService.remove(lambdaQueryWrapper); + //合同条款-扣款与奖励项 + LambdaQueryWrapper lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper1.in(XzdDeductionItems::getContractDetailsId, ids); + xzdDeductionItemsService.remove(lambdaQueryWrapper1); + //合同条款-合同条款 + LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.in(XzdContractClause::getContractDetailsId, ids); + xzdContractClauseService.remove(lambdaQueryWrapper2); + //支付条款 + LambdaQueryWrapper lambdaQueryWrapper3 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper3.in(XzdSettlementRules::getContractDetailsId, ids); + xzdSettlementRulesService.remove(lambdaQueryWrapper3); + + + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java index fc875d67..f68db242 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java @@ -203,7 +203,7 @@ public class XzdSubcontract extends BaseEntity { /** * 备案时间 */ - private LocalDateTime filingTime; + private LocalDate filingTime; /** * WBS diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/bo/XzdSubcontractBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/bo/XzdSubcontractBo.java index 4d60638d..e01480e6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/bo/XzdSubcontractBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/bo/XzdSubcontractBo.java @@ -29,13 +29,11 @@ public class XzdSubcontractBo extends BaseEntity { /** * */ - @NotNull(message = "不能为空", groups = { EditGroup.class }) private Long id; /** * 合同编码 */ - @NotBlank(message = "合同编码不能为空", groups = { AddGroup.class, EditGroup.class }) private String contractCode; /** @@ -206,7 +204,7 @@ public class XzdSubcontractBo extends BaseEntity { /** * 备案时间 */ - private LocalDateTime filingTime; + private LocalDate filingTime; /** * WBS diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java index 89a79b67..4382fffb 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java @@ -2,6 +2,8 @@ package org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.vo; import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import org.dromara.common.translation.annotation.Translation; import org.dromara.common.translation.constant.TransConstant; import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.XzdSubcontract; @@ -321,7 +323,7 @@ public class XzdSubcontractVo implements Serializable { * 备案时间 */ @ExcelProperty(value = "备案时间") - private LocalDateTime filingTime; + private LocalDate filingTime; /** * WBS @@ -389,6 +391,27 @@ public class XzdSubcontractVo implements Serializable { @ExcelProperty(value = "单据引用ID") private Long danjuId; + + + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + /** + * 创建者 + */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + @TableField(fill = FieldFill.INSERT) + private Long createByName; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + /** * 预收款项 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/service/impl/XzdSubcontractServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/service/impl/XzdSubcontractServiceImpl.java index bc806254..5ac03c16 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/service/impl/XzdSubcontractServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/service/impl/XzdSubcontractServiceImpl.java @@ -89,7 +89,7 @@ public class XzdSubcontractServiceImpl extends ServiceImpl infos) { for (XzdSubcontractVo item : infos) { - - //项目名称 if (item.getProject() != null){ String projectName = xzdProjectService.queryNameById(item.getProject()); @@ -270,8 +268,9 @@ public class XzdSubcontractServiceImpl extends ServiceImpl().gt(XzdSubcontract::getCreateTime, LocalDate.now())); String s = areaUtil.generateDateBasedNumberByY(); - boolean flag = baseMapper.insert(add) > 0; + add.setContractCode(ZxdEnum.FENBAOHETONG_PREFIX.getTypeValue()+"-"+s+"-"+(l+1)); + boolean flag = baseMapper.insert(add) > 0; // 表名 String tableName = XzdClassEnum.FENBAOHETONG_INFORMATION.getClassName(); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/controller/XzdSubcontractTerminationController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/controller/XzdSubcontractTerminationController.java new file mode 100644 index 00000000..a3f3a3eb --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/controller/XzdSubcontractTerminationController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.vo.XzdSubcontractTerminationVo; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.bo.XzdSubcontractTerminationBo; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.service.IXzdSubcontractTerminationService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 分包合同终止 + * + * @author Lion Li + * @date 2025-10-14 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/fenbaohetongzhongzhi/subcontractTermination") +public class XzdSubcontractTerminationController extends BaseController { + + private final IXzdSubcontractTerminationService xzdSubcontractTerminationService; + + /** + * 查询分包合同终止列表 + */ + @SaCheckPermission("fenbaohetongzhongzhi:subcontractTermination:list") + @GetMapping("/list") + public TableDataInfo list(XzdSubcontractTerminationBo bo, PageQuery pageQuery) { + return xzdSubcontractTerminationService.queryPageList(bo, pageQuery); + } + + /** + * 导出分包合同终止列表 + */ + @SaCheckPermission("fenbaohetongzhongzhi:subcontractTermination:export") + @Log(title = "分包合同终止", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(XzdSubcontractTerminationBo bo, HttpServletResponse response) { + List list = xzdSubcontractTerminationService.queryList(bo); + ExcelUtil.exportExcel(list, "分包合同终止", XzdSubcontractTerminationVo.class, response); + } + + /** + * 获取分包合同终止详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fenbaohetongzhongzhi:subcontractTermination:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(xzdSubcontractTerminationService.queryById(id)); + } + + /** + * 新增分包合同终止 + */ + @SaCheckPermission("fenbaohetongzhongzhi:subcontractTermination:add") + @Log(title = "分包合同终止", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody XzdSubcontractTerminationBo bo) { + return toAjax(xzdSubcontractTerminationService.insertByBo(bo)); + } + + /** + * 修改分包合同终止 + */ + @SaCheckPermission("fenbaohetongzhongzhi:subcontractTermination:edit") + @Log(title = "分包合同终止", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody XzdSubcontractTerminationBo bo) { + return toAjax(xzdSubcontractTerminationService.updateByBo(bo)); + } + + /** + * 删除分包合同终止 + * + * @param ids 主键串 + */ + @SaCheckPermission("fenbaohetongzhongzhi:subcontractTermination:remove") + @Log(title = "分包合同终止", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(xzdSubcontractTerminationService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/XzdSubcontractTermination.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/XzdSubcontractTermination.java new file mode 100644 index 00000000..45f1f2b7 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/XzdSubcontractTermination.java @@ -0,0 +1,118 @@ +package org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 分包合同终止对象 xzd_subcontract_termination + * + * @author Lion Li + * @date 2025-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("xzd_subcontract_termination") +public class XzdSubcontractTermination extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 合同编号 + */ + private Long contractNumber; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 终止日期 + */ + private LocalDate terminationDate; + + /** + * 工程项目 + */ + private String engineeringProject; + + /** + * 甲方单位 + */ + private String partyAUnit; + + /** + * 乙方单位 + */ + private String partyBUnit; + + /** + * 终止原因 + */ + private String terminationReason; + + /** + * 备注 + */ + private String remarks; + + /** + * 累计结算金额 + */ + private BigDecimal cumulativeSettlementAmount; + + /** + * 累计付款金额 + */ + private BigDecimal cumulativePaymentAmount; + + /** + * 项目大类(字典) + */ + private String projectCategory; + + /** + * 项目类型(字典) + */ + private String projectType; + + /** + * 文件id (多个文件逗号分隔) + */ + private String fileId; + + /** + * 单据引用ID + */ + private Long danjuId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/bo/XzdSubcontractTerminationBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/bo/XzdSubcontractTerminationBo.java new file mode 100644 index 00000000..7fa6c147 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/bo/XzdSubcontractTerminationBo.java @@ -0,0 +1,116 @@ +package org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.bo; + +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.XzdSubcontractTermination; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 分包合同终止业务对象 xzd_subcontract_termination + * + * @author Lion Li + * @date 2025-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = XzdSubcontractTermination.class, reverseConvertGenerate = false) +public class XzdSubcontractTerminationBo extends BaseEntity { + + /** + * + */ + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 合同编号 + */ + private Long contractNumber; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 终止日期 + */ + private LocalDate terminationDate; + + /** + * 工程项目 + */ + private String engineeringProject; + + /** + * 甲方单位 + */ + private String partyAUnit; + + /** + * 乙方单位 + */ + private String partyBUnit; + + /** + * 终止原因 + */ + private String terminationReason; + + /** + * 备注 + */ + private String remarks; + + /** + * 累计结算金额 + */ + private BigDecimal cumulativeSettlementAmount; + + /** + * 累计付款金额 + */ + private BigDecimal cumulativePaymentAmount; + + /** + * 项目大类(字典) + */ + private String projectCategory; + + /** + * 项目类型(字典) + */ + private String projectType; + + /** + * 文件id (多个文件逗号分隔) + */ + private String fileId; + + /** + * 单据引用ID + */ + private Long danjuId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/vo/XzdSubcontractTerminationVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/vo/XzdSubcontractTerminationVo.java new file mode 100644 index 00000000..a93e9099 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/domain/vo/XzdSubcontractTerminationVo.java @@ -0,0 +1,175 @@ +package org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.vo; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.XzdSubcontractTermination; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; + + + +/** + * 分包合同终止视图对象 xzd_subcontract_termination + * + * @author Lion Li + * @date 2025-10-14 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = XzdSubcontractTermination.class) +public class XzdSubcontractTerminationVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 单据编码 + */ + @ExcelProperty(value = "单据编码") + private String documentCode; + + /** + * 标题 + */ + @ExcelProperty(value = "标题") + private String title; + + /** + * 单据日期 + */ + @ExcelProperty(value = "单据日期") + private LocalDate documentDate; + + /** + * 合同编号 + */ + @ExcelProperty(value = "合同编号") + private Long contractNumber; + /** + * 合同编码 + */ + @ExcelProperty(value = "合同编码") + private String contractNumberName; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 终止日期 + */ + @ExcelProperty(value = "终止日期") + private LocalDate terminationDate; + + /** + * 工程项目 + */ + @ExcelProperty(value = "工程项目") + private String engineeringProject; + + /** + * 甲方单位 + */ + @ExcelProperty(value = "甲方单位") + private String partyAUnit; + + /** + * 乙方单位 + */ + @ExcelProperty(value = "乙方单位") + private String partyBUnit; + + /** + * 终止原因 + */ + @ExcelProperty(value = "终止原因") + private String terminationReason; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remarks; + + /** + * 累计结算金额 + */ + @ExcelProperty(value = "累计结算金额") + private BigDecimal cumulativeSettlementAmount; + + /** + * 累计付款金额 + */ + @ExcelProperty(value = "累计付款金额") + private BigDecimal cumulativePaymentAmount; + + /** + * 项目大类(字典) + */ + @ExcelProperty(value = "项目大类", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "字=典") + private String projectCategory; + + /** + * 项目类型(字典) + */ + @ExcelProperty(value = "项目类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "字=典") + private String projectType; + + /** + * 文件id (多个文件逗号分隔) + */ + @ExcelProperty(value = "文件id ", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "多=个文件逗号分隔") + private String fileId; + + /** + * 单据引用ID + */ + @ExcelProperty(value = "单据引用ID") + private Long danjuId; + + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + /** + * 创建者 + */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + @TableField(fill = FieldFill.INSERT) + private Long createByName; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/mapper/XzdSubcontractTerminationMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/mapper/XzdSubcontractTerminationMapper.java new file mode 100644 index 00000000..66d692cc --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/mapper/XzdSubcontractTerminationMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.mapper; + +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.XzdSubcontractTermination; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.vo.XzdSubcontractTerminationVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 分包合同终止Mapper接口 + * + * @author Lion Li + * @date 2025-10-14 + */ +public interface XzdSubcontractTerminationMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/IXzdSubcontractTerminationService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/IXzdSubcontractTerminationService.java new file mode 100644 index 00000000..399aa44c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/IXzdSubcontractTerminationService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.service; + +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.vo.XzdSubcontractTerminationVo; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.bo.XzdSubcontractTerminationBo; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.XzdSubcontractTermination; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 分包合同终止Service接口 + * + * @author Lion Li + * @date 2025-10-14 + */ +public interface IXzdSubcontractTerminationService extends IService{ + + /** + * 查询分包合同终止 + * + * @param id 主键 + * @return 分包合同终止 + */ + XzdSubcontractTerminationVo queryById(Long id); + + /** + * 分页查询分包合同终止列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同终止分页列表 + */ + TableDataInfo queryPageList(XzdSubcontractTerminationBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的分包合同终止列表 + * + * @param bo 查询条件 + * @return 分包合同终止列表 + */ + List queryList(XzdSubcontractTerminationBo bo); + + /** + * 新增分包合同终止 + * + * @param bo 分包合同终止 + * @return 是否新增成功 + */ + Boolean insertByBo(XzdSubcontractTerminationBo bo); + + /** + * 修改分包合同终止 + * + * @param bo 分包合同终止 + * @return 是否修改成功 + */ + Boolean updateByBo(XzdSubcontractTerminationBo bo); + + /** + * 校验并批量删除分包合同终止信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/impl/XzdSubcontractTerminationServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/impl/XzdSubcontractTerminationServiceImpl.java new file mode 100644 index 00000000..ea17f912 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongzhongzhi/service/impl/XzdSubcontractTerminationServiceImpl.java @@ -0,0 +1,177 @@ +package org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.caigoucontractTermination.domain.XzdPurchaseContractSuspend; +import org.dromara.xzd.contractManagement.caigoucontractTermination.domain.vo.XzdPurchaseContractSuspendVo; +import org.dromara.xzd.utilS.AreaUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.bo.XzdSubcontractTerminationBo; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.vo.XzdSubcontractTerminationVo; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.XzdSubcontractTermination; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.mapper.XzdSubcontractTerminationMapper; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.service.IXzdSubcontractTerminationService; + +import java.time.LocalDate; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Collection; +import java.util.stream.Collectors; + +/** + * 分包合同终止Service业务层处理 + * + * @author Lion Li + * @date 2025-10-14 + */ +@RequiredArgsConstructor +@Service +public class XzdSubcontractTerminationServiceImpl extends ServiceImpl implements IXzdSubcontractTerminationService { + + private final XzdSubcontractTerminationMapper baseMapper; + private final AreaUtil areaUtil; + + @Autowired + private SysOssServiceImpl sysOssService; + + /** + * 查询分包合同终止 + * + * @param id 主键 + * @return 分包合同终止 + */ + @Override + public XzdSubcontractTerminationVo queryById(Long id){ + XzdSubcontractTerminationVo vo = baseMapper.selectVoById(id); + List.of(vo); + return baseMapper.selectVoById(id); + } + + /** + * 分页查询分包合同终止列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同终止分页列表 + */ + @Override + public TableDataInfo queryPageList(XzdSubcontractTerminationBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的分包合同终止列表 + * + * @param bo 查询条件 + * @return 分包合同终止列表 + */ + @Override + public List queryList(XzdSubcontractTerminationBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(XzdSubcontractTerminationBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(XzdSubcontractTermination::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentCode()), XzdSubcontractTermination::getDocumentCode, bo.getDocumentCode()); + lqw.eq(StringUtils.isNotBlank(bo.getTitle()), XzdSubcontractTermination::getTitle, bo.getTitle()); + lqw.eq(bo.getDocumentDate() != null, XzdSubcontractTermination::getDocumentDate, bo.getDocumentDate()); + lqw.eq(bo.getContractNumber() != null, XzdSubcontractTermination::getContractNumber, bo.getContractNumber()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), XzdSubcontractTermination::getContractName, bo.getContractName()); + lqw.eq(bo.getTerminationDate() != null, XzdSubcontractTermination::getTerminationDate, bo.getTerminationDate()); + lqw.eq(StringUtils.isNotBlank(bo.getEngineeringProject()), XzdSubcontractTermination::getEngineeringProject, bo.getEngineeringProject()); + lqw.eq(StringUtils.isNotBlank(bo.getPartyAUnit()), XzdSubcontractTermination::getPartyAUnit, bo.getPartyAUnit()); + lqw.eq(StringUtils.isNotBlank(bo.getPartyBUnit()), XzdSubcontractTermination::getPartyBUnit, bo.getPartyBUnit()); + lqw.eq(StringUtils.isNotBlank(bo.getTerminationReason()), XzdSubcontractTermination::getTerminationReason, bo.getTerminationReason()); + lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), XzdSubcontractTermination::getRemarks, bo.getRemarks()); + lqw.eq(bo.getCumulativeSettlementAmount() != null, XzdSubcontractTermination::getCumulativeSettlementAmount, bo.getCumulativeSettlementAmount()); + lqw.eq(bo.getCumulativePaymentAmount() != null, XzdSubcontractTermination::getCumulativePaymentAmount, bo.getCumulativePaymentAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectCategory()), XzdSubcontractTermination::getProjectCategory, bo.getProjectCategory()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectType()), XzdSubcontractTermination::getProjectType, bo.getProjectType()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), XzdSubcontractTermination::getFileId, bo.getFileId()); + lqw.eq(bo.getDanjuId() != null, XzdSubcontractTermination::getDanjuId, bo.getDanjuId()); + return lqw; + } + + /** + * 新增分包合同终止 + * + * @param bo 分包合同终止 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(XzdSubcontractTerminationBo bo) { + XzdSubcontractTermination add = MapstructUtils.convert(bo, XzdSubcontractTermination.class); + validEntityBeforeSave(add); + + Long l = baseMapper.selectCount(new LambdaQueryWrapper().gt(XzdSubcontractTermination::getCreateTime, LocalDate.now())); + String s = areaUtil.generateDateBasedNumber(); + add.setDocumentCode(s+"-"+(l+1)); + + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改分包合同终止 + * + * @param bo 分包合同终止 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(XzdSubcontractTerminationBo bo) { + XzdSubcontractTermination update = MapstructUtils.convert(bo, XzdSubcontractTermination.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(XzdSubcontractTermination entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除分包合同终止信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + + for (Long id : ids) { + XzdSubcontractTerminationVo vo = baseMapper.selectVoById(id); + // 删除附件 + if (!StringUtils.isEmpty(vo.getFileId())){ + List collect = Arrays.stream(vo.getFileId().split(",")).map(item -> { + return Long.parseLong(item); + }).collect(Collectors.toList()); + sysOssService.deleteWithValidByIds(collect, false); + } + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/domain/vo/XzdPurchaseContractInformationVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/domain/vo/XzdPurchaseContractInformationVo.java index 1d5b8bcc..3c33942b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/domain/vo/XzdPurchaseContractInformationVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/domain/vo/XzdPurchaseContractInformationVo.java @@ -1,7 +1,11 @@ package org.dromara.xzd.contractManagement.purchaseManagement.domain.vo; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.Date; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; @@ -416,6 +420,25 @@ public class XzdPurchaseContractInformationVo implements Serializable { private String auditStatus; + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + /** + * 创建者 + */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + @TableField(fill = FieldFill.INSERT) + private Long createByName; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + /** * 预收款项 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/impl/XzdPurchaseContractInformationServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/impl/XzdPurchaseContractInformationServiceImpl.java index 858797a1..5c804af6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/impl/XzdPurchaseContractInformationServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/purchaseManagement/service/impl/XzdPurchaseContractInformationServiceImpl.java @@ -94,11 +94,12 @@ public class XzdPurchaseContractInformationServiceImpl extends ServiceImpl informationVo = List.of(xzdPurchaseContractInformationVo); + List informationVo = new ArrayList<>(); + if (xzdPurchaseContractInformationVo != null){ + informationVo = List.of(xzdPurchaseContractInformationVo); // 装填数据 - setValue(informationVo); - - + setValue(informationVo); + } return informationVo.getFirst(); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/controller/XzdCorrespondentList.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/controller/XzdCorrespondentList.java index db9b2ca2..cd20afcc 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/controller/XzdCorrespondentList.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/controller/XzdCorrespondentList.java @@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.*; import java.util.List; + +//客户信息总controller @Validated @RequiredArgsConstructor @RestController @@ -28,8 +30,6 @@ public class XzdCorrespondentList { private final IXzdCorrespondentList iXzdCorrespondentList; - - private final IXzdCustomertypeService iXzdCustomertypeService; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/XzdGuaranteeChangeInfo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/XzdGuaranteeChangeInfo.java index a4fb0144..e1cac339 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/XzdGuaranteeChangeInfo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/XzdGuaranteeChangeInfo.java @@ -40,6 +40,10 @@ public class XzdGuaranteeChangeInfo extends BaseEntity { * 单据编号 */ private String documentNumber; + /** + * 合同类型 + */ + private String contractType; /** * 标题 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/bo/XzdGuaranteeChangeInfoBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/bo/XzdGuaranteeChangeInfoBo.java index b081c67a..2b394813 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/bo/XzdGuaranteeChangeInfoBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/bo/XzdGuaranteeChangeInfoBo.java @@ -60,7 +60,12 @@ public class XzdGuaranteeChangeInfoBo extends BaseEntity { /** * 合同保函名称 */ - private Long contractGuaranteeName; + private String contractGuaranteeName; + + /** + * 合同类型 + */ + private String contractType; /** * 工程项目 @@ -76,7 +81,7 @@ public class XzdGuaranteeChangeInfoBo extends BaseEntity { * 经办人名称 */ @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "handlerId") - private Long handlerName; + private String handlerName; /** * 变更类型(字典) diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/vo/XzdGuaranteeChangeInfoVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/vo/XzdGuaranteeChangeInfoVo.java index aada246a..052666e9 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/vo/XzdGuaranteeChangeInfoVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/domain/vo/XzdGuaranteeChangeInfoVo.java @@ -84,6 +84,11 @@ public class XzdGuaranteeChangeInfoVo implements Serializable { @ExcelProperty(value = "工程项目") private String engineeringProject; + /** + * 合同类型 + */ + private String contractType; + /** * 经办人 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/service/impl/XzdGuaranteeChangeInfoServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/service/impl/XzdGuaranteeChangeInfoServiceImpl.java index ea5b13d2..188a26bf 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/service/impl/XzdGuaranteeChangeInfoServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/deposit/backletter/service/impl/XzdGuaranteeChangeInfoServiceImpl.java @@ -60,7 +60,7 @@ public class XzdGuaranteeChangeInfoServiceImpl extends ServiceImpl list(SettlementOfSubcontractingContractBo bo, PageQuery pageQuery) { + return settlementOfSubcontractingContractService.queryPageList(bo, pageQuery); + } + + /** + * 导出分包合同进度结算列表 + */ + @SaCheckPermission("fenbaohetongjingdu:ofSubcontractingContract:export") + @Log(title = "分包合同进度结算", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SettlementOfSubcontractingContractBo bo, HttpServletResponse response) { + List list = settlementOfSubcontractingContractService.queryList(bo); + ExcelUtil.exportExcel(list, "分包合同进度结算", SettlementOfSubcontractingContractVo.class, response); + } + + /** + * 获取分包合同进度结算详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fenbaohetongjingdu:ofSubcontractingContract:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(settlementOfSubcontractingContractService.queryById(id)); + } + + /** + * 新增分包合同进度结算 + */ + @SaCheckPermission("fenbaohetongjingdu:ofSubcontractingContract:add") + @Log(title = "分包合同进度结算", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SettlementOfSubcontractingContractBo bo) { + return toAjax(settlementOfSubcontractingContractService.insertByBo(bo)); + } + + /** + * 修改分包合同进度结算 + */ + @SaCheckPermission("fenbaohetongjingdu:ofSubcontractingContract:edit") + @Log(title = "分包合同进度结算", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SettlementOfSubcontractingContractBo bo) { + return toAjax(settlementOfSubcontractingContractService.updateByBo(bo)); + } + + /** + * 删除分包合同进度结算 + * + * @param ids 主键串 + */ + @SaCheckPermission("fenbaohetongjingdu:ofSubcontractingContract:remove") + @Log(title = "分包合同进度结算", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(settlementOfSubcontractingContractService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/SettlementOfSubcontractingContract.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/SettlementOfSubcontractingContract.java new file mode 100644 index 00000000..664a61c4 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/SettlementOfSubcontractingContract.java @@ -0,0 +1,168 @@ +package org.dromara.xzd.settlement.fenbaohetongjingdu.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 分包合同进度结算对象 settlement_of_subcontracting_contract + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("settlement_of_subcontracting_contract") +public class SettlementOfSubcontractingContract extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 统计周期 + */ + private String statisticPeriod; + + /** + * 计量开始 + */ + private LocalDate measurementStart; + + /** + * 项目 + */ + private Long project; + + /** + * 审批金额 + */ + private BigDecimal approvalAmount; + + /** + * 计量结束 + */ + private LocalDate measurementEnd; + + /** + * 结算单位 客户信息 + */ + private Long settlementUnit; + + /** + * 合同金额 + */ + private BigDecimal contractAmount; + + /** + * 累计结算金额(含本期) + */ + private BigDecimal cumulativeSettlementAmountIncludeCurrent; + + /** + * 累计结算金额(不含本期) + */ + private BigDecimal cumulativeSettlementNotAmountIncludeCurrent; + + /** + * 本次结算比例 + */ + private BigDecimal currentSettlementRatio; + + /** + * 截止本期结算比例 + */ + private BigDecimal settlementRatioUntilCurrent; + + /** + * 已结算比例(不含本期) + */ + private BigDecimal settlementRatioExcludeCurrent; + + /** + * 备注 + */ + private String remarks; + + /** + * 合同含税金额 + */ + private BigDecimal contractTaxInclusiveAmount; + + /** + * 合同不含税金额 + */ + private BigDecimal contractTaxExclusiveAmount; + + /** + * 累计结算金额 + */ + private BigDecimal cumulativeSettlementAmount; + + /** + * 本期扣款金额 + */ + private BigDecimal currentDeductionAmount; + + /** + * 本期奖励金额 + */ + private BigDecimal currentRewardAmount; + + /** + * 实时刷新 1选择 0未选 + */ + private String realtimeRefresh; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/bo/SettlementOfSubcontractingContractBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/bo/SettlementOfSubcontractingContractBo.java new file mode 100644 index 00000000..0c4b82df --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/bo/SettlementOfSubcontractingContractBo.java @@ -0,0 +1,170 @@ +package org.dromara.xzd.settlement.fenbaohetongjingdu.domain.bo; + +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.SettlementOfSubcontractingContract; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 分包合同进度结算业务对象 settlement_of_subcontracting_contract + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SettlementOfSubcontractingContract.class, reverseConvertGenerate = false) +public class SettlementOfSubcontractingContractBo extends BaseEntity { + + /** + * 主键ID + */ + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 统计周期 + */ + private String statisticPeriod; + + /** + * 计量开始 + */ + private LocalDate measurementStart; + + /** + * 项目 + */ + private Long project; + + /** + * 审批金额 + */ + private BigDecimal approvalAmount; + + /** + * 计量结束 + */ + private LocalDate measurementEnd; + + /** + * 结算单位 客户信息 + */ + private Long settlementUnit; + + /** + * 合同金额 + */ + private BigDecimal contractAmount; + + /** + * 累计结算金额(含本期) + */ + private BigDecimal cumulativeSettlementAmountIncludeCurrent; + + /** + * 累计结算金额(不含本期) + */ + private BigDecimal cumulativeSettlementNotAmountIncludeCurrent; + + /** + * 本次结算比例 + */ + private BigDecimal currentSettlementRatio; + + /** + * 截止本期结算比例 + */ + private BigDecimal settlementRatioUntilCurrent; + + /** + * 已结算比例(不含本期) + */ + private BigDecimal settlementRatioExcludeCurrent; + + /** + * 备注 + */ + private String remarks; + + /** + * 合同含税金额 + */ + private BigDecimal contractTaxInclusiveAmount; + + /** + * 合同不含税金额 + */ + private BigDecimal contractTaxExclusiveAmount; + + /** + * 累计结算金额 + */ + private BigDecimal cumulativeSettlementAmount; + + /** + * 本期扣款金额 + */ + private BigDecimal currentDeductionAmount; + + /** + * 本期奖励金额 + */ + private BigDecimal currentRewardAmount; + + /** + * 实时刷新 1选择 0未选 + */ + private String realtimeRefresh; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + private LocalDate startDate; + + private LocalDate endDate; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/vo/SettlementOfSubcontractingContractVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/vo/SettlementOfSubcontractingContractVo.java new file mode 100644 index 00000000..4e4af705 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/domain/vo/SettlementOfSubcontractingContractVo.java @@ -0,0 +1,221 @@ +package org.dromara.xzd.settlement.fenbaohetongjingdu.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.SettlementOfSubcontractingContract; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + + + +/** + * 分包合同进度结算视图对象 settlement_of_subcontracting_contract + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SettlementOfSubcontractingContract.class) +public class SettlementOfSubcontractingContractVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 单据编码 + */ + @ExcelProperty(value = "单据编码") + private String documentCode; + + /** + * 标题 + */ + @ExcelProperty(value = "标题") + private String title; + + /** + * 单据日期 + */ + @ExcelProperty(value = "单据日期") + private LocalDate documentDate; + + /** + * 合同编码 + */ + @ExcelProperty(value = "合同编码") + private Long contractCode; + + + /** + * 合同编码名称 + */ + @ExcelProperty(value = "合同编码名称") + private String contractCodeName; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 统计周期 + */ + @ExcelProperty(value = "统计周期") + private String statisticPeriod; + + /** + * 计量开始 + */ + @ExcelProperty(value = "计量开始") + private LocalDate measurementStart; + + /** + * 项目 + */ + @ExcelProperty(value = "项目") + private Long project; + + /** + * 项目名称 + */ + @ExcelProperty(value = "项目名称") + private String projectName; + + /** + * 审批金额 + */ + @ExcelProperty(value = "审批金额") + private BigDecimal approvalAmount; + + /** + * 计量结束 + */ + @ExcelProperty(value = "计量结束") + private LocalDate measurementEnd; + + /** + * 结算单位 客户信息 + */ + @ExcelProperty(value = "结算单位 客户信息") + private Long settlementUnit; + + /** + * 结算单位 客户信息名称 + */ + @ExcelProperty(value = "结算单位 客户信息名称") + private String settlementUnitName; + + /** + * 合同金额 + */ + @ExcelProperty(value = "合同金额") + private BigDecimal contractAmount; + + /** + * 累计结算金额(含本期) + */ + @ExcelProperty(value = "累计结算金额(含本期)") + private BigDecimal cumulativeSettlementAmountIncludeCurrent; + + /** + * 累计结算金额(不含本期) + */ + @ExcelProperty(value = "累计结算金额(不含本期)") + private BigDecimal cumulativeSettlementNotAmountIncludeCurrent; + + /** + * 本次结算比例 + */ + @ExcelProperty(value = "本次结算比例") + private BigDecimal currentSettlementRatio; + + /** + * 截止本期结算比例 + */ + @ExcelProperty(value = "截止本期结算比例") + private BigDecimal settlementRatioUntilCurrent; + + /** + * 已结算比例(不含本期) + */ + @ExcelProperty(value = "已结算比例(不含本期)") + private BigDecimal settlementRatioExcludeCurrent; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remarks; + + /** + * 合同含税金额 + */ + @ExcelProperty(value = "合同含税金额") + private BigDecimal contractTaxInclusiveAmount; + + /** + * 合同不含税金额 + */ + @ExcelProperty(value = "合同不含税金额") + private BigDecimal contractTaxExclusiveAmount; + + /** + * 累计结算金额 + */ + @ExcelProperty(value = "累计结算金额") + private BigDecimal cumulativeSettlementAmount; + + /** + * 本期扣款金额 + */ + @ExcelProperty(value = "本期扣款金额") + private BigDecimal currentDeductionAmount; + + /** + * 本期奖励金额 + */ + @ExcelProperty(value = "本期奖励金额") + private BigDecimal currentRewardAmount; + + /** + * 实时刷新 1选择 0未选 + */ + @ExcelProperty(value = "实时刷新 1选择 0未选") + private String realtimeRefresh; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/mapper/SettlementOfSubcontractingContractMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/mapper/SettlementOfSubcontractingContractMapper.java new file mode 100644 index 00000000..8e97e4d2 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/mapper/SettlementOfSubcontractingContractMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.settlement.fenbaohetongjingdu.mapper; + +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.SettlementOfSubcontractingContract; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.vo.SettlementOfSubcontractingContractVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 分包合同进度结算Mapper接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface SettlementOfSubcontractingContractMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/ISettlementOfSubcontractingContractService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/ISettlementOfSubcontractingContractService.java new file mode 100644 index 00000000..ae54c0db --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/ISettlementOfSubcontractingContractService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.settlement.fenbaohetongjingdu.service; + +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.vo.SettlementOfSubcontractingContractVo; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.bo.SettlementOfSubcontractingContractBo; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.SettlementOfSubcontractingContract; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 分包合同进度结算Service接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface ISettlementOfSubcontractingContractService extends IService{ + + /** + * 查询分包合同进度结算 + * + * @param id 主键 + * @return 分包合同进度结算 + */ + SettlementOfSubcontractingContractVo queryById(Long id); + + /** + * 分页查询分包合同进度结算列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同进度结算分页列表 + */ + TableDataInfo queryPageList(SettlementOfSubcontractingContractBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的分包合同进度结算列表 + * + * @param bo 查询条件 + * @return 分包合同进度结算列表 + */ + List queryList(SettlementOfSubcontractingContractBo bo); + + /** + * 新增分包合同进度结算 + * + * @param bo 分包合同进度结算 + * @return 是否新增成功 + */ + Boolean insertByBo(SettlementOfSubcontractingContractBo bo); + + /** + * 修改分包合同进度结算 + * + * @param bo 分包合同进度结算 + * @return 是否修改成功 + */ + Boolean updateByBo(SettlementOfSubcontractingContractBo bo); + + /** + * 校验并批量删除分包合同进度结算信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/impl/SettlementOfSubcontractingContractServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/impl/SettlementOfSubcontractingContractServiceImpl.java new file mode 100644 index 00000000..09c12dc5 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjingdu/service/impl/SettlementOfSubcontractingContractServiceImpl.java @@ -0,0 +1,228 @@ +package org.dromara.xzd.settlement.fenbaohetongjingdu.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.caigoucontractTermination.domain.XzdPurchaseContractSuspend; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.vo.XzdSubcontractVo; +import org.dromara.xzd.domain.*; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; +import org.dromara.xzd.service.IXzdCorrespondentList; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.dromara.xzd.utilS.AreaUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.bo.SettlementOfSubcontractingContractBo; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.vo.SettlementOfSubcontractingContractVo; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.SettlementOfSubcontractingContract; +import org.dromara.xzd.settlement.fenbaohetongjingdu.mapper.SettlementOfSubcontractingContractMapper; +import org.dromara.xzd.settlement.fenbaohetongjingdu.service.ISettlementOfSubcontractingContractService; + +import java.time.LocalDate; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 分包合同进度结算Service业务层处理 + * + * @author Lion Li + * @date 2025-10-15 + */ +@RequiredArgsConstructor +@Service +public class SettlementOfSubcontractingContractServiceImpl extends ServiceImpl implements ISettlementOfSubcontractingContractService { + + private final SettlementOfSubcontractingContractMapper baseMapper; + private final AreaUtil areaUtil; + + + @Autowired + private IXzdCorrespondentList iXzdCorrespondentList; + + + @Autowired + private XzdProjectServiceImpl xzdProjectService; + + @Autowired + private SysOssServiceImpl sysOssService; + + /** + * 查询分包合同进度结算 + * + * @param id 主键 + * @return 分包合同进度结算 + */ + @Override + public SettlementOfSubcontractingContractVo queryById(Long id){ + SettlementOfSubcontractingContractVo vo = baseMapper.selectVoById(id); + List res = List.of(vo); + setValue(res); + + return res.getFirst(); + } + + /** + * 分页查询分包合同进度结算列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同进度结算分页列表 + */ + @Override + public TableDataInfo queryPageList(SettlementOfSubcontractingContractBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + setValue(result.getRecords()); + return TableDataInfo.build(result); + } + + + +// 填充数据 + + private void setValue(List records) { + for (SettlementOfSubcontractingContractVo item : records) { + //项目名称 + if (item.getProject() != null){ + String projectName = xzdProjectService.queryNameById(item.getProject()); + if (projectName != null){ + item.setProjectName(projectName); + } + } + //甲方单位(客户信息列表) + R byid = iXzdCorrespondentList.getCustomerByid(item.getSettlementUnit()); + if (byid!=null){ + if (byid.getData().getXzdCustomerinformation() != null){ + item.setSettlementUnitName(byid.getData().getXzdCustomerinformation().getUnitName()); + } + } + } + } + + /** + * 查询符合条件的分包合同进度结算列表 + * + * @param bo 查询条件 + * @return 分包合同进度结算列表 + */ + @Override + public List queryList(SettlementOfSubcontractingContractBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SettlementOfSubcontractingContractBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(SettlementOfSubcontractingContract::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentCode()), SettlementOfSubcontractingContract::getDocumentCode, bo.getDocumentCode()); + lqw.eq(StringUtils.isNotBlank(bo.getTitle()), SettlementOfSubcontractingContract::getTitle, bo.getTitle()); + lqw.eq(bo.getDocumentDate() != null, SettlementOfSubcontractingContract::getDocumentDate, bo.getDocumentDate()); + lqw.ge(bo.getStartDate() != null, SettlementOfSubcontractingContract::getDocumentDate, bo.getStartDate()); + lqw.le(bo.getEndDate() != null, SettlementOfSubcontractingContract::getDocumentDate, bo.getEndDate()); + + + lqw.eq(bo.getContractCode() != null, SettlementOfSubcontractingContract::getContractCode, bo.getContractCode()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), SettlementOfSubcontractingContract::getContractName, bo.getContractName()); + lqw.eq(StringUtils.isNotBlank(bo.getStatisticPeriod()), SettlementOfSubcontractingContract::getStatisticPeriod, bo.getStatisticPeriod()); + lqw.eq(bo.getMeasurementStart() != null, SettlementOfSubcontractingContract::getMeasurementStart, bo.getMeasurementStart()); + lqw.eq(bo.getProject() != null, SettlementOfSubcontractingContract::getProject, bo.getProject()); + lqw.eq(bo.getApprovalAmount() != null, SettlementOfSubcontractingContract::getApprovalAmount, bo.getApprovalAmount()); + lqw.eq(bo.getMeasurementEnd() != null, SettlementOfSubcontractingContract::getMeasurementEnd, bo.getMeasurementEnd()); + lqw.eq(bo.getSettlementUnit() != null, SettlementOfSubcontractingContract::getSettlementUnit, bo.getSettlementUnit()); + lqw.eq(bo.getContractAmount() != null, SettlementOfSubcontractingContract::getContractAmount, bo.getContractAmount()); + lqw.eq(bo.getCumulativeSettlementAmountIncludeCurrent() != null, SettlementOfSubcontractingContract::getCumulativeSettlementAmountIncludeCurrent, bo.getCumulativeSettlementAmountIncludeCurrent()); + lqw.eq(bo.getCumulativeSettlementNotAmountIncludeCurrent() != null, SettlementOfSubcontractingContract::getCumulativeSettlementNotAmountIncludeCurrent, bo.getCumulativeSettlementNotAmountIncludeCurrent()); + lqw.eq(bo.getCurrentSettlementRatio() != null, SettlementOfSubcontractingContract::getCurrentSettlementRatio, bo.getCurrentSettlementRatio()); + lqw.eq(bo.getSettlementRatioUntilCurrent() != null, SettlementOfSubcontractingContract::getSettlementRatioUntilCurrent, bo.getSettlementRatioUntilCurrent()); + lqw.eq(bo.getSettlementRatioExcludeCurrent() != null, SettlementOfSubcontractingContract::getSettlementRatioExcludeCurrent, bo.getSettlementRatioExcludeCurrent()); + lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), SettlementOfSubcontractingContract::getRemarks, bo.getRemarks()); + lqw.eq(bo.getContractTaxInclusiveAmount() != null, SettlementOfSubcontractingContract::getContractTaxInclusiveAmount, bo.getContractTaxInclusiveAmount()); + lqw.eq(bo.getContractTaxExclusiveAmount() != null, SettlementOfSubcontractingContract::getContractTaxExclusiveAmount, bo.getContractTaxExclusiveAmount()); + lqw.eq(bo.getCumulativeSettlementAmount() != null, SettlementOfSubcontractingContract::getCumulativeSettlementAmount, bo.getCumulativeSettlementAmount()); + lqw.eq(bo.getCurrentDeductionAmount() != null, SettlementOfSubcontractingContract::getCurrentDeductionAmount, bo.getCurrentDeductionAmount()); + lqw.eq(bo.getCurrentRewardAmount() != null, SettlementOfSubcontractingContract::getCurrentRewardAmount, bo.getCurrentRewardAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getRealtimeRefresh()), SettlementOfSubcontractingContract::getRealtimeRefresh, bo.getRealtimeRefresh()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), SettlementOfSubcontractingContract::getFileId, bo.getFileId()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), SettlementOfSubcontractingContract::getAuditStatus, bo.getAuditStatus()); + return lqw; + } + + /** + * 新增分包合同进度结算 + * + * @param bo 分包合同进度结算 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(SettlementOfSubcontractingContractBo bo) { + SettlementOfSubcontractingContract add = MapstructUtils.convert(bo, SettlementOfSubcontractingContract.class); + validEntityBeforeSave(add); + Long l = baseMapper.selectCount(new LambdaQueryWrapper().gt(SettlementOfSubcontractingContract::getCreateTime, LocalDate.now())); + String s = areaUtil.generateDateBasedNumber(); + add.setDocumentCode(s+"-"+(l+1)); + + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改分包合同进度结算 + * + * @param bo 分包合同进度结算 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(SettlementOfSubcontractingContractBo bo) { + SettlementOfSubcontractingContract update = MapstructUtils.convert(bo, SettlementOfSubcontractingContract.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SettlementOfSubcontractingContract entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除分包合同进度结算信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + for (Long id : ids) { + SettlementOfSubcontractingContractVo vo = baseMapper.selectVoById(id); + if (vo != null){ + //删除附件 + if (vo.getFileId()!= null && !vo.getFileId().isEmpty()){ + List deleteIds = Arrays.stream(vo.getFileId().split(",")).map(Long::valueOf).toList(); + if (!deleteIds.isEmpty()) { + sysOssService.deleteWithValidByIds(deleteIds, false); + } + } + } + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/controller/SettlementOfSubcontractingCompletionController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/controller/SettlementOfSubcontractingCompletionController.java new file mode 100644 index 00000000..e59deea3 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/controller/SettlementOfSubcontractingCompletionController.java @@ -0,0 +1,121 @@ +package org.dromara.xzd.settlement.fenbaohetongjungong.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.xzd.domain.vo.XzdSettlementRulesVo; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.vo.SettlementOfSubcontractingCompletionVo; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.bo.SettlementOfSubcontractingCompletionBo; +import org.dromara.xzd.settlement.fenbaohetongjungong.service.ISettlementOfSubcontractingCompletionService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 分包合同竣工结算 + * + * @author Lion Li + * @date 2025-10-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/fenbaohetongjungong/ofSubcontractingCompletion") +public class SettlementOfSubcontractingCompletionController extends BaseController { + + private final ISettlementOfSubcontractingCompletionService settlementOfSubcontractingCompletionService; + + /** + * 查询分包合同竣工结算列表 + */ + @SaCheckPermission("fenbaohetongjungong:ofSubcontractingCompletion:list") + @GetMapping("/list") + public TableDataInfo list(SettlementOfSubcontractingCompletionBo bo, PageQuery pageQuery) { + return settlementOfSubcontractingCompletionService.queryPageList(bo, pageQuery); + } + + /** + * 导出分包合同竣工结算列表 + */ + @SaCheckPermission("fenbaohetongjungong:ofSubcontractingCompletion:export") + @Log(title = "分包合同竣工结算", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SettlementOfSubcontractingCompletionBo bo, HttpServletResponse response) { + List list = settlementOfSubcontractingCompletionService.queryList(bo); + ExcelUtil.exportExcel(list, "分包合同竣工结算", SettlementOfSubcontractingCompletionVo.class, response); + } + + /** + * 获取分包合同竣工结算详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fenbaohetongjungong:ofSubcontractingCompletion:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(settlementOfSubcontractingCompletionService.queryById(id)); + } + + /** + * 新增分包合同竣工结算 + */ + @SaCheckPermission("fenbaohetongjungong:ofSubcontractingCompletion:add") + @Log(title = "分包合同竣工结算", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SettlementOfSubcontractingCompletionBo bo) { + return toAjax(settlementOfSubcontractingCompletionService.insertByBo(bo)); + } + + /** + * 修改分包合同竣工结算 + */ + @SaCheckPermission("fenbaohetongjungong:ofSubcontractingCompletion:edit") + @Log(title = "分包合同竣工结算", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SettlementOfSubcontractingCompletionBo bo) { + return toAjax(settlementOfSubcontractingCompletionService.updateByBo(bo)); + } + + /** + * 删除分包合同竣工结算 + * + * @param ids 主键串 + */ + @SaCheckPermission("fenbaohetongjungong:ofSubcontractingCompletion:remove") + @Log(title = "分包合同竣工结算", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(settlementOfSubcontractingCompletionService.deleteWithValidByIds(List.of(ids), true)); + } + /** + * 根据合同编号获取支付条款 + * + * @param id 合同编号 + */ + @SaCheckPermission("fenbaohetongjungong:ofSubcontractingCompletion:remove") + @Log(title = "根据合同编号获取支付条款", businessType = BusinessType.DELETE) + @DeleteMapping("/contract/{id}") + public R> contractPaymentTerm(@NotEmpty(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(settlementOfSubcontractingCompletionService.contractPaymentTerm(id, true)); + } + + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java new file mode 100644 index 00000000..c212904b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java @@ -0,0 +1,173 @@ +package org.dromara.xzd.settlement.fenbaohetongjungong.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 分包合同竣工结算对象 settlement_of_subcontracting_completion + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("settlement_of_subcontracting_completion") +public class SettlementOfSubcontractingCompletion extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编号 + */ + private String documentCode; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 合同编号 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 审定总价 + */ + private Long approvedTotalPrice; + + /** + * 审定日期 + */ + private LocalDate approvedDate; + + /** + * 工程项目 + */ + private String engineeringProject; + + /** + * 经营模式 + */ + private String businessModel; + + /** + * 甲方单位 + */ + private Long partyAUnit; + + /** + * 乙方单位 + */ + private Long partyBUnit; + + /** + * 累计已结金额 + */ + private BigDecimal cumulativeSettledAmount; + + /** + * 累计已付金额 + */ + private BigDecimal cumulativePaidAmount; + + /** + * 已付比例 + */ + private BigDecimal paidRatio; + + /** + * 支付条款 + */ + private Long paymentTerms; + + /** + * 本期应付金额 + */ + private BigDecimal currentPayableAmount; + + /** + * 应付日期 + */ + private LocalDate payableDate; + + /** + * 竣工日期 + */ + private LocalDate completionDate; + + /** + * 警示 + */ + private String warning; + + /** + * 备注 + */ + private String remarks; + + /** + * 本期决算总额 + */ + private BigDecimal currentFinalSettlementAmount; + + /** + * 业主单位 客户 + */ + private Long ownerUnit; + + /** + * 监理单位 客户 + */ + private Long supervisionUnit; + + /** + * 施工单位 客户 + */ + private Long constructionUnit; + + /** + * 审核单位 客户 + */ + private Long auditUnit; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java new file mode 100644 index 00000000..d4e13f9c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java @@ -0,0 +1,179 @@ +package org.dromara.xzd.settlement.fenbaohetongjungong.domain.bo; + +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.SettlementOfSubcontractingCompletion; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 分包合同竣工结算业务对象 settlement_of_subcontracting_completion + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SettlementOfSubcontractingCompletion.class, reverseConvertGenerate = false) +public class SettlementOfSubcontractingCompletionBo extends BaseEntity { + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 单据编号 + */ + @NotBlank(message = "单据编号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String documentCode; + + /** + * 标题 + */ + @NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class }) + private String title; + + /** + * 单据日期 + */ + @NotNull(message = "单据日期不能为空", groups = { AddGroup.class, EditGroup.class }) + private LocalDate documentDate; + + /** + * 合同编号 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 审定总价 + */ + private Long approvedTotalPrice; + + /** + * 审定日期 + */ + private LocalDate approvedDate; + + /** + * 工程项目 + */ + private String engineeringProject; + + /** + * 经营模式 + */ + private String businessModel; + + /** + * 甲方单位 + */ + private Long partyAUnit; + + /** + * 乙方单位 + */ + private Long partyBUnit; + + /** + * 累计已结金额 + */ + private BigDecimal cumulativeSettledAmount; + + /** + * 累计已付金额 + */ + private BigDecimal cumulativePaidAmount; + + /** + * 已付比例 + */ + private BigDecimal paidRatio; + + /** + * 支付条款 + */ + private Long paymentTerms; + + /** + * 本期应付金额 + */ + private BigDecimal currentPayableAmount; + + /** + * 应付日期 + */ + private LocalDate payableDate; + + /** + * 竣工日期 + */ + private LocalDate completionDate; + + /** + * 警示 + */ + private String warning; + + /** + * 备注 + */ + private String remarks; + + /** + * 本期决算总额 + */ + private BigDecimal currentFinalSettlementAmount; + + /** + * 业主单位 客户 + */ + private Long ownerUnit; + + /** + * 监理单位 客户 + */ + private Long supervisionUnit; + + /** + * 施工单位 客户 + */ + private Long constructionUnit; + + /** + * 审核单位 客户 + */ + private Long auditUnit; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + private LocalDate startTime; + + private LocalDate endTime; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java new file mode 100644 index 00000000..834f9460 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java @@ -0,0 +1,254 @@ +package org.dromara.xzd.settlement.fenbaohetongjungong.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.SettlementOfSubcontractingCompletion; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + + + +/** + * 分包合同竣工结算视图对象 settlement_of_subcontracting_completion + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SettlementOfSubcontractingCompletion.class) +public class SettlementOfSubcontractingCompletionVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 单据编号 + */ + @ExcelProperty(value = "单据编号") + private String documentCode; + + /** + * 标题 + */ + @ExcelProperty(value = "标题") + private String title; + + /** + * 单据日期 + */ + @ExcelProperty(value = "单据日期") + private LocalDate documentDate; + + /** + * 合同编号 + */ + @ExcelProperty(value = "合同编号") + private Long contractCode; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 审定总价 + */ + @ExcelProperty(value = "审定总价") + private Long approvedTotalPrice; + + /** + * 审定日期 + */ + @ExcelProperty(value = "审定日期") + private LocalDate approvedDate; + + /** + * 工程项目 + */ + @ExcelProperty(value = "工程项目") + private String engineeringProject; + + /** + * 经营模式 + */ + @ExcelProperty(value = "经营模式") + private String businessModel; + + /** + * 甲方单位 + */ + @ExcelProperty(value = "甲方单位") + private Long partyAUnit; + + + /** + * 甲方单位名称 + */ + @ExcelProperty(value = "甲方单位名称") + private String partyAUnitName; + + + /** + * 乙方单位 + */ + @ExcelProperty(value = "乙方单位") + private Long partyBUnit; + + /** + * 乙方单位名称 + */ + @ExcelProperty(value = "乙方单位名称") + private String partyBUnitName; + + /** + * 累计已结金额 + */ + @ExcelProperty(value = "累计已结金额") + private BigDecimal cumulativeSettledAmount; + + /** + * 累计已付金额 + */ + @ExcelProperty(value = "累计已付金额") + private BigDecimal cumulativePaidAmount; + + /** + * 已付比例 + */ + @ExcelProperty(value = "已付比例") + private BigDecimal paidRatio; + + /** + * 支付条款 + */ + @ExcelProperty(value = "支付条款") + private Long paymentTerms; + + + /** + * 支付条款回显信息 + */ + @ExcelProperty(value = "支付条款回显信息") + private String paymentTermsName; + + /** + * 本期应付金额 + */ + @ExcelProperty(value = "本期应付金额") + private BigDecimal currentPayableAmount; + + /** + * 应付日期 + */ + @ExcelProperty(value = "应付日期") + private LocalDate payableDate; + + /** + * 竣工日期 + */ + @ExcelProperty(value = "竣工日期") + private LocalDate completionDate; + + /** + * 警示 + */ + @ExcelProperty(value = "警示") + private String warning; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remarks; + + /** + * 本期决算总额 + */ + @ExcelProperty(value = "本期决算总额") + private BigDecimal currentFinalSettlementAmount; + + /** + * 业主单位 客户 + */ + @ExcelProperty(value = "业主单位 客户") + private Long ownerUnit; + + /** + * 业主单位名称 客户 + */ + @ExcelProperty(value = "业主单位名称 客户") + private String ownerUnitName; + + /** + * 监理单位 客户 + */ + @ExcelProperty(value = "监理单位 客户") + private Long supervisionUnit; + + /** + * 监理单位名称 客户 + */ + @ExcelProperty(value = "监理单位名称 客户") + private String supervisionUnitName; + + /** + * 施工单位 客户 + */ + @ExcelProperty(value = "施工单位 客户") + private Long constructionUnit; + + /** + * 施工单位名称 客户 + */ + @ExcelProperty(value = "施工单位名称 客户") + private String constructionUnitName; + + /** + * 审核单位 客户 + */ + @ExcelProperty(value = "审核单位 客户") + private Long auditUnit; + + /** + * 审核单位名称 客户 + */ + @ExcelProperty(value = "审核单位名称 客户") + private String auditUnitName; + + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/mapper/SettlementOfSubcontractingCompletionMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/mapper/SettlementOfSubcontractingCompletionMapper.java new file mode 100644 index 00000000..da86e7cd --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/mapper/SettlementOfSubcontractingCompletionMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.settlement.fenbaohetongjungong.mapper; + +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.SettlementOfSubcontractingCompletion; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.vo.SettlementOfSubcontractingCompletionVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 分包合同竣工结算Mapper接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface SettlementOfSubcontractingCompletionMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/ISettlementOfSubcontractingCompletionService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/ISettlementOfSubcontractingCompletionService.java new file mode 100644 index 00000000..1f06f7d7 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/ISettlementOfSubcontractingCompletionService.java @@ -0,0 +1,76 @@ +package org.dromara.xzd.settlement.fenbaohetongjungong.service; + +import jakarta.validation.constraints.NotEmpty; +import org.dromara.xzd.domain.vo.XzdSettlementRulesVo; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.vo.SettlementOfSubcontractingCompletionVo; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.bo.SettlementOfSubcontractingCompletionBo; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.SettlementOfSubcontractingCompletion; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 分包合同竣工结算Service接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface ISettlementOfSubcontractingCompletionService extends IService{ + + /** + * 查询分包合同竣工结算 + * + * @param id 主键 + * @return 分包合同竣工结算 + */ + SettlementOfSubcontractingCompletionVo queryById(Long id); + + /** + * 分页查询分包合同竣工结算列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同竣工结算分页列表 + */ + TableDataInfo queryPageList(SettlementOfSubcontractingCompletionBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的分包合同竣工结算列表 + * + * @param bo 查询条件 + * @return 分包合同竣工结算列表 + */ + List queryList(SettlementOfSubcontractingCompletionBo bo); + + /** + * 新增分包合同竣工结算 + * + * @param bo 分包合同竣工结算 + * @return 是否新增成功 + */ + Boolean insertByBo(SettlementOfSubcontractingCompletionBo bo); + + /** + * 修改分包合同竣工结算 + * + * @param bo 分包合同竣工结算 + * @return 是否修改成功 + */ + Boolean updateByBo(SettlementOfSubcontractingCompletionBo bo); + + /** + * 校验并批量删除分包合同竣工结算信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + + + List contractPaymentTerm(@NotEmpty(message = "主键不能为空") Long id, boolean b); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java new file mode 100644 index 00000000..13388e97 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java @@ -0,0 +1,307 @@ +package org.dromara.xzd.settlement.fenbaohetongjungong.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.vo.XzdSubcontractVo; +import org.dromara.xzd.domain.*; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; +import org.dromara.xzd.domain.vo.XzdSettlementRulesVo; +import org.dromara.xzd.service.*; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.SettlementOfSubcontractingContract; +import org.dromara.xzd.settlement.fenbaohetongjingdu.domain.vo.SettlementOfSubcontractingContractVo; +import org.dromara.xzd.utilS.AreaUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.bo.SettlementOfSubcontractingCompletionBo; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.vo.SettlementOfSubcontractingCompletionVo; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.SettlementOfSubcontractingCompletion; +import org.dromara.xzd.settlement.fenbaohetongjungong.mapper.SettlementOfSubcontractingCompletionMapper; +import org.dromara.xzd.settlement.fenbaohetongjungong.service.ISettlementOfSubcontractingCompletionService; + +import java.time.LocalDate; +import java.util.*; + +/** + * 分包合同竣工结算Service业务层处理 + * + * @author Lion Li + * @date 2025-10-15 + */ +@RequiredArgsConstructor +@Service +public class SettlementOfSubcontractingCompletionServiceImpl extends ServiceImpl implements ISettlementOfSubcontractingCompletionService { + + private final SettlementOfSubcontractingCompletionMapper baseMapper; + + private final AreaUtil areaUtil; + + private final IXzdSettlementRulesService xzdSettlementRulesService; + + + @Autowired + private IXzdCorrespondentList iXzdCorrespondentList; + + + @Autowired + private XzdProjectServiceImpl xzdProjectService; + + @Autowired + private SysOssServiceImpl sysOssService; + + @Autowired + private XzdSupplierInfoServiceImpl xzdSupplierInfoService; + + private final IXzdContractAdvanceInfoService iXzdContractAdvanceInfoService; + + private final IXzdDeductionItemsService iXzdDeductionItemsService; + + private final IXzdContractClauseService iXzdContractClauseService; + + /** + * 查询分包合同竣工结算 + * + * @param id 主键 + * @return 分包合同竣工结算 + */ + @Override + public SettlementOfSubcontractingCompletionVo queryById(Long id){ + SettlementOfSubcontractingCompletionVo vo = baseMapper.selectVoById(id); + if (vo == null) { + throw new RuntimeException("数据不存在"); + } + List res = List.of(vo); + setValue(res); + + return res.getFirst(); + } + + /** + * 分页查询分包合同竣工结算列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同竣工结算分页列表 + */ + @Override + public TableDataInfo queryPageList(SettlementOfSubcontractingCompletionBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + setValue(result.getRecords()); + return TableDataInfo.build(result); + } + + private void setValue(List records) { + for (SettlementOfSubcontractingCompletionVo item : records) { +// //项目名称 +// if (item.getProject() != null){ +// String projectName = xzdProjectService.queryNameById(item.getProject()); +// if (projectName != null){ +// item.setProjectName(projectName); +// } +// } + //甲方单位(客户信息列表) + R byid = iXzdCorrespondentList.getCustomerByid(item.getPartyAUnit()); + if (byid!=null){ + if (byid.getData().getXzdCustomerinformation() != null){ + item.setPartyAUnitName(byid.getData().getXzdCustomerinformation().getUnitName()); + } + } + //乙方单位(供应商信息列表) + if (item.getPartyBUnit() != null){ + String unitName = xzdSupplierInfoService.queryNameById(item.getPartyBUnit()); + if (unitName != null){ + item.setPartyBUnitName(unitName); + } + } +// 支付条款 + if (item.getPaymentTerms() != null){ + XzdSettlementRules byId = xzdSettlementRulesService.getById(item.getPaymentTerms()); + if (byId != null){ + item.setPaymentTermsName(byId.getType()); + } + } + + // 业主单位(客户信息列表) + R temp = iXzdCorrespondentList.getCustomerByid(item.getOwnerUnit()); + if (temp!=null){ + if (temp.getData().getXzdCustomerinformation() != null){ + item.setOwnerUnitName(temp.getData().getXzdCustomerinformation().getUnitName()); + } + } + + // 监理单位(客户信息列表) + R supervisionUnit = iXzdCorrespondentList.getCustomerByid(item.getSupervisionUnit()); + if (supervisionUnit!=null){ + if (supervisionUnit.getData().getXzdCustomerinformation() != null){ + item.setSupervisionUnitName(supervisionUnit.getData().getXzdCustomerinformation().getUnitName()); + } + } + + // 施工单位(客户信息列表) + R constructionUnit = iXzdCorrespondentList.getCustomerByid(item.getConstructionUnit()); + if (constructionUnit!=null){ + if (constructionUnit.getData().getXzdCustomerinformation() != null){ + item.setConstructionUnitName(constructionUnit.getData().getXzdCustomerinformation().getUnitName()); + } + } + + // 施工单位(客户信息列表) + R auditUnit = iXzdCorrespondentList.getCustomerByid(item.getAuditUnit()); + if (auditUnit!=null){ + if (auditUnit.getData().getXzdCustomerinformation() != null){ + item.setAuditUnitName(auditUnit.getData().getXzdCustomerinformation().getUnitName()); + } + } + } + } + + /** + * 查询符合条件的分包合同竣工结算列表 + * + * @param bo 查询条件 + * @return 分包合同竣工结算列表 + */ + @Override + public List queryList(SettlementOfSubcontractingCompletionBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SettlementOfSubcontractingCompletionBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(SettlementOfSubcontractingCompletion::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentCode()), SettlementOfSubcontractingCompletion::getDocumentCode, bo.getDocumentCode()); + lqw.eq(StringUtils.isNotBlank(bo.getTitle()), SettlementOfSubcontractingCompletion::getTitle, bo.getTitle()); + lqw.eq(bo.getDocumentDate() != null, SettlementOfSubcontractingCompletion::getDocumentDate, bo.getDocumentDate()); + lqw.ge(bo.getStartTime() != null, SettlementOfSubcontractingCompletion::getDocumentDate, bo.getStartTime()); + lqw.le(bo.getEndTime() != null, SettlementOfSubcontractingCompletion::getDocumentDate, bo.getEndTime()); + + + + lqw.eq(bo.getContractCode() != null, SettlementOfSubcontractingCompletion::getContractCode, bo.getContractCode()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), SettlementOfSubcontractingCompletion::getContractName, bo.getContractName()); + lqw.eq(bo.getApprovedTotalPrice() != null, SettlementOfSubcontractingCompletion::getApprovedTotalPrice, bo.getApprovedTotalPrice()); + lqw.eq(bo.getApprovedDate() != null, SettlementOfSubcontractingCompletion::getApprovedDate, bo.getApprovedDate()); + lqw.eq(StringUtils.isNotBlank(bo.getEngineeringProject()), SettlementOfSubcontractingCompletion::getEngineeringProject, bo.getEngineeringProject()); + lqw.eq(StringUtils.isNotBlank(bo.getBusinessModel()), SettlementOfSubcontractingCompletion::getBusinessModel, bo.getBusinessModel()); + lqw.eq(bo.getPartyAUnit() != null, SettlementOfSubcontractingCompletion::getPartyAUnit, bo.getPartyAUnit()); + lqw.eq(bo.getPartyBUnit() != null, SettlementOfSubcontractingCompletion::getPartyBUnit, bo.getPartyBUnit()); + lqw.eq(bo.getCumulativeSettledAmount() != null, SettlementOfSubcontractingCompletion::getCumulativeSettledAmount, bo.getCumulativeSettledAmount()); + lqw.eq(bo.getCumulativePaidAmount() != null, SettlementOfSubcontractingCompletion::getCumulativePaidAmount, bo.getCumulativePaidAmount()); + lqw.eq(bo.getPaidRatio() != null, SettlementOfSubcontractingCompletion::getPaidRatio, bo.getPaidRatio()); + lqw.eq(bo.getPaymentTerms() != null, SettlementOfSubcontractingCompletion::getPaymentTerms, bo.getPaymentTerms()); + lqw.eq(bo.getCurrentPayableAmount() != null, SettlementOfSubcontractingCompletion::getCurrentPayableAmount, bo.getCurrentPayableAmount()); + lqw.eq(bo.getPayableDate() != null, SettlementOfSubcontractingCompletion::getPayableDate, bo.getPayableDate()); + lqw.eq(bo.getCompletionDate() != null, SettlementOfSubcontractingCompletion::getCompletionDate, bo.getCompletionDate()); + lqw.eq(StringUtils.isNotBlank(bo.getWarning()), SettlementOfSubcontractingCompletion::getWarning, bo.getWarning()); + lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), SettlementOfSubcontractingCompletion::getRemarks, bo.getRemarks()); + lqw.eq(bo.getCurrentFinalSettlementAmount() != null, SettlementOfSubcontractingCompletion::getCurrentFinalSettlementAmount, bo.getCurrentFinalSettlementAmount()); + lqw.eq(bo.getOwnerUnit() != null, SettlementOfSubcontractingCompletion::getOwnerUnit, bo.getOwnerUnit()); + lqw.eq(bo.getSupervisionUnit() != null, SettlementOfSubcontractingCompletion::getSupervisionUnit, bo.getSupervisionUnit()); + lqw.eq(bo.getConstructionUnit() != null, SettlementOfSubcontractingCompletion::getConstructionUnit, bo.getConstructionUnit()); + lqw.eq(bo.getAuditUnit() != null, SettlementOfSubcontractingCompletion::getAuditUnit, bo.getAuditUnit()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), SettlementOfSubcontractingCompletion::getFileId, bo.getFileId()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), SettlementOfSubcontractingCompletion::getAuditStatus, bo.getAuditStatus()); + return lqw; + } + + /** + * 新增分包合同竣工结算 + * + * @param bo 分包合同竣工结算 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(SettlementOfSubcontractingCompletionBo bo) { + SettlementOfSubcontractingCompletion add = MapstructUtils.convert(bo, SettlementOfSubcontractingCompletion.class); + validEntityBeforeSave(add); + Long l = baseMapper.selectCount(new LambdaQueryWrapper().gt(SettlementOfSubcontractingCompletion::getCreateTime, LocalDate.now())); + String s = areaUtil.generateDateBasedNumber(); + add.setDocumentCode(s+"-"+(l+1)); + + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改分包合同竣工结算 + * + * @param bo 分包合同竣工结算 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(SettlementOfSubcontractingCompletionBo bo) { + SettlementOfSubcontractingCompletion update = MapstructUtils.convert(bo, SettlementOfSubcontractingCompletion.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SettlementOfSubcontractingCompletion entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除分包合同竣工结算信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + + } + + for (Long id : ids) { + SettlementOfSubcontractingCompletionVo vo = baseMapper.selectVoById(id); + if (vo != null){ + //删除附件 + if (vo.getFileId()!= null && !vo.getFileId().isEmpty()){ + List deleteIds = Arrays.stream(vo.getFileId().split(",")).map(Long::valueOf).toList(); + if (!deleteIds.isEmpty()) { + sysOssService.deleteWithValidByIds(deleteIds, false); + } + } + } + } + return baseMapper.deleteByIds(ids) > 0; + } + + + + + /** + * 查询符合条件的分包合同竣工结算列表 + * + * @return 分包合同竣工结算列表 + */ + @Override + public List contractPaymentTerm(Long id, boolean b) { + Map hashMap = new HashMap<>(); + hashMap.put("contract_details_id", id); + List xzdSettlementRules = xzdSettlementRulesService.getBaseMapper().selectByMap(hashMap); + + List convert = MapstructUtils.convert(xzdSettlementRules, XzdSettlementRulesVo.class); + + return convert; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/controller/SettlementOfSubcontractingAdjustmentController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/controller/SettlementOfSubcontractingAdjustmentController.java new file mode 100644 index 00000000..305b8b1a --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/controller/SettlementOfSubcontractingAdjustmentController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.settlement.fenbaohetongtiaozheng.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.vo.SettlementOfSubcontractingAdjustmentVo; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.bo.SettlementOfSubcontractingAdjustmentBo; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.service.ISettlementOfSubcontractingAdjustmentService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 分包合同竣工结算调整 + * + * @author Lion Li + * @date 2025-10-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/fenbaohetongtiaozheng/ofSubcontractingAdjustment") +public class SettlementOfSubcontractingAdjustmentController extends BaseController { + + private final ISettlementOfSubcontractingAdjustmentService settlementOfSubcontractingAdjustmentService; + + /** + * 查询分包合同竣工结算调整列表 + */ + @SaCheckPermission("fenbaohetongtiaozheng:ofSubcontractingAdjustment:list") + @GetMapping("/list") + public TableDataInfo list(SettlementOfSubcontractingAdjustmentBo bo, PageQuery pageQuery) { + return settlementOfSubcontractingAdjustmentService.queryPageList(bo, pageQuery); + } + + /** + * 导出分包合同竣工结算调整列表 + */ + @SaCheckPermission("fenbaohetongtiaozheng:ofSubcontractingAdjustment:export") + @Log(title = "分包合同竣工结算调整", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SettlementOfSubcontractingAdjustmentBo bo, HttpServletResponse response) { + List list = settlementOfSubcontractingAdjustmentService.queryList(bo); + ExcelUtil.exportExcel(list, "分包合同竣工结算调整", SettlementOfSubcontractingAdjustmentVo.class, response); + } + + /** + * 获取分包合同竣工结算调整详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fenbaohetongtiaozheng:ofSubcontractingAdjustment:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(settlementOfSubcontractingAdjustmentService.queryById(id)); + } + + /** + * 新增分包合同竣工结算调整 + */ + @SaCheckPermission("fenbaohetongtiaozheng:ofSubcontractingAdjustment:add") + @Log(title = "分包合同竣工结算调整", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SettlementOfSubcontractingAdjustmentBo bo) { + return toAjax(settlementOfSubcontractingAdjustmentService.insertByBo(bo)); + } + + /** + * 修改分包合同竣工结算调整 + */ + @SaCheckPermission("fenbaohetongtiaozheng:ofSubcontractingAdjustment:edit") + @Log(title = "分包合同竣工结算调整", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SettlementOfSubcontractingAdjustmentBo bo) { + return toAjax(settlementOfSubcontractingAdjustmentService.updateByBo(bo)); + } + + /** + * 删除分包合同竣工结算调整 + * + * @param ids 主键串 + */ + @SaCheckPermission("fenbaohetongtiaozheng:ofSubcontractingAdjustment:remove") + @Log(title = "分包合同竣工结算调整", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(settlementOfSubcontractingAdjustmentService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/SettlementOfSubcontractingAdjustment.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/SettlementOfSubcontractingAdjustment.java new file mode 100644 index 00000000..d1d29195 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/SettlementOfSubcontractingAdjustment.java @@ -0,0 +1,98 @@ +package org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 分包合同竣工结算调整对象 settlement_of_subcontracting_adjustment + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("settlement_of_subcontracting_adjustment") +public class SettlementOfSubcontractingAdjustment extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编号 + */ + private String documentNo; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 决算单编号 + */ + private Long finalAccountNo; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同编号) + */ + private String contractNo; + + /** + * 调整后决算金额 + */ + private BigDecimal adjustedFinalAmount; + + /** + * 工程项目名称 + */ + private String projectName; + + /** + * 调整说明 + */ + private String adjustmentDescription; + + /** + * 备注信息 + */ + private String remarks; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/bo/SettlementOfSubcontractingAdjustmentBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/bo/SettlementOfSubcontractingAdjustmentBo.java new file mode 100644 index 00000000..bc1da53c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/bo/SettlementOfSubcontractingAdjustmentBo.java @@ -0,0 +1,96 @@ +package org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.bo; + +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.SettlementOfSubcontractingAdjustment; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 分包合同竣工结算调整业务对象 settlement_of_subcontracting_adjustment + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SettlementOfSubcontractingAdjustment.class, reverseConvertGenerate = false) +public class SettlementOfSubcontractingAdjustmentBo extends BaseEntity { + + /** + * 主键ID + */ + private Long id; + + /** + * 单据编号 + */ + private String documentNo; + + /** + * 标题 + */ + private String title; + + /** + * 单据日期 + */ + private LocalDate documentDate; + + /** + * 决算单编号 + */ + private Long finalAccountNo; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同编号) + */ + private String contractNo; + + /** + * 调整后决算金额 + */ + private BigDecimal adjustedFinalAmount; + + /** + * 工程项目名称 + */ + private String projectName; + + /** + * 调整说明 + */ + private String adjustmentDescription; + + /** + * 备注信息 + */ + private String remarks; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/vo/SettlementOfSubcontractingAdjustmentVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/vo/SettlementOfSubcontractingAdjustmentVo.java new file mode 100644 index 00000000..9a5a3404 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/domain/vo/SettlementOfSubcontractingAdjustmentVo.java @@ -0,0 +1,118 @@ +package org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.SettlementOfSubcontractingAdjustment; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + + + +/** + * 分包合同竣工结算调整视图对象 settlement_of_subcontracting_adjustment + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SettlementOfSubcontractingAdjustment.class) +public class SettlementOfSubcontractingAdjustmentVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 单据编号 + */ + @ExcelProperty(value = "单据编号") + private String documentNo; + + /** + * 标题 + */ + @ExcelProperty(value = "标题") + private String title; + + /** + * 单据日期 + */ + @ExcelProperty(value = "单据日期") + private LocalDate documentDate; + + /** + * 决算单编号 + */ + @ExcelProperty(value = "决算单编号") + private Long finalAccountNo; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 合同编号) + */ + @ExcelProperty(value = "合同编号)") + private String contractNo; + + /** + * 调整后决算金额 + */ + @ExcelProperty(value = "调整后决算金额") + private BigDecimal adjustedFinalAmount; + + /** + * 工程项目名称 + */ + @ExcelProperty(value = "工程项目名称") + private String projectName; + + /** + * 调整说明 + */ + @ExcelProperty(value = "调整说明") + private String adjustmentDescription; + + /** + * 备注信息 + */ + @ExcelProperty(value = "备注信息") + private String remarks; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/mapper/SettlementOfSubcontractingAdjustmentMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/mapper/SettlementOfSubcontractingAdjustmentMapper.java new file mode 100644 index 00000000..028afd28 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/mapper/SettlementOfSubcontractingAdjustmentMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.settlement.fenbaohetongtiaozheng.mapper; + +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.SettlementOfSubcontractingAdjustment; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.vo.SettlementOfSubcontractingAdjustmentVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 分包合同竣工结算调整Mapper接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface SettlementOfSubcontractingAdjustmentMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/ISettlementOfSubcontractingAdjustmentService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/ISettlementOfSubcontractingAdjustmentService.java new file mode 100644 index 00000000..b634c755 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/ISettlementOfSubcontractingAdjustmentService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.settlement.fenbaohetongtiaozheng.service; + +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.vo.SettlementOfSubcontractingAdjustmentVo; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.bo.SettlementOfSubcontractingAdjustmentBo; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.SettlementOfSubcontractingAdjustment; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 分包合同竣工结算调整Service接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface ISettlementOfSubcontractingAdjustmentService extends IService{ + + /** + * 查询分包合同竣工结算调整 + * + * @param id 主键 + * @return 分包合同竣工结算调整 + */ + SettlementOfSubcontractingAdjustmentVo queryById(Long id); + + /** + * 分页查询分包合同竣工结算调整列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同竣工结算调整分页列表 + */ + TableDataInfo queryPageList(SettlementOfSubcontractingAdjustmentBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的分包合同竣工结算调整列表 + * + * @param bo 查询条件 + * @return 分包合同竣工结算调整列表 + */ + List queryList(SettlementOfSubcontractingAdjustmentBo bo); + + /** + * 新增分包合同竣工结算调整 + * + * @param bo 分包合同竣工结算调整 + * @return 是否新增成功 + */ + Boolean insertByBo(SettlementOfSubcontractingAdjustmentBo bo); + + /** + * 修改分包合同竣工结算调整 + * + * @param bo 分包合同竣工结算调整 + * @return 是否修改成功 + */ + Boolean updateByBo(SettlementOfSubcontractingAdjustmentBo bo); + + /** + * 校验并批量删除分包合同竣工结算调整信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/impl/SettlementOfSubcontractingAdjustmentServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/impl/SettlementOfSubcontractingAdjustmentServiceImpl.java new file mode 100644 index 00000000..92eece3e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongtiaozheng/service/impl/SettlementOfSubcontractingAdjustmentServiceImpl.java @@ -0,0 +1,170 @@ +package org.dromara.xzd.settlement.fenbaohetongtiaozheng.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.SettlementOfSubcontractingCompletion; +import org.dromara.xzd.settlement.fenbaohetongjungong.domain.vo.SettlementOfSubcontractingCompletionVo; +import org.dromara.xzd.utilS.AreaUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.bo.SettlementOfSubcontractingAdjustmentBo; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.vo.SettlementOfSubcontractingAdjustmentVo; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.domain.SettlementOfSubcontractingAdjustment; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.mapper.SettlementOfSubcontractingAdjustmentMapper; +import org.dromara.xzd.settlement.fenbaohetongtiaozheng.service.ISettlementOfSubcontractingAdjustmentService; + +import java.time.LocalDate; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 分包合同竣工结算调整Service业务层处理 + * + * @author Lion Li + * @date 2025-10-15 + */ +@RequiredArgsConstructor +@Service +public class SettlementOfSubcontractingAdjustmentServiceImpl extends ServiceImpl implements ISettlementOfSubcontractingAdjustmentService { + + private final SettlementOfSubcontractingAdjustmentMapper baseMapper; + + private final AreaUtil areaUtil; + + @Autowired + private SysOssServiceImpl sysOssService; + + /** + * 查询分包合同竣工结算调整 + * + * @param id 主键 + * @return 分包合同竣工结算调整 + */ + @Override + public SettlementOfSubcontractingAdjustmentVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询分包合同竣工结算调整列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分包合同竣工结算调整分页列表 + */ + @Override + public TableDataInfo queryPageList(SettlementOfSubcontractingAdjustmentBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的分包合同竣工结算调整列表 + * + * @param bo 查询条件 + * @return 分包合同竣工结算调整列表 + */ + @Override + public List queryList(SettlementOfSubcontractingAdjustmentBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SettlementOfSubcontractingAdjustmentBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(SettlementOfSubcontractingAdjustment::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentNo()), SettlementOfSubcontractingAdjustment::getDocumentNo, bo.getDocumentNo()); + lqw.eq(StringUtils.isNotBlank(bo.getTitle()), SettlementOfSubcontractingAdjustment::getTitle, bo.getTitle()); + lqw.eq(bo.getDocumentDate() != null, SettlementOfSubcontractingAdjustment::getDocumentDate, bo.getDocumentDate()); + lqw.eq(bo.getFinalAccountNo() != null, SettlementOfSubcontractingAdjustment::getFinalAccountNo, bo.getFinalAccountNo()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), SettlementOfSubcontractingAdjustment::getContractName, bo.getContractName()); + lqw.eq(StringUtils.isNotBlank(bo.getContractNo()), SettlementOfSubcontractingAdjustment::getContractNo, bo.getContractNo()); + lqw.eq(bo.getAdjustedFinalAmount() != null, SettlementOfSubcontractingAdjustment::getAdjustedFinalAmount, bo.getAdjustedFinalAmount()); + lqw.like(StringUtils.isNotBlank(bo.getProjectName()), SettlementOfSubcontractingAdjustment::getProjectName, bo.getProjectName()); + lqw.eq(StringUtils.isNotBlank(bo.getAdjustmentDescription()), SettlementOfSubcontractingAdjustment::getAdjustmentDescription, bo.getAdjustmentDescription()); + lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), SettlementOfSubcontractingAdjustment::getRemarks, bo.getRemarks()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), SettlementOfSubcontractingAdjustment::getFileId, bo.getFileId()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), SettlementOfSubcontractingAdjustment::getAuditStatus, bo.getAuditStatus()); + return lqw; + } + + /** + * 新增分包合同竣工结算调整 + * + * @param bo 分包合同竣工结算调整 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(SettlementOfSubcontractingAdjustmentBo bo) { + SettlementOfSubcontractingAdjustment add = MapstructUtils.convert(bo, SettlementOfSubcontractingAdjustment.class); + validEntityBeforeSave(add); + Long l = baseMapper.selectCount(new LambdaQueryWrapper().gt(SettlementOfSubcontractingAdjustment::getCreateTime, LocalDate.now())); + String s = areaUtil.generateDateBasedNumber(); + add.setDocumentNo(s+"-"+(l+1)); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改分包合同竣工结算调整 + * + * @param bo 分包合同竣工结算调整 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(SettlementOfSubcontractingAdjustmentBo bo) { + SettlementOfSubcontractingAdjustment update = MapstructUtils.convert(bo, SettlementOfSubcontractingAdjustment.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SettlementOfSubcontractingAdjustment entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除分包合同竣工结算调整信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + + for (Long id : ids) { + SettlementOfSubcontractingAdjustmentVo vo = baseMapper.selectVoById(id); + if (vo != null){ + //删除附件 + if (vo.getFileId()!= null && !vo.getFileId().isEmpty()){ + List deleteIds = Arrays.stream(vo.getFileId().split(",")).map(Long::valueOf).toList(); + if (!deleteIds.isEmpty()) { + sysOssService.deleteWithValidByIds(deleteIds, false); + } + } + } + } + return baseMapper.deleteByIds(ids) > 0; + } +} From 68080571113a3a84ff8e637224b942036240cf20 Mon Sep 17 00:00:00 2001 From: lcj <2331845269@qq.com> Date: Wed, 15 Oct 2025 23:57:32 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=80=83=E5=8B=A4=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-prod.yml | 4 +- .../MatMaterialsInventoryServiceImpl.java | 2 +- .../DeviceMessageSender.java | 14 +- .../DeviceWebSocketServer.java | 18 +- .../BusAttendanceMachineController.java | 94 +++++++ .../BusAttendanceMachineUserController.java | 65 +++++ .../project/domain/BusAttendanceMachine.java | 65 +++++ .../domain/BusAttendanceMachineUser.java | 56 ++++ .../BusAttendanceMachineQueryReq.java | 37 +++ .../BusAttendanceMachineUpdateReq.java | 40 +++ .../BusAttendanceMachineSendInfoUserReq.java | 32 +++ .../BusAttendanceMachineUserQueryReq.java | 40 +++ .../BusAttendanceMachineUserRemoveReq.java | 31 ++ .../domain/vo/BusAttendanceMachineUserVo.java | 46 +++ .../domain/vo/BusAttendanceMachineVo.java | 87 ++++++ .../mapper/BusAttendanceMachineMapper.java | 15 + .../service/IBusAttendanceMachineService.java | 78 +++++ .../IBusAttendanceMachineUserService.java | 41 +++ .../impl/BusAttendanceMachineServiceImpl.java | 266 ++++++++++++++++++ .../BusAttendanceMachineUserServiceImpl.java | 163 +++++++++++ .../controller/system/SysUserController.java | 2 +- .../project/BusAttendanceMachineMapper.xml | 7 + 22 files changed, 1189 insertions(+), 14 deletions(-) create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineUserController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachine.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachineUser.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineQueryReq.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineUpdateReq.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineSendInfoUserReq.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserQueryReq.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserRemoveReq.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineUserVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/mapper/BusAttendanceMachineMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineUserService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineUserServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/project/BusAttendanceMachineMapper.xml diff --git a/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml b/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml index fba67693..0650b550 100644 --- a/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml +++ b/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml @@ -324,9 +324,9 @@ dxf2GeoJson: file-name: main.exe ys7: app-key: 3acf9f1a43dc4209841e0893003db0a2 - app-secret: 4bbf3e9394f55d3af6e3af27b2d3db36 + app-secret: 09e29c70ae1161fbc3ce2030fc09ba2e job: - capture-enabled: false # 控制是否启用萤石抓拍任务 + capture-enabled: true # 控制是否启用萤石抓拍任务 # 斯巴达算法 sparta: url: http://119.3.204.120:8040 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsInventoryServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsInventoryServiceImpl.java index 1641cbbf..29f3eebc 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsInventoryServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/materials/service/impl/MatMaterialsInventoryServiceImpl.java @@ -355,7 +355,7 @@ public class MatMaterialsInventoryServiceImpl extends ServiceImpl connectedDevices = new ConcurrentHashMap<>(); // 响应通道:key=UUID,value=响应结果容器 @@ -212,7 +215,6 @@ public class DeviceWebSocketServer { // registerFuture.complete(true); // 标记注册成功 // log.info("设备注册成功,SN: {},IP: {}:{},会话ID: {}", sn, ip, port, session.getId()); // } - private void handleRegisterStage(String message, String cmd) throws Exception { // 非DECLARE消息直接拒绝 if (!DECLARE.equals(cmd)) { @@ -382,6 +384,11 @@ public class DeviceWebSocketServer { // TODO: 替换为真实的业务服务调用(如Spring Bean注入后调用) log.info("【业务服务】设备注册,SN: {}", sn); // 示例:BusAttendanceMachineService.register(sn); + if (attendanceMachineService != null) { + attendanceMachineService.insertBySn(sn); + } else { + log.error("IBusAttendanceMachineService 为空,无法进行设备注册"); + } } catch (Exception e) { log.error("【业务服务】设备注册失败,SN: {}", sn, e); } @@ -395,6 +402,11 @@ public class DeviceWebSocketServer { // TODO: 替换为真实的业务服务调用 log.info("【业务服务】更新设备状态,SN: {},状态: {}", sn, status); // 示例:BusAttendanceMachineService.changeStatus(sn, status); + if (attendanceMachineService != null) { + attendanceMachineService.changeStatus(sn, status); + } else { + log.error("IBusAttendanceMachineService 为空,无法更新设备状态"); + } } catch (Exception e) { log.error("【业务服务】更新设备状态失败,SN: {}", sn, e); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineController.java new file mode 100644 index 00000000..1a842e40 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineController.java @@ -0,0 +1,94 @@ +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.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.dto.attendancemachine.BusAttendanceMachineQueryReq; +import org.dromara.project.domain.dto.attendancemachine.BusAttendanceMachineUpdateReq; +import org.dromara.project.domain.vo.BusAttendanceMachineVo; +import org.dromara.project.service.IBusAttendanceMachineService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 考勤机 + * + * @author lilemy + * @date 2025-10-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/project/attendanceMachine") +public class BusAttendanceMachineController extends BaseController { + + private final IBusAttendanceMachineService busAttendanceMachineService; + + /** + * 查询考勤机列表 + */ + @SaCheckPermission("project:attendanceMachine:list") + @GetMapping("/list") + public TableDataInfo list(BusAttendanceMachineQueryReq req, PageQuery pageQuery) { + return busAttendanceMachineService.queryPageList(req, pageQuery); + } + + /** + * 导出考勤机列表 + */ + @SaCheckPermission("project:attendanceMachine:export") + @Log(title = "考勤机", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(BusAttendanceMachineQueryReq req, HttpServletResponse response) { + List list = busAttendanceMachineService.queryList(req); + ExcelUtil.exportExcel(list, "考勤机", BusAttendanceMachineVo.class, response); + } + + /** + * 获取考勤机详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("project:attendanceMachine:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(busAttendanceMachineService.queryById(id)); + } + + /** + * 修改考勤机 + */ + @SaCheckPermission("project:attendanceMachine:edit") + @Log(title = "考勤机", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated @RequestBody BusAttendanceMachineUpdateReq req) { + return toAjax(busAttendanceMachineService.updateByBo(req)); + } + + /** + * 删除考勤机 + * + * @param ids 主键串 + */ + @SaCheckPermission("project:attendanceMachine:remove") + @Log(title = "考勤机", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(busAttendanceMachineService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineUserController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineUserController.java new file mode 100644 index 00000000..a534a8f4 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/BusAttendanceMachineUserController.java @@ -0,0 +1,65 @@ +package org.dromara.project.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.domain.R; +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.web.core.BaseController; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineSendInfoUserReq; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineUserQueryReq; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineUserRemoveReq; +import org.dromara.project.domain.vo.BusAttendanceMachineUserVo; +import org.dromara.project.service.IBusAttendanceMachineUserService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 考勤机用户 + * + * @author lilemy + * @date 2025-10-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/project/attendanceMachineUser") +public class BusAttendanceMachineUserController extends BaseController { + + private final IBusAttendanceMachineUserService busAttendanceMachineUserService; + + /** + * 查询考勤机用户列表 + */ + @SaCheckPermission("project:attendanceMachineUser:list") + @GetMapping("/list") + public R> list(BusAttendanceMachineUserQueryReq req) { + return R.ok(busAttendanceMachineUserService.queryList(req)); + } + + /** + * 下发用户到考勤机中 + */ + @SaCheckPermission("project:attendanceMachineUser:add") + @Log(title = "考勤机用户", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/send") + public R sendPersonInfo(@Validated @RequestBody BusAttendanceMachineSendInfoUserReq req) { + return R.ok(busAttendanceMachineUserService.sendPersonInfo(req)); + } + + /** + * 删除考勤机用户 + */ + @SaCheckPermission("project:attendanceMachineUser:remove") + @Log(title = "考勤机用户", businessType = BusinessType.DELETE) + @RepeatSubmit() + @DeleteMapping() + public R remove(@Validated @RequestBody BusAttendanceMachineUserRemoveReq req) { + return toAjax(busAttendanceMachineUserService.remove(req)); + } + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachine.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachine.java new file mode 100644 index 00000000..c71fb2cf --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachine.java @@ -0,0 +1,65 @@ +package org.dromara.project.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 考勤机对象 bus_attendance_machine + * + * @author lilemy + * @date 2025-10-15 + */ +@Data +@TableName("bus_attendance_machine") +public class BusAttendanceMachine implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 项目ID + */ + private Long projectId; + + /** + * 设备sn + */ + private String sn; + + /** + * 是否在线(0-no 1-yes) + */ + private String status; + + /** + * 班组id,多个逗号分隔 + */ + private String teams; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachineUser.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachineUser.java new file mode 100644 index 00000000..c7e340b8 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusAttendanceMachineUser.java @@ -0,0 +1,56 @@ +package org.dromara.project.domain; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 考勤机用户对象 bus_attendance_machine_user + * + * @author lilemy + * @date 2025-10-15 + */ +@Data +public class BusAttendanceMachineUser implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private Long id; + + /** + * 考勤机主键ID + */ + private Long machineId; + + /** + * 班组ID + */ + private Long teamId; + + /** + * 用户ID + */ + private Long userId; + + /** + * 标识(是否下发) + */ + private Integer identifying; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineQueryReq.java new file mode 100644 index 00000000..83456084 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineQueryReq.java @@ -0,0 +1,37 @@ +package org.dromara.project.domain.dto.attendancemachine; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author lilemy + * @date 2025-10-15 16:18 + */ +@Data +public class BusAttendanceMachineQueryReq implements Serializable { + + @Serial + private static final long serialVersionUID = 6296359812022907365L; + + /** + * 项目ID + */ + private Long projectId; + + /** + * 设备sn + */ + private String sn; + + /** + * 是否在线(0-no 1-yes) + */ + private String status; + + /** + * 班组id,多个逗号分隔 + */ + private String teams; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineUpdateReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineUpdateReq.java new file mode 100644 index 00000000..d8f774d4 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachine/BusAttendanceMachineUpdateReq.java @@ -0,0 +1,40 @@ +package org.dromara.project.domain.dto.attendancemachine; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author lilemy + * @date 2025-10-15 16:15 + */ +@Data +public class BusAttendanceMachineUpdateReq implements Serializable { + + @Serial + private static final long serialVersionUID = 4764015594443520162L; + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空") + private Long id; + + /** + * 项目ID + */ + @NotNull(message = "项目ID不能为空") + private Long projectId; + + /** + * 班组id,多个逗号分隔 + */ + private String teams; + + /** + * 备注 + */ + private String remark; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineSendInfoUserReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineSendInfoUserReq.java new file mode 100644 index 00000000..0b43618f --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineSendInfoUserReq.java @@ -0,0 +1,32 @@ +package org.dromara.project.domain.dto.attendancemachineuser; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +/** + * @author lilemy + * @date 2025-10-15 17:43 + */ +@Data +public class BusAttendanceMachineSendInfoUserReq implements Serializable { + + @Serial + private static final long serialVersionUID = -6517799483848691652L; + + /** + * 考勤机主键ID + */ + @NotNull(message = "考勤机不能为空") + private Long machineId; + + /** + * 用户ID列表 + */ + @NotNull(message = "用户列表不能为空") + private List userIds; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserQueryReq.java new file mode 100644 index 00000000..bec22d37 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserQueryReq.java @@ -0,0 +1,40 @@ +package org.dromara.project.domain.dto.attendancemachineuser; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author lilemy + * @date 2025-10-15 19:22 + */ +@Data +public class BusAttendanceMachineUserQueryReq implements Serializable { + + @Serial + private static final long serialVersionUID = -1629819732452840391L; + + /** + * 考勤机主键ID + */ + @NotNull(message = "考勤机不能为空") + private Long machineId; + + /** + * 班组ID + */ + @NotNull(message = "班组不能为空") + private Long teamId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 标识(是否下发) + */ + private Integer identifying; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserRemoveReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserRemoveReq.java new file mode 100644 index 00000000..19ffa59b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/attendancemachineuser/BusAttendanceMachineUserRemoveReq.java @@ -0,0 +1,31 @@ +package org.dromara.project.domain.dto.attendancemachineuser; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +/** + * @author lilemy + * @date 2025-10-15 19:56 + */ +@Data +public class BusAttendanceMachineUserRemoveReq implements Serializable { + + @Serial + private static final long serialVersionUID = -8880884070612972760L; + + /** + * 考勤机主键ID + */ + @NotNull(message = "考勤机不能为空") + private Long machineId; + + /** + * 用户ID列表 + */ + @NotNull(message = "用户列表不能为空") + private List userIds; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineUserVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineUserVo.java new file mode 100644 index 00000000..66a5560f --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineUserVo.java @@ -0,0 +1,46 @@ +package org.dromara.project.domain.vo; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 考勤机用户视图对象 bus_attendance_machine_user + * + * @author lilemy + * @date 2025-10-15 + */ +@Data +public class BusAttendanceMachineUserVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 考勤机主键ID + */ + private Long machineId; + + /** + * 班组ID + */ + private Long teamId; + + /** + * 用户ID + */ + private Long userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 标识(是否下发) + */ + private Integer identifying; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineVo.java new file mode 100644 index 00000000..d49fe642 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/BusAttendanceMachineVo.java @@ -0,0 +1,87 @@ +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.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.project.domain.BusAttendanceMachine; +import org.dromara.project.domain.vo.projectteam.BusProjectTeamVo; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 考勤机视图对象 bus_attendance_machine + * + * @author lilemy + * @date 2025-10-15 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BusAttendanceMachine.class) +public class BusAttendanceMachineVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 项目ID + */ + @ExcelProperty(value = "项目ID") + private Long projectId; + + /** + * 项目名称 + */ + @Translation(type = TransConstant.PROJECT_ID_TO_NAME, mapper = "projectId") + private String projectName; + + /** + * 设备sn + */ + @ExcelProperty(value = "设备sn") + private String sn; + + /** + * 是否在线(0-no 1-yes) + */ + @ExcelProperty(value = "是否在线", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=-no,1=-yes") + private String status; + + /** + * 班组id,多个逗号分隔 + */ + @ExcelProperty(value = "班组id,多个逗号分隔") + private String teams; + + /** + * 班组列表 + */ + private List teamsList; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/mapper/BusAttendanceMachineMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/mapper/BusAttendanceMachineMapper.java new file mode 100644 index 00000000..7991b89f --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/mapper/BusAttendanceMachineMapper.java @@ -0,0 +1,15 @@ +package org.dromara.project.mapper; + +import org.dromara.project.domain.BusAttendanceMachine; +import org.dromara.project.domain.vo.BusAttendanceMachineVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 考勤机Mapper接口 + * + * @author lilemy + * @date 2025-10-15 + */ +public interface BusAttendanceMachineMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineService.java new file mode 100644 index 00000000..78eec5ce --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineService.java @@ -0,0 +1,78 @@ +package org.dromara.project.service; + +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.BusAttendanceMachine; +import org.dromara.project.domain.dto.attendancemachine.BusAttendanceMachineQueryReq; +import org.dromara.project.domain.dto.attendancemachine.BusAttendanceMachineUpdateReq; +import org.dromara.project.domain.vo.BusAttendanceMachineVo; + +import java.util.Collection; +import java.util.List; + +/** + * 考勤机Service接口 + * + * @author lilemy + * @date 2025-10-15 + */ +public interface IBusAttendanceMachineService extends IService { + + /** + * 查询考勤机 + * + * @param id 主键 + * @return 考勤机 + */ + BusAttendanceMachineVo queryById(Long id); + + /** + * 分页查询考勤机列表 + * + * @param req 查询条件 + * @param pageQuery 分页参数 + * @return 考勤机分页列表 + */ + TableDataInfo queryPageList(BusAttendanceMachineQueryReq req, PageQuery pageQuery); + + /** + * 查询符合条件的考勤机列表 + * + * @param req 查询条件 + * @return 考勤机列表 + */ + List queryList(BusAttendanceMachineQueryReq req); + + /** + * 根据sn新增考勤机 + * + * @param sn 考勤机sn + */ + void insertBySn(String sn); + + /** + * 修改考勤机 + * + * @param req 考勤机 + * @return 是否修改成功 + */ + Boolean updateByBo(BusAttendanceMachineUpdateReq req); + + /** + * 修改考勤机状态 + * + * @param sn 考勤机sn + * @param status 考勤机状态 + */ + void changeStatus(String sn, String status); + + /** + * 校验并批量删除考勤机信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineUserService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineUserService.java new file mode 100644 index 00000000..9b4d751e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusAttendanceMachineUserService.java @@ -0,0 +1,41 @@ +package org.dromara.project.service; + +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineSendInfoUserReq; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineUserQueryReq; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineUserRemoveReq; +import org.dromara.project.domain.vo.BusAttendanceMachineUserVo; + +import java.util.List; + +/** + * 考勤机用户Service接口 + * + * @author lilemy + * @date 2025-10-15 + */ +public interface IBusAttendanceMachineUserService { + + /** + * 查询符合条件的考勤机用户列表 + * + * @param req 查询条件 + * @return 考勤机用户列表 + */ + List queryList(BusAttendanceMachineUserQueryReq req); + + /** + * 下发用户到考勤机中 + * + * @param req 下发用户参数 + * @return 下发结果 + */ + String sendPersonInfo(BusAttendanceMachineSendInfoUserReq req); + + /** + * 删除考勤机用户 + * + * @param req 删除参数 + * @return 删除结果 + */ + Boolean remove(BusAttendanceMachineUserRemoveReq req); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineServiceImpl.java new file mode 100644 index 00000000..20c86a1f --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineServiceImpl.java @@ -0,0 +1,266 @@ +package org.dromara.project.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +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.constant.HttpStatus; +import org.dromara.common.core.exception.ServiceException; +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.mobileAttendanceMachine.DeviceMessageSender; +import org.dromara.project.domain.BusAttendanceMachine; +import org.dromara.project.domain.BusProject; +import org.dromara.project.domain.BusProjectTeam; +import org.dromara.project.domain.BusProjectTeamMember; +import org.dromara.project.domain.dto.attendancemachine.BusAttendanceMachineQueryReq; +import org.dromara.project.domain.dto.attendancemachine.BusAttendanceMachineUpdateReq; +import org.dromara.project.domain.vo.BusAttendanceMachineVo; +import org.dromara.project.domain.vo.projectteam.BusProjectTeamVo; +import org.dromara.project.mapper.BusAttendanceMachineMapper; +import org.dromara.project.service.IBusAttendanceMachineService; +import org.dromara.project.service.IBusProjectService; +import org.dromara.project.service.IBusProjectTeamMemberService; +import org.dromara.project.service.IBusProjectTeamService; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 考勤机Service业务层处理 + * + * @author lilemy + * @date 2025-10-15 + */ +@RequiredArgsConstructor +@Service +public class BusAttendanceMachineServiceImpl extends ServiceImpl + implements IBusAttendanceMachineService { + + @Resource + private IBusProjectService projectService; + + @Resource + private IBusProjectTeamService projectTeamService; + + @Resource + private IBusProjectTeamMemberService projectTeamMemberService; + + @Resource + private DeviceMessageSender deviceMessageSender; + + /** + * 查询考勤机 + * + * @param id 主键 + * @return 考勤机 + */ + @Override + public BusAttendanceMachineVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + /** + * 分页查询考勤机列表 + * + * @param req 查询条件 + * @param pageQuery 分页参数 + * @return 考勤机分页列表 + */ + @Override + public TableDataInfo queryPageList(BusAttendanceMachineQueryReq req, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(req); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + List records = result.getRecords(); + List teamIds = records.stream() + .map(BusAttendanceMachineVo::getTeams) + .filter(StringUtils::isNotBlank) + .flatMap(team -> Arrays.stream(team.split(",")) // flatMap 展开内部 stream + .map(Long::parseLong)) + .toList(); + if (CollUtil.isEmpty(teamIds)) { + return TableDataInfo.build(result); + } + List projectTeams = projectTeamService.listByIds(teamIds); + Map teamMap = projectTeams.stream() + .collect(Collectors.toMap(BusProjectTeam::getId, BusProjectTeam::getTeamName)); + records.forEach(machine -> { + String teams = machine.getTeams(); + if (StringUtils.isNotBlank(teams)) { + List t = Arrays.stream(teams.split(",")).map(Long::parseLong).toList(); + List teamVoList = t.stream().map(teamId -> { + BusProjectTeamVo vo = new BusProjectTeamVo(); + vo.setId(teamId); + vo.setTeamName(teamMap.getOrDefault(teamId, "未命名")); + return vo; + }).toList(); + machine.setTeamsList(teamVoList); + } + }); + result.setRecords(records); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的考勤机列表 + * + * @param req 查询条件 + * @return 考勤机列表 + */ + @Override + public List queryList(BusAttendanceMachineQueryReq req) { + LambdaQueryWrapper lqw = buildQueryWrapper(req); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BusAttendanceMachineQueryReq req) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(BusAttendanceMachine::getId); + lqw.eq(req.getProjectId() != null, BusAttendanceMachine::getProjectId, req.getProjectId()); + lqw.isNull(req.getProjectId() == null, BusAttendanceMachine::getProjectId); + lqw.eq(StringUtils.isNotBlank(req.getSn()), BusAttendanceMachine::getSn, req.getSn()); + lqw.eq(StringUtils.isNotBlank(req.getStatus()), BusAttendanceMachine::getStatus, req.getStatus()); + lqw.like(StringUtils.isNotBlank(req.getTeams()), BusAttendanceMachine::getTeams, req.getTeams()); + return lqw; + } + + /** + * 根据sn新增考勤机 + * + * @param sn 考勤机sn + */ + @Override + public void insertBySn(String sn) { + BusAttendanceMachine machine = new BusAttendanceMachine(); + // 判断考勤机是否存在 + BusAttendanceMachine oldMachine = this.lambdaQuery() + .eq(BusAttendanceMachine::getSn, sn) + .one(); + if (oldMachine != null) { + machine.setId(oldMachine.getId()); + } + machine.setSn(sn); + machine.setStatus("1"); + this.saveOrUpdate(machine); + } + + /** + * 修改考勤机 + * + * @param req 考勤机 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(BusAttendanceMachineUpdateReq req) { + Long id = req.getId(); + BusAttendanceMachine oldMachine = this.getById(id); + if (oldMachine == null) { + throw new ServiceException("考勤机不存在", HttpStatus.NOT_FOUND); + } + BusAttendanceMachine machine = new BusAttendanceMachine(); + BeanUtils.copyProperties(req, machine); + // 判断班组是否属于所选项目 + Long projectId = req.getProjectId(); + BusProject project = projectService.getById(projectId); + if (project == null) { + throw new ServiceException("所选项目不存在", HttpStatus.NOT_FOUND); + } + String teams = req.getTeams(); + if (StringUtils.isBlank(teams) && StringUtils.isBlank(oldMachine.getTeams())) { + throw new ServiceException("请选择班组", HttpStatus.BAD_REQUEST); + } + if (StringUtils.isNotBlank(teams)) { + List teamIds = Arrays.stream(teams.split(",")) + .map(Long::parseLong) + .distinct() + .toList(); + List projectTeams = projectTeamService.listByIds(teamIds); + if (projectTeams.size() != teamIds.size()) { + throw new ServiceException("所选班组不存在", HttpStatus.NOT_FOUND); + } + String oldTeams = oldMachine.getTeams(); + if (StringUtils.isNotBlank(oldTeams)) { + List oldTeamIds = Arrays.stream(oldTeams.split(",")) + .map(Long::parseLong) + .distinct() + .toList(); + // 获取新增的班组ID + List added = teamIds.stream() + .filter(t -> !oldTeamIds.contains(t)) + .toList(); + // 获取删除的班组ID + List deleted = oldTeamIds.stream() + .filter(t -> !teamIds.contains(t)) + .toList(); + // 删除的班组不为空时,删除考勤机中对应的人数 + if (CollUtil.isNotEmpty(deleted)) { + // 获取待删除的班组的所有用户id + List userIds = projectTeamMemberService.lambdaQuery() + .select(BusProjectTeamMember::getMemberId) + .in(BusProjectTeamMember::getTeamId, deleted) + .list() + .stream().map(BusProjectTeamMember::getMemberId).toList(); + if (CollUtil.isNotEmpty(userIds)) { + String[] userIdArray = userIds.stream() + .map(String::valueOf) // 将 Long 转成 String + .toArray(String[]::new); + try { + deviceMessageSender.batchDeleteUsers(machine.getSn(), userIdArray); + } catch (Exception e) { + throw new ServiceException("删除考勤机用户失败", HttpStatus.ERROR); + } + } + } + } + projectTeams.forEach(team -> { + if (!team.getProjectId().equals(projectId)) { + throw new ServiceException(team.getTeamName() + "不属于所选项目", HttpStatus.BAD_REQUEST); + } + }); + } + return this.updateById(machine); + } + + /** + * 修改考勤机状态 + * + * @param sn 考勤机sn + * @param status 考勤机状态 + */ + @Override + public void changeStatus(String sn, String status) { + BusAttendanceMachine machine = this.lambdaQuery() + .eq(BusAttendanceMachine::getSn, sn) + .one(); + if (machine == null) { + machine = new BusAttendanceMachine(); + machine.setSn(sn); + } + machine.setStatus(status); + this.saveOrUpdate(machine); + } + + /** + * 校验并批量删除考勤机信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineUserServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineUserServiceImpl.java new file mode 100644 index 00000000..493eeeeb --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusAttendanceMachineUserServiceImpl.java @@ -0,0 +1,163 @@ +package org.dromara.project.service.impl; + +import cn.hutool.core.collection.CollUtil; +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.constant.HttpStatus; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.contractor.domain.SubConstructionUser; +import org.dromara.contractor.service.ISubConstructionUserService; +import org.dromara.mobileAttendanceMachine.DeviceMessageSender; +import org.dromara.mobileAttendanceMachine.KqjEntity; +import org.dromara.project.domain.BusAttendanceMachine; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineSendInfoUserReq; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineUserQueryReq; +import org.dromara.project.domain.dto.attendancemachineuser.BusAttendanceMachineUserRemoveReq; +import org.dromara.project.domain.dto.projectteammember.BusProjectTeamMemberQueryReq; +import org.dromara.project.domain.vo.BusAttendanceMachineUserVo; +import org.dromara.project.domain.vo.projectteammember.BusProjectTeamMemberVo; +import org.dromara.project.service.IBusAttendanceMachineService; +import org.dromara.project.service.IBusAttendanceMachineUserService; +import org.dromara.project.service.IBusProjectTeamMemberService; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 考勤机用户Service业务层处理 + * + * @author lilemy + * @date 2025-10-15 + */ +@RequiredArgsConstructor +@Service +public class BusAttendanceMachineUserServiceImpl implements IBusAttendanceMachineUserService { + + private final IBusAttendanceMachineService attendanceMachineService; + + private final DeviceMessageSender deviceMessageSender; + + private final ISubConstructionUserService constructionUserService; + + private final IBusProjectTeamMemberService projectTeamMemberService; + + /** + * 查询符合条件的考勤机用户列表 + * + * @param req 查询条件 + * @return 考勤机用户列表 + */ + @Override + public List queryList(BusAttendanceMachineUserQueryReq req) { + BusProjectTeamMemberQueryReq query = new BusProjectTeamMemberQueryReq(); + query.setTeamId(req.getTeamId()); + query.setMemberName(req.getUserName()); + List teamMemberList = projectTeamMemberService.queryList(query); + if (CollUtil.isEmpty(teamMemberList)) { + return CollUtil.newArrayList(); + } + BusAttendanceMachine machine = attendanceMachineService.getById(req.getMachineId()); + if (machine == null) { + throw new ServiceException("考勤机不存在", HttpStatus.NOT_FOUND); + } + // 判断选择班组和考勤机是否一致 + if (StringUtils.isBlank(machine.getTeams())) { + throw new ServiceException("考勤机未绑定班组", HttpStatus.NOT_FOUND); + } + if (!Arrays.stream(machine.getTeams().split(",")) + .map(Long::parseLong) + .collect(Collectors.toSet()).contains(req.getTeamId())) { + throw new ServiceException("所选班组与考勤机不匹配", HttpStatus.NOT_FOUND); + } + // 获取考勤机里的用户 + Set userIdList = new HashSet<>(); + try { + KqjEntity.CommonResponse response = deviceMessageSender.getAllUsers(machine.getSn()); + int code = response.getData().getCode(); + if (code == 0 || code == 200) { + String[] userIds = response.getData().getUserIds(); + userIdList = Arrays.stream(userIds).map(Long::parseLong).collect(Collectors.toSet()); + } + } catch (Exception e) { + throw new ServiceException("获取考勤机用户失败", HttpStatus.ERROR); + } + Set finalUserIdList = userIdList; + return teamMemberList.stream().map(member -> { + BusAttendanceMachineUserVo vo = new BusAttendanceMachineUserVo(); + vo.setMachineId(req.getMachineId()); + vo.setTeamId(req.getTeamId()); + vo.setUserId(member.getMemberId()); + vo.setUserName(member.getMemberName()); + if (CollUtil.isEmpty(finalUserIdList)) { + vo.setIdentifying(0); + } else if (finalUserIdList.contains(member.getMemberId())) { + vo.setIdentifying(1); + } else { + vo.setIdentifying(0); + } + return vo; + }).toList(); + } + + /** + * 下发用户到考勤机中 + * + * @param req 下发用户参数 + * @return 下发结果 + */ + @Override + public String sendPersonInfo(BusAttendanceMachineSendInfoUserReq req) { + Long machineId = req.getMachineId(); + List userIds = req.getUserIds(); + BusAttendanceMachine machine = attendanceMachineService.getById(machineId); + if (machine == null) { + throw new ServiceException("考勤机不存在", HttpStatus.NOT_FOUND); + } + List userList = constructionUserService.lambdaQuery() + .in(SubConstructionUser::getSysUserId, userIds) + .list(); + // 返回数据 + StringBuilder sb = new StringBuilder(); + sb.append("用户:["); + int count = 0; + for (SubConstructionUser user : userList) { + Boolean result = deviceMessageSender.sendPersonnelInformation(machine.getSn(), + user.getSysUserId().toString(), user.getUserName(), user.getFacePic()); + if (!result) { + sb.append(user.getUserName()).append(" "); + count++; + } + } + sb.append("] 下发失败"); + return count == 0 ? "下发成功" : sb.toString(); + } + + /** + * 删除考勤机用户 + * + * @param req 删除参数 + * @return 删除结果 + */ + @Override + public Boolean remove(BusAttendanceMachineUserRemoveReq req) { + Long machineId = req.getMachineId(); + List userIds = req.getUserIds(); + BusAttendanceMachine machine = attendanceMachineService.getById(machineId); + if (machine == null) { + throw new ServiceException("考勤机不存在", HttpStatus.NOT_FOUND); + } + String[] userIdArray = userIds.stream() + .map(String::valueOf) // 将 Long 转成 String + .toArray(String[]::new); + try { + KqjEntity.CommonResponse response = deviceMessageSender.batchDeleteUsers(machine.getSn(), userIdArray); + return response.getData().getCode() == 0 || response.getData().getCode() == 200; + } catch (Exception e) { + throw new ServiceException("删除考勤机用户失败", HttpStatus.ERROR); + } + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java index db8cd249..2f06ef47 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java @@ -273,7 +273,7 @@ public class SysUserController extends BaseController { @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/resetPwd") public R resetPwd(@RequestBody SysUserBo user) { - userService.checkUserAllowed(user.getUserId()); +// userService.checkUserAllowed(user.getUserId()); userService.checkUserDataScope(user.getUserId()); user.setPassword(BCrypt.hashpw(user.getPassword())); return toAjax(userService.resetUserPwd(user.getUserId(), user.getPassword())); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/project/BusAttendanceMachineMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/project/BusAttendanceMachineMapper.xml new file mode 100644 index 00000000..913ca1ac --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/project/BusAttendanceMachineMapper.xml @@ -0,0 +1,7 @@ + + + + + From bca9745e6026f416ef4a7ea11e95483d1002289d Mon Sep 17 00:00:00 2001 From: dfdg <2710245601@qq.com> Date: Thu, 16 Oct 2025 14:40:31 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E4=B8=8E=E4=BB=98?= =?UTF-8?q?=E6=AC=BE-=E9=87=87=E8=B4=AD=E3=80=81=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=BB=98=E6=AC=BE=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/XzdSfkCaigouFkController.java | 105 +++++++ .../controller/XzdSfkFapiaoController.java | 105 +++++++ .../controller/XzdSfkFukuanController.java | 105 +++++++ .../XzdSfkZonhefuwuFkController.java | 105 +++++++ .../domain/XzdSfkCaigouFk.java | 223 ++++++++++++++ .../paymentsReceipts/domain/XzdSfkFapiao.java | 93 ++++++ .../paymentsReceipts/domain/XzdSfkFukuan.java | 88 ++++++ .../domain/XzdSfkZonhefuwuFk.java | 218 ++++++++++++++ .../domain/bo/XzdSfkCaigouFkBo.java | 231 ++++++++++++++ .../domain/bo/XzdSfkFapiaoBo.java | 92 ++++++ .../domain/bo/XzdSfkFukuanBo.java | 90 ++++++ .../domain/bo/XzdSfkZonhefuwuFkBo.java | 226 ++++++++++++++ .../domain/vo/XzdSfkCaigouFkVo.java | 282 ++++++++++++++++++ .../domain/vo/XzdSfkFapiaoVo.java | 114 +++++++ .../domain/vo/XzdSfkFukuanVo.java | 110 +++++++ .../domain/vo/XzdSfkZonhefuwuFkVo.java | 276 +++++++++++++++++ .../mapper/XzdSfkCaigouFkMapper.java | 15 + .../mapper/XzdSfkFapiaoMapper.java | 15 + .../mapper/XzdSfkFukuanMapper.java | 15 + .../mapper/XzdSfkZonhefuwuFkMapper.java | 15 + .../service/IXzdSfkCaigouFkService.java | 70 +++++ .../service/IXzdSfkFapiaoService.java | 70 +++++ .../service/IXzdSfkFukuanService.java | 70 +++++ .../service/IXzdSfkZonhefuwuFkService.java | 70 +++++ .../impl/XzdSfkCaigouFkServiceImpl.java | 167 +++++++++++ .../service/impl/XzdSfkFapiaoServiceImpl.java | 141 +++++++++ .../service/impl/XzdSfkFukuanServiceImpl.java | 140 +++++++++ .../impl/XzdSfkZonhefuwuFkServiceImpl.java | 166 +++++++++++ .../domain/vo/XzdJsCgJungonEditVo.java | 2 + .../service/IXzdJsCgJungonService.java | 2 + .../impl/XzdJsCgJungonEditServiceImpl.java | 13 +- .../impl/XzdJsCgJungonServiceImpl.java | 5 + .../paymentsReceipts/XzdSfkCaigouFkMapper.xml | 7 + .../paymentsReceipts/XzdSfkFapiaoMapper.xml | 7 + .../paymentsReceipts/XzdSfkFukuanMapper.xml | 7 + .../XzdSfkZonhefuwuFkMapper.xml | 7 + 36 files changed, 3466 insertions(+), 1 deletion(-) create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkCaigouFkController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFapiaoController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFukuanController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkZonhefuwuFkController.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkCaigouFk.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFapiao.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFukuan.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkZonhefuwuFk.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkCaigouFkBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFapiaoBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFukuanBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkZonhefuwuFkBo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkCaigouFkVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFapiaoVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFukuanVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkZonhefuwuFkVo.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkCaigouFkMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFapiaoMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFukuanMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkZonhefuwuFkMapper.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkCaigouFkService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFapiaoService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFukuanService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkZonhefuwuFkService.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkCaigouFkServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFapiaoServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFukuanServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkZonhefuwuFkServiceImpl.java create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkCaigouFkMapper.xml create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFapiaoMapper.xml create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFukuanMapper.xml create mode 100644 xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkZonhefuwuFkMapper.xml diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkCaigouFkController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkCaigouFkController.java new file mode 100644 index 00000000..95d5d5b6 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkCaigouFkController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.paymentsReceipts.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkCaigouFkVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkCaigouFkBo; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkCaigouFkService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 采购合同付款 + * + * @author Lion Li + * @date 2025-10-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/paymentsReceipts/sfkCaigouFk") +public class XzdSfkCaigouFkController extends BaseController { + + private final IXzdSfkCaigouFkService xzdSfkCaigouFkService; + + /** + * 查询采购合同付款列表 + */ + @SaCheckPermission("paymentsReceipts:sfkCaigouFk:list") + @GetMapping("/list") + public TableDataInfo list(XzdSfkCaigouFkBo bo, PageQuery pageQuery) { + return xzdSfkCaigouFkService.queryPageList(bo, pageQuery); + } + + /** + * 导出采购合同付款列表 + */ + @SaCheckPermission("paymentsReceipts:sfkCaigouFk:export") + @Log(title = "采购合同付款", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(XzdSfkCaigouFkBo bo, HttpServletResponse response) { + List list = xzdSfkCaigouFkService.queryList(bo); + ExcelUtil.exportExcel(list, "采购合同付款", XzdSfkCaigouFkVo.class, response); + } + + /** + * 获取采购合同付款详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("paymentsReceipts:sfkCaigouFk:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(xzdSfkCaigouFkService.queryById(id)); + } + + /** + * 新增采购合同付款 + */ + @SaCheckPermission("paymentsReceipts:sfkCaigouFk:add") + @Log(title = "采购合同付款", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody XzdSfkCaigouFkBo bo) { + return toAjax(xzdSfkCaigouFkService.insertByBo(bo)); + } + + /** + * 修改采购合同付款 + */ + @SaCheckPermission("paymentsReceipts:sfkCaigouFk:edit") + @Log(title = "采购合同付款", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody XzdSfkCaigouFkBo bo) { + return toAjax(xzdSfkCaigouFkService.updateByBo(bo)); + } + + /** + * 删除采购合同付款 + * + * @param ids 主键串 + */ + @SaCheckPermission("paymentsReceipts:sfkCaigouFk:remove") + @Log(title = "采购合同付款", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(xzdSfkCaigouFkService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFapiaoController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFapiaoController.java new file mode 100644 index 00000000..d592903b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFapiaoController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.paymentsReceipts.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFapiaoVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkFapiaoBo; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkFapiaoService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 收款与付款-发票明细 + * + * @author Lion Li + * @date 2025-10-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/paymentsReceipts/sfkFapiao") +public class XzdSfkFapiaoController extends BaseController { + + private final IXzdSfkFapiaoService xzdSfkFapiaoService; + + /** + * 查询收款与付款-发票明细列表 + */ + @SaCheckPermission("paymentsReceipts:sfkFapiao:list") + @GetMapping("/list") + public TableDataInfo list(XzdSfkFapiaoBo bo, PageQuery pageQuery) { + return xzdSfkFapiaoService.queryPageList(bo, pageQuery); + } + + /** + * 导出收款与付款-发票明细列表 + */ + @SaCheckPermission("paymentsReceipts:sfkFapiao:export") + @Log(title = "收款与付款-发票明细", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(XzdSfkFapiaoBo bo, HttpServletResponse response) { + List list = xzdSfkFapiaoService.queryList(bo); + ExcelUtil.exportExcel(list, "收款与付款-发票明细", XzdSfkFapiaoVo.class, response); + } + + /** + * 获取收款与付款-发票明细详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("paymentsReceipts:sfkFapiao:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(xzdSfkFapiaoService.queryById(id)); + } + + /** + * 新增收款与付款-发票明细 + */ + @SaCheckPermission("paymentsReceipts:sfkFapiao:add") + @Log(title = "收款与付款-发票明细", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody XzdSfkFapiaoBo bo) { + return toAjax(xzdSfkFapiaoService.insertByBo(bo)); + } + + /** + * 修改收款与付款-发票明细 + */ + @SaCheckPermission("paymentsReceipts:sfkFapiao:edit") + @Log(title = "收款与付款-发票明细", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody XzdSfkFapiaoBo bo) { + return toAjax(xzdSfkFapiaoService.updateByBo(bo)); + } + + /** + * 删除收款与付款-发票明细 + * + * @param ids 主键串 + */ + @SaCheckPermission("paymentsReceipts:sfkFapiao:remove") + @Log(title = "收款与付款-发票明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(xzdSfkFapiaoService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFukuanController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFukuanController.java new file mode 100644 index 00000000..52126fb6 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkFukuanController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.paymentsReceipts.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFukuanVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkFukuanBo; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkFukuanService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 收款与付款-付款明细 + * + * @author Lion Li + * @date 2025-10-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/paymentsReceipts/sfkFukuan") +public class XzdSfkFukuanController extends BaseController { + + private final IXzdSfkFukuanService xzdSfkFukuanService; + + /** + * 查询收款与付款-付款明细列表 + */ + @SaCheckPermission("paymentsReceipts:sfkFukuan:list") + @GetMapping("/list") + public TableDataInfo list(XzdSfkFukuanBo bo, PageQuery pageQuery) { + return xzdSfkFukuanService.queryPageList(bo, pageQuery); + } + + /** + * 导出收款与付款-付款明细列表 + */ + @SaCheckPermission("paymentsReceipts:sfkFukuan:export") + @Log(title = "收款与付款-付款明细", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(XzdSfkFukuanBo bo, HttpServletResponse response) { + List list = xzdSfkFukuanService.queryList(bo); + ExcelUtil.exportExcel(list, "收款与付款-付款明细", XzdSfkFukuanVo.class, response); + } + + /** + * 获取收款与付款-付款明细详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("paymentsReceipts:sfkFukuan:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(xzdSfkFukuanService.queryById(id)); + } + + /** + * 新增收款与付款-付款明细 + */ + @SaCheckPermission("paymentsReceipts:sfkFukuan:add") + @Log(title = "收款与付款-付款明细", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody XzdSfkFukuanBo bo) { + return toAjax(xzdSfkFukuanService.insertByBo(bo)); + } + + /** + * 修改收款与付款-付款明细 + */ + @SaCheckPermission("paymentsReceipts:sfkFukuan:edit") + @Log(title = "收款与付款-付款明细", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody XzdSfkFukuanBo bo) { + return toAjax(xzdSfkFukuanService.updateByBo(bo)); + } + + /** + * 删除收款与付款-付款明细 + * + * @param ids 主键串 + */ + @SaCheckPermission("paymentsReceipts:sfkFukuan:remove") + @Log(title = "收款与付款-付款明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(xzdSfkFukuanService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkZonhefuwuFkController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkZonhefuwuFkController.java new file mode 100644 index 00000000..a5eabb80 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/controller/XzdSfkZonhefuwuFkController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.paymentsReceipts.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +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.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkZonhefuwuFkVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkZonhefuwuFkBo; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkZonhefuwuFkService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 综合服务合同付款 + * + * @author Lion Li + * @date 2025-10-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/paymentsReceipts/sfkZonhefuwuFk") +public class XzdSfkZonhefuwuFkController extends BaseController { + + private final IXzdSfkZonhefuwuFkService xzdSfkZonhefuwuFkService; + + /** + * 查询综合服务合同付款列表 + */ + @SaCheckPermission("paymentsReceipts:sfkZonhefuwuFk:list") + @GetMapping("/list") + public TableDataInfo list(XzdSfkZonhefuwuFkBo bo, PageQuery pageQuery) { + return xzdSfkZonhefuwuFkService.queryPageList(bo, pageQuery); + } + + /** + * 导出综合服务合同付款列表 + */ + @SaCheckPermission("paymentsReceipts:sfkZonhefuwuFk:export") + @Log(title = "综合服务合同付款", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(XzdSfkZonhefuwuFkBo bo, HttpServletResponse response) { + List list = xzdSfkZonhefuwuFkService.queryList(bo); + ExcelUtil.exportExcel(list, "综合服务合同付款", XzdSfkZonhefuwuFkVo.class, response); + } + + /** + * 获取综合服务合同付款详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("paymentsReceipts:sfkZonhefuwuFk:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(xzdSfkZonhefuwuFkService.queryById(id)); + } + + /** + * 新增综合服务合同付款 + */ + @SaCheckPermission("paymentsReceipts:sfkZonhefuwuFk:add") + @Log(title = "综合服务合同付款", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody XzdSfkZonhefuwuFkBo bo) { + return toAjax(xzdSfkZonhefuwuFkService.insertByBo(bo)); + } + + /** + * 修改综合服务合同付款 + */ + @SaCheckPermission("paymentsReceipts:sfkZonhefuwuFk:edit") + @Log(title = "综合服务合同付款", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody XzdSfkZonhefuwuFkBo bo) { + return toAjax(xzdSfkZonhefuwuFkService.updateByBo(bo)); + } + + /** + * 删除综合服务合同付款 + * + * @param ids 主键串 + */ + @SaCheckPermission("paymentsReceipts:sfkZonhefuwuFk:remove") + @Log(title = "综合服务合同付款", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(xzdSfkZonhefuwuFkService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkCaigouFk.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkCaigouFk.java new file mode 100644 index 00000000..7516ef7d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkCaigouFk.java @@ -0,0 +1,223 @@ +package org.dromara.xzd.paymentsReceipts.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 采购合同付款对象 xzd_sfk_caigou_fk + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("xzd_sfk_caigou_fk") +public class XzdSfkCaigouFk extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID,自增 + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编码(带*,必填) + */ + private String docCode; + + /** + * 标题(带*,必填) + */ + private String title; + + /** + * 单据日期(带*,必填) + */ + private LocalDate docDate; + + /** + * 合同编码(带*,必填) + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 付款性质(带*,必填) + */ + private Long paymentProperty; + + /** + * 支出合同金额 + */ + private BigDecimal expendContractAmount; + + /** + * 本期审批金额 + */ + private BigDecimal currentApproveAmount; + + /** + * 项目 + */ + private Long project; + + /** + * 付款单位 + */ + private Long paymentUnit; + + /** + * 收款单位(带*,必填) + */ + private Long receiptUnit; + + /** + * 收款银行 + */ + private Long receiptBank; + + /** + * 收款银行账号 + */ + private String receiptBankAccount; + + /** + * 统计周期(带*,必填) + */ + private String statCycle; + + /** + * 是否是研发类 + */ + private Long isYanfa; + + /** + * 税率(带*,必填) + */ + private BigDecimal taxRate; + + /** + * 项目大类 + */ + private String projectCategory; + + /** + * 备注 + */ + private String remark; + + /** + * 本期进度支付金额 + */ + private BigDecimal currentProgressPayment; + + /** + * 累计进度支付金额 + */ + private BigDecimal totalProgressPayment; + + /** + * 预付款金额 + */ + private BigDecimal advancePayment; + + /** + * 累计支付金额 + */ + private BigDecimal totalPaymentAmount; + + /** + * 本期进度应付金额(带*,必填) + */ + private BigDecimal currentProgressPayable; + + /** + * 累计进度应付金额 + */ + private BigDecimal totalProgressPayable; + + /** + * 预付款扣回金额 + */ + private BigDecimal advanceDeductionAmount; + + /** + * 累计进度结算占合同比例(%) + */ + private BigDecimal totalProgressSettlementRatio; + + /** + * 本期进度支付占本期进度应付(%) + */ + private BigDecimal currentPaymentRatio; + + /** + * 累计进度支付占累计进度应付(%) + */ + private BigDecimal totalPaymentRatio; + + /** + * 预付款剩余未抵扣金额 + */ + private BigDecimal advanceRemainingDeduction; + + /** + * 累计支付占合同比例(%) + */ + private BigDecimal totalPaymentContractRatio; + + /** + * 剩余进度应付未付金额 + */ + private BigDecimal remainingProgressPayable; + + /** + * 累计进度结算金额 + */ + private BigDecimal totalProgressSettlementAmount; + + /** + * 实时刷新(0=未勾选,1=勾选) + */ + private Long realTimeRefresh; + + /** + * 合同含税金额 + */ + private BigDecimal contractTaxInclAmount; + + /** + * 合同累计实际付款金额 + */ + private BigDecimal contractTotalActualPayment; + + /** + * 累计结算金额 + */ + private BigDecimal totalSettlementAmount; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFapiao.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFapiao.java new file mode 100644 index 00000000..a6665ef4 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFapiao.java @@ -0,0 +1,93 @@ +package org.dromara.xzd.paymentsReceipts.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 收款与付款-发票明细对象 xzd_sfk_fapiao + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("xzd_sfk_fapiao") +public class XzdSfkFapiao extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID,自增 + */ + @TableId(value = "id") + private Long id; + + /** + * 关联主单据的ID(外键,指向付款单/结算单等主表) + */ + private Long mainDocumentId; + + /** + * 发票类型 + */ + private String invoiceType; + + /** + * 发票号码 + */ + private String invoiceNumber; + + /** + * 发票代码 + */ + private String invoiceCode; + + /** + * 开票日期 + */ + private LocalDate invoiceDate; + + /** + * 金额(不含税) + */ + private BigDecimal amount; + + /** + * 税额 + */ + private BigDecimal taxAmount; + + /** + * 价税合计 + */ + private BigDecimal totalAmountWithTax; + + /** + * 引用金额 + */ + private BigDecimal referenceAmount; + + /** + * 备注 + */ + private String remark; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFukuan.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFukuan.java new file mode 100644 index 00000000..f2a8c7b0 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkFukuan.java @@ -0,0 +1,88 @@ +package org.dromara.xzd.paymentsReceipts.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 收款与付款-付款明细对象 xzd_sfk_fukuan + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("xzd_sfk_fukuan") +public class XzdSfkFukuan extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 关联主单据的ID(外键,指向付款单等主表) + */ + private Long mainDocumentId; + + /** + * 类型(带*,必填) + */ + private String type; + + /** + * 方向 + */ + private String direction; + + /** + * 款项类别 + */ + private String itemCategory; + + /** + * 款项属性(带*,必填) + */ + private String itemProperty; + + /** + * 本期申请金额 + */ + private BigDecimal currentApplyAmount; + + /** + * 本期审批金额(带*,必填) + */ + private BigDecimal currentApproveAmount; + + /** + * 归还日期 + */ + private LocalDate returnDate; + + /** + * 备注 + */ + private String remark; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkZonhefuwuFk.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkZonhefuwuFk.java new file mode 100644 index 00000000..8ad60674 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/XzdSfkZonhefuwuFk.java @@ -0,0 +1,218 @@ +package org.dromara.xzd.paymentsReceipts.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 综合服务合同付款对象 xzd_sfk_zonhefuwu_fk + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("xzd_sfk_zonhefuwu_fk") +public class XzdSfkZonhefuwuFk extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID,自增 + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编码(带*,必填) + */ + private String docCode; + + /** + * 标题(带*,必填) + */ + private String title; + + /** + * 单据日期(带*,必填) + */ + private LocalDate docDate; + + /** + * 合同编码(带*,必填) + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 付款性质(带*,必填) + */ + private Long paymentProperty; + + /** + * 支出合同金额 + */ + private BigDecimal expendContractAmount; + + /** + * 本期审批金额 + */ + private BigDecimal currentApproveAmount; + + /** + * 项目 + */ + private Long projectId; + + /** + * 付款单位 + */ + private Long paymentUnit; + + /** + * 收款单位(带*,必填) + */ + private Long receiptUnit; + + /** + * 收款银行 + */ + private Long receiptBank; + + /** + * 收款银行账号 + */ + private String receiptBankAccount; + + /** + * 统计周期(带*,必填) + */ + private String statCycle; + + /** + * 是否研发类(0=否,1=是) + */ + private Long isResearch; + + /** + * 税率(带*,必填) + */ + private BigDecimal taxRate; + + /** + * 项目大类 + */ + private String projectCategory; + + /** + * 备注 + */ + private String remark; + + /** + * 本期进度支付金额 + */ + private BigDecimal currentProgressPayment; + + /** + * 累计进度支付金额 + */ + private BigDecimal totalProgressPayment; + + /** + * 预付款金额 + */ + private BigDecimal advancePayment; + + /** + * 累计支付金额 + */ + private BigDecimal totalPaymentAmount; + + /** + * 本期进度应付金额(带*,必填) + */ + private BigDecimal currentProgressPayable; + + /** + * 累计进度应付金额 + */ + private BigDecimal totalProgressPayable; + + /** + * 预付款扣回金额 + */ + private BigDecimal advanceDeductionAmount; + + /** + * 累计进度结算占合同比例(%) + */ + private BigDecimal totalProgressSettlementRatio; + + /** + * 本期进度支付占本期进度应付(%) + */ + private BigDecimal currentPaymentRatio; + + /** + * 累计支付占合同比例(%) + */ + private BigDecimal totalPaymentContractRatio; + + /** + * 预付款剩余未抵扣金额 + */ + private BigDecimal advanceRemainingDeduction; + + /** + * 剩余进度应付未付金额 + */ + private BigDecimal remainingProgressPayable; + + /** + * 累计进度结算金额 + */ + private BigDecimal totalProgressSettlementAmount; + + /** + * 实时刷新(0=未勾选,1=勾选) + */ + private Long realTimeRefresh; + + /** + * 合同累计实际付款金额 + */ + private BigDecimal contractTotalActualPayment; + + /** + * 合同含税金额 + */ + private BigDecimal contractTaxInclAmount; + + /** + * 累计结算金额 + */ + private BigDecimal totalSettlementAmount; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkCaigouFkBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkCaigouFkBo.java new file mode 100644 index 00000000..92a2f490 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkCaigouFkBo.java @@ -0,0 +1,231 @@ +package org.dromara.xzd.paymentsReceipts.domain.bo; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkCaigouFk; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 采购合同付款业务对象 xzd_sfk_caigou_fk + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = XzdSfkCaigouFk.class, reverseConvertGenerate = false) +public class XzdSfkCaigouFkBo extends BaseEntity { + + /** + * 主键ID,自增 + */ + @NotNull(message = "主键ID,自增不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 单据编码(带*,必填) + */ + @NotBlank(message = "单据编码(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String docCode; + + /** + * 标题(带*,必填) + */ + @NotBlank(message = "标题(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String title; + + /** + * 单据日期(带*,必填) + */ + @NotNull(message = "单据日期(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private LocalDate docDate; + + /** + * 合同编码(带*,必填) + */ + @NotNull(message = "合同编码(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 付款性质(带*,必填) + */ + @NotNull(message = "付款性质(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long paymentProperty; + + /** + * 支出合同金额 + */ + private BigDecimal expendContractAmount; + + /** + * 本期审批金额 + */ + private BigDecimal currentApproveAmount; + + /** + * 项目 + */ + private Long project; + + /** + * 付款单位 + */ + private Long paymentUnit; + + /** + * 收款单位(带*,必填) + */ + @NotNull(message = "收款单位(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long receiptUnit; + + /** + * 收款银行 + */ + private Long receiptBank; + + /** + * 收款银行账号 + */ + private String receiptBankAccount; + + /** + * 统计周期(带*,必填) + */ + @NotBlank(message = "统计周期(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String statCycle; + + /** + * 是否是研发类 + */ + private Long isYanfa; + + /** + * 税率(带*,必填) + */ + @NotNull(message = "税率(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal taxRate; + + /** + * 项目大类 + */ + private String projectCategory; + + /** + * 备注 + */ + private String remark; + + /** + * 本期进度支付金额 + */ + private BigDecimal currentProgressPayment; + + /** + * 累计进度支付金额 + */ + private BigDecimal totalProgressPayment; + + /** + * 预付款金额 + */ + private BigDecimal advancePayment; + + /** + * 累计支付金额 + */ + private BigDecimal totalPaymentAmount; + + /** + * 本期进度应付金额(带*,必填) + */ + @NotNull(message = "本期进度应付金额(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal currentProgressPayable; + + /** + * 累计进度应付金额 + */ + private BigDecimal totalProgressPayable; + + /** + * 预付款扣回金额 + */ + private BigDecimal advanceDeductionAmount; + + /** + * 累计进度结算占合同比例(%) + */ + private BigDecimal totalProgressSettlementRatio; + + /** + * 本期进度支付占本期进度应付(%) + */ + private BigDecimal currentPaymentRatio; + + /** + * 累计进度支付占累计进度应付(%) + */ + private BigDecimal totalPaymentRatio; + + /** + * 预付款剩余未抵扣金额 + */ + private BigDecimal advanceRemainingDeduction; + + /** + * 累计支付占合同比例(%) + */ + private BigDecimal totalPaymentContractRatio; + + /** + * 剩余进度应付未付金额 + */ + private BigDecimal remainingProgressPayable; + + /** + * 累计进度结算金额 + */ + private BigDecimal totalProgressSettlementAmount; + + /** + * 实时刷新(0=未勾选,1=勾选) + */ + private Long realTimeRefresh; + + /** + * 合同含税金额 + */ + private BigDecimal contractTaxInclAmount; + + /** + * 合同累计实际付款金额 + */ + private BigDecimal contractTotalActualPayment; + + /** + * 累计结算金额 + */ + private BigDecimal totalSettlementAmount; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFapiaoBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFapiaoBo.java new file mode 100644 index 00000000..60551d03 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFapiaoBo.java @@ -0,0 +1,92 @@ +package org.dromara.xzd.paymentsReceipts.domain.bo; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFapiao; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 收款与付款-发票明细业务对象 xzd_sfk_fapiao + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = XzdSfkFapiao.class, reverseConvertGenerate = false) +public class XzdSfkFapiaoBo extends BaseEntity { + + /** + * 主键ID,自增 + */ + @NotNull(message = "主键ID,自增不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 关联主单据的ID(外键,指向付款单/结算单等主表) + */ + private Long mainDocumentId; + + /** + * 发票类型 + */ + private String invoiceType; + + /** + * 发票号码 + */ + private String invoiceNumber; + + /** + * 发票代码 + */ + private String invoiceCode; + + /** + * 开票日期 + */ + private LocalDate invoiceDate; + + /** + * 金额(不含税) + */ + private BigDecimal amount; + + /** + * 税额 + */ + private BigDecimal taxAmount; + + /** + * 价税合计 + */ + private BigDecimal totalAmountWithTax; + + /** + * 引用金额 + */ + private BigDecimal referenceAmount; + + /** + * 备注 + */ + private String remark; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFukuanBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFukuanBo.java new file mode 100644 index 00000000..2054b2dc --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkFukuanBo.java @@ -0,0 +1,90 @@ +package org.dromara.xzd.paymentsReceipts.domain.bo; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFukuan; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 收款与付款-付款明细业务对象 xzd_sfk_fukuan + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = XzdSfkFukuan.class, reverseConvertGenerate = false) +public class XzdSfkFukuanBo extends BaseEntity { + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 关联主单据的ID(外键,指向付款单等主表) + */ + private Long mainDocumentId; + + /** + * 类型(带*,必填) + */ + @NotBlank(message = "类型(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String type; + + /** + * 方向 + */ + private String direction; + + /** + * 款项类别 + */ + private String itemCategory; + + /** + * 款项属性(带*,必填) + */ + @NotBlank(message = "款项属性(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String itemProperty; + + /** + * 本期申请金额 + */ + private BigDecimal currentApplyAmount; + + /** + * 本期审批金额(带*,必填) + */ + @NotNull(message = "本期审批金额(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal currentApproveAmount; + + /** + * 归还日期 + */ + private LocalDate returnDate; + + /** + * 备注 + */ + private String remark; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkZonhefuwuFkBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkZonhefuwuFkBo.java new file mode 100644 index 00000000..5f4343d1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/bo/XzdSfkZonhefuwuFkBo.java @@ -0,0 +1,226 @@ +package org.dromara.xzd.paymentsReceipts.domain.bo; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkZonhefuwuFk; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 综合服务合同付款业务对象 xzd_sfk_zonhefuwu_fk + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = XzdSfkZonhefuwuFk.class, reverseConvertGenerate = false) +public class XzdSfkZonhefuwuFkBo extends BaseEntity { + + /** + * 主键ID,自增 + */ + @NotNull(message = "主键ID,自增不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 单据编码(带*,必填) + */ + @NotBlank(message = "单据编码(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String docCode; + + /** + * 标题(带*,必填) + */ + @NotBlank(message = "标题(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String title; + + /** + * 单据日期(带*,必填) + */ + @NotNull(message = "单据日期(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private LocalDate docDate; + + /** + * 合同编码(带*,必填) + */ + @NotNull(message = "合同编码(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 付款性质(带*,必填) + */ + @NotNull(message = "付款性质(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long paymentProperty; + + /** + * 支出合同金额 + */ + private BigDecimal expendContractAmount; + + /** + * 本期审批金额 + */ + private BigDecimal currentApproveAmount; + + /** + * 项目 + */ + private Long projectId; + + /** + * 付款单位 + */ + private Long paymentUnit; + + /** + * 收款单位(带*,必填) + */ + @NotNull(message = "收款单位(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long receiptUnit; + + /** + * 收款银行 + */ + private Long receiptBank; + + /** + * 收款银行账号 + */ + private String receiptBankAccount; + + /** + * 统计周期(带*,必填) + */ + @NotBlank(message = "统计周期(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String statCycle; + + /** + * 是否研发类(0=否,1=是) + */ + private Long isResearch; + + /** + * 税率(带*,必填) + */ + @NotNull(message = "税率(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal taxRate; + + /** + * 项目大类 + */ + private String projectCategory; + + /** + * 备注 + */ + private String remark; + + /** + * 本期进度支付金额 + */ + private BigDecimal currentProgressPayment; + + /** + * 累计进度支付金额 + */ + private BigDecimal totalProgressPayment; + + /** + * 预付款金额 + */ + private BigDecimal advancePayment; + + /** + * 累计支付金额 + */ + private BigDecimal totalPaymentAmount; + + /** + * 本期进度应付金额(带*,必填) + */ + @NotNull(message = "本期进度应付金额(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal currentProgressPayable; + + /** + * 累计进度应付金额 + */ + private BigDecimal totalProgressPayable; + + /** + * 预付款扣回金额 + */ + private BigDecimal advanceDeductionAmount; + + /** + * 累计进度结算占合同比例(%) + */ + private BigDecimal totalProgressSettlementRatio; + + /** + * 本期进度支付占本期进度应付(%) + */ + private BigDecimal currentPaymentRatio; + + /** + * 累计支付占合同比例(%) + */ + private BigDecimal totalPaymentContractRatio; + + /** + * 预付款剩余未抵扣金额 + */ + private BigDecimal advanceRemainingDeduction; + + /** + * 剩余进度应付未付金额 + */ + private BigDecimal remainingProgressPayable; + + /** + * 累计进度结算金额 + */ + private BigDecimal totalProgressSettlementAmount; + + /** + * 实时刷新(0=未勾选,1=勾选) + */ + private Long realTimeRefresh; + + /** + * 合同累计实际付款金额 + */ + private BigDecimal contractTotalActualPayment; + + /** + * 合同含税金额 + */ + private BigDecimal contractTaxInclAmount; + + /** + * 累计结算金额 + */ + private BigDecimal totalSettlementAmount; + + /** + * 单据引用 + */ + private String documentReference; + + /** + * 文件ID + */ + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkCaigouFkVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkCaigouFkVo.java new file mode 100644 index 00000000..cd02147e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkCaigouFkVo.java @@ -0,0 +1,282 @@ +package org.dromara.xzd.paymentsReceipts.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkCaigouFk; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + + + +/** + * 采购合同付款视图对象 xzd_sfk_caigou_fk + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = XzdSfkCaigouFk.class) +public class XzdSfkCaigouFkVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID,自增 + */ + @ExcelProperty(value = "主键ID,自增") + private Long id; + + /** + * 单据编码(带*,必填) + */ + @ExcelProperty(value = "单据编码", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String docCode; + + /** + * 标题(带*,必填) + */ + @ExcelProperty(value = "标题", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String title; + + /** + * 单据日期(带*,必填) + */ + @ExcelProperty(value = "单据日期", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private LocalDate docDate; + + /** + * 合同编码(带*,必填) + */ + @ExcelProperty(value = "合同编码", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private Long contractCode; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 付款性质(带*,必填) + */ + @ExcelProperty(value = "付款性质", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private Long paymentProperty; + + /** + * 支出合同金额 + */ + @ExcelProperty(value = "支出合同金额") + private BigDecimal expendContractAmount; + + /** + * 本期审批金额 + */ + @ExcelProperty(value = "本期审批金额") + private BigDecimal currentApproveAmount; + + /** + * 项目 + */ + @ExcelProperty(value = "项目") + private Long project; + + /** + * 付款单位 + */ + @ExcelProperty(value = "付款单位") + private Long paymentUnit; + + /** + * 收款单位(带*,必填) + */ + @ExcelProperty(value = "收款单位", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private Long receiptUnit; + + /** + * 收款银行 + */ + @ExcelProperty(value = "收款银行") + private Long receiptBank; + + /** + * 收款银行账号 + */ + @ExcelProperty(value = "收款银行账号") + private String receiptBankAccount; + + /** + * 统计周期(带*,必填) + */ + @ExcelProperty(value = "统计周期", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String statCycle; + + /** + * 是否是研发类 + */ + @ExcelProperty(value = "是否是研发类") + private Long isYanfa; + + /** + * 税率(带*,必填) + */ + @ExcelProperty(value = "税率", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private BigDecimal taxRate; + + /** + * 项目大类 + */ + @ExcelProperty(value = "项目大类") + private String projectCategory; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 本期进度支付金额 + */ + @ExcelProperty(value = "本期进度支付金额") + private BigDecimal currentProgressPayment; + + /** + * 累计进度支付金额 + */ + @ExcelProperty(value = "累计进度支付金额") + private BigDecimal totalProgressPayment; + + /** + * 预付款金额 + */ + @ExcelProperty(value = "预付款金额") + private BigDecimal advancePayment; + + /** + * 累计支付金额 + */ + @ExcelProperty(value = "累计支付金额") + private BigDecimal totalPaymentAmount; + + /** + * 本期进度应付金额(带*,必填) + */ + @ExcelProperty(value = "本期进度应付金额", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private BigDecimal currentProgressPayable; + + /** + * 累计进度应付金额 + */ + @ExcelProperty(value = "累计进度应付金额") + private BigDecimal totalProgressPayable; + + /** + * 预付款扣回金额 + */ + @ExcelProperty(value = "预付款扣回金额") + private BigDecimal advanceDeductionAmount; + + /** + * 累计进度结算占合同比例(%) + */ + @ExcelProperty(value = "累计进度结算占合同比例", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "%=") + private BigDecimal totalProgressSettlementRatio; + + /** + * 本期进度支付占本期进度应付(%) + */ + @ExcelProperty(value = "本期进度支付占本期进度应付", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "%=") + private BigDecimal currentPaymentRatio; + + /** + * 累计进度支付占累计进度应付(%) + */ + @ExcelProperty(value = "累计进度支付占累计进度应付", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "%=") + private BigDecimal totalPaymentRatio; + + /** + * 预付款剩余未抵扣金额 + */ + @ExcelProperty(value = "预付款剩余未抵扣金额") + private BigDecimal advanceRemainingDeduction; + + /** + * 累计支付占合同比例(%) + */ + @ExcelProperty(value = "累计支付占合同比例", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "%=") + private BigDecimal totalPaymentContractRatio; + + /** + * 剩余进度应付未付金额 + */ + @ExcelProperty(value = "剩余进度应付未付金额") + private BigDecimal remainingProgressPayable; + + /** + * 累计进度结算金额 + */ + @ExcelProperty(value = "累计进度结算金额") + private BigDecimal totalProgressSettlementAmount; + + /** + * 实时刷新(0=未勾选,1=勾选) + */ + @ExcelProperty(value = "实时刷新", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0==未勾选,1=勾选") + private Long realTimeRefresh; + + /** + * 合同含税金额 + */ + @ExcelProperty(value = "合同含税金额") + private BigDecimal contractTaxInclAmount; + + /** + * 合同累计实际付款金额 + */ + @ExcelProperty(value = "合同累计实际付款金额") + private BigDecimal contractTotalActualPayment; + + /** + * 累计结算金额 + */ + @ExcelProperty(value = "累计结算金额") + private BigDecimal totalSettlementAmount; + + /** + * 单据引用 + */ + @ExcelProperty(value = "单据引用") + private String documentReference; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFapiaoVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFapiaoVo.java new file mode 100644 index 00000000..9edd07af --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFapiaoVo.java @@ -0,0 +1,114 @@ +package org.dromara.xzd.paymentsReceipts.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFapiao; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + + + +/** + * 收款与付款-发票明细视图对象 xzd_sfk_fapiao + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = XzdSfkFapiao.class) +public class XzdSfkFapiaoVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID,自增 + */ + @ExcelProperty(value = "主键ID,自增") + private Long id; + + /** + * 关联主单据的ID(外键,指向付款单/结算单等主表) + */ + @ExcelProperty(value = "关联主单据的ID", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "外=键,指向付款单/结算单等主表") + private Long mainDocumentId; + + /** + * 发票类型 + */ + @ExcelProperty(value = "发票类型") + private String invoiceType; + + /** + * 发票号码 + */ + @ExcelProperty(value = "发票号码") + private String invoiceNumber; + + /** + * 发票代码 + */ + @ExcelProperty(value = "发票代码") + private String invoiceCode; + + /** + * 开票日期 + */ + @ExcelProperty(value = "开票日期") + private LocalDate invoiceDate; + + /** + * 金额(不含税) + */ + @ExcelProperty(value = "金额", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "不=含税") + private BigDecimal amount; + + /** + * 税额 + */ + @ExcelProperty(value = "税额") + private BigDecimal taxAmount; + + /** + * 价税合计 + */ + @ExcelProperty(value = "价税合计") + private BigDecimal totalAmountWithTax; + + /** + * 引用金额 + */ + @ExcelProperty(value = "引用金额") + private BigDecimal referenceAmount; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 单据引用 + */ + @ExcelProperty(value = "单据引用") + private String documentReference; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFukuanVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFukuanVo.java new file mode 100644 index 00000000..7c112f31 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkFukuanVo.java @@ -0,0 +1,110 @@ +package org.dromara.xzd.paymentsReceipts.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFukuan; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + + + +/** + * 收款与付款-付款明细视图对象 xzd_sfk_fukuan + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = XzdSfkFukuan.class) +public class XzdSfkFukuanVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 关联主单据的ID(外键,指向付款单等主表) + */ + @ExcelProperty(value = "关联主单据的ID", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "外=键,指向付款单等主表") + private Long mainDocumentId; + + /** + * 类型(带*,必填) + */ + @ExcelProperty(value = "类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String type; + + /** + * 方向 + */ + @ExcelProperty(value = "方向") + private String direction; + + /** + * 款项类别 + */ + @ExcelProperty(value = "款项类别") + private String itemCategory; + + /** + * 款项属性(带*,必填) + */ + @ExcelProperty(value = "款项属性", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String itemProperty; + + /** + * 本期申请金额 + */ + @ExcelProperty(value = "本期申请金额") + private BigDecimal currentApplyAmount; + + /** + * 本期审批金额(带*,必填) + */ + @ExcelProperty(value = "本期审批金额", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private BigDecimal currentApproveAmount; + + /** + * 归还日期 + */ + @ExcelProperty(value = "归还日期") + private LocalDate returnDate; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 单据引用 + */ + @ExcelProperty(value = "单据引用") + private String documentReference; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkZonhefuwuFkVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkZonhefuwuFkVo.java new file mode 100644 index 00000000..8d5ccf89 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/domain/vo/XzdSfkZonhefuwuFkVo.java @@ -0,0 +1,276 @@ +package org.dromara.xzd.paymentsReceipts.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkZonhefuwuFk; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + + + +/** + * 综合服务合同付款视图对象 xzd_sfk_zonhefuwu_fk + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = XzdSfkZonhefuwuFk.class) +public class XzdSfkZonhefuwuFkVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID,自增 + */ + @ExcelProperty(value = "主键ID,自增") + private Long id; + + /** + * 单据编码(带*,必填) + */ + @ExcelProperty(value = "单据编码", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String docCode; + + /** + * 标题(带*,必填) + */ + @ExcelProperty(value = "标题", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String title; + + /** + * 单据日期(带*,必填) + */ + @ExcelProperty(value = "单据日期", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private LocalDate docDate; + + /** + * 合同编码(带*,必填) + */ + @ExcelProperty(value = "合同编码", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private Long contractCode; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 付款性质(带*,必填) + */ + @ExcelProperty(value = "付款性质", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private Long paymentProperty; + + /** + * 支出合同金额 + */ + @ExcelProperty(value = "支出合同金额") + private BigDecimal expendContractAmount; + + /** + * 本期审批金额 + */ + @ExcelProperty(value = "本期审批金额") + private BigDecimal currentApproveAmount; + + /** + * 项目 + */ + @ExcelProperty(value = "项目") + private Long projectId; + + /** + * 付款单位 + */ + @ExcelProperty(value = "付款单位") + private Long paymentUnit; + + /** + * 收款单位(带*,必填) + */ + @ExcelProperty(value = "收款单位", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private Long receiptUnit; + + /** + * 收款银行 + */ + @ExcelProperty(value = "收款银行") + private Long receiptBank; + + /** + * 收款银行账号 + */ + @ExcelProperty(value = "收款银行账号") + private String receiptBankAccount; + + /** + * 统计周期(带*,必填) + */ + @ExcelProperty(value = "统计周期", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private String statCycle; + + /** + * 是否研发类(0=否,1=是) + */ + @ExcelProperty(value = "是否研发类", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0==否,1=是") + private Long isResearch; + + /** + * 税率(带*,必填) + */ + @ExcelProperty(value = "税率", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private BigDecimal taxRate; + + /** + * 项目大类 + */ + @ExcelProperty(value = "项目大类") + private String projectCategory; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 本期进度支付金额 + */ + @ExcelProperty(value = "本期进度支付金额") + private BigDecimal currentProgressPayment; + + /** + * 累计进度支付金额 + */ + @ExcelProperty(value = "累计进度支付金额") + private BigDecimal totalProgressPayment; + + /** + * 预付款金额 + */ + @ExcelProperty(value = "预付款金额") + private BigDecimal advancePayment; + + /** + * 累计支付金额 + */ + @ExcelProperty(value = "累计支付金额") + private BigDecimal totalPaymentAmount; + + /** + * 本期进度应付金额(带*,必填) + */ + @ExcelProperty(value = "本期进度应付金额", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "带=*,必填") + private BigDecimal currentProgressPayable; + + /** + * 累计进度应付金额 + */ + @ExcelProperty(value = "累计进度应付金额") + private BigDecimal totalProgressPayable; + + /** + * 预付款扣回金额 + */ + @ExcelProperty(value = "预付款扣回金额") + private BigDecimal advanceDeductionAmount; + + /** + * 累计进度结算占合同比例(%) + */ + @ExcelProperty(value = "累计进度结算占合同比例", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "%=") + private BigDecimal totalProgressSettlementRatio; + + /** + * 本期进度支付占本期进度应付(%) + */ + @ExcelProperty(value = "本期进度支付占本期进度应付", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "%=") + private BigDecimal currentPaymentRatio; + + /** + * 累计支付占合同比例(%) + */ + @ExcelProperty(value = "累计支付占合同比例", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "%=") + private BigDecimal totalPaymentContractRatio; + + /** + * 预付款剩余未抵扣金额 + */ + @ExcelProperty(value = "预付款剩余未抵扣金额") + private BigDecimal advanceRemainingDeduction; + + /** + * 剩余进度应付未付金额 + */ + @ExcelProperty(value = "剩余进度应付未付金额") + private BigDecimal remainingProgressPayable; + + /** + * 累计进度结算金额 + */ + @ExcelProperty(value = "累计进度结算金额") + private BigDecimal totalProgressSettlementAmount; + + /** + * 实时刷新(0=未勾选,1=勾选) + */ + @ExcelProperty(value = "实时刷新", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0==未勾选,1=勾选") + private Long realTimeRefresh; + + /** + * 合同累计实际付款金额 + */ + @ExcelProperty(value = "合同累计实际付款金额") + private BigDecimal contractTotalActualPayment; + + /** + * 合同含税金额 + */ + @ExcelProperty(value = "合同含税金额") + private BigDecimal contractTaxInclAmount; + + /** + * 累计结算金额 + */ + @ExcelProperty(value = "累计结算金额") + private BigDecimal totalSettlementAmount; + + /** + * 单据引用 + */ + @ExcelProperty(value = "单据引用") + private String documentReference; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkCaigouFkMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkCaigouFkMapper.java new file mode 100644 index 00000000..8bf75c45 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkCaigouFkMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.paymentsReceipts.mapper; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkCaigouFk; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkCaigouFkVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 采购合同付款Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface XzdSfkCaigouFkMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFapiaoMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFapiaoMapper.java new file mode 100644 index 00000000..880e10a2 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFapiaoMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.paymentsReceipts.mapper; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFapiao; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFapiaoVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 收款与付款-发票明细Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface XzdSfkFapiaoMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFukuanMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFukuanMapper.java new file mode 100644 index 00000000..f816a996 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkFukuanMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.paymentsReceipts.mapper; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFukuan; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFukuanVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 收款与付款-付款明细Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface XzdSfkFukuanMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkZonhefuwuFkMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkZonhefuwuFkMapper.java new file mode 100644 index 00000000..2e5d7ce0 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/mapper/XzdSfkZonhefuwuFkMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.paymentsReceipts.mapper; + +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkZonhefuwuFk; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkZonhefuwuFkVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 综合服务合同付款Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface XzdSfkZonhefuwuFkMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkCaigouFkService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkCaigouFkService.java new file mode 100644 index 00000000..1c3127b9 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkCaigouFkService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.paymentsReceipts.service; + +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkCaigouFkVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkCaigouFkBo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkCaigouFk; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 采购合同付款Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface IXzdSfkCaigouFkService extends IService{ + + /** + * 查询采购合同付款 + * + * @param id 主键 + * @return 采购合同付款 + */ + XzdSfkCaigouFkVo queryById(Long id); + + /** + * 分页查询采购合同付款列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 采购合同付款分页列表 + */ + TableDataInfo queryPageList(XzdSfkCaigouFkBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的采购合同付款列表 + * + * @param bo 查询条件 + * @return 采购合同付款列表 + */ + List queryList(XzdSfkCaigouFkBo bo); + + /** + * 新增采购合同付款 + * + * @param bo 采购合同付款 + * @return 是否新增成功 + */ + Boolean insertByBo(XzdSfkCaigouFkBo bo); + + /** + * 修改采购合同付款 + * + * @param bo 采购合同付款 + * @return 是否修改成功 + */ + Boolean updateByBo(XzdSfkCaigouFkBo bo); + + /** + * 校验并批量删除采购合同付款信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFapiaoService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFapiaoService.java new file mode 100644 index 00000000..22eaee15 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFapiaoService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.paymentsReceipts.service; + +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFapiaoVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkFapiaoBo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFapiao; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 收款与付款-发票明细Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface IXzdSfkFapiaoService extends IService{ + + /** + * 查询收款与付款-发票明细 + * + * @param id 主键 + * @return 收款与付款-发票明细 + */ + XzdSfkFapiaoVo queryById(Long id); + + /** + * 分页查询收款与付款-发票明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 收款与付款-发票明细分页列表 + */ + TableDataInfo queryPageList(XzdSfkFapiaoBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的收款与付款-发票明细列表 + * + * @param bo 查询条件 + * @return 收款与付款-发票明细列表 + */ + List queryList(XzdSfkFapiaoBo bo); + + /** + * 新增收款与付款-发票明细 + * + * @param bo 收款与付款-发票明细 + * @return 是否新增成功 + */ + Boolean insertByBo(XzdSfkFapiaoBo bo); + + /** + * 修改收款与付款-发票明细 + * + * @param bo 收款与付款-发票明细 + * @return 是否修改成功 + */ + Boolean updateByBo(XzdSfkFapiaoBo bo); + + /** + * 校验并批量删除收款与付款-发票明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFukuanService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFukuanService.java new file mode 100644 index 00000000..d832af88 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkFukuanService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.paymentsReceipts.service; + +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFukuanVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkFukuanBo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFukuan; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 收款与付款-付款明细Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface IXzdSfkFukuanService extends IService{ + + /** + * 查询收款与付款-付款明细 + * + * @param id 主键 + * @return 收款与付款-付款明细 + */ + XzdSfkFukuanVo queryById(Long id); + + /** + * 分页查询收款与付款-付款明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 收款与付款-付款明细分页列表 + */ + TableDataInfo queryPageList(XzdSfkFukuanBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的收款与付款-付款明细列表 + * + * @param bo 查询条件 + * @return 收款与付款-付款明细列表 + */ + List queryList(XzdSfkFukuanBo bo); + + /** + * 新增收款与付款-付款明细 + * + * @param bo 收款与付款-付款明细 + * @return 是否新增成功 + */ + Boolean insertByBo(XzdSfkFukuanBo bo); + + /** + * 修改收款与付款-付款明细 + * + * @param bo 收款与付款-付款明细 + * @return 是否修改成功 + */ + Boolean updateByBo(XzdSfkFukuanBo bo); + + /** + * 校验并批量删除收款与付款-付款明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkZonhefuwuFkService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkZonhefuwuFkService.java new file mode 100644 index 00000000..bbfa9778 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/IXzdSfkZonhefuwuFkService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.paymentsReceipts.service; + +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkZonhefuwuFkVo; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkZonhefuwuFkBo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkZonhefuwuFk; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 综合服务合同付款Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface IXzdSfkZonhefuwuFkService extends IService{ + + /** + * 查询综合服务合同付款 + * + * @param id 主键 + * @return 综合服务合同付款 + */ + XzdSfkZonhefuwuFkVo queryById(Long id); + + /** + * 分页查询综合服务合同付款列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 综合服务合同付款分页列表 + */ + TableDataInfo queryPageList(XzdSfkZonhefuwuFkBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的综合服务合同付款列表 + * + * @param bo 查询条件 + * @return 综合服务合同付款列表 + */ + List queryList(XzdSfkZonhefuwuFkBo bo); + + /** + * 新增综合服务合同付款 + * + * @param bo 综合服务合同付款 + * @return 是否新增成功 + */ + Boolean insertByBo(XzdSfkZonhefuwuFkBo bo); + + /** + * 修改综合服务合同付款 + * + * @param bo 综合服务合同付款 + * @return 是否修改成功 + */ + Boolean updateByBo(XzdSfkZonhefuwuFkBo bo); + + /** + * 校验并批量删除综合服务合同付款信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkCaigouFkServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkCaigouFkServiceImpl.java new file mode 100644 index 00000000..b773714f --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkCaigouFkServiceImpl.java @@ -0,0 +1,167 @@ +package org.dromara.xzd.paymentsReceipts.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkCaigouFkBo; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkCaigouFkVo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkCaigouFk; +import org.dromara.xzd.paymentsReceipts.mapper.XzdSfkCaigouFkMapper; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkCaigouFkService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 采购合同付款Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class XzdSfkCaigouFkServiceImpl extends ServiceImpl implements IXzdSfkCaigouFkService { + + private final XzdSfkCaigouFkMapper baseMapper; + + /** + * 查询采购合同付款 + * + * @param id 主键 + * @return 采购合同付款 + */ + @Override + public XzdSfkCaigouFkVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询采购合同付款列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 采购合同付款分页列表 + */ + @Override + public TableDataInfo queryPageList(XzdSfkCaigouFkBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的采购合同付款列表 + * + * @param bo 查询条件 + * @return 采购合同付款列表 + */ + @Override + public List queryList(XzdSfkCaigouFkBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(XzdSfkCaigouFkBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(XzdSfkCaigouFk::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocCode()), XzdSfkCaigouFk::getDocCode, bo.getDocCode()); + lqw.eq(StringUtils.isNotBlank(bo.getTitle()), XzdSfkCaigouFk::getTitle, bo.getTitle()); + lqw.eq(bo.getDocDate() != null, XzdSfkCaigouFk::getDocDate, bo.getDocDate()); + lqw.eq(bo.getContractCode() != null, XzdSfkCaigouFk::getContractCode, bo.getContractCode()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), XzdSfkCaigouFk::getContractName, bo.getContractName()); + lqw.eq(bo.getPaymentProperty() != null, XzdSfkCaigouFk::getPaymentProperty, bo.getPaymentProperty()); + lqw.eq(bo.getExpendContractAmount() != null, XzdSfkCaigouFk::getExpendContractAmount, bo.getExpendContractAmount()); + lqw.eq(bo.getCurrentApproveAmount() != null, XzdSfkCaigouFk::getCurrentApproveAmount, bo.getCurrentApproveAmount()); + lqw.eq(bo.getProject() != null, XzdSfkCaigouFk::getProject, bo.getProject()); + lqw.eq(bo.getPaymentUnit() != null, XzdSfkCaigouFk::getPaymentUnit, bo.getPaymentUnit()); + lqw.eq(bo.getReceiptUnit() != null, XzdSfkCaigouFk::getReceiptUnit, bo.getReceiptUnit()); + lqw.eq(bo.getReceiptBank() != null, XzdSfkCaigouFk::getReceiptBank, bo.getReceiptBank()); + lqw.eq(StringUtils.isNotBlank(bo.getReceiptBankAccount()), XzdSfkCaigouFk::getReceiptBankAccount, bo.getReceiptBankAccount()); + lqw.eq(StringUtils.isNotBlank(bo.getStatCycle()), XzdSfkCaigouFk::getStatCycle, bo.getStatCycle()); + lqw.eq(bo.getIsYanfa() != null, XzdSfkCaigouFk::getIsYanfa, bo.getIsYanfa()); + lqw.eq(bo.getTaxRate() != null, XzdSfkCaigouFk::getTaxRate, bo.getTaxRate()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectCategory()), XzdSfkCaigouFk::getProjectCategory, bo.getProjectCategory()); + lqw.eq(bo.getCurrentProgressPayment() != null, XzdSfkCaigouFk::getCurrentProgressPayment, bo.getCurrentProgressPayment()); + lqw.eq(bo.getTotalProgressPayment() != null, XzdSfkCaigouFk::getTotalProgressPayment, bo.getTotalProgressPayment()); + lqw.eq(bo.getAdvancePayment() != null, XzdSfkCaigouFk::getAdvancePayment, bo.getAdvancePayment()); + lqw.eq(bo.getTotalPaymentAmount() != null, XzdSfkCaigouFk::getTotalPaymentAmount, bo.getTotalPaymentAmount()); + lqw.eq(bo.getCurrentProgressPayable() != null, XzdSfkCaigouFk::getCurrentProgressPayable, bo.getCurrentProgressPayable()); + lqw.eq(bo.getTotalProgressPayable() != null, XzdSfkCaigouFk::getTotalProgressPayable, bo.getTotalProgressPayable()); + lqw.eq(bo.getAdvanceDeductionAmount() != null, XzdSfkCaigouFk::getAdvanceDeductionAmount, bo.getAdvanceDeductionAmount()); + lqw.eq(bo.getTotalProgressSettlementRatio() != null, XzdSfkCaigouFk::getTotalProgressSettlementRatio, bo.getTotalProgressSettlementRatio()); + lqw.eq(bo.getCurrentPaymentRatio() != null, XzdSfkCaigouFk::getCurrentPaymentRatio, bo.getCurrentPaymentRatio()); + lqw.eq(bo.getTotalPaymentRatio() != null, XzdSfkCaigouFk::getTotalPaymentRatio, bo.getTotalPaymentRatio()); + lqw.eq(bo.getAdvanceRemainingDeduction() != null, XzdSfkCaigouFk::getAdvanceRemainingDeduction, bo.getAdvanceRemainingDeduction()); + lqw.eq(bo.getTotalPaymentContractRatio() != null, XzdSfkCaigouFk::getTotalPaymentContractRatio, bo.getTotalPaymentContractRatio()); + lqw.eq(bo.getRemainingProgressPayable() != null, XzdSfkCaigouFk::getRemainingProgressPayable, bo.getRemainingProgressPayable()); + lqw.eq(bo.getTotalProgressSettlementAmount() != null, XzdSfkCaigouFk::getTotalProgressSettlementAmount, bo.getTotalProgressSettlementAmount()); + lqw.eq(bo.getRealTimeRefresh() != null, XzdSfkCaigouFk::getRealTimeRefresh, bo.getRealTimeRefresh()); + lqw.eq(bo.getContractTaxInclAmount() != null, XzdSfkCaigouFk::getContractTaxInclAmount, bo.getContractTaxInclAmount()); + lqw.eq(bo.getContractTotalActualPayment() != null, XzdSfkCaigouFk::getContractTotalActualPayment, bo.getContractTotalActualPayment()); + lqw.eq(bo.getTotalSettlementAmount() != null, XzdSfkCaigouFk::getTotalSettlementAmount, bo.getTotalSettlementAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentReference()), XzdSfkCaigouFk::getDocumentReference, bo.getDocumentReference()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), XzdSfkCaigouFk::getFileId, bo.getFileId()); + return lqw; + } + + /** + * 新增采购合同付款 + * + * @param bo 采购合同付款 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(XzdSfkCaigouFkBo bo) { + XzdSfkCaigouFk add = MapstructUtils.convert(bo, XzdSfkCaigouFk.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改采购合同付款 + * + * @param bo 采购合同付款 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(XzdSfkCaigouFkBo bo) { + XzdSfkCaigouFk update = MapstructUtils.convert(bo, XzdSfkCaigouFk.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(XzdSfkCaigouFk entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除采购合同付款信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFapiaoServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFapiaoServiceImpl.java new file mode 100644 index 00000000..28d27741 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFapiaoServiceImpl.java @@ -0,0 +1,141 @@ +package org.dromara.xzd.paymentsReceipts.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkFapiaoBo; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFapiaoVo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFapiao; +import org.dromara.xzd.paymentsReceipts.mapper.XzdSfkFapiaoMapper; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkFapiaoService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 收款与付款-发票明细Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class XzdSfkFapiaoServiceImpl extends ServiceImpl implements IXzdSfkFapiaoService { + + private final XzdSfkFapiaoMapper baseMapper; + + /** + * 查询收款与付款-发票明细 + * + * @param id 主键 + * @return 收款与付款-发票明细 + */ + @Override + public XzdSfkFapiaoVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询收款与付款-发票明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 收款与付款-发票明细分页列表 + */ + @Override + public TableDataInfo queryPageList(XzdSfkFapiaoBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的收款与付款-发票明细列表 + * + * @param bo 查询条件 + * @return 收款与付款-发票明细列表 + */ + @Override + public List queryList(XzdSfkFapiaoBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(XzdSfkFapiaoBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(XzdSfkFapiao::getId); + lqw.eq(bo.getMainDocumentId() != null, XzdSfkFapiao::getMainDocumentId, bo.getMainDocumentId()); + lqw.eq(StringUtils.isNotBlank(bo.getInvoiceType()), XzdSfkFapiao::getInvoiceType, bo.getInvoiceType()); + lqw.eq(StringUtils.isNotBlank(bo.getInvoiceNumber()), XzdSfkFapiao::getInvoiceNumber, bo.getInvoiceNumber()); + lqw.eq(StringUtils.isNotBlank(bo.getInvoiceCode()), XzdSfkFapiao::getInvoiceCode, bo.getInvoiceCode()); + lqw.eq(bo.getInvoiceDate() != null, XzdSfkFapiao::getInvoiceDate, bo.getInvoiceDate()); + lqw.eq(bo.getAmount() != null, XzdSfkFapiao::getAmount, bo.getAmount()); + lqw.eq(bo.getTaxAmount() != null, XzdSfkFapiao::getTaxAmount, bo.getTaxAmount()); + lqw.eq(bo.getTotalAmountWithTax() != null, XzdSfkFapiao::getTotalAmountWithTax, bo.getTotalAmountWithTax()); + lqw.eq(bo.getReferenceAmount() != null, XzdSfkFapiao::getReferenceAmount, bo.getReferenceAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentReference()), XzdSfkFapiao::getDocumentReference, bo.getDocumentReference()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), XzdSfkFapiao::getFileId, bo.getFileId()); + return lqw; + } + + /** + * 新增收款与付款-发票明细 + * + * @param bo 收款与付款-发票明细 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(XzdSfkFapiaoBo bo) { + XzdSfkFapiao add = MapstructUtils.convert(bo, XzdSfkFapiao.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改收款与付款-发票明细 + * + * @param bo 收款与付款-发票明细 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(XzdSfkFapiaoBo bo) { + XzdSfkFapiao update = MapstructUtils.convert(bo, XzdSfkFapiao.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(XzdSfkFapiao entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除收款与付款-发票明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFukuanServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFukuanServiceImpl.java new file mode 100644 index 00000000..8a042775 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkFukuanServiceImpl.java @@ -0,0 +1,140 @@ +package org.dromara.xzd.paymentsReceipts.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkFukuanBo; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkFukuanVo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkFukuan; +import org.dromara.xzd.paymentsReceipts.mapper.XzdSfkFukuanMapper; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkFukuanService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 收款与付款-付款明细Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class XzdSfkFukuanServiceImpl extends ServiceImpl implements IXzdSfkFukuanService { + + private final XzdSfkFukuanMapper baseMapper; + + /** + * 查询收款与付款-付款明细 + * + * @param id 主键 + * @return 收款与付款-付款明细 + */ + @Override + public XzdSfkFukuanVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询收款与付款-付款明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 收款与付款-付款明细分页列表 + */ + @Override + public TableDataInfo queryPageList(XzdSfkFukuanBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的收款与付款-付款明细列表 + * + * @param bo 查询条件 + * @return 收款与付款-付款明细列表 + */ + @Override + public List queryList(XzdSfkFukuanBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(XzdSfkFukuanBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(XzdSfkFukuan::getId); + lqw.eq(bo.getMainDocumentId() != null, XzdSfkFukuan::getMainDocumentId, bo.getMainDocumentId()); + lqw.eq(StringUtils.isNotBlank(bo.getType()), XzdSfkFukuan::getType, bo.getType()); + lqw.eq(StringUtils.isNotBlank(bo.getDirection()), XzdSfkFukuan::getDirection, bo.getDirection()); + lqw.eq(StringUtils.isNotBlank(bo.getItemCategory()), XzdSfkFukuan::getItemCategory, bo.getItemCategory()); + lqw.eq(StringUtils.isNotBlank(bo.getItemProperty()), XzdSfkFukuan::getItemProperty, bo.getItemProperty()); + lqw.eq(bo.getCurrentApplyAmount() != null, XzdSfkFukuan::getCurrentApplyAmount, bo.getCurrentApplyAmount()); + lqw.eq(bo.getCurrentApproveAmount() != null, XzdSfkFukuan::getCurrentApproveAmount, bo.getCurrentApproveAmount()); + lqw.eq(bo.getReturnDate() != null, XzdSfkFukuan::getReturnDate, bo.getReturnDate()); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentReference()), XzdSfkFukuan::getDocumentReference, bo.getDocumentReference()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), XzdSfkFukuan::getFileId, bo.getFileId()); + return lqw; + } + + /** + * 新增收款与付款-付款明细 + * + * @param bo 收款与付款-付款明细 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(XzdSfkFukuanBo bo) { + XzdSfkFukuan add = MapstructUtils.convert(bo, XzdSfkFukuan.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改收款与付款-付款明细 + * + * @param bo 收款与付款-付款明细 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(XzdSfkFukuanBo bo) { + XzdSfkFukuan update = MapstructUtils.convert(bo, XzdSfkFukuan.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(XzdSfkFukuan entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除收款与付款-付款明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkZonhefuwuFkServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkZonhefuwuFkServiceImpl.java new file mode 100644 index 00000000..48a20e37 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/paymentsReceipts/service/impl/XzdSfkZonhefuwuFkServiceImpl.java @@ -0,0 +1,166 @@ +package org.dromara.xzd.paymentsReceipts.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.xzd.paymentsReceipts.domain.bo.XzdSfkZonhefuwuFkBo; +import org.dromara.xzd.paymentsReceipts.domain.vo.XzdSfkZonhefuwuFkVo; +import org.dromara.xzd.paymentsReceipts.domain.XzdSfkZonhefuwuFk; +import org.dromara.xzd.paymentsReceipts.mapper.XzdSfkZonhefuwuFkMapper; +import org.dromara.xzd.paymentsReceipts.service.IXzdSfkZonhefuwuFkService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 综合服务合同付款Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class XzdSfkZonhefuwuFkServiceImpl extends ServiceImpl implements IXzdSfkZonhefuwuFkService { + + private final XzdSfkZonhefuwuFkMapper baseMapper; + + /** + * 查询综合服务合同付款 + * + * @param id 主键 + * @return 综合服务合同付款 + */ + @Override + public XzdSfkZonhefuwuFkVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询综合服务合同付款列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 综合服务合同付款分页列表 + */ + @Override + public TableDataInfo queryPageList(XzdSfkZonhefuwuFkBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的综合服务合同付款列表 + * + * @param bo 查询条件 + * @return 综合服务合同付款列表 + */ + @Override + public List queryList(XzdSfkZonhefuwuFkBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(XzdSfkZonhefuwuFkBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(XzdSfkZonhefuwuFk::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocCode()), XzdSfkZonhefuwuFk::getDocCode, bo.getDocCode()); + lqw.eq(StringUtils.isNotBlank(bo.getTitle()), XzdSfkZonhefuwuFk::getTitle, bo.getTitle()); + lqw.eq(bo.getDocDate() != null, XzdSfkZonhefuwuFk::getDocDate, bo.getDocDate()); + lqw.eq(bo.getContractCode() != null, XzdSfkZonhefuwuFk::getContractCode, bo.getContractCode()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), XzdSfkZonhefuwuFk::getContractName, bo.getContractName()); + lqw.eq(bo.getPaymentProperty() != null, XzdSfkZonhefuwuFk::getPaymentProperty, bo.getPaymentProperty()); + lqw.eq(bo.getExpendContractAmount() != null, XzdSfkZonhefuwuFk::getExpendContractAmount, bo.getExpendContractAmount()); + lqw.eq(bo.getCurrentApproveAmount() != null, XzdSfkZonhefuwuFk::getCurrentApproveAmount, bo.getCurrentApproveAmount()); + lqw.eq(bo.getProjectId() != null, XzdSfkZonhefuwuFk::getProjectId, bo.getProjectId()); + lqw.eq(bo.getPaymentUnit() != null, XzdSfkZonhefuwuFk::getPaymentUnit, bo.getPaymentUnit()); + lqw.eq(bo.getReceiptUnit() != null, XzdSfkZonhefuwuFk::getReceiptUnit, bo.getReceiptUnit()); + lqw.eq(bo.getReceiptBank() != null, XzdSfkZonhefuwuFk::getReceiptBank, bo.getReceiptBank()); + lqw.eq(StringUtils.isNotBlank(bo.getReceiptBankAccount()), XzdSfkZonhefuwuFk::getReceiptBankAccount, bo.getReceiptBankAccount()); + lqw.eq(StringUtils.isNotBlank(bo.getStatCycle()), XzdSfkZonhefuwuFk::getStatCycle, bo.getStatCycle()); + lqw.eq(bo.getIsResearch() != null, XzdSfkZonhefuwuFk::getIsResearch, bo.getIsResearch()); + lqw.eq(bo.getTaxRate() != null, XzdSfkZonhefuwuFk::getTaxRate, bo.getTaxRate()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectCategory()), XzdSfkZonhefuwuFk::getProjectCategory, bo.getProjectCategory()); + lqw.eq(bo.getCurrentProgressPayment() != null, XzdSfkZonhefuwuFk::getCurrentProgressPayment, bo.getCurrentProgressPayment()); + lqw.eq(bo.getTotalProgressPayment() != null, XzdSfkZonhefuwuFk::getTotalProgressPayment, bo.getTotalProgressPayment()); + lqw.eq(bo.getAdvancePayment() != null, XzdSfkZonhefuwuFk::getAdvancePayment, bo.getAdvancePayment()); + lqw.eq(bo.getTotalPaymentAmount() != null, XzdSfkZonhefuwuFk::getTotalPaymentAmount, bo.getTotalPaymentAmount()); + lqw.eq(bo.getCurrentProgressPayable() != null, XzdSfkZonhefuwuFk::getCurrentProgressPayable, bo.getCurrentProgressPayable()); + lqw.eq(bo.getTotalProgressPayable() != null, XzdSfkZonhefuwuFk::getTotalProgressPayable, bo.getTotalProgressPayable()); + lqw.eq(bo.getAdvanceDeductionAmount() != null, XzdSfkZonhefuwuFk::getAdvanceDeductionAmount, bo.getAdvanceDeductionAmount()); + lqw.eq(bo.getTotalProgressSettlementRatio() != null, XzdSfkZonhefuwuFk::getTotalProgressSettlementRatio, bo.getTotalProgressSettlementRatio()); + lqw.eq(bo.getCurrentPaymentRatio() != null, XzdSfkZonhefuwuFk::getCurrentPaymentRatio, bo.getCurrentPaymentRatio()); + lqw.eq(bo.getTotalPaymentContractRatio() != null, XzdSfkZonhefuwuFk::getTotalPaymentContractRatio, bo.getTotalPaymentContractRatio()); + lqw.eq(bo.getAdvanceRemainingDeduction() != null, XzdSfkZonhefuwuFk::getAdvanceRemainingDeduction, bo.getAdvanceRemainingDeduction()); + lqw.eq(bo.getRemainingProgressPayable() != null, XzdSfkZonhefuwuFk::getRemainingProgressPayable, bo.getRemainingProgressPayable()); + lqw.eq(bo.getTotalProgressSettlementAmount() != null, XzdSfkZonhefuwuFk::getTotalProgressSettlementAmount, bo.getTotalProgressSettlementAmount()); + lqw.eq(bo.getRealTimeRefresh() != null, XzdSfkZonhefuwuFk::getRealTimeRefresh, bo.getRealTimeRefresh()); + lqw.eq(bo.getContractTotalActualPayment() != null, XzdSfkZonhefuwuFk::getContractTotalActualPayment, bo.getContractTotalActualPayment()); + lqw.eq(bo.getContractTaxInclAmount() != null, XzdSfkZonhefuwuFk::getContractTaxInclAmount, bo.getContractTaxInclAmount()); + lqw.eq(bo.getTotalSettlementAmount() != null, XzdSfkZonhefuwuFk::getTotalSettlementAmount, bo.getTotalSettlementAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentReference()), XzdSfkZonhefuwuFk::getDocumentReference, bo.getDocumentReference()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), XzdSfkZonhefuwuFk::getFileId, bo.getFileId()); + return lqw; + } + + /** + * 新增综合服务合同付款 + * + * @param bo 综合服务合同付款 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(XzdSfkZonhefuwuFkBo bo) { + XzdSfkZonhefuwuFk add = MapstructUtils.convert(bo, XzdSfkZonhefuwuFk.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改综合服务合同付款 + * + * @param bo 综合服务合同付款 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(XzdSfkZonhefuwuFkBo bo) { + XzdSfkZonhefuwuFk update = MapstructUtils.convert(bo, XzdSfkZonhefuwuFk.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(XzdSfkZonhefuwuFk entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除综合服务合同付款信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java index 3b420dfa..152d3f83 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/domain/vo/XzdJsCgJungonEditVo.java @@ -64,6 +64,8 @@ public class XzdJsCgJungonEditVo implements Serializable { @ExcelProperty(value = "决算单号", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "带=*,必填") private Long finalAccountCode; + private String finalAccountCodeName; + /** * 合同名称 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/IXzdJsCgJungonService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/IXzdJsCgJungonService.java index fc1b0214..178a69fa 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/IXzdJsCgJungonService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/IXzdJsCgJungonService.java @@ -67,4 +67,6 @@ public interface IXzdJsCgJungonService extends IService{ * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + String queryNameById(Long contractCode); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java index 99c93622..1946a958 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/service/impl/XzdJsCgJungonEditServiceImpl.java @@ -22,6 +22,7 @@ import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; import org.dromara.xzd.settlement.domain.XzdJsDeductionItems; import org.dromara.xzd.settlement.domain.vo.XzdJsCgJinduVo; import org.dromara.xzd.settlement.domain.vo.XzdJsCgJungonVo; +import org.dromara.xzd.settlement.service.IXzdJsCgJungonService; import org.dromara.xzd.settlement.service.IXzdJsDeductionItemsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -62,6 +63,9 @@ public class XzdJsCgJungonEditServiceImpl extends ServiceImpl 0; } + @Override + public String queryNameById(Long contractCode) { + return baseMapper.selectVoById(contractCode).getDocCode(); + } + /** * 获取部分字段名称 * @param item diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkCaigouFkMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkCaigouFkMapper.xml new file mode 100644 index 00000000..8591a77e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkCaigouFkMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFapiaoMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFapiaoMapper.xml new file mode 100644 index 00000000..7c2fd849 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFapiaoMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFukuanMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFukuanMapper.xml new file mode 100644 index 00000000..b72ba18b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkFukuanMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkZonhefuwuFkMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkZonhefuwuFkMapper.xml new file mode 100644 index 00000000..cd88ab39 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/xzd/paymentsReceipts/XzdSfkZonhefuwuFkMapper.xml @@ -0,0 +1,7 @@ + + + + +