示例#1
0
 /**
  * 明细规则配置
  *
  * @return
  * @throws Exception
  */
 public String updateDetailRule() throws Exception {
   RuleEditDto former = ruleComponent.queryRuleForCollectChangeInfo(rule);
   String ruleid = ruleComponent.updateDetailRule(rule);
   rule.setRule_id(ruleid);
   RuleEditDto newOne = ruleComponent.queryRuleForCollectChangeInfo(rule);
   saveSysChange(former, newOne);
   return JSON;
 }
示例#2
0
  /**
   * 保存或修改条件规则
   *
   * @return
   * @throws Exception
   */
  public String updateRuleAndRuleEdit() throws Exception {
    String ruleInfo = request.getParameter("ruleEditDto");
    Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
    RuleEditDto ruleEditDto = gson.fromJson(ruleInfo, RuleEditDto.class);
    // 规则对象
    RuleDefineDto rule = ruleEditDto.getRule();
    // 规则编辑对象
    List<TRuleEdit> ruleEdits = ruleEditDto.getRuleEdits();

    RuleEditDto former = ruleComponent.queryRuleForCollectChangeInfo(rule);
    rule.setRule_id(ruleComponent.updateRuleAndRuleEdit(rule, ruleEdits));
    RuleEditDto theNewOne = ruleComponent.queryRuleForCollectChangeInfo(rule);

    saveSysChange(former, theNewOne);

    return JSON_SUCCESS;
  }