AdminShipmentDetailController.java 2.14 KB
package com.huaheng.pc.shipment.shipmentDetail.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.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.shipment.shipmentDetail.domain.ShipmentDetail;
import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService;
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 2018-08-19
 */
@Controller
@RequestMapping("/admin/shipmentDetail")
public class AdminShipmentDetailController extends BaseController
{
    private String prefix = "admin/shipmentDetail";
	
	@Autowired
	private ShipmentDetailService shipmentDetailService;
	
    @GetMapping("/{shipmentId}/{shipmentCode}")
	public String shipmentDetail(@PathVariable("shipmentId") String shipmentId, @PathVariable("shipmentCode") String shipmentCode,@PathVariable("inventoryStatus") String inventoryStatus, ModelMap mmap)
	{
        mmap.put("receiptId", shipmentId);
		mmap.put("shipmentCode", shipmentCode);
		mmap.put("inventoryStatus",inventoryStatus);
	    return prefix + "/shipmentDetail";
	}
	
	/**
	 * 查询出库明细列表
	 */
	@Log(title = "出库-出库单", operating= "查看出库明细", action = BusinessType.GRANT)
	@PostMapping("/list")
	@ResponseBody
	public TableDataInfo list(ShipmentDetail shipmentDetail)
	{
		startPage();
		LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
		lambdaQueryWrapper.eq(StringUtils.isNotNull(shipmentDetail.getShipmentId()), ShipmentDetail::getShipmentId, shipmentDetail.getShipmentId());
		List<ShipmentDetail> list = shipmentDetailService.list(lambdaQueryWrapper) ;
		return getDataTable(list);
	}
	

}