|
|
|
@ -23,6 +23,8 @@ import com.logpm.basicdata.vo.BasicdataPriceBasicUpdateVO;
|
|
|
|
|
import com.logpm.basicdata.vo.BasicdataPricePageVO; |
|
|
|
|
import com.logpm.basicdata.vo.PriceVO; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
@ -32,12 +34,16 @@ import org.springblade.core.tool.api.R;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PatchMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestPart; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 基础价格表 控制器 |
|
|
|
@ -90,12 +96,30 @@ public class BasicdataPriceController extends BladeController {
|
|
|
|
|
* 基础价格表 修改 |
|
|
|
|
*/ |
|
|
|
|
@PutMapping |
|
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
|
@ApiOperation(value = "修改", notes = "传入basicdataPrice") |
|
|
|
|
public R<Boolean> update(@Valid @RequestBody PriceVO vo) { |
|
|
|
|
Boolean res = basicdataPriceService.updatePrice(vo); |
|
|
|
|
return R.status(res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 基础价格表 导入 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("upload") |
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperation(value = "导入", notes = "导入") |
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "file", value = "文件", dataType = "MultipartFile") |
|
|
|
|
}) |
|
|
|
|
public R<String> upload(@RequestPart("file") MultipartFile file) { |
|
|
|
|
try (InputStream inputStream = file.getInputStream()) { |
|
|
|
|
String res = basicdataPriceService.upload(inputStream); |
|
|
|
|
return R.data(res); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
return R.data("上传失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|