diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusBillofquantitiesLimitListController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusBillofquantitiesLimitListController.java new file mode 100644 index 00000000..fbf63628 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusBillofquantitiesLimitListController.java @@ -0,0 +1,134 @@ +package org.dromara.tender.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.design.domain.bo.ObtainAllVersionNumbersReq; +import org.dromara.design.domain.bo.SheetListReq; +import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo; +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.tender.domain.vo.BusBillofquantitiesLimitListVo; +import org.dromara.tender.domain.bo.BusBillofquantitiesLimitListBo; +import org.dromara.tender.service.IBusBillofquantitiesLimitListService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 限价一览 + * + * @author Lion Li + * @date 2025-08-19 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/tender/billofquantitiesLimitList") +public class BusBillofquantitiesLimitListController extends BaseController { + + private final IBusBillofquantitiesLimitListService busBillofquantitiesLimitListService; + + /** + * 查询限价一览列表 + */ + @SaCheckPermission("tender:billofquantitiesLimitList:list") + @GetMapping("/list") + public R> list(BusBillofquantitiesLimitListBo bo, PageQuery pageQuery) { + return R.ok(busBillofquantitiesLimitListService.getTree(bo)); + } + /** + * 查询限价一览列表 + */ + @SaCheckPermission("tender:billofquantitiesLimitList:getTree") + @GetMapping("/getTree") + public R> getTree(BusBillofquantitiesLimitListBo bo) { + return R.ok(busBillofquantitiesLimitListService.getTree(bo)); + } + + /** + * 获取所有版本号 + */ + @SaCheckPermission("design:billofquantitiesLimitList:obtainAllVersionNumbers") + @GetMapping("/obtainAllVersionNumbers") + public R> obtainAllVersionNumbers(BusBillofquantitiesLimitListBo bo) { + return R.ok(busBillofquantitiesLimitListService.obtainAllVersionNumbers(bo)); + } + + /** + * 获取指定版本的sheet + */ + @SaCheckPermission("design:billofquantitiesLimitList:sheetList") + @GetMapping("/sheetList") + public R> sheetList(BusBillofquantitiesLimitListBo bo) { + return R.ok(busBillofquantitiesLimitListService.sheetList(bo)); + } + + /** + * 导出限价一览列表 + */ + @SaCheckPermission("tender:billofquantitiesLimitList:export") + @Log(title = "限价一览", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(BusBillofquantitiesLimitListBo bo, HttpServletResponse response) { + List list = busBillofquantitiesLimitListService.queryList(bo); + ExcelUtil.exportExcel(list, "限价一览", BusBillofquantitiesLimitListVo.class, response); + } + + /** + * 获取限价一览详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("tender:billofquantitiesLimitList:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(busBillofquantitiesLimitListService.queryById(id)); + } + + /** + * 新增限价一览 + */ + @SaCheckPermission("tender:billofquantitiesLimitList:add") + @Log(title = "限价一览", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody BusBillofquantitiesLimitListBo bo) { + return toAjax(busBillofquantitiesLimitListService.insertByBo(bo)); + } + + /** + * 修改限价一览 + */ + @SaCheckPermission("tender:billofquantitiesLimitList:edit") + @Log(title = "限价一览", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody BusBillofquantitiesLimitListBo bo) { + return toAjax(busBillofquantitiesLimitListService.updateByBo(bo)); + } + + /** + * 删除限价一览 + * + * @param ids 主键串 + */ + @SaCheckPermission("tender:billofquantitiesLimitList:remove") + @Log(title = "限价一览", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(busBillofquantitiesLimitListService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusIndicatorPlanningLimitListController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusIndicatorPlanningLimitListController.java new file mode 100644 index 00000000..cf2e8000 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusIndicatorPlanningLimitListController.java @@ -0,0 +1,105 @@ +package org.dromara.tender.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.tender.domain.vo.BusIndicatorPlanningLimitListVo; +import org.dromara.tender.domain.bo.BusIndicatorPlanningLimitListBo; +import org.dromara.tender.service.IBusIndicatorPlanningLimitListService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 分标策划-限价一览 + * + * @author Lion Li + * @date 2025-08-19 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/tender/indicatorPlanningLimitList") +public class BusIndicatorPlanningLimitListController extends BaseController { + + private final IBusIndicatorPlanningLimitListService busIndicatorPlanningLimitListService; + + /** + * 查询分标策划-限价一览列表 + */ + @SaCheckPermission("tender:indicatorPlanningLimitList:list") + @GetMapping("/list") + public TableDataInfo list(BusIndicatorPlanningLimitListBo bo, PageQuery pageQuery) { + return busIndicatorPlanningLimitListService.queryPageList(bo, pageQuery); + } + + /** + * 导出分标策划-限价一览列表 + */ + @SaCheckPermission("tender:indicatorPlanningLimitList:export") + @Log(title = "分标策划-限价一览", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(BusIndicatorPlanningLimitListBo bo, HttpServletResponse response) { + List list = busIndicatorPlanningLimitListService.queryList(bo); + ExcelUtil.exportExcel(list, "分标策划-限价一览", BusIndicatorPlanningLimitListVo.class, response); + } + + /** + * 获取分标策划-限价一览详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("tender:indicatorPlanningLimitList:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(busIndicatorPlanningLimitListService.queryById(id)); + } + + /** + * 新增分标策划-限价一览 + */ + @SaCheckPermission("tender:indicatorPlanningLimitList:add") + @Log(title = "分标策划-限价一览", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody BusIndicatorPlanningLimitListBo bo) { + return toAjax(busIndicatorPlanningLimitListService.insertByBo(bo)); + } + + /** + * 修改分标策划-限价一览 + */ + @SaCheckPermission("tender:indicatorPlanningLimitList:edit") + @Log(title = "分标策划-限价一览", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody BusIndicatorPlanningLimitListBo bo) { + return toAjax(busIndicatorPlanningLimitListService.updateByBo(bo)); + } + + /** + * 删除分标策划-限价一览 + * + * @param ids 主键串 + */ + @SaCheckPermission("tender:indicatorPlanningLimitList:remove") + @Log(title = "分标策划-限价一览", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(busIndicatorPlanningLimitListService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusSegmentedIndicatorPlanningController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusSegmentedIndicatorPlanningController.java new file mode 100644 index 00000000..882d5dd5 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/controller/BusSegmentedIndicatorPlanningController.java @@ -0,0 +1,112 @@ +package org.dromara.tender.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.common.core.exception.ServiceException; +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.tender.domain.vo.BusSegmentedIndicatorPlanningVo; +import org.dromara.tender.domain.bo.BusSegmentedIndicatorPlanningBo; +import org.dromara.tender.service.IBusSegmentedIndicatorPlanningService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 分标策划 + * + * @author Lion Li + * @date 2025-08-19 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/tender/segmentedIndicatorPlanning") +public class BusSegmentedIndicatorPlanningController extends BaseController { + + private final IBusSegmentedIndicatorPlanningService busSegmentedIndicatorPlanningService; + + /** + * 查询分标策划列表 + */ + @SaCheckPermission("tender:segmentedIndicatorPlanning:list") + @GetMapping("/list") + public TableDataInfo list(BusSegmentedIndicatorPlanningBo bo, PageQuery pageQuery) { + if (bo.getProjectId() == null) { + throw new ServiceException("项目id不能为空"); + } + if (bo.getDictId() == null) { + throw new ServiceException("分包类型id不能为空"); + } + return busSegmentedIndicatorPlanningService.queryPageList(bo, pageQuery); + } + + /** + * 导出分标策划列表 + */ +// @SaCheckPermission("tender:segmentedIndicatorPlanning:export") +// @Log(title = "分标策划", businessType = BusinessType.EXPORT) +// @PostMapping("/export") +// public void export(BusSegmentedIndicatorPlanningBo bo, HttpServletResponse response) { +// List list = busSegmentedIndicatorPlanningService.queryList(bo); +// ExcelUtil.exportExcel(list, "分标策划", BusSegmentedIndicatorPlanningVo.class, response); +// } + + /** + * 获取分标策划详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("tender:segmentedIndicatorPlanning:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(busSegmentedIndicatorPlanningService.queryById(id)); + } + + /** + * 新增分标策划 + */ + @SaCheckPermission("tender:segmentedIndicatorPlanning:add") + @Log(title = "分标策划", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody BusSegmentedIndicatorPlanningBo bo) { + return toAjax(busSegmentedIndicatorPlanningService.insertByBo(bo)); + } + + /** + * 修改分标策划 + */ + @SaCheckPermission("tender:segmentedIndicatorPlanning:edit") + @Log(title = "分标策划", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody BusSegmentedIndicatorPlanningBo bo) { + return toAjax(busSegmentedIndicatorPlanningService.updateByBo(bo)); + } + + /** + * 删除分标策划 + * + * @param ids 主键串 + */ + @SaCheckPermission("tender:segmentedIndicatorPlanning:remove") + @Log(title = "分标策划", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(busSegmentedIndicatorPlanningService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusBillofquantitiesLimitList.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusBillofquantitiesLimitList.java new file mode 100644 index 00000000..6420f33d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusBillofquantitiesLimitList.java @@ -0,0 +1,97 @@ +package org.dromara.tender.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; +import java.math.BigDecimal; + +/** + * 限价一览对象 bus_billofquantities_limit_list + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("bus_billofquantities_limit_list") +public class BusBillofquantitiesLimitList extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 项目Id + */ + private Long projectId; + + /** + * 版本号 + */ + private String versions; + + /** + * 表名 + */ + private String sheet; + + /** + * 子ID + */ + private String sid; + + /** + * 父ID + */ + private String pid; + + /** + * 编号 + */ + private String num; + + /** + * 名称 + */ + private String name; + + /** + * 规格 + */ + private String specification; + + /** + * 单位 + */ + private String unit; + + /** + * 数量 + */ + private BigDecimal quantity; + + /** + * 单价 + */ + private BigDecimal unitPrice; + + /** + * 总价 + */ +// private BigDecimal price; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusIndicatorPlanningLimitList.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusIndicatorPlanningLimitList.java new file mode 100644 index 00000000..341c8c0c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusIndicatorPlanningLimitList.java @@ -0,0 +1,47 @@ +package org.dromara.tender.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; +import java.math.BigDecimal; + +/** + * 分标策划-限价一览对象 bus_indicator_planning_limit_list + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("bus_indicator_planning_limit_list") +public class BusIndicatorPlanningLimitList extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 分标策划Id + */ + private Long segmentedIndicatorId; + + /** + * 限价一览id + */ + private Long limitListId; + + /** + * 数量 + */ + private BigDecimal num; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusSegmentedIndicatorPlanning.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusSegmentedIndicatorPlanning.java new file mode 100644 index 00000000..73ecd081 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/BusSegmentedIndicatorPlanning.java @@ -0,0 +1,70 @@ +package org.dromara.tender.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDate; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 分标策划对象 bus_segmented_indicator_planning + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("bus_segmented_indicator_planning") +public class BusSegmentedIndicatorPlanning extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 项目Id + */ + private Long projectId; + + /** + * 分包类型id + */ + private Long dictId; + + /** + * 分包类型名称 + */ + private String dictName; + + /** + * 名称 + */ + private String name; + + /** + * 计划招标时间 + */ + private LocalDate plannedBiddingTime; + + /** + * 总价 + */ + private Long price; + + /** + * 分包内容 + */ + private String content; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusBillofquantitiesLimitListBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusBillofquantitiesLimitListBo.java new file mode 100644 index 00000000..65c5cf40 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusBillofquantitiesLimitListBo.java @@ -0,0 +1,99 @@ +package org.dromara.tender.domain.bo; + +import org.dromara.tender.domain.BusBillofquantitiesLimitList; +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; + +/** + * 限价一览业务对象 bus_billofquantities_limit_list + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = BusBillofquantitiesLimitList.class, reverseConvertGenerate = false) +public class BusBillofquantitiesLimitListBo extends BaseEntity { + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 项目Id + */ + @NotNull(message = "项目Id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long projectId; + + /** + * 版本号 + */ + @NotBlank(message = "版本号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String versions; + + /** + * 表名 + */ + private String sheet; + + /** + * 子ID + */ + private String sid; + + /** + * 父ID + */ + private String pid; + + /** + * 编号 + */ + private String num; + + /** + * 名称 + */ + private String name; + + /** + * 规格 + */ + private String specification; + + /** + * 单位 + */ + private String unit; + + /** + * 数量 + */ + private BigDecimal quantity; + + /** + * 单价 + */ + private BigDecimal unitPrice; + + /** + * 总价 + */ +// private BigDecimal price; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusIndicatorPlanningLimitListBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusIndicatorPlanningLimitListBo.java new file mode 100644 index 00000000..266e56f1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusIndicatorPlanningLimitListBo.java @@ -0,0 +1,47 @@ +package org.dromara.tender.domain.bo; + +import org.dromara.tender.domain.BusIndicatorPlanningLimitList; +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; + +/** + * 分标策划-限价一览业务对象 bus_indicator_planning_limit_list + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = BusIndicatorPlanningLimitList.class, reverseConvertGenerate = false) +public class BusIndicatorPlanningLimitListBo extends BaseEntity { + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 分标策划Id + */ + private Long segmentedIndicatorId; + + /** + * 限价一览id + */ + private Long limitListId; + + /** + * 数量 + */ + private BigDecimal num; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusSegmentedIndicatorPlanningBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusSegmentedIndicatorPlanningBo.java new file mode 100644 index 00000000..6c4b9fb1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/bo/BusSegmentedIndicatorPlanningBo.java @@ -0,0 +1,80 @@ +package org.dromara.tender.domain.bo; + +import org.dromara.tender.domain.BusSegmentedIndicatorPlanning; +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; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 分标策划业务对象 bus_segmented_indicator_planning + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = BusSegmentedIndicatorPlanning.class, reverseConvertGenerate = false) +public class BusSegmentedIndicatorPlanningBo extends BaseEntity { + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 项目Id + */ + @NotNull(message = "项目Id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long projectId; + + /** + * 分包类型id + */ + @NotNull(message = "分包类型id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long dictId; + + /** + * 分包类型名称 + */ + private String dictName; + + /** + * 名称 + */ + private String name; + + /** + * 计划招标时间 + */ + private LocalDate plannedBiddingTime; + + /** + * 总价 + */ + private BigDecimal price; + + /** + * 分包内容 + */ + private String content; + + + /** + * 限价一览表ids + */ + private List limitListBos; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusBillofquantitiesLimitListVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusBillofquantitiesLimitListVo.java new file mode 100644 index 00000000..6ffb7e25 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusBillofquantitiesLimitListVo.java @@ -0,0 +1,123 @@ +package org.dromara.tender.domain.vo; + +import org.dromara.design.domain.vo.ObtainTheListRes; +import org.dromara.tender.domain.BusBillofquantitiesLimitList; +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.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * 限价一览视图对象 bus_billofquantities_limit_list + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BusBillofquantitiesLimitList.class) +public class BusBillofquantitiesLimitListVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 项目Id + */ + @ExcelProperty(value = "项目Id") + private Long projectId; + + /** + * 版本号 + */ + @ExcelProperty(value = "版本号") + private String versions; + + /** + * 表名 + */ + @ExcelProperty(value = "表名") + private String sheet; + + /** + * 子ID + */ + @ExcelProperty(value = "子ID") + private String sid; + + /** + * 父ID + */ + @ExcelProperty(value = "父ID") + private String pid; + + /** + * 编号 + */ + @ExcelProperty(value = "编号") + private String num; + + /** + * 名称 + */ + @ExcelProperty(value = "名称") + private String name; + + /** + * 规格 + */ + @ExcelProperty(value = "规格") + private String specification; + + /** + * 单位 + */ + @ExcelProperty(value = "单位") + private String unit; + + /** + * 数量 + */ + @ExcelProperty(value = "数量") + private BigDecimal quantity; + + /** + * 单价 + */ + @ExcelProperty(value = "单价") + private BigDecimal unitPrice; + + /** + * 总价 + */ +// @ExcelProperty(value = "总价") + private BigDecimal price; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 子节点 + */ + private List children = new ArrayList<>(); + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusIndicatorPlanningLimitListVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusIndicatorPlanningLimitListVo.java new file mode 100644 index 00000000..66d15dd7 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusIndicatorPlanningLimitListVo.java @@ -0,0 +1,57 @@ +package org.dromara.tender.domain.vo; + +import org.dromara.tender.domain.BusIndicatorPlanningLimitList; +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.math.BigDecimal; +import java.util.Date; + + + +/** + * 分标策划-限价一览视图对象 bus_indicator_planning_limit_list + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BusIndicatorPlanningLimitList.class) +public class BusIndicatorPlanningLimitListVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 分标策划Id + */ + @ExcelProperty(value = "分标策划Id") + private Long segmentedIndicatorId; + + /** + * 限价一览id + */ + @ExcelProperty(value = "限价一览id") + private Long limitListId; + + /** + * 数量 + */ + @ExcelProperty(value = "数量") + private BigDecimal num; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusSegmentedIndicatorPlanningVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusSegmentedIndicatorPlanningVo.java new file mode 100644 index 00000000..d5df7103 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/domain/vo/BusSegmentedIndicatorPlanningVo.java @@ -0,0 +1,84 @@ +package org.dromara.tender.domain.vo; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.tender.domain.BusSegmentedIndicatorPlanning; +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.util.Date; + + + +/** + * 分标策划视图对象 bus_segmented_indicator_planning + * + * @author Lion Li + * @date 2025-08-19 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BusSegmentedIndicatorPlanning.class) +public class BusSegmentedIndicatorPlanningVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 项目Id + */ + @ExcelProperty(value = "项目Id") + private Long projectId; + + /** + * 分包类型id + */ + @ExcelProperty(value = "分包类型id") + private Long dictId; + + /** + * 分包类型名称 + */ + @ExcelProperty(value = "分包类型名称") + private String dictName; + + /** + * 名称 + */ + @ExcelProperty(value = "名称") + private String name; + + /** + * 计划招标时间 + */ + @ExcelProperty(value = "计划招标时间") + private LocalDate plannedBiddingTime; + + /** + * 总价 + */ + @ExcelProperty(value = "总价") + private BigDecimal price; + + /** + * 分包内容 + */ + @ExcelProperty(value = "分包内容") + private String content; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusBillofquantitiesLimitListMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusBillofquantitiesLimitListMapper.java new file mode 100644 index 00000000..efbbdc45 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusBillofquantitiesLimitListMapper.java @@ -0,0 +1,15 @@ +package org.dromara.tender.mapper; + +import org.dromara.tender.domain.BusBillofquantitiesLimitList; +import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 限价一览Mapper接口 + * + * @author Lion Li + * @date 2025-08-19 + */ +public interface BusBillofquantitiesLimitListMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusIndicatorPlanningLimitListMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusIndicatorPlanningLimitListMapper.java new file mode 100644 index 00000000..0b174a73 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusIndicatorPlanningLimitListMapper.java @@ -0,0 +1,22 @@ +package org.dromara.tender.mapper; + +import org.apache.ibatis.annotations.Param; +import org.dromara.design.domain.bo.ObtainTheListReq; +import org.dromara.tender.domain.BusIndicatorPlanningLimitList; +import org.dromara.tender.domain.vo.BusIndicatorPlanningLimitListVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +import java.math.BigDecimal; + +/** + * 分标策划-限价一览Mapper接口 + * + * @author Lion Li + * @date 2025-08-19 + */ +public interface BusIndicatorPlanningLimitListMapper extends BaseMapperPlus { + + + BigDecimal getLimitCoount(@Param("limitListId") Long id); + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusSegmentedIndicatorPlanningMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusSegmentedIndicatorPlanningMapper.java new file mode 100644 index 00000000..26e35a35 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/mapper/BusSegmentedIndicatorPlanningMapper.java @@ -0,0 +1,15 @@ +package org.dromara.tender.mapper; + +import org.dromara.tender.domain.BusSegmentedIndicatorPlanning; +import org.dromara.tender.domain.vo.BusSegmentedIndicatorPlanningVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 分标策划Mapper接口 + * + * @author Lion Li + * @date 2025-08-19 + */ +public interface BusSegmentedIndicatorPlanningMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusBillofquantitiesLimitListService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusBillofquantitiesLimitListService.java new file mode 100644 index 00000000..e7aef6a7 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusBillofquantitiesLimitListService.java @@ -0,0 +1,87 @@ +package org.dromara.tender.service; + +import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo; +import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListVo; +import org.dromara.tender.domain.bo.BusBillofquantitiesLimitListBo; +import org.dromara.tender.domain.BusBillofquantitiesLimitList; +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-08-19 + */ +public interface IBusBillofquantitiesLimitListService extends IService{ + + /** + * 查询限价一览 + * + * @param id 主键 + * @return 限价一览 + */ + BusBillofquantitiesLimitListVo queryById(Long id); + + /** + * 分页查询限价一览列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 限价一览分页列表 + */ + TableDataInfo queryPageList(BusBillofquantitiesLimitListBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的限价一览列表 + * + * @param bo 查询条件 + * @return 限价一览列表 + */ + List queryList(BusBillofquantitiesLimitListBo bo); + + /** + * 新增限价一览 + * + * @param bo 限价一览 + * @return 是否新增成功 + */ + Boolean insertByBo(BusBillofquantitiesLimitListBo bo); + + /** + * 修改限价一览 + * + * @param bo 限价一览 + * @return 是否修改成功 + */ + Boolean updateByBo(BusBillofquantitiesLimitListBo bo); + + /** + * 校验并批量删除限价一览信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 查询限价一览表返树形结构数据 + * @param bo + * @return + */ + List getTree(BusBillofquantitiesLimitListBo bo); + /** + * 获取所有版本号 + */ + List obtainAllVersionNumbers(BusBillofquantitiesLimitListBo bo); + + /** + * 获取指定版本的sheet + */ + List sheetList(BusBillofquantitiesLimitListBo bo); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusIndicatorPlanningLimitListService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusIndicatorPlanningLimitListService.java new file mode 100644 index 00000000..013dd02d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusIndicatorPlanningLimitListService.java @@ -0,0 +1,70 @@ +package org.dromara.tender.service; + +import org.dromara.tender.domain.vo.BusIndicatorPlanningLimitListVo; +import org.dromara.tender.domain.bo.BusIndicatorPlanningLimitListBo; +import org.dromara.tender.domain.BusIndicatorPlanningLimitList; +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-08-19 + */ +public interface IBusIndicatorPlanningLimitListService extends IService{ + + /** + * 查询分标策划-限价一览 + * + * @param id 主键 + * @return 分标策划-限价一览 + */ + BusIndicatorPlanningLimitListVo queryById(Long id); + + /** + * 分页查询分标策划-限价一览列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分标策划-限价一览分页列表 + */ + TableDataInfo queryPageList(BusIndicatorPlanningLimitListBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的分标策划-限价一览列表 + * + * @param bo 查询条件 + * @return 分标策划-限价一览列表 + */ + List queryList(BusIndicatorPlanningLimitListBo bo); + + /** + * 新增分标策划-限价一览 + * + * @param bo 分标策划-限价一览 + * @return 是否新增成功 + */ + Boolean insertByBo(BusIndicatorPlanningLimitListBo bo); + + /** + * 修改分标策划-限价一览 + * + * @param bo 分标策划-限价一览 + * @return 是否修改成功 + */ + Boolean updateByBo(BusIndicatorPlanningLimitListBo 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/tender/service/IBusSegmentedIndicatorPlanningService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusSegmentedIndicatorPlanningService.java new file mode 100644 index 00000000..1c824b7c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/IBusSegmentedIndicatorPlanningService.java @@ -0,0 +1,70 @@ +package org.dromara.tender.service; + +import org.dromara.tender.domain.vo.BusSegmentedIndicatorPlanningVo; +import org.dromara.tender.domain.bo.BusSegmentedIndicatorPlanningBo; +import org.dromara.tender.domain.BusSegmentedIndicatorPlanning; +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-08-19 + */ +public interface IBusSegmentedIndicatorPlanningService extends IService{ + + /** + * 查询分标策划 + * + * @param id 主键 + * @return 分标策划 + */ + BusSegmentedIndicatorPlanningVo queryById(Long id); + + /** + * 分页查询分标策划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分标策划分页列表 + */ + TableDataInfo queryPageList(BusSegmentedIndicatorPlanningBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的分标策划列表 + * + * @param bo 查询条件 + * @return 分标策划列表 + */ + List queryList(BusSegmentedIndicatorPlanningBo bo); + + /** + * 新增分标策划 + * + * @param bo 分标策划 + * @return 是否新增成功 + */ + Boolean insertByBo(BusSegmentedIndicatorPlanningBo bo); + + /** + * 修改分标策划 + * + * @param bo 分标策划 + * @return 是否修改成功 + */ + Boolean updateByBo(BusSegmentedIndicatorPlanningBo 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/tender/service/impl/BusBillofquantitiesLimitListServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusBillofquantitiesLimitListServiceImpl.java new file mode 100644 index 00000000..e17a435b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusBillofquantitiesLimitListServiceImpl.java @@ -0,0 +1,216 @@ +package org.dromara.tender.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.design.domain.BusBillofquantities; +import org.springframework.stereotype.Service; +import org.dromara.tender.domain.bo.BusBillofquantitiesLimitListBo; +import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListVo; +import org.dromara.tender.domain.BusBillofquantitiesLimitList; +import org.dromara.tender.mapper.BusBillofquantitiesLimitListMapper; +import org.dromara.tender.service.IBusBillofquantitiesLimitListService; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 限价一览Service业务层处理 + * + * @author Lion Li + * @date 2025-08-19 + */ +@RequiredArgsConstructor +@Service +public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl implements IBusBillofquantitiesLimitListService { + + private final BusBillofquantitiesLimitListMapper baseMapper; + + /** + * 查询限价一览 + * + * @param id 主键 + * @return 限价一览 + */ + @Override + public BusBillofquantitiesLimitListVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询限价一览列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 限价一览分页列表 + */ + @Override + public TableDataInfo queryPageList(BusBillofquantitiesLimitListBo 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(BusBillofquantitiesLimitListBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BusBillofquantitiesLimitListBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(BusBillofquantitiesLimitList::getId); + lqw.eq(bo.getProjectId() != null, BusBillofquantitiesLimitList::getProjectId, bo.getProjectId()); + lqw.eq(StringUtils.isNotBlank(bo.getVersions()), BusBillofquantitiesLimitList::getVersions, bo.getVersions()); + lqw.eq(StringUtils.isNotBlank(bo.getSheet()), BusBillofquantitiesLimitList::getSheet, bo.getSheet()); + lqw.eq(StringUtils.isNotBlank(bo.getSid()), BusBillofquantitiesLimitList::getSid, bo.getSid()); + lqw.eq(StringUtils.isNotBlank(bo.getPid()), BusBillofquantitiesLimitList::getPid, bo.getPid()); + lqw.eq(StringUtils.isNotBlank(bo.getNum()), BusBillofquantitiesLimitList::getNum, bo.getNum()); + lqw.like(StringUtils.isNotBlank(bo.getName()), BusBillofquantitiesLimitList::getName, bo.getName()); + lqw.eq(StringUtils.isNotBlank(bo.getSpecification()), BusBillofquantitiesLimitList::getSpecification, bo.getSpecification()); + lqw.eq(StringUtils.isNotBlank(bo.getUnit()), BusBillofquantitiesLimitList::getUnit, bo.getUnit()); + lqw.eq(bo.getQuantity() != null, BusBillofquantitiesLimitList::getQuantity, bo.getQuantity()); +// lqw.eq(bo.getUnitPrice() != null, BusBillofquantitiesLimitList::getUnitPrice, bo.getUnitPrice()); +// lqw.eq(bo.getPrice() != null, BusBillofquantitiesLimitList::getPrice, bo.getPrice()); + return lqw; + } + + /** + * 新增限价一览 + * + * @param bo 限价一览 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(BusBillofquantitiesLimitListBo bo) { + BusBillofquantitiesLimitList add = MapstructUtils.convert(bo, BusBillofquantitiesLimitList.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改限价一览 + * + * @param bo 限价一览 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(BusBillofquantitiesLimitListBo bo) { +// if (bo.getUnitPrice() != null && bo.getQuantity() != null) { +// bo.setPrice(bo.getUnitPrice().multiply(bo.getQuantity()).setScale(2, RoundingMode.HALF_UP)); +// } + BusBillofquantitiesLimitList update = MapstructUtils.convert(bo, BusBillofquantitiesLimitList.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(BusBillofquantitiesLimitList entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除限价一览信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } + + @Override + public List getTree(BusBillofquantitiesLimitListBo bo) { + //获取所有数据 + List listVoList = queryList(bo); + listVoList.stream().filter(vo -> vo.getUnitPrice() !=null && vo.getUnitPrice().compareTo(BigDecimal.ZERO) != 0) + .forEach(item -> { + item.setPrice(item.getUnitPrice().multiply(item.getQuantity()).setScale(2, RoundingMode.HALF_UP)); + }); + + //构建父子映射 + Map> parentMap = listVoList.stream() + .collect(Collectors.groupingBy(BusBillofquantitiesLimitListVo::getPid)); + //递归组装树形结构 + List treeList = buildTree("0", parentMap); + + return treeList; + } + + @Override + public List obtainAllVersionNumbers(BusBillofquantitiesLimitListBo bo) { + List busBillofquantitiesLimitLists = baseMapper.selectList(new LambdaQueryWrapper() + .select(BusBillofquantitiesLimitList::getVersions) + .eq(bo.getProjectId() != null, BusBillofquantitiesLimitList::getProjectId, bo.getProjectId()) + .orderByDesc(BusBillofquantitiesLimitList::getCreateTime) + .groupBy(BusBillofquantitiesLimitList::getVersions)); + return busBillofquantitiesLimitLists.stream() + .filter(Objects::nonNull) + .map(BusBillofquantitiesLimitList::getVersions) + .collect(Collectors.toList()); + } + + @Override + public List sheetList(BusBillofquantitiesLimitListBo bo) { + List busBillofquantitiesLimitLists = baseMapper.selectList(new LambdaQueryWrapper() + .select(BusBillofquantitiesLimitList::getSheet) + .eq(bo.getProjectId() != null, BusBillofquantitiesLimitList::getProjectId, bo.getProjectId()) + .eq(StringUtils.isNotBlank(bo.getVersions()), BusBillofquantitiesLimitList::getVersions, bo.getVersions()) + .orderByAsc(BusBillofquantitiesLimitList::getSheet) + .groupBy(BusBillofquantitiesLimitList::getSheet)); + return busBillofquantitiesLimitLists.stream() + .filter(Objects::nonNull) + .map(BusBillofquantitiesLimitList::getSheet) + .collect(Collectors.toList()); + } + + /** + * 递归构建树形结构 + * @param parentId 父节点ID(顶级节点为0) + * @param parentMap 父子映射表(key=pid,value=子节点列表) + * @return 组装好的子树列表 + */ + private List buildTree(String parentId, Map> parentMap) { + // 获取当前父节点的所有直接子节点 + List children = parentMap.getOrDefault(parentId, Collections.emptyList()); + if (children.isEmpty()) { + return Collections.emptyList(); + } + + // 为每个子节点递归设置其下一级子节点 + for (BusBillofquantitiesLimitListVo child : children) { + // 递归查询当前子节点的子节点,设置为它的子树 + List subChildren = buildTree(child.getSid(), parentMap); + // 注意:需要在Vo中添加子节点列表字段,用于存储子树 + child.setChildren(subChildren); + } + + return children; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusIndicatorPlanningLimitListServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusIndicatorPlanningLimitListServiceImpl.java new file mode 100644 index 00000000..40a7480b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusIndicatorPlanningLimitListServiceImpl.java @@ -0,0 +1,132 @@ +package org.dromara.tender.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.tender.domain.bo.BusIndicatorPlanningLimitListBo; +import org.dromara.tender.domain.vo.BusIndicatorPlanningLimitListVo; +import org.dromara.tender.domain.BusIndicatorPlanningLimitList; +import org.dromara.tender.mapper.BusIndicatorPlanningLimitListMapper; +import org.dromara.tender.service.IBusIndicatorPlanningLimitListService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 分标策划-限价一览Service业务层处理 + * + * @author Lion Li + * @date 2025-08-19 + */ +@RequiredArgsConstructor +@Service +public class BusIndicatorPlanningLimitListServiceImpl extends ServiceImpl implements IBusIndicatorPlanningLimitListService { + + private final BusIndicatorPlanningLimitListMapper baseMapper; + + /** + * 查询分标策划-限价一览 + * + * @param id 主键 + * @return 分标策划-限价一览 + */ + @Override + public BusIndicatorPlanningLimitListVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询分标策划-限价一览列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分标策划-限价一览分页列表 + */ + @Override + public TableDataInfo queryPageList(BusIndicatorPlanningLimitListBo 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(BusIndicatorPlanningLimitListBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BusIndicatorPlanningLimitListBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(BusIndicatorPlanningLimitList::getId); + lqw.eq(bo.getSegmentedIndicatorId() != null, BusIndicatorPlanningLimitList::getSegmentedIndicatorId, bo.getSegmentedIndicatorId()); + lqw.eq(bo.getLimitListId() != null, BusIndicatorPlanningLimitList::getLimitListId, bo.getLimitListId()); + return lqw; + } + + /** + * 新增分标策划-限价一览 + * + * @param bo 分标策划-限价一览 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(BusIndicatorPlanningLimitListBo bo) { + BusIndicatorPlanningLimitList add = MapstructUtils.convert(bo, BusIndicatorPlanningLimitList.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改分标策划-限价一览 + * + * @param bo 分标策划-限价一览 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(BusIndicatorPlanningLimitListBo bo) { + BusIndicatorPlanningLimitList update = MapstructUtils.convert(bo, BusIndicatorPlanningLimitList.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(BusIndicatorPlanningLimitList 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/tender/service/impl/BusSegmentedIndicatorPlanningServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusSegmentedIndicatorPlanningServiceImpl.java new file mode 100644 index 00000000..24ad5741 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusSegmentedIndicatorPlanningServiceImpl.java @@ -0,0 +1,171 @@ +package org.dromara.tender.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.common.translation.annotation.Translation; +import org.dromara.tender.domain.BusIndicatorPlanningLimitList; +import org.dromara.tender.domain.bo.BusIndicatorPlanningLimitListBo; +import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListVo; +import org.dromara.tender.mapper.BusIndicatorPlanningLimitListMapper; +import org.dromara.tender.service.IBusBillofquantitiesLimitListService; +import org.dromara.tender.service.IBusIndicatorPlanningLimitListService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.tender.domain.bo.BusSegmentedIndicatorPlanningBo; +import org.dromara.tender.domain.vo.BusSegmentedIndicatorPlanningVo; +import org.dromara.tender.domain.BusSegmentedIndicatorPlanning; +import org.dromara.tender.mapper.BusSegmentedIndicatorPlanningMapper; +import org.dromara.tender.service.IBusSegmentedIndicatorPlanningService; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 分标策划Service业务层处理 + * + * @author Lion Li + * @date 2025-08-19 + */ +@RequiredArgsConstructor +@Service +public class BusSegmentedIndicatorPlanningServiceImpl extends ServiceImpl implements IBusSegmentedIndicatorPlanningService { + + private final BusSegmentedIndicatorPlanningMapper baseMapper; + @Autowired + private BusIndicatorPlanningLimitListMapper indicatorPlanningLimitListMapper; + @Autowired + private IBusBillofquantitiesLimitListService busBillofquantitiesLimitListService; + + /** + * 查询分标策划 + * + * @param id 主键 + * @return 分标策划 + */ + @Override + public BusSegmentedIndicatorPlanningVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询分标策划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 分标策划分页列表 + */ + @Override + public TableDataInfo queryPageList(BusSegmentedIndicatorPlanningBo 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(BusSegmentedIndicatorPlanningBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BusSegmentedIndicatorPlanningBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(BusSegmentedIndicatorPlanning::getPlannedBiddingTime); + lqw.eq(bo.getProjectId() != null, BusSegmentedIndicatorPlanning::getProjectId, bo.getProjectId()); + lqw.eq(bo.getDictId() != null, BusSegmentedIndicatorPlanning::getDictId, bo.getDictId()); + lqw.like(StringUtils.isNotBlank(bo.getName()), BusSegmentedIndicatorPlanning::getName, bo.getName()); + lqw.like(StringUtils.isNotBlank(bo.getContent()), BusSegmentedIndicatorPlanning::getContent, bo.getContent()); + lqw.eq(bo.getPlannedBiddingTime() != null, BusSegmentedIndicatorPlanning::getPlannedBiddingTime, bo.getPlannedBiddingTime()); + lqw.eq(bo.getPrice() != null, BusSegmentedIndicatorPlanning::getPrice, bo.getPrice()); + return lqw; + } + + /** + * 新增分标策划 + * + * @param bo 分标策划 + * @return 是否新增成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(BusSegmentedIndicatorPlanningBo bo) { + BusSegmentedIndicatorPlanning add = MapstructUtils.convert(bo, BusSegmentedIndicatorPlanning.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + if (bo.getLimitListBos() != null && !bo.getLimitListBos().isEmpty()) { + List planningLimitListList = new ArrayList<>(); + for (BusIndicatorPlanningLimitListBo limitListBo : bo.getLimitListBos()) { + BusIndicatorPlanningLimitList busIndicatorPlanningLimitList = new BusIndicatorPlanningLimitList(); + busIndicatorPlanningLimitList.setLimitListId(limitListBo.getLimitListId()); + busIndicatorPlanningLimitList.setSegmentedIndicatorId(bo.getId()); + BigDecimal count = indicatorPlanningLimitListMapper.getLimitCoount(limitListBo.getLimitListId()); + BusBillofquantitiesLimitListVo busBillofquantitiesLimitListVo = busBillofquantitiesLimitListService.queryById(limitListBo.getLimitListId()); + if (busBillofquantitiesLimitListVo == null) { + throw new ServiceException("限价一览数据不存在"); + } + if (busBillofquantitiesLimitListVo.getQuantity().compareTo(limitListBo.getNum().add(count)) < 0) { + throw new ServiceException(busBillofquantitiesLimitListVo.getName()+"数量超过了总数量"); + } + planningLimitListList.add(busIndicatorPlanningLimitList); + } + indicatorPlanningLimitListMapper.insertBatch(planningLimitListList); + } + } + return flag; + } + + /** + * 修改分标策划 + * + * @param bo 分标策划 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(BusSegmentedIndicatorPlanningBo bo) { + BusSegmentedIndicatorPlanning update = MapstructUtils.convert(bo, BusSegmentedIndicatorPlanning.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(BusSegmentedIndicatorPlanning 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/resources/mapper/tender/BusBillofquantitiesLimitListMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusBillofquantitiesLimitListMapper.xml new file mode 100644 index 00000000..16b2f11c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusBillofquantitiesLimitListMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusIndicatorPlanningLimitListMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusIndicatorPlanningLimitListMapper.xml new file mode 100644 index 00000000..a79e61f1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusIndicatorPlanningLimitListMapper.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusSegmentedIndicatorPlanningMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusSegmentedIndicatorPlanningMapper.xml new file mode 100644 index 00000000..b8faca65 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/tender/BusSegmentedIndicatorPlanningMapper.xml @@ -0,0 +1,7 @@ + + + + +