jiazx0107@163.com
2023-06-08 08cea428e888b6fdd2a3c3783e87e4f828385783
igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java
@@ -1,6 +1,5 @@
package com.ld.igds.inout.controller;
import ch.qos.logback.classic.pattern.ClassNameOnlyAbbreviator;
import com.bstek.bdf2.core.business.IUser;
import com.bstek.bdf2.core.model.DefaultDept;
import com.ld.igds.check.dto.CheckItemData;
@@ -239,7 +238,12 @@
     * @return
     */
    @RequestMapping("/in-handle")
    public ModelAndView inHandle() {
    public ModelAndView inHandle(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
        //如果没有指定地磅,从用户上一个选择中获取
        if (StringUtils.isEmpty(sort)) {
            sort = commonManager.getInoutWeightByClient(httpRequest);
        }
        ModelAndView view = new ModelAndView();
@@ -263,15 +267,13 @@
        // 当前流程节点
        view.addObject("progress", InoutConstant.PROGRESS_HANDLE);
        // 粮食品种下拉框
        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
        view.addObject("listFoodVariety", listFoodVariety);
        // 远程智慧卡
        // 获取出入库设备配置信息
        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_80, InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        if (null != conf) conf.setSort(sort);
        view.addObject("cardDto", conf);
        // 粮食等级下拉框
        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
        view.addObject("listFoodLevel", listFoodLevel);
        view.setViewName("admin/inout/in-handle");
        return view;
@@ -322,6 +324,7 @@
    /**
     * 出库登记
     *
     * @param sort 表示使用的出入库设备配套号,不传递默认为1
     * @return
     */
@@ -449,7 +452,7 @@
        view.addObject("type", InoutConstant.TYPE_OUT);
        // 仓库列表做下拉框使用
        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId);
        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId);
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
        //出库流程
@@ -486,15 +489,15 @@
        IUser user = ContextUtil.getLoginUser();
        String deptId =  ContextUtil.subDeptId(user);
        String deptId = ContextUtil.subDeptId(user);
        view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
        view.addObject("bizType", BizType.INOUT_OUT.getCode());
        view.addObject("deptId",deptId);
        view.addObject("deptId", deptId);
        view.addObject("type", InoutConstant.TYPE_OUT);
        // 仓库列表做下拉框使用
        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId);
        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId);
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
@@ -528,7 +531,7 @@
     */
    @RequestMapping("/inout-query")
    public PageResponse<InoutData> inoutQuery(@RequestBody InoutParam param) {
        if(null == param.getCompanyId()) param.setCompanyId(ContextUtil.getCompanyId());
        if (null == param.getCompanyId()) param.setCompanyId(ContextUtil.getCompanyId());
        return inoutManager.inoutQuery(param);
    }
@@ -601,6 +604,38 @@
        }
        return inoutManager.submitRegisterInout(data);
    }
    /**
     * 出入库称重环节提交
     *
     * @param data
     * @return
     */
    @RequestMapping("/submit-weight")
    @Transactional
    public PageResponse<InoutData> submitWeight(@RequestBody InoutData data) throws Exception {
        if (null == data.getJjlx()) data.setJjlx("0");
        if (InoutConstant.TYPE_IN.equals(data.getType())) {
            return inoutManager.submitWeightIn(data);
        } else {
            return inoutManager.submitWeightOut(data);
        }
    }
    /**
     * 出入库称重环节提交,请注意:值仓挑提交的数据非出入库流水完整信息,不能直接调用update方法
     *
     * @param data
     * @return
     */
    @RequestMapping("/submit-handle")
    @Transactional
    public PageResponse<InoutData> submitHandle(@RequestBody InoutData data) throws Exception {
        return inoutManager.submitHandle(data);
    }
    /**
@@ -817,7 +852,7 @@
     */
    @RequestMapping("/get-check-item")
    public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutCheckParam param) {
            return inoutManager.getCheckItemData(param);
        return inoutManager.getCheckItemData(param);
    }
    /**