PositionAction.java 2.12 KB
package com.cjs.site.action.user.pick;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.cjs.site.biz.user.pick.PositionBiz;
import com.cjs.site.dao.user.pick.PickPackDao;
import com.cjs.site.dao.user.pick.PickPackageDao;
import com.cjs.site.dao.user.pick.WarehouseDao;
import com.cjs.site.util.t2.T2Result;
import com.cjs.site.util.web.ActionUtil;

/**
 * 持仓列表
 * 
 * @author tongyufu
 *
 */
@Controller
@RequestMapping("/user")
public class PositionAction {

    Logger                 log = LogManager.getLogger();
    @Autowired
    private PositionBiz    positionBiz;
    @Autowired
    private PickPackDao    pickPackDao;
    @Autowired
    private PickPackageDao pickPackageDao;
    @Autowired
    private WarehouseDao   warehouseDao;

    /**持仓列表*/
    @RequestMapping("position")
    public String position(Model model) {
        T2Result result = positionBiz.positionSelf(ActionUtil.getUser());
        model.addAttribute("positions", result.getData());
        return "user/pick/position.jsp";
    }

    /**持仓列表(封装)*/
    @RequestMapping("position/pack")
    public String packPosition(Model model) {
        model.addAttribute("positions", positionBiz.packPosition(ActionUtil.getUser()));
        model.addAttribute("pickPacks", pickPackDao.queryAll());
        model.addAttribute("pickPackages", pickPackageDao.queryAll());
        return "user/pick/packPosition.jsp";
    }

    /**持仓列表(网点自提)*/
    @RequestMapping("position/warehouse")
    public String warehousePosition(@RequestParam String warehouseCode, Model model) {
        model.addAttribute("warehouse", warehouseDao.queryByCode(warehouseCode));
        model.addAttribute("positions",
            positionBiz.warehousePosition(ActionUtil.getUser(), warehouseCode));
        return "user/pick/warehousePosition.jsp";
    }
}