package cn.superdesk.uniorder.controller._patch;

import cn.superdesk.uniorder.common.pagination.PageQueryParam;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dubbo.consumer.order.base.UnifiedOrderGoodsDubboConsumerService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/patch/unified/order/goods/fix")
public class UnifiedOrderGoodsFixTaxRateTaxCodeFiscalCode {

	@Autowired
	private UnifiedOrderGoodsDubboConsumerService unifiedOrderGoodsDubboConsumerService;

	@ApiOperation(value = "修正退单商品的税率|税务编码|财务编码")
	@RequestMapping(value = "run", method = RequestMethod.POST)
	@ResponseBody
	public R<String> run(@RequestBody PageQueryParam param) {


		R<String> response = new R<>();

		// TODO 参数合法性判定


		// TODO 调用补丁方法 修正 订单商品 税率

		String report = unifiedOrderGoodsDubboConsumerService.checkAndFixFixTaxRateTaxCodeFiscalCode();

		response.setData(report);


		return response;
	}

}
