package com.zhongzheng.controller.order;

import java.util.List;
import java.util.Arrays;

import com.zhongzheng.modules.order.bo.OrderBillGoodsEditBo;
import com.zhongzheng.modules.order.service.IOrderBillGoodsService;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhongzheng.common.annotation.Log;
import com.zhongzheng.common.core.controller.BaseController;
import com.zhongzheng.common.core.domain.AjaxResult;
import com.zhongzheng.common.enums.BusinessType;
import com.zhongzheng.common.utils.poi.ExcelUtil;
import com.zhongzheng.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 订单计费单商品Controller
 *
 * @author hjl
 * @date 2021-12-06
 */
@Api(value = "订单计费单商品控制器", tags = {"订单计费单商品管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/sheet/goods")
public class OrderBillGoodsController extends BaseController {

    private final IOrderBillGoodsService iOrderBillGoodsService;

    /**
     * 查询订单计费单商品列表
     */
   /* @ApiOperation("查询订单计费单商品列表")
    @PreAuthorize("@ss.hasPermi('system:goods:list')")
    @GetMapping("/list")
    public TableDataInfo<OrderBillGoodsVo> list(OrderBillGoodsQueryBo bo) {
        startPage();
        List<OrderBillGoodsVo> list = iOrderBillGoodsService.queryList(bo);
        return getDataTable(list);
    }*/

    /**
     * 导出订单计费单商品列表
     */
   /* @ApiOperation("导出订单计费单商品列表")
    @PreAuthorize("@ss.hasPermi('system:goods:export')")
    @Log(title = "订单计费单商品", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult<OrderBillGoodsVo> export(OrderBillGoodsQueryBo bo) {
        List<OrderBillGoodsVo> list = iOrderBillGoodsService.queryList(bo);
        ExcelUtil<OrderBillGoodsVo> util = new ExcelUtil<OrderBillGoodsVo>(OrderBillGoodsVo.class);
        return util.exportExcel(list, "订单计费单商品");
    }*/

    /**
     * 获取订单计费单商品详细信息
     */
  /*  @ApiOperation("获取订单计费单商品详细信息")
    @PreAuthorize("@ss.hasPermi('system:goods:query')")
    @GetMapping("/{id}")
    public AjaxResult<OrderBillGoodsVo> getInfo(@PathVariable("id" ) Long id) {
        return AjaxResult.success(iOrderBillGoodsService.queryById(id));
    }*/

    /**
     * 新增订单计费单商品
     */
   /* @ApiOperation("新增订单计费单商品")
    @PreAuthorize("@ss.hasPermi('system:goods:add')")
    @Log(title = "订单计费单商品", businessType = BusinessType.INSERT)
    @PostMapping()
    public AjaxResult<Void> add(@RequestBody OrderBillGoodsAddBo bo) {
        return toAjax(iOrderBillGoodsService.insertByAddBo(bo) ? 1 : 0);
    }*/

    /**
     * 修改订单计费单商品
     */
    @ApiOperation("修改订单计费单商品")
    @PreAuthorize("@ss.hasPermi('system:goods:edit')")
    @Log(title = "订单计费单商品", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult<Void> edit(@RequestBody OrderBillGoodsEditBo bo) {
        return toAjax(iOrderBillGoodsService.updateByEditBo(bo) ? 1 : 0);
    }

    /**
     * 删除订单计费单商品
     */
   /* @ApiOperation("删除订单计费单商品")
    @PreAuthorize("@ss.hasPermi('system:goods:remove')")
    @Log(title = "订单计费单商品" , businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult<Void> remove(@PathVariable Long[] ids) {
        return toAjax(iOrderBillGoodsService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
    }*/
}
