十六397 2022-07-07 10:00 采纳率: 50%
浏览 60
已结题

关于如何添加样式,并增加相应功能

添加样式并写出相应代码
要求是这样的:

img

img

参考以下代码:

     /**
     * 查询审核列表
     *
     * @return
     */
    @RequestMapping(params = "method=findCheckList")
    public String findCheckList(HttpServletRequest request,
                                ModelMap modelMap,
                                AssetsDeleteQuery assetsDeleteQuery,String page, String pagesize,String assetsTypeIdtxt,HttpServletResponse response) throws Exception {
        findApply(request, modelMap, assetsDeleteQuery);
        User user = (User) request.getSession().getAttribute("user");
        if (pagesize != null && !"".equals(pagesize)) {
            len = Integer.parseInt(pagesize);

            //存入cookie
            Cookie cookie = new Cookie(user.getId(), pagesize);
            response.addCookie(cookie);
        } else {
            //用cookie得到用户名
            Cookie[] cookies = request.getCookies();
            if (cookies != null && cookies.length > 0) {
                for (Cookie c : cookies) {
                    if (c.getName().equals(user.getId())) {
                        len = Integer.parseInt(c.getValue());
                    }
                }
            }
        }
        if (page != null && !"".equals(page)) {
            pageNum = Integer.parseInt(page);
        } else {
            pageNum = 1;
        }
        // 下级
        List<BaseCode> xiaJi = new ArrayList();
        // 下级的下级
        List<BaseCode> xiaJiNextJi = new ArrayList();
        // 合并
        List<BaseCode> allZCLB = new ArrayList<>();
        String zclbId = assetsDeleteQuery.getAssetsTypeId();
        if (!"".equals(zclbId) && null != zclbId) {
            // 查询出所有的资产类别(经营性资产类别,非经营性资产)
            List<BaseCode> baseCodeList = baseCodeService.findBaseCodeByType2("ZCLBJYX", "ZCLBFJYX");
            // 根据页面传过来的资产类型Id查询到下级
            for (int i = 0; i < baseCodeList.size(); i++) {
                // parent不为空的情况下
                if (!"".equals(baseCodeList.get(i).getParentId()) && null != baseCodeList.get(i).getParentId()) {
                    // 页面传过来的id与资产类别的parent对比,如果相等,就是他的下级,否则没有下级
                    if (zclbId.equals(baseCodeList.get(i).getParentId().getId())) {
                        xiaJi.add(baseCodeList.get(i));
                    }
                }
            }
            // 如果nextJi.size()>0 表示他有下级
            if (xiaJi.size() > 0) {
                // 通过下级的id继续查询下级的下级
                for (int i = 0; i < xiaJi.size(); i++) {
                    for (int j = 0; j < baseCodeList.size(); j++) {
                        if (!"".equals(baseCodeList.get(j).getParentId()) && null != baseCodeList.get(j).getParentId()) {
                            if (xiaJi.get(i).getId().equals(baseCodeList.get(j).getParentId().getId())) {
                                xiaJiNextJi.add(baseCodeList.get(j));
                            }
                        }
                    }
                }
            }
            if (xiaJi.size() > 0) {
                allZCLB.addAll(xiaJi);
            }
            if (xiaJiNextJi.size() > 0) {
                allZCLB.addAll(xiaJiNextJi);
            }
            assetsDeleteQuery.setBaseCodeList(allZCLB);
        }
        if (assetsDeleteQuery.getUnitid() != null && !"".equals(assetsDeleteQuery.getUnitid())) {
            assetsDeleteQuery.setUnitId(assetsDeleteQuery.getUnitid());
        }
        assetsDeleteQuery.setNeedFindZu(Constant.YES);
        unitService.getQueryUnit(assetsDeleteQuery, request);
        CommonTreeDto commonTreeDto=assetsDeleteQuery.getCommonTreeDto();
        if(commonTreeDto==null){
            commonTreeDto=new CommonTreeDto();
            Dept dept = user.getDept();
            Unit areaId = dept.getAreaId();
            commonTreeDto.setUnitId(areaId.getId());
            commonTreeDto.setAllpath(areaId.getAllPath());
            commonTreeDto.setLevel(areaId.getLevel()+"");
            commonTreeDto.setType("dq");
            commonTreeDto.setName(areaId.getAreaName());
        }
        commonTreeDto.setDataDeptId("");
        commonTreeDto.setUser(user);
        assetsDeleteQuery.setCommonTreeDto(commonTreeDto);
        String unitList=commonTreeService.buildCurrentUserTree(request,null);
        PageControl applyList = assetsDeleteService.findCheckListNew(pageNum, len,assetsDeleteQuery);
        String zcTypeList = baseCodeService.findBaseCodeJson2("ZCLBJYX", "ZCLBFJYX");
        List<BaseCode> QCFSList = baseCodeService.findBaseCodeByType("ZCJSFS");
        modelMap.addAttribute("QCFSList", QCFSList);
        modelMap.addAttribute("zcTypeList", zcTypeList);
        modelMap.addAttribute("pc", applyList);
        modelMap.addAttribute("unitList", unitList);
        modelMap.addAttribute("query",assetsDeleteQuery);
        return "sanzgl/zichanggl/zcbd/check_list";
    }

,在以下代码中添加功能代码:


 /**
     * 资产购入审核-列表
     * @param request
     * @param modelMap
     * @param assetsPurchaseQuery
     * @return
     * @throws Exception
     */
    @RequestMapping(params = "method=findCheck")
    public String findCheck(HttpServletRequest request, ModelMap modelMap,
                            AssetsPurchaseQuery assetsPurchaseQuery,
                            String page, String pagesize,
                            String assetsTypeIdtxt, HttpServletResponse response) throws Exception {
        User user = (User) request.getSession().getAttribute("user");
        if(user == null){
            return "login";
        }

        //待办事项处理,列表自动选择待办事项中点击的地区
        HttpSession s = request.getSession();
        String dbsx_unitId= (String) s.getAttribute("dbsx_unitId");
        String dbsx_unitName= (String) s.getAttribute("dbsx_unitName");
        String dbsx_allPath= (String) s.getAttribute("dbsx_allPath");
        boolean useDb=false;
        if(Util.n(assetsPurchaseQuery.getUnitid())&&!Util.n(dbsx_allPath)){
            useDb=true;
            s.removeAttribute("dbsx_unitId");
            s.removeAttribute("dbsx_unitName");
            s.removeAttribute("dbsx_allPath");
        }

        assetsPurchaseQuery.setNeedFindZu(Constant.YES);
        CommonTreeDto commonTreeDto = assetsPurchaseQuery.getCommonTreeDto();
        if(commonTreeDto==null){
            commonTreeDto=new CommonTreeDto();
            Dept dept = user.getDept();
            Unit areaId = dept.getAreaId();
            commonTreeDto.setUnitId(areaId.getId());
            commonTreeDto.setAllpath(areaId.getAllPath());
            commonTreeDto.setLevel(areaId.getLevel()+"");
            commonTreeDto.setType("dq");
            commonTreeDto.setName(areaId.getAreaName());
        }
        commonTreeDto.setDataDeptId("");
        commonTreeDto.setUser(user);
        assetsPurchaseQuery.setCommonTreeDto(commonTreeDto);
        String unitList = commonTreeService.buildCurrentUserTree(request,null);
        formatParam(assetsPurchaseQuery);
        modelMap.addAttribute("unitList", unitList);

        if(useDb){
            assetsPurchaseQuery.setAllpathList(Arrays.asList(dbsx_allPath));
            assetsPurchaseQuery.setUnitName(dbsx_unitName);
            assetsPurchaseQuery.setUnitid(dbsx_unitId);
        }
        modelMap.addAttribute("pc", assetsPurchaseService.findCheck(assetsPurchaseQuery));
        modelMap.addAttribute("query", assetsPurchaseQuery);
        modelMap.addAttribute("user", user);
        return "sanzgl/zichanggl/zcgz/find_check";
    }

,其中,

img


我添加了这两个参数,也不知道对不对,求老哥们指点,有偿

  • 写回答

3条回答 默认 最新

  • sinJack 2022-07-07 10:54
    关注

    接口上增加 HttpServletRequest request,方法内通过以下获取选中的内容:

     String [] strs=request.getParameterValues();
    
    评论

报告相同问题?

问题事件

  • 系统已结题 7月15日
  • 创建了问题 7月7日

悬赏问题

  • ¥15 结果有了,想问一下这个具体怎么输入
  • ¥15 怎么修改鸿蒙app的UI及功能设计
  • ¥15 帮我利用jupyter 运行一个正确的代码
  • ¥15 如何使用Gephi软件和Python包中的GephiStreamer交互
  • ¥15 sqlite加密问题咨询
  • ¥15 appdesigner接收不到udp组播的数据
  • ¥15 verilog 非阻塞赋值下的移位拼接错误
  • ¥100 两个按钮控制一个LED
  • ¥15 用C语言写离散数学相关问题
  • ¥30 如何用python的GephiStreamer连接到gephi中,把Python和Gephi的具体操作过程都展示,重点回答Gephi软件的调试,以及如果代码的端口在浏览器中无法显示怎么处理