package com.pj.tb_import_order;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.pj.utils.sg.AjaxJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;



/**
 * Controller: tb_import_order -- 进口申报单
 * @author lbl
 */
@RestController
@RequestMapping("/app/TbImportOrder/")
public class TbImportOrderAppController {

	/** 底层 Service 对象 */
	@Autowired
	TbImportOrderService tbImportOrderService;


	/** 查 - 根据id */
	@RequestMapping("getById")
	public AjaxJson getById(Long id){
		TbImportOrder t = tbImportOrderService.getById(id);
		return AjaxJson.getSuccessData(t);
	}
	/**
	 * 获取进口申报单详情
	 * @param orderId
	 * @return
	 */
	@RequestMapping("importOrderDetail")
	public AjaxJson importOrderDetail(@RequestParam("orderId")Long orderId){
		return AjaxJson.getSuccessData(tbImportOrderService.importOrderDetail(orderId));
	}

	/** 改 */
	@RequestMapping("update")
	public AjaxJson update(TbImportOrder t){
		boolean b = tbImportOrderService.updateById(t);
		return AjaxJson.getSuccess();
	}
}
