报价结构化
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package com.chinaunicom.mall.ebtp.project.bidratio.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -15,6 +17,7 @@ import io.swagger.annotations.ApiParam;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "中标/中选分配比例")
|
||||
@ -23,53 +26,20 @@ public class BidRatioController{
|
||||
|
||||
@Resource
|
||||
private IBidRatioService ibidRatioService;
|
||||
|
||||
/**
|
||||
* 插入新数据
|
||||
*
|
||||
* @param bidRatio
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("插入新数据")
|
||||
@PostMapping("/insert")
|
||||
public BaseResponse<Boolean> insert(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid BidRatio bidRatio){
|
||||
|
||||
boolean save = ibidRatioService.save(bidRatio);
|
||||
|
||||
return BaseResponse.success(save);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param bidRatio
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("修改数据")
|
||||
@PostMapping("/update")
|
||||
public BaseResponse<Boolean> update(@ApiParam(value = "对象数据", required = true) @RequestBody BidRatio bidRatio){
|
||||
|
||||
Boolean i = ibidRatioService.updateById(bidRatio);
|
||||
|
||||
return BaseResponse.success(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据
|
||||
*
|
||||
* 查询中选分配比例
|
||||
*
|
||||
* @param id
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询数据")
|
||||
@ApiOperation("查询中选分配比例")
|
||||
@GetMapping("/{id}")
|
||||
public BaseResponse<BidRatio> get(@ApiParam(value = "主键id", required = true) @PathVariable String id){
|
||||
|
||||
BidRatio bidRatio = ibidRatioService.getById(id);
|
||||
|
||||
return BaseResponse.success(bidRatio);
|
||||
public BaseResponse<List<BidRatio>> getBidRatio(@ApiParam(value = "标段id", required = true) @PathVariable String id){
|
||||
LambdaQueryWrapper<BidRatio> queryWrapper=Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(BidRatio::getSectionId,id);
|
||||
return BaseResponse.success(ibidRatioService.list(queryWrapper));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user