合约规划-限价管理模块
This commit is contained in:
@ -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<BusBillofquantitiesLimitListVo>> list(BusBillofquantitiesLimitListBo bo, PageQuery pageQuery) {
|
||||
return R.ok(busBillofquantitiesLimitListService.getTree(bo));
|
||||
}
|
||||
/**
|
||||
* 查询限价一览列表
|
||||
*/
|
||||
@SaCheckPermission("tender:billofquantitiesLimitList:getTree")
|
||||
@GetMapping("/getTree")
|
||||
public R<List<BusBillofquantitiesLimitListVo>> getTree(BusBillofquantitiesLimitListBo bo) {
|
||||
return R.ok(busBillofquantitiesLimitListService.getTree(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有版本号
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesLimitList:obtainAllVersionNumbers")
|
||||
@GetMapping("/obtainAllVersionNumbers")
|
||||
public R<List<String>> obtainAllVersionNumbers(BusBillofquantitiesLimitListBo bo) {
|
||||
return R.ok(busBillofquantitiesLimitListService.obtainAllVersionNumbers(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定版本的sheet
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesLimitList:sheetList")
|
||||
@GetMapping("/sheetList")
|
||||
public R<List<String>> 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<BusBillofquantitiesLimitListVo> list = busBillofquantitiesLimitListService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "限价一览", BusBillofquantitiesLimitListVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取限价一览详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("tender:billofquantitiesLimitList:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusBillofquantitiesLimitListVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busBillofquantitiesLimitListService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -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<BusIndicatorPlanningLimitListVo> 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<BusIndicatorPlanningLimitListVo> list = busIndicatorPlanningLimitListService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "分标策划-限价一览", BusIndicatorPlanningLimitListVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分标策划-限价一览详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("tender:indicatorPlanningLimitList:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusIndicatorPlanningLimitListVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busIndicatorPlanningLimitListService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -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<BusSegmentedIndicatorPlanningVo> 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<BusSegmentedIndicatorPlanningVo> list = busSegmentedIndicatorPlanningService.queryList(bo);
|
||||
// ExcelUtil.exportExcel(list, "分标策划", BusSegmentedIndicatorPlanningVo.class, response);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取分标策划详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("tender:segmentedIndicatorPlanning:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusSegmentedIndicatorPlanningVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busSegmentedIndicatorPlanningService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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<BusIndicatorPlanningLimitListBo> limitListBos;
|
||||
|
||||
|
||||
}
|
@ -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<BusBillofquantitiesLimitListVo> children = new ArrayList<>();
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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<BusBillofquantitiesLimitList, BusBillofquantitiesLimitListVo> {
|
||||
|
||||
}
|
@ -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<BusIndicatorPlanningLimitList, BusIndicatorPlanningLimitListVo> {
|
||||
|
||||
|
||||
BigDecimal getLimitCoount(@Param("limitListId") Long id);
|
||||
|
||||
}
|
@ -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<BusSegmentedIndicatorPlanning, BusSegmentedIndicatorPlanningVo> {
|
||||
|
||||
}
|
@ -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<BusBillofquantitiesLimitList>{
|
||||
|
||||
/**
|
||||
* 查询限价一览
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 限价一览
|
||||
*/
|
||||
BusBillofquantitiesLimitListVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询限价一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 限价一览分页列表
|
||||
*/
|
||||
TableDataInfo<BusBillofquantitiesLimitListVo> queryPageList(BusBillofquantitiesLimitListBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的限价一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 限价一览列表
|
||||
*/
|
||||
List<BusBillofquantitiesLimitListVo> 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<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 查询限价一览表返树形结构数据
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
List<BusBillofquantitiesLimitListVo> getTree(BusBillofquantitiesLimitListBo bo);
|
||||
/**
|
||||
* 获取所有版本号
|
||||
*/
|
||||
List<String> obtainAllVersionNumbers(BusBillofquantitiesLimitListBo bo);
|
||||
|
||||
/**
|
||||
* 获取指定版本的sheet
|
||||
*/
|
||||
List<String> sheetList(BusBillofquantitiesLimitListBo bo);
|
||||
}
|
@ -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<BusIndicatorPlanningLimitList>{
|
||||
|
||||
/**
|
||||
* 查询分标策划-限价一览
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 分标策划-限价一览
|
||||
*/
|
||||
BusIndicatorPlanningLimitListVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询分标策划-限价一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分标策划-限价一览分页列表
|
||||
*/
|
||||
TableDataInfo<BusIndicatorPlanningLimitListVo> queryPageList(BusIndicatorPlanningLimitListBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的分标策划-限价一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 分标策划-限价一览列表
|
||||
*/
|
||||
List<BusIndicatorPlanningLimitListVo> 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<Long> ids, Boolean isValid);
|
||||
}
|
@ -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<BusSegmentedIndicatorPlanning>{
|
||||
|
||||
/**
|
||||
* 查询分标策划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 分标策划
|
||||
*/
|
||||
BusSegmentedIndicatorPlanningVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询分标策划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分标策划分页列表
|
||||
*/
|
||||
TableDataInfo<BusSegmentedIndicatorPlanningVo> queryPageList(BusSegmentedIndicatorPlanningBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的分标策划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 分标策划列表
|
||||
*/
|
||||
List<BusSegmentedIndicatorPlanningVo> 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<Long> ids, Boolean isValid);
|
||||
}
|
@ -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<BusBillofquantitiesLimitListMapper, BusBillofquantitiesLimitList> 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<BusBillofquantitiesLimitListVo> queryPageList(BusBillofquantitiesLimitListBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBillofquantitiesLimitList> lqw = buildQueryWrapper(bo);
|
||||
Page<BusBillofquantitiesLimitListVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的限价一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 限价一览列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusBillofquantitiesLimitListVo> queryList(BusBillofquantitiesLimitListBo bo) {
|
||||
LambdaQueryWrapper<BusBillofquantitiesLimitList> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusBillofquantitiesLimitList> buildQueryWrapper(BusBillofquantitiesLimitListBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusBillofquantitiesLimitList> 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<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusBillofquantitiesLimitListVo> getTree(BusBillofquantitiesLimitListBo bo) {
|
||||
//获取所有数据
|
||||
List<BusBillofquantitiesLimitListVo> 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<String, List<BusBillofquantitiesLimitListVo>> parentMap = listVoList.stream()
|
||||
.collect(Collectors.groupingBy(BusBillofquantitiesLimitListVo::getPid));
|
||||
//递归组装树形结构
|
||||
List<BusBillofquantitiesLimitListVo> treeList = buildTree("0", parentMap);
|
||||
|
||||
return treeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> obtainAllVersionNumbers(BusBillofquantitiesLimitListBo bo) {
|
||||
List<BusBillofquantitiesLimitList> busBillofquantitiesLimitLists = baseMapper.selectList(new LambdaQueryWrapper<BusBillofquantitiesLimitList>()
|
||||
.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<String> sheetList(BusBillofquantitiesLimitListBo bo) {
|
||||
List<BusBillofquantitiesLimitList> busBillofquantitiesLimitLists = baseMapper.selectList(new LambdaQueryWrapper<BusBillofquantitiesLimitList>()
|
||||
.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<BusBillofquantitiesLimitListVo> buildTree(String parentId, Map<String, List<BusBillofquantitiesLimitListVo>> parentMap) {
|
||||
// 获取当前父节点的所有直接子节点
|
||||
List<BusBillofquantitiesLimitListVo> children = parentMap.getOrDefault(parentId, Collections.emptyList());
|
||||
if (children.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 为每个子节点递归设置其下一级子节点
|
||||
for (BusBillofquantitiesLimitListVo child : children) {
|
||||
// 递归查询当前子节点的子节点,设置为它的子树
|
||||
List<BusBillofquantitiesLimitListVo> subChildren = buildTree(child.getSid(), parentMap);
|
||||
// 注意:需要在Vo中添加子节点列表字段,用于存储子树
|
||||
child.setChildren(subChildren);
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
}
|
@ -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<BusIndicatorPlanningLimitListMapper, BusIndicatorPlanningLimitList> 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<BusIndicatorPlanningLimitListVo> queryPageList(BusIndicatorPlanningLimitListBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusIndicatorPlanningLimitList> lqw = buildQueryWrapper(bo);
|
||||
Page<BusIndicatorPlanningLimitListVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的分标策划-限价一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 分标策划-限价一览列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusIndicatorPlanningLimitListVo> queryList(BusIndicatorPlanningLimitListBo bo) {
|
||||
LambdaQueryWrapper<BusIndicatorPlanningLimitList> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusIndicatorPlanningLimitList> buildQueryWrapper(BusIndicatorPlanningLimitListBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusIndicatorPlanningLimitList> 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<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -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<BusSegmentedIndicatorPlanningMapper, BusSegmentedIndicatorPlanning> 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<BusSegmentedIndicatorPlanningVo> queryPageList(BusSegmentedIndicatorPlanningBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusSegmentedIndicatorPlanning> lqw = buildQueryWrapper(bo);
|
||||
Page<BusSegmentedIndicatorPlanningVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的分标策划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 分标策划列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusSegmentedIndicatorPlanningVo> queryList(BusSegmentedIndicatorPlanningBo bo) {
|
||||
LambdaQueryWrapper<BusSegmentedIndicatorPlanning> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusSegmentedIndicatorPlanning> buildQueryWrapper(BusSegmentedIndicatorPlanningBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusSegmentedIndicatorPlanning> 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<BusIndicatorPlanningLimitList> 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<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.tender.mapper.BusBillofquantitiesLimitListMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.tender.mapper.BusIndicatorPlanningLimitListMapper">
|
||||
|
||||
<select id="getLimitCoount" resultType="java.math.BigDecimal">
|
||||
SELECT SUM("num") as num
|
||||
from bus_indicator_planning_limit_list
|
||||
where id = #{limitListId}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.tender.mapper.BusSegmentedIndicatorPlanningMapper">
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user