Exemplo n.º 1
0
 /**
  * <br>
  * Description:红线项目列表过滤 <br>
  * Author:黎春行 <br>
  * Date:2013-12-25
  *
  * @throws Exception
  */
 public void getReport() throws Exception {
   String keyword = request.getParameter("keyword");
   StringBuffer query = new StringBuffer();
   ITableStyle its = new TableStyleEditRow();
   if (keyword != null) {
     query.append(" where ");
     keyword = UtilFactory.getStrUtil().unescape(keyword);
     StringBuffer querybuffer = new StringBuffer();
     String[][] nameStrings = HxxmReport.shows;
     for (int i = 1; i < nameStrings.length - 1; i++) {
       querybuffer.append("upper(t.").append(nameStrings[i][0]).append(")||");
     }
     querybuffer
         .append("upper(t.")
         .append(nameStrings[nameStrings.length - 1][0])
         .append(")) like '%")
         .append(keyword)
         .append("%'");
     query.append("(");
     query.append(querybuffer);
   }
   Map<String, Object> conditionMap = new HashMap<String, Object>();
   conditionMap.put("query", query.toString());
   response(
       String.valueOf(new CBDReportManager().getReport("HXXM", new Object[] {conditionMap}, its)));
 }
Exemplo n.º 2
0
 /**
  * <br>
  * Title:上传工作流ZIP文件 <br>
  * Description: <br>
  * Author:王峰 <br>
  * Date:2011-6-30
  */
 public void uploadFile() {
   File delFile = null;
   File newFolder = null;
   String filePath = "";
   try {
     List<String> list;
     list = UtilFactory.getFileUtil().upload(request, 0, 0);
     filePath = list.get(0);
     String n = filePath.substring(0, filePath.lastIndexOf("."));
     newFolder = new File(n);
     String m = n.substring(0, filePath.lastIndexOf("//" + newFolder.getName()));
     System.out.print(m);
     delFile = new File(m);
   } catch (Exception e2) {
     // TODO Auto-generated catch block
     e2.printStackTrace();
   }
   IWorkflowOp work = WorkflowOp.getInstance();
   try {
     work.deploy(filePath.replaceAll("//", "/"));
     response.getWriter().write("{success:true,info:'上传成功!'}");
   } catch (Exception e) {
     e.printStackTrace();
     try {
       response.getWriter().write("{success:false,info:'" + e.getMessage() + "'}");
     } catch (IOException e1) {
       // TODO Auto-generated catch block
       e1.printStackTrace();
     }
   } finally {
     if (delFile != null) DelFile.getInstance().deleteAllFile(delFile);
   }
 }
Exemplo n.º 3
0
  /**
   * <br>
   * Description:供地体量查询 <br>
   * Author:陈强峰 <br>
   * Date:2013-10-11
   */
  public void query() {
    String xmmc = UtilFactory.getStrUtil().unescape(request.getParameter("xmmc"));
    String nd = request.getParameter("nd");
    String jd = request.getParameter("jd");
    String sql =
        "select xmmc,nd||'-'||yf as sx,dl,gm,cb,sy,zj,zuj as zujin,rownum-1 as mod,rownum-1 as del,yw_guid  as gdbh,dlz,gmz,cbz,syz,zjz,yf from hx_gdtl  where xmmc=? and nd=? and jd=?";

    List<Map<String, Object>> list = query(sql, YW, new Object[] {xmmc, nd, jd});
    response(list);
  }
Exemplo n.º 4
0
 /**
  * <br>
  * Description:添加一个新的红线项目 <br>
  * Author:黎春行 <br>
  * Date:2013-12-24
  *
  * @throws Exception
  */
 public void insert() throws Exception {
   String xmmc = new String(request.getParameter("xmmc").getBytes("iso-8859-1"), "UTF-8");
   if (xmmc != null) {
     xmmc = UtilFactory.getStrUtil().unescape(xmmc);
     if (new HxxmData().insertHxxm(xmmc)) {
       response("{success:true}");
     } else {
       response("{success:false}");
     }
   } else {
     response("{success:false}");
   }
 }
Exemplo n.º 5
0
 /**
  * <br>
  * Description:根据guid 下载附件 <br>
  * Author:陈强峰 <br>
  * Date:2012-8-13
  *
  * @param guid
  * @param ftpmap
  * @param folder
  */
 private void downloadByGuid(String guid, String folder) {
   String sql = "select file_id,file_name,file_path from atta_accessory where yw_guid=?";
   List<Map<String, Object>> list = query(sql, CORE, new Object[] {guid});
   for (int i = 0; i < list.size(); i++) {
     Map<String, Object> accessory = list.get(i);
     String remoteFileName = accessory.get("file_path").toString();
     String file_name = accessory.get("file_name").toString();
     try {
       UtilFactory.getFtpUtil().downloadFile(remoteFileName, folder + "//" + file_name);
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
 }
Exemplo n.º 6
0
 /**
  * <br>
  * Description:删除供地体量 <br>
  * Author:陈强峰 <br>
  * Date:2013-10-11
  */
 public void delete() {
   String xmmc = UtilFactory.getStrUtil().unescape(request.getParameter("gdxmmc"));
   String year = request.getParameter("gdnd");
   String season = request.getParameter("gdjd");
   String xmbh = getXmbh(xmmc);
   String sql = "select nd,jd,xmguid from hx_gdtl where nd=? and jd=? and xmguid=?";
   int flag = update(sql, YW, new Object[] {year, season, xmbh});
   if (flag == 0) {
     response("{success:false}");
   } else {
     removeFromSx(year, season, xmbh);
     updateTj(year, season);
     response("{success:true}");
   }
   response("{success:false}");
 }
Exemplo n.º 7
0
  public void draw() throws Exception {
    // String guid = new String(request.getParameter("guid").getBytes("ISO-8859-1"),"UTF-8");
    String guid = request.getParameter("guid");
    String polygon = request.getParameter("polygon");
    String type = request.getParameter("type");
    if (guid != null) {
      guid = UtilFactory.getStrUtil().unescape(guid);
    } else {
      response("{error:not primary}");
    }
    boolean draw = false;
    if ("3d".equals(type)) {
      draw = new HxxmData().recordGIS(guid, polygon, type);
    } else {
      draw = new HxxmData().recordGIS(guid, polygon);
    }

    response(String.valueOf(draw));
  }
Exemplo n.º 8
0
 /**
  * <br>
  * Description:成果压缩 <br>
  * Author:陈强峰 <br>
  * Date:2012-8-13
  *
  * @param zipPath
  * @param path
  */
 private void resultToZip(String zipPath, String path) {
   UtilFactory.getZIPUtil().zip(zipPath + ".zip", path);
 }