• 文本框上绑校验


    加属性 
    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;
        }
  • 相关阅读:
    web test Grinder / nGrinder / ngrinder / gor / tcpcopy
    【python学习】之五、可调用对象
    【C/C++学习】之五、dynamic_cast
    【网络编程】之一、初识WinSocket
    【啊哈!算法】之四、选择排序
    【IOS学习】之二、虚拟机MAC Lion 10.7 下问题集锦和xcode的安装
    【网络编程】之二、socket API学习
    【C/C++学习】之六、reinterpret_cast
    【啊哈!算法】之五、归并排序
    【IOS学习】之一、VM8下安装mac lion10.7 黑苹果之续
  • 原文地址:https://www.cnblogs.com/xueblvip/p/14928024.html
Copyright © 2020-2023  润新知