zoukankan      html  css  js  c++  java
  • 文本框上绑校验

    加属性 
    ajaxurl="ldcInvtHeadController.do?checkType&id=${ldcInvtHeadPage.id }&type=S"  datatype="*"
    @RequestMapping(params = "checkType")
        @ResponseBody
        public ValidForm checkType(HttpServletRequest request) {
            ValidForm v = new ValidForm();
            String typecode=oConvertUtils.getString(request.getParameter("param"));
            String id=oConvertUtils.getString(request.getParameter("id"));
            String ietype=oConvertUtils.getString(request.getParameter("type"));
            String hql = "select count(*) from LDC_INVT_HEAD where   (BILLFLAG!='2' or  BILLFLAG is NULL) and (CUSTOM_STATE!='6' or  CUSTOM_STATE is NULL) ";
    
    
            if(ietype.equals("I")) {
                hql=hql+"  and ORDERBOOKBILLNO='"+typecode+"'  ";
            }
            if(ietype.equals("E")) {
                hql=hql+"  and INVOICE='"+typecode+"'  ";
            }
            if(ietype.equals("P")) {
                hql=hql+"  and BOND_INVT_NO='"+typecode+"'  ";
            }
            if(ietype.equals("S")) {
                hql=hql+"  and ETPS_INNER_INVT_NO='"+typecode+"'  ";
            }
            if(StringUtil.isNotEmpty(id)) {
                hql=hql+"  and id!='"+id+"'";
            }
    
    
            String types = jdbcTemplate.queryForObject(hql, String.class);
            if(!types.equals("0"))
            {
                v.setInfo("类型已存在");
                v.setStatus("n");
            }
            return v;
        }
    @RequestMapping(params = "checkType")
        @ResponseBody
        public ValidForm checkType(HttpServletRequest request) {
            ValidForm v = new ValidForm();
            String typecode=oConvertUtils.getString(request.getParameter("param"));
            String id=oConvertUtils.getString(request.getParameter("id"));
            String ietype=oConvertUtils.getString(request.getParameter("type"));
            String hql = "select count(*) from LDC_INVT_HEAD where   (BILLFLAG!='2' or  BILLFLAG is NULL) and (CUSTOM_STATE!='6' or  CUSTOM_STATE is NULL) ";
    
    
            if(ietype.equals("I")) {
                hql=hql+"  and ORDERBOOKBILLNO='"+typecode+"'  ";
            }
            if(ietype.equals("E")) {
                hql=hql+"  and INVOICE='"+typecode+"'  ";
            }
            if(ietype.equals("P")) {
                hql=hql+"  and BOND_INVT_NO='"+typecode+"'  ";
            }
            if(ietype.equals("S")) {
                hql=hql+"  and ETPS_INNER_INVT_NO='"+typecode+"'  ";
            }
            if(StringUtil.isNotEmpty(id)) {
                hql=hql+"  and id!='"+id+"'";
            }
    
    
            String types = jdbcTemplate.queryForObject(hql, String.class);
            if(!types.equals("0"))
            {
                v.setInfo("类型已存在");
                v.setStatus("n");
            }
            return v;
        }
  • 相关阅读:
    详细的git入门级别,从安装到实战
    Linux安装maven超级详细步骤
    比较全的开源软件镜像地址
    区块链应用领域
    区块链来源比特币,区块链基础构造
    xpath定位总结--精简版
    python装饰器
    python六剑客
    Python断言方法:assert
    python3对excel读写openpyxl
  • 原文地址:https://www.cnblogs.com/xueblvip/p/14928024.html
Copyright © 2011-2022 走看看