⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 find.java

📁 检化验管理系统
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
                  String blFindT = blFindTitle ();
                  buf.append (blFindT);
              }
              if (biaoshi) {
                  buf.append (
                      "<td align=\"center\" height= \"24\" style=\"white-space:nowrap\">");
                  buf.append ("车数</td>\n<td align=\"center\" height= \"24\" style=\"white-space:nowrap\">");
                  buf.append ("总重量kg</td>\n");
              }
              buf.append ("<td align=\"center\" height= \"27\">操 作</td>");
              buf.append ("</tr> \n");
              while (rs15.next ()) {
                  String signhav = rs15.getString (8);
                  int havSignn = signhav.length () -
                      (signhav.replaceAll ("@", "")).length ();
                  isSignCheck = signShenn - havSignn;
                  if (isSignCheck == 1) {
                      rs_count++;
                      buf.append (
                          "<tr bgcolor=\"#FFFFFF\" height= \"22\" onclick=\"onClickColor(this);\">\n");
                      for (int i = 1; i <= count; i++) {
                          if(i==1)
                              fujian = rs15.getString("l2");
                          if (i > 3 && i < 17 || i == 21)
                              continue;
                          if (biaoshi && i == 19)
                              continue; //读卡物资不显示标识列
                          if (i == 23 && !biaoshi && mlhg.equals ("b"))
                              continue; //不读卡物资,不显示合格与否列
                          if (i == 17 && rs15.getString (17).length () >= 10)
                              buf.append ("<td align=\"center\">");
                          else
                              buf.append (
                                  "<td align=\"center\" style=\"white-space:nowrap\">");
                          if (i == 17 || i <= 3 && i >= 1) {
                              String priv = rs15.getString (5); //审核结束列
                              if (priv.trim ().equals ("y") ||
                                  shPriv.equals ("y")) {
                                  myrs = rs15.getString (i);
                                  lbView = true;
                              } else {
                                  myrs = "******";
                                  lbView = false;
                              }
                          } else if ((fujian!=null && i==19)||(fujian!=null && i==18 && biaoshi )){
                              if(fujian.indexOf("复检")!=-1)
                                  myrs = rs15.getString (i)+"<font color=\"#CC0000\">复检</font>";
                              else myrs = rs15.getString(i);
                          }else{
                              myrs = rs15.getString (i);
                          }
                          if (myrs == null || myrs.length () == 0) {
                              buf.append ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                          } else {
                              if ( (i == 2 || i == 20) &&
                                  !myrs.equals ("******")) {
                                  buf.append (myrs.substring (0, 10));
                              } else {
                                  if (myrs.length () <= 2) {
                                      buf.append ("&nbsp;" + myrs + "&nbsp;");
                                  } else {
                                      buf.append (myrs);
                                  }
                              }
                          }
                      }
                      if (bl.indexOf ("w") != -1) {
                          //buf.append (myrs);
                          String blstr = "";
                          if (lbView || bl.indexOf ("s") != -1) {
                              blstr = blFindCont (rs15.getString (7));
                          } else {
                              blstr = blFindCont ("");
                          }
                          buf.append (blstr);
                      }
                      //----------
                      if (biaoshi) {
                          String chehWe = chehaoFind (rs15.getString (3));
                          ex ex = new ex ();
                          String[] chw = ex.split (chehWe, "@@");
                          if (lbView) {
                              buf.append (
                                  "<td align=\"center\" height= \"24\" style=\"white-space:nowrap\">");
                              if (chw[0] != null) {
                                  buf.append (
                                      "<a href=\"#\" onMouseOver=\"showmessage('");
                                  buf.append (chw[2]);
                                  buf.append (
                                      "')\" onMouseOut=\"hideticker()\">");
                                  buf.append (chw[0]);
                                  buf.append ("</a>");
                              }
                              buf.append ("</td>");
                              buf.append (
                                  "<td align=\"center\" height= \"24\" style=\"white-space:nowrap\">");
                              buf.append (chw[1]+"</td>");
                          }else{
                              buf.append("<td></td><td></td>");
                          }
                      }
                      //----------
                      String liushui = rs15.getString (18).trim ();
                      String radio_check_name = "a" + rs_count;
                      if (judgech.trim ().equals ("y") && biaoshi) {
                          buf.append (
                              "<td align=\"center\" width=\"135\" style=\"white-space:nowrap\">");
                          buf.append ("<input type=\"checkbox\" name=\"");
                          buf.append (radio_check_name.trim ());
                          buf.append ("\" value=\"");
                          buf.append (liushui + "push" + rs15.getString("编码流水"));
                          buf.append ("\">作废;");
                          buf.append ("<select name=\"");
                          buf.append (radio_check_name.trim ());
                          buf.append ("\"><option value=\"");
                          buf.append (liushui + "notcheck");
                          buf.append ("\" selected>暂不审</option>");
                          buf.append ("<option value=\"");
                          buf.append (liushui + "合格");
                          buf.append ("\">合格</option>");
                          buf.append ("<option value=\"");
                          buf.append (liushui + "不合格");
                          buf.append ("\">不合格</option></select>");
                      } else {
                          buf.append (
                              "<td align=\"center\" width=\"110\" style=\"white-space:nowrap\">");
                          buf.append ("<nobr><input type=\"radio\" name=\"");
                          buf.append (radio_check_name.trim ());
                          buf.append ("\" value=\"");
                          buf.append (liushui + "check");
                          buf.append ("\">审核;");
                          buf.append ("<input type=\"radio\" name=\"");
                          buf.append (radio_check_name.trim ());
                          buf.append ("\" value=\"");
                          buf.append (liushui + "push"+ rs15.getString("编码流水"));
                          buf.append ("\">作废<nobr>");
                      }
                      buf.append ("</td>");
                      buf.append ("</tr> \n");
                  }
              }
              buf.append ("<table width=\"100%\"><tr>\n<td>");
              buf.append ("<input type=\"hidden\" name=\"rscount\" value=\"");
              buf.append (rs_count);
              buf.append ("\">");
              buf.append ("</td> \n</tr> \n</table>");
              if (rs_count == 0) {
                  buf.append ("<table width=\"100%\"  bgcolor=\"#cccccc\" ><tr>\n<td align=\"center\"  height= \"50\">");
                  buf.append ("没有符合条件的查询结果!</td> \n</tr> \n</table>");
              }
          } else {
              buf.append (
                  "<td align=\"center\" width=\"100%\" height= \"27\">无结果!</td>");
          }
      } catch (Exception e) {
          e.printStackTrace ();
      }
      finally {
        try {
          if (rs15 != null) {rs15.close();}
        }
        catch (SQLException ex) {}
      }
      return buf.toString ();
  }

//-----------------------------------------------------------------------
  public int check (String rscheck) { //审核
      int flag = 0;
      String signm = "";
      String sqlm = "";
      String sqlg = "";
      String process = "";
      String sqlUpdate = "";
      String numid = rscheck.substring (0, 7); //流水号为7位!
      String checkSign = rscheck.substring (7);
      String judgeSign = "";
      String userid = "";
      String feibiaoshi = "";
      MyResultSet rs16 = null;//此处可能应该省略,定义一个全局变量
      MyResultSet rs17 = null;
      MyResultSet rs18 = null;
      MyResultSet rs19 = null;
      //MyResultSet rs20 = null;

      long currTime = Calendar.getInstance ().getTimeInMillis ();
      SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
      String temp = formatter.format (new Date (currTime));

      if (!checkSign.equals ("check") && checkSign.indexOf("push")==-1)
          judgeSign = rscheck.substring (7);
      try {
          sqlg = "select 审核,标识 from " + goods + " where 流水号 = '" + numid + "'";
          //rs = super.executeQuery (sqlg);
          rs16 = DbAccess.querySqlOption(sqlg);
          while (rs16.next ()) {
              process = rs16.getString ("审核");
              feibiaoshi = rs16.getString("标识") + "_fei";
          }
         // System.out.
          try {
            if (rs16 != null) {rs16.close();}
          }catch (SQLException ex) {}
          userid = userids.substring(2);
          //String newProcess = process + person + "@";
          String newProcess = process + userid+temp+ "@";
          if (checkSign.indexOf("push")!=-1) {
              String bmls = checkSign.substring(4);
              String sqlselbm = " select 称重流水 from bianma where 编码流水 = '"+bmls+"'";
              //rs = super.executeQueryp(sqlselbm);
              rs17 = DbAccess.querySqlOption(sqlselbm);
              while(rs17.next()){
                  String czls = rs17.getString ("称重流水");
                  String newczls = czls + "_fei";
                  String sqlupbm = "update bianma set 称重流水 = '" + newczls +
                      "' where 编码流水 = '" + bmls + "' and 称重流水 = '" + czls +
                      "'";
                  //super.executeUpdatev(sqlupbm);
                  DbAccess.updateOption(sqlupbm);
              }
              try {
                if (rs17 != null) {rs17.close();}
              }catch (SQLException ex) {}
              //String sqlupbm = "update bianma set 称重流水 = '"+checkSign+"'";
              sqlUpdate = "update " + goods + " set 审核 = '" + newProcess +
                  "',作废 = 'y',审核结束 = 'n',标识 = '"+feibiaoshi+"' where 流水号 = '" + numid + "'";
          } else if (checkSign.equals ("check")) {
              sqlm = "select 级数 from mulu where 物品 = '" + goods + "'";
              //rs = super.executeQuery (sqlm);
              rs18 = DbAccess.querySqlOption(sqlm);
              while (rs18.next ()) {
                  signm = rs18.getString ("级数");
              }
              try {
                if (rs18 != null) {rs18.close();}
              }catch (SQLException ex) {}
              int prosign = process.length () -
                  (process.replaceAll ("@", "")).length ();
              int sign = Integer.parseInt (signm.trim ()) - prosign;
              if (sign == 1) {
                  sqlUpdate = "update " + goods + " set 审核结束 = 'y',审核 = '" +
                      newProcess + "' where 流水号 = '" + numid + "'";
              } else {
                  sqlUpdate = "update " + goods + " set 审核 = '" + newProcess +
                      "' where 流水号 = '" + numid + "'";
              }
          } else {
              sqlm = "select 级数 from mulu where 物品 = '" + goods + "'";
              //rs = super.executeQuery (sqlm);
              rs19 = DbAccess.querySqlOption(sqlm);
              while (rs19.next ()) {
                  signm = rs19.getString ("级数");
              }
              try {
                if (rs19 != null) {rs19.close();}
              }catch (SQLException ex) {}
              int prosign = process.length () -
                  (process.replaceAll ("@", "")).length ();
              int sign = Integer.parseInt (signm.trim ()) - prosign;
              if (sign == 1) {
                  sqlUpdate = "update " + goods + " set 审核结束 = 'y',审核 = '" +
                      newProcess + "',合格与否 = '" + judgeSign +
                      "' where 流水号 = '" + numid + "'";
              } else {
                  sqlUpdate = "update " + goods + " set 审核 = '" + newProcess +
                      "',合格与否 = '" + judgeSign + "' where 流水号 = '" + numid +
                      "'";
              }
          }
          //flag = super.executeUpdate (sqlUpdate);
          flag = DbAccess.updateOption(sqlUpdate);
      } catch (Exception e) {
          e.printStackTrace ();
      }
      return flag;
  }

//----------------------------------------------------------------
  public String[] selectLei () throws Exception {
      String sql = "";
      String colname = "";
      //String not = "n";
      MyResultSet rs13 = null;
      ArrayList queslist = new ArrayList ();
      String kind = "30"; //30代表全部物品类别

      try {
          if (kind.trim ().equals ("30")) {
              sql = "select 物品 from mulu";
          } else {
              sql = "select 物品 from mulu where 类别 = '" + kind + "'";
          }
          //rs = super.executeQueryp (sql);
          rs13 = DbAccess.querySqlOption(sql);
          while (rs13.next ()) {
              colname = rs13.getString ("物品");
              queslist.add (colname);
          }
      } catch (SQLException ex) {
          ex.printStackTrace ();
      }
      finally {
        try {
          if (rs13 != null) {rs13.close();}
        }
        catch (SQLException ex) {}
      }
      String[] rs0 = {
          ""};
      return (String[])queslist.toArray (rs0);
  }

//----------------------------------------------------------------
  public String chehaoFind (String bmls) throws Exception {
      String sql = "";
      String chehao = "";
      MyResultSet rs20 = null;
      int numche = 0;
      int oneweight = 0;
      int allweight = 0;
      String restr = "";
      String laststr = "0@@0@@无对应编码流水";

      try {
          sql = "select 车号,重量 from bianma where 编码流水 = '" + bmls +
              "' order by 车号 desc";
          //rs = super.executeQueryp (sql);
          rs20 = DbAccess.querySqlOption(sql);
          while (rs20.next ()) {
              chehao = rs20.getString ("车号").replaceAll (" ", "");
              if(chehao.indexOf("#")!=-1){
                  ex ex = new ex ();
                  String[] huoche = ex.split(chehao+"#","#");
                  laststr = huoche[2]+"@@火车@@"+huoche[1];
              }else{
                  oneweight = rs20.getInt ("重量");
                  allweight += oneweight;
                  numche += 1;
                  restr += chehao + "/" + oneweight + "kg,";
                  laststr = numche + "@@" + allweight + "@@" + restr;
              }
          }
      } catch (SQLException ex) {
          ex.printStackTrace ();
      }
      finally {
        try {
          if (rs20 != null) {rs20.close();}
        }catch (SQLException ex) {}
      }
      return laststr;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -