public void cancelRelaCom() {
   LEDBankComRelaSchema tBankComRelaSchema = new LEDBankComRelaSchema();
   tBankComRelaSchema.setBankCode(this.getBankCode());
   tBankComRelaSchema.setComCode(this.getComCode());
   tBankComRelaSchema.setPayFlag(this.getPayFlag());
   LEDBankComRelaDB tBankComRelaDB = new LEDBankComRelaDB();
   tBankComRelaDB.setSchema(tBankComRelaSchema);
   LEDBankComRelaSet tBankComRelaSet = tBankComRelaDB.query();
   if (tBankComRelaSet.size() < 1) {
     this.setOperateCode("cancelRelaCom_Fail010");
     this.operateNotice =
         ECPubFun.getDisplayString(valiConfig.getBundle(), this.operateCode, null);
     return;
   }
   MMap map = new MMap();
   map.put(tBankComRelaSchema, "DELETE");
   mVData.clear();
   mVData.add(map);
   PubSubmit pubSubmit = new PubSubmit();
   if (!pubSubmit.submitData(mVData, "delete")) {
     this.setOperateCode("cancelRelaCom_Fail020");
     this.operateNotice =
         ECPubFun.getDisplayString(valiConfig.getBundle(), this.operateCode, null);
     return;
   } else {
     this.setOperateCode("cancelRelaCom_Succ010");
     this.operateNotice =
         ECPubFun.getDisplayString(valiConfig.getBundle(), this.operateCode, null);
     queryComInfo();
     return;
   }
 }
Пример #2
0
  /** 修改广告来源信息 */
  public void modifyADSouce() {

    LEDAdSourceDB tLEDAdSourceDB = new LEDAdSourceDB();
    tLEDAdSourceDB.setProductCode(this.getProductCode());
    tLEDAdSourceDB.setSiteCode(this.getSiteCode());
    if (!tLEDAdSourceDB.getInfo()) {
      operateResult = "Fail|修改失败,数据库中没有此广告来源信息";
      return;
    }
    LEDAdSourceSchema tLEDAdSourceSchema = new LEDAdSourceSchema();
    tLEDAdSourceSchema.setSchema(tLEDAdSourceDB.getSchema());
    tLEDAdSourceSchema.setPayMode(this.getPayMode());
    tLEDAdSourceSchema.setContent(this.getContent());

    MMap map = new MMap();
    map.put(tLEDAdSourceSchema, "UPDATE");

    PubSubmit tPubSubmit = new PubSubmit();
    VData cVData = new VData();
    cVData.add(map);
    if (!tPubSubmit.submitData(cVData, "")) {
      operateResult = "Fail|修改操作失败";
      return;
    } else {
      operateResult = "Succ|修改成功";
      initData();
      return;
    }
  }
 private boolean saveData(MMap map) {
   VData tVData = new VData();
   tVData.add(map);
   PubSubmit tPubSubmit = new PubSubmit();
   if (!tPubSubmit.submitData(tVData, "")) {
     return false;
   }
   return true;
 }
Пример #4
0
 /** 删除数据 */
 public void deleteById() {
   String sql =
       "delete from ledadsource where sitecode='"
           + this.getSiteCode()
           + "' and productcode='"
           + this.getProductCode()
           + "'";
   MMap map = new MMap();
   map.put(sql, "DELETE");
   VData tVData = new VData();
   tVData.add(map);
   PubSubmit tPubSubmit = new PubSubmit();
   if (tPubSubmit.submitData(tVData, "")) {
     operateResult = "succ|删除成功";
     initData();
     find();
   } else {
     operateResult = "fail|删除失败";
   }
 }
  @SuppressWarnings("unchecked")
  public void save() throws IOException {
    boolean cFlag = true;
    if (!processFile()) {
      cFlag = false;
    }
    // 选中险种的个数
    int n = risks.length;
    LEPPlanRiskSet mLEPPlanRiskSet = new LEPPlanRiskSet();
    LEPPlanSchema mLEPPlanSchema = null;
    String contPlanCode = "";
    if (cFlag) {
      if (n > 0) {
        mLEPPlanSchema = new LEPPlanSchema();
        SysMaxNoMETLIFE tSysMaxNoMETLIFE = new SysMaxNoMETLIFE();
        contPlanCode = tSysMaxNoMETLIFE.CreateMaxNo("SerialNo", 10);
        mLEPPlanSchema.setContPlanCode(contPlanCode);
        mLEPPlanSchema.setContPlanName(planName);
        mLEPPlanSchema.setPlanType("00");
        mLEPPlanSchema.setPlanRiskType("H");
        mLEPPlanSchema.setPlanRule(rule);
        // modify by fengzg 将产品介绍写入文件
        String fileName = "planIntro_" + contPlanCode + ".txt";
        mLEPPlanSchema.setPlanIntro(fileName);
        ECPubFun.writeStringToFile(ECPubFun.getFCKEditFile(fileName), introduce);
        mLEPPlanSchema.setSaleStartDate(startDate);
        mLEPPlanSchema.setSaleEndDate(endDate);
        if (timeoutDef == null || "".equals(timeoutDef)) {
          // mLEPPlanSchema.setOverTime("24");
        } else {
          mLEPPlanSchema.setOverTime(timeoutDef);
        }
        mLEPPlanSchema.setOverTimeFlag("H");
        mLEPPlanSchema.setOperator(getVisitor().getUser().getUserName());
        String currentDate = PubFun.getCurrentDate();
        String currentTime = PubFun.getCurrentTime();
        mLEPPlanSchema.setMakeDate(currentDate);
        mLEPPlanSchema.setMakeTime(currentTime);
        mLEPPlanSchema.setModifyDate(currentDate);
        mLEPPlanSchema.setModifyTime(currentTime);
        // add ---wangzhixin----2009/07/21  start
        mLEPPlanSchema.setFileName(this.myFile);
        // add ---wangzhixin----2009/07/21  end
        for (int i = 0; i < n; i++) {
          LEPPlanRiskSchema mLEPPlanRiskSchema = new LEPPlanRiskSchema();
          mLEPPlanRiskSchema.setContPlanCode(contPlanCode);
          mLEPPlanRiskSchema.setContPlanName(planName);
          mLEPPlanRiskSchema.setMainRiskCode(planMainRisk);
          mLEPPlanRiskSchema.setRiskCode(risks[i]);
          mLEPPlanRiskSchema.setPlanType("00");
          mLEPPlanRiskSchema.setOperator(getVisitor().getUser().getUserName());
          mLEPPlanRiskSchema.setMakeDate(currentDate);
          mLEPPlanRiskSchema.setMakeTime(currentTime);
          mLEPPlanRiskSchema.setModifyDate(currentDate);
          mLEPPlanRiskSchema.setModifyTime(currentTime);
          mLEPPlanRiskSet.add(mLEPPlanRiskSchema);
        }
      }
      MMap map = new MMap();
      map.put(mLEPPlanSchema, "INSERT");
      map.put(mLEPPlanRiskSet, "INSERT");
      PubSubmit tPubSubmit = new PubSubmit();
      VData cVData = new VData();
      cVData.add(map);
      FacesContext fc = getFacesContext();
      HttpServletRequest request = (HttpServletRequest) fc.getExternalContext().getRequest();

      if (tPubSubmit.submitData(cVData, "")) {
        operateResult = "succ";
        planCode = contPlanCode;
        setInit("1");
        //				FacesContext fc = getFacesContext();
        //		        HttpServletResponse response = (HttpServletResponse)
        // fc.getExternalContext().getResponse();
        //		        PrintWriter out =  response.getWriter();
        //		        out.write("javascrip:alert(保存成功,生成的产品组合编码是"+contPlanCode+")");
        request.setAttribute("result", operateResult);
        request.setAttribute("planCode", planCode);
      } else {
        operateResult = "fail";
        request.setAttribute("result", operateResult);
      }
    } else {
      operateResult = "checkfail";
    }
  }
Пример #6
0
  /** 保存数据 */
  public void save() {
    if (this.getSiteName() == null || "".equals(this.getSiteName())) {
      operateResult = "Fail|" + "网站名称不能为空!";
      return;
    }

    if (this.getSiteCode() == null || "".equals(this.getSiteCode())) {
      operateResult = "Fail|" + "网站缩写不能为空!";
      return;
    }

    if (this.getProductCode() == null || "".equals(this.getProductCode())) {
      operateResult = "Fail|" + "产品不能为空!";
      return;
    }

    if (this.getSiteType() == null || "".equals(this.getSiteType())) {
      operateResult = "Fail|" + "网站类型不能为空!";
      return;
    }
    if (this.payModelList == null || this.payModelList.length < 1) {
      operateResult = "Fail|" + "支付方式不能为空!";
      return;
    }

    String type = "";
    String sql =
        "select siteCode,siteType from ledadsource where siteCode='" + this.getSiteCode() + "'";
    ExeSQL tExeSQL = new ExeSQL();
    SSRS tSSRS = new SSRS();
    tSSRS = tExeSQL.execSQL(sql);
    int row = tSSRS.getMaxRow();
    if (row > 0) {
      type = tSSRS.GetText(1, 2);
      if (!this.getSiteType().equals(type)) {
        operateResult = "Fail|网站编码在数据库中已存在,输入的网站类型与存在的不一致!";
        return;
      }
    }

    sql =
        "select siteCode from ledadsource where "
            + "siteCode='"
            + this.getSiteCode()
            + "' "
            + "and productcode='"
            + this.getProductCode()
            + "'";
    tExeSQL = new ExeSQL();
    tSSRS = new SSRS();
    tSSRS = tExeSQL.execSQL(sql);
    row = tSSRS.getMaxRow();
    if (row > 0) {
      operateResult = "Fail|" + "添加失败!该数据在数据库中已存在!";
      return;
    }
    if ("all".equals(this.getProductCode())) {
      this.setVisitedPage("首页面");
    } else if ("register".equals(this.getProductCode())) {
      this.setVisitedPage("注册页面");
    } else if ("actIndex".equals(this.getProductCode())) {
      this.setVisitedPage("宣传页面");
    } else if ("readIndex".equals(this.getProductCode())) {
      this.setVisitedPage("阅读投保须知页面");
    } else {
      sql =
          "select contplanname from lepplan where contplancode='"
              + this.getProductCode()
              + "' and plantype='00'";
      this.setVisitedPage(tExeSQL.getOneValue(sql));
    }

    String siteUrl = "http://icare.metlife.com.cn/visit.jsf?source=";
    LisIDEA tLisIDEA = new LisIDEA();
    siteUrl = siteUrl + tLisIDEA.encryptString(this.getSiteCode());
    siteUrl = siteUrl + "&product=" + tLisIDEA.encryptString(this.getProductCode());
    LEDAdSourceSchema tLEDAdSourceSchema = new LEDAdSourceSchema();
    tLEDAdSourceSchema.setContent(this.getContent());
    tLEDAdSourceSchema.setProductCode(this.getProductCode());
    tLEDAdSourceSchema.setSiteCode(this.getSiteCode());
    tLEDAdSourceSchema.setSiteName(this.getSiteName());
    tLEDAdSourceSchema.setSiteType(this.getSiteType());
    tLEDAdSourceSchema.setUrl(siteUrl);
    tLEDAdSourceSchema.setPayMode(this.getPayMode());
    tLEDAdSourceSchema.setVisitedPage(this.getVisitedPage());
    MMap map = new MMap();
    map.put(tLEDAdSourceSchema, "INSERT");

    PubSubmit tPubSubmit = new PubSubmit();
    VData cVData = new VData();
    cVData.add(map);
    if (!tPubSubmit.submitData(cVData, "")) {
      operateResult = "Fail|添加失败";
      return;
    } else {
      operateResult = "Succ|添加成功";
      initData();
      find();
      return;
    }
  }