Examples of DivRlItm


Examples of com.iisigroup.cap.rule.model.DivRlItm

    return rlItmDao.find(oid);
  }

  @Override
  public void deleteById(String oid) {
    DivRlItm rlItm = rlItmDao.find(oid);
    if(rlItm.getDivRlDtls()!=null && !rlItm.getDivRlDtls().isEmpty()){
      rlDtlDao.delete(rlItm.getDivRlDtls());
    }
    if (rlItm != null) {
      rlItmDao.delete(rlItm);
    }
  }
View Full Code Here

Examples of com.iisigroup.cap.rule.model.DivRlItm

    }
    @SuppressWarnings("unchecked")
    public String reformat(Object in) throws CapFormatException {
      StringBuffer result = new StringBuffer();
      if (in instanceof DivRlItm) {
        DivRlItm rlItm = ((DivRlItm) in);
        if(rlItm.getDivRlDtls()!=null && !rlItm.getDivRlDtls().isEmpty()){
          for(DivRlDtl rlDtl : rlItm.getDivRlDtls()){
            DivCtItm ctItm =
                conditionMntService.findByDivCtItmNo(rlDtl.getDivCtNo());
            if(ctItm!=null)
              result.append(ctItm.getDivCtNm()+",");
          }
View Full Code Here

Examples of com.iisigroup.cap.rule.model.DivRlItm

  @HandlerType(HandlerTypeEnum.FORM)
  public IResult query(IRequest request) {
    String oid = request.get("mainOid");
    String divCtNo = request.get("divRlNo");
    AjaxFormResult result = new AjaxFormResult();
    DivRlItm rlItm = null;
    if(!CapString.isEmpty(oid)){
      rlItm = ruleTbMntService.getById(oid);
    }else if(!CapString.isEmpty(divCtNo)){
      rlItm = ruleTbMntService.findByDivRlNo(divCtNo);
    }
    if(rlItm!=null){
      result.putAll(rlItm.toJSONObject(new String[]{"divRlNo", "divRlNm"
          , "oid"}, null));
      result.set("RadioGroup1", rlItm.getDivRlTyp());
    }
   
    return result;
  }// ;
View Full Code Here

Examples of com.iisigroup.cap.rule.model.DivRlItm

    AjaxFormResult result = new AjaxFormResult();
    String type = request.get("type");
    String divCtNo = request.get("divRlNo");
    //Factor DETAIL
    String[] ftGridData = request.getParamsAsStringArray("grid[]");
    DivRlItm rlItm = ruleTbMntService.findByDivRlNo(divCtNo);

    if ("A".equals(type)) {
      if (rlItm != null) {
        // 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("ruleTb.0001"), getClass());
      }
      rlItm = new DivRlItm();
    } else {
      if (rlItm != null && !rlItm.getOid().equals(request.get("oid"))) {
        // 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("ruleTb.0001"), getClass());
      } else if (rlItm == null && !CapString.isEmpty(request.get("oid"))) {
        rlItm = ruleTbMntService.getById(request.get("oid"));
      } else if (rlItm == null){
        rlItm = new DivRlItm();
      }
    }
    CapBeanUtil.map2Bean(request, rlItm);
    if ("A".equals(type)) {
      rlItm.setOid(null);
    }
    List<DivRlDtl> delRlDtl = new ArrayList<DivRlDtl>();
    if(ftGridData!=null){
      List<DivRlDtl> rlDtls = new LinkedList<DivRlDtl>();
      if(rlItm.getDivRlDtls()!=null && !rlItm.getDivRlDtls().isEmpty()){
        delRlDtl = rlItm.getDivRlDtls();
      }
      for(int i = 0; i<ftGridData.length; i++){
        JSONObject jsData = JSONObject.fromObject(ftGridData[i]);
        DivRlDtl rlDtl = new DivRlDtl();
//        int j = 0;
//        boolean haveOld = false;
//        if(!CapString.isEmpty(jsData.getString("oid")) && !rlItm.getDivRlDtls().isEmpty()){
//          for(DivRlDtl rlDtl2 : rlDtls){
//            j++;
//            if(rlDtl2.getOid().equals(jsData.opt("oid"))){
//              rlDtl = rlDtl2;
//              haveOld = true;
//              break;
//            }
//          }
//        }
        CapBeanUtil.map2Bean(jsData, rlDtl);
        rlDtl.setDivRlNo(rlItm.getDivRlNo());
        rlDtl.setDivRlSor(new BigDecimal(i+1));
        rlDtl.setDivCtNo(jsData.optString("divCtNo"));
        DivCtItm ctItm = conditionMntService.getById(jsData.optString("divCtOid"));
//        rlDtl.setDivCtItm(ctItm);
        rlDtl.setDivRlItm(rlItm);
//        if(haveOld){
//          rlDtls.set(j, rlDtl);
//        }else{
          rlDtls.add(rlDtl);
//        }
      }
     
      rlItm.setDivRlDtls(rlDtls);
    }
    String userId = CapSecurityContext.getUserId();
    if(userId.length()>6)userId = userId.substring(0,6);
    rlItm.setUpdater(userId);
    rlItm.setUpdateTime(CapDate.getCurrentTimestamp());
    String divRltyp = request.get("RadioGroup1");
    rlItm.setDivRlTyp(divRltyp);
    ruleTbMntService.saveDivRlItm(rlItm);
    if(!delRlDtl.isEmpty())
      ruleTbMntService.deleteRlDtlByList(delRlDtl);
    result.set(Constants.AJAX_NOTIFY_MESSAGE, CapAppContext.getMessage("ruleTb.0002"));
    return result;
View Full Code Here

Examples of com.iisigroup.cap.rule.model.DivRlItm

//    String packageName = "com.iisigroup.cap.service";
//    String importClass = "com.iisigroup.cap.base.model.CaseInfo,com.iisigroup.cap.utils.CapDroolsUtil";r
//    String variablesName = "com.iisigroup.cap.utils.CapDroolsUtil comUtil";
    String divRlNo = request.get("divRlNo");
    String oid = request.get("oid");
    DivRlItm rlItm = ruleTbMntService.getByRlItmNo(divRlNo);
    if(rlItm==null || rlItm.getDivRlDtls()==null){
      return null;
    }
    //取得排序的Rule明細
    List<DivRlDtl> rlDtls = ruleTbMntService.findRlDtlsByRlNoAndSort(rlItm.getDivRlNo());//rlItm.getDivRlDtls();
    List<DivCtItm> ctItms = null;
    WritableWorkbook workbook = null;
    File relFile = null;
    try{
      File fileDir = new File("../Temp");
      FileUtils.forceMkdir(fileDir);
      // 使用Char(3.6) 取得承辦分行資料。
      List<Map<String, Object>> lnf312Data = new ArrayList<Map<String,Object>>();
      String BRNO = "", BRNM = "";
      StringBuffer BRNoNm=new StringBuffer();
      if(!CollectionUtils.isEmpty(lnf312Data)){
        for(Map<String, Object> map : lnf312Data){
          BRNO = MapUtils.getString(map, "BRNO")+" ";
          BRNM = MapUtils.getString(map, "BRNM")+" ";
          BRNoNm.append(BRNO).append(BRNM);
        }
      }

      relFile = new File(fileDir + File.separator + CapDate.getCurrentDate("yyyyMMdd") + "_ruleExport.xls");
      relFile.createNewFile();
      // 2. 產生 workbook
      workbook = Workbook.createWorkbook(relFile);
      WritableSheet sheet1 = workbook.createSheet("Tables", 0);
      WritableFont myFont = new WritableFont(WritableFont.createFont("Arial"), 12);
      WritableFont boldWhiteFnt =
          new WritableFont(WritableFont.createFont("Arial"), 12, WritableFont.BOLD);
      boldWhiteFnt.setColour(Colour.WHITE);
      WritableFont blackFnt =
          new WritableFont(WritableFont.createFont("Arial"), 12, WritableFont.NO_BOLD);
      blackFnt.setColour(Colour.BLACK);
      // 第1行先放空白資料,並設定欄寬--->還沒設定
      //DecisionTable起始先告區(黑底白字)
      WritableCellFormat headCellFmt = new WritableCellFormat();
      //自動換行
      headCellFmt.setWrap(false);
      //水平靠左
      headCellFmt.setAlignment(Alignment.LEFT);
      //垂直置中
      headCellFmt.setVerticalAlignment(VerticalAlignment.TOP);
      //設字形
      headCellFmt.setFont(boldWhiteFnt);
      //設欄位框(細)線
//      headCellFmt.setBorder(Border.ALL,BorderLineStyle.THIN, Colour.BLACK);
      //設定顏色
      headCellFmt.setBackground(Colour.GRAY_80);
     
      //DecisionTable內容橘底黑字
      WritableCellFormat setCellFmt = new WritableCellFormat();
      //自動換行
      setCellFmt.setWrap(true);
      //水平靠左
      setCellFmt.setAlignment(Alignment.LEFT);
      //垂直置中
      setCellFmt.setVerticalAlignment(VerticalAlignment.TOP);
      //設字形
      setCellFmt.setFont(myFont);
      //設欄位框(細)線
      setCellFmt.setBorder(Border.ALL,BorderLineStyle.THIN, Colour.BLACK);
      //設定顏色(粉橘色)
      setCellFmt.setBackground(Colour.TAN);
     
      //DecisionTable內容白底黑字
      WritableCellFormat bodyCellFmt = new WritableCellFormat();
      //自動換行
      bodyCellFmt.setWrap(false);
      //水平靠左
      bodyCellFmt.setAlignment(Alignment.LEFT);
      //垂直置中
      bodyCellFmt.setVerticalAlignment(VerticalAlignment.TOP);
      //設字形
      bodyCellFmt.setFont(myFont);
      //設欄位框(細)線
      bodyCellFmt.setBorder(Border.ALL,BorderLineStyle.THIN, Colour.BLACK);
      //設定顏色
//      bodyCellFmt.setBackground(Colour.BLACK);
     

      //DecisionTable內容藍底黑字
      WritableCellFormat blueCellFmt = new WritableCellFormat();
      //自動換行
      blueCellFmt.setWrap(false);
      //水平靠左
      blueCellFmt.setAlignment(Alignment.LEFT);
      //垂直置中
      blueCellFmt.setVerticalAlignment(VerticalAlignment.TOP);
      //設字形
      blueCellFmt.setFont(myFont);
      //設欄位框(細)線
      blueCellFmt.setBorder(Border.ALL,BorderLineStyle.THIN, Colour.BLACK);
      blueCellFmt.setBackground(Colour.LIGHT_TURQUOISE);

      //DecisionTable內容黃底黑字
      WritableCellFormat yellowCellFmt = new WritableCellFormat();
      //自動換行
      yellowCellFmt.setWrap(false);
      //水平靠左
      yellowCellFmt.setAlignment(Alignment.LEFT);
      //垂直置中
      yellowCellFmt.setVerticalAlignment(VerticalAlignment.TOP);
      //設字形
      yellowCellFmt.setFont(myFont);
      //設欄位框(細)線
      yellowCellFmt.setBorder(Border.ALL,BorderLineStyle.THIN, Colour.BLACK);
      yellowCellFmt.setBackground(Colour.YELLOW);

      //DecisionTable內容綠底黑字
      WritableCellFormat greenCellFmt = new WritableCellFormat();
      //自動換行
      greenCellFmt.setWrap(false);
      //水平靠左
      greenCellFmt.setAlignment(Alignment.LEFT);
      //垂直置中
      greenCellFmt.setVerticalAlignment(VerticalAlignment.TOP);
      //設字形
      greenCellFmt.setFont(myFont);
      //設欄位框(細)線
      greenCellFmt.setBorder(Border.ALL,BorderLineStyle.THIN, Colour.BLACK);
      greenCellFmt.setBackground(Colour.LIGHT_GREEN);
     
      //設列高
//      int row = 0;
//      sheet1.setRowView(row,450);
      //將第row行的欄寬設為100
//      sheet1.setColumnView(row, 100);
      // 合併儲存格(x,y, x1,y2)
//      sheet1.mergeCells(0, row, 11, row);
//      sheet1.addCell(new Label(0, 0, "", bodyCellFmt));
//      sheet1.setColumnView(0, 26);
     
      for(int i = 0; i < 65535; i++){
        sheet1.setRowView(i+1,450);
        sheet1.setColumnView(i, 23);
      }
      sheet1.setRowView(12,900);
     
      //DecisionTable開頭宣告-參數
      NumberFormat nf = new DecimalFormat("#.00");
      sheet1.addCell(new Label(1, 2, "RuleSet", headCellFmt));
      sheet1.addCell(new Label(1, 3, "Import", headCellFmt));
      sheet1.addCell(new Label(1, 4, "EscapeQuotes", headCellFmt));
      sheet1.addCell(new Label(1, 5, "Variables", headCellFmt));
      sheet1.addCell(new Label(1, 6, "Functions", headCellFmt));
      sheet1.addCell(new Label(1, 7, "Notes", headCellFmt));
      sheet1.addCell(new Label(1, 9, "RuleTable "+ rlItm.getDivRlNm(), headCellFmt));

      //DecisionTable開頭宣告-值
      sheet1.addCell(new Label(2, 2, DroolsConstants.PACKAGE_NAME, headCellFmt));
      sheet1.addCell(new Label(2, 3, DroolsConstants.IMPORT_CLASS, headCellFmt));
      sheet1.addCell(new Label(2, 4, "false", headCellFmt));
      sheet1.addCell(new Label(2, 5, DroolsConstants.VARIABLES_NAME, headCellFmt));
      //設定均量化參數
      sheet1.addCell(new Label(2, 6, "", headCellFmt));
      sheet1.addCell(new Label(2, 7, "This is decision table for "+rlItm.getDivRlNm()
          , headCellFmt));
      sheet1.addCell(new Label(2, 9, "", headCellFmt));
      //excel合併儲存格(著色)
      for(int i = 0;i <6; i++){       
        sheet1.mergeCells(2, 2+i, 7, 2+i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.