报价结构化
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
package com.chinaunicom.mall.ebtp.project.bidratio.controller;
|
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 com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@ -15,6 +17,7 @@ import io.swagger.annotations.ApiParam;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "中标/中选分配比例")
|
@Api(tags = "中标/中选分配比例")
|
||||||
@ -25,51 +28,18 @@ public class BidRatioController{
|
|||||||
private IBidRatioService ibidRatioService;
|
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
|
* @param id
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询数据")
|
@ApiOperation("查询中选分配比例")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public BaseResponse<BidRatio> get(@ApiParam(value = "主键id", required = true) @PathVariable String id){
|
public BaseResponse<List<BidRatio>> getBidRatio(@ApiParam(value = "标段id", required = true) @PathVariable String id){
|
||||||
|
LambdaQueryWrapper<BidRatio> queryWrapper=Wrappers.lambdaQuery();
|
||||||
BidRatio bidRatio = ibidRatioService.getById(id);
|
queryWrapper.eq(BidRatio::getSectionId,id);
|
||||||
|
return BaseResponse.success(ibidRatioService.list(queryWrapper));
|
||||||
return BaseResponse.success(bidRatio);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user