AdminReceiptDetailController.java 1.99 KB
package com.huaheng.pc.receipt.receiptDetail.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.huaheng.common.utils.Wrappers;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.page.TableDataInfo;
import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail;
import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 入库明细 信息操作处理
 * 
 * @author huaheng
 * @date 2019-05-21
 */
@Controller
@RequestMapping("/admin/receiptDetail")
public class AdminReceiptDetailController extends BaseController
{
    private String prefix = "admin/receiptDetail";
	
	@Autowired
	private ReceiptDetailService receiptDetailService;

	
	@GetMapping("/{receiptId}/{receiptCode}")
	public String receiptDetail(@PathVariable("receiptId") String receiptId, @PathVariable("receiptCode") String receiptCode, ModelMap mmap)
	{
		mmap.put("receiptId", receiptId);
        mmap.put("receiptCode", receiptCode);
	    return prefix + "/receiptDetail";
	}
	
	/**
	 * 查询入库明细列表
	 */
	@Log(title = "入库-入库单", operating = "查看入库单明细", action = BusinessType.GRANT)
	@PostMapping("/list")
	@ResponseBody
	public TableDataInfo list(ReceiptDetail receiptDetail)
	{
		startPage();
		LambdaQueryWrapper<ReceiptDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
		lambdaQueryWrapper.eq(StringUtils.isNotNull(receiptDetail.getReceiptId()), ReceiptDetail::getReceiptId, receiptDetail.getReceiptId());
		List<ReceiptDetail> list = receiptDetailService.list(lambdaQueryWrapper) ;
		return getDataTable(list);
	}

}