コード例 #1
0
ファイル: TeamMainAction.java プロジェクト: tyxing007/wkspc
 @Action("merger2Team") // 请求入径为/absale/team/merger2Team.action
 public void merger2Team() {
   try {
     TeamMixInfoBean teamMixInfoBean = this.entity;
     // TeamMixInfoBean teamMixInfoBean = test1();
     Long baseTid = teamMixInfoBean.getTid();
     Long otherTid = teamMixInfoBean.getMergerTid();
     //			List<ObjRelationBean> rb = new ArrayList<ObjRelationBean>();//代码走查 add by guojian at
     // 2010-11-5 for 去除警告
     /** *************** 从入参获取数据,写入到t1,t2,根据业务,如有需要,则添加rb **************** */
     if (service.merger2Team(baseTid, otherTid)) {
       Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(true, "修改成功!")));
     } else {
       Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, "修改失败!")));
     }
   } catch (ServiceException se) {
     logger.error(
         "com.isoftstone.framework.modules.web.team.TZeamMainAction.java.merger2Team():"
             + se.getMessage(),
         se); // 代码走查 add by guojian at 2010-11-5 for log4j
     Struts2Utils.renderJson(
         ExtjsHelper.toJsonObjectResult(new Info(false, "数据验证,服务层异常!" + se.getMessage())));
   } catch (Exception e) {
     logger.error(
         "com.isoftstone.framework.modules.web.team.TZeamMainAction.java.merger2Team():"
             + e.getMessage()); // 代码走查 add by guojian at 2010-11-5 for log4j
     Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, e.getMessage())));
   }
 }
コード例 #2
0
ファイル: TeamMainAction.java プロジェクト: tyxing007/wkspc
  @Action("addTeamMixInfo") // 请求入径为/absale/team/addTeamMixInfo.action
  public void addTeamMixInfo() {
    try {
      TeamMixInfoBean teamMixInfoBean = this.entity;
      // TeamMixInfoBean teamMixInfoBean = test();
      TeamBaseBean t1 = new TeamBaseBean();
      long serNo = UUIDProxy.integerKey();
      t1.setTid(new Long(serNo));
      t1.setTeamCode(teamMixInfoBean.getTeamCode());
      t1.setTeamName(teamMixInfoBean.getTeamName());
      t1.setStatus("1");
      t1.setRid(teamMixInfoBean.getRid());
      t1.setDid(teamMixInfoBean.getDid());
      t1.setTypeNo1(teamMixInfoBean.getTypeNo1());
      t1.setCreateDate(teamMixInfoBean.getCreateDate());
      t1.setInvalidDate("2099-12-31");
      TeamNatureBean t2 = new TeamNatureBean();
      t2.setTid(new Long(serNo));
      t2.setAddr(teamMixInfoBean.getAddr());
      t2.setPostalCode(teamMixInfoBean.getPostalCode());
      t2.setPhone(teamMixInfoBean.getPhone());
      t2.setFax(teamMixInfoBean.getFax());
      TeamLeaderBean t3 = new TeamLeaderBean();
      t3.setLeaderId(teamMixInfoBean.getLeaderId());
      t3.setLeaderRankId(teamMixInfoBean.getLeaderRankId());
      List<ObjRelationBean> rb = new ArrayList<ObjRelationBean>();

      /** *************** 从入参获取数据,写入到t1,t2,t3,根据业务,如有需要,则添加rb **************** */
      if (service.insertTeamMixInfo(t1, t2, t3, rb.toArray(new ObjRelationBean[0]))) {
        Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(true, "保存成功!")));
      } else {
        Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, "保存失败!")));
      }
    } catch (ServiceException se) {
      logger.error(
          "com.isoftstone.framework.modules.web.team.TeamMainAction.java.addTeamMixInfo():"
              + se.getMessage(),
          se); // 代码走查 add by guojian at 2010-11-5 for log4j
      Struts2Utils.renderJson(
          ExtjsHelper.toJsonObjectResult(new Info(false, "数据验证,服务层异常!" + se.getMessage())));
    } catch (Exception e) {
      logger.error(
          "com.isoftstone.framework.modules.web.team.TeamMainAction.java.addTeamMixInfo():"
              + e.getMessage()); // 代码走查 add by guojian at 2010-11-5 for log4j
      Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, e.getMessage())));
    }
  }
コード例 #3
0
ファイル: TeamMainAction.java プロジェクト: tyxing007/wkspc
 @Action("split2Team") // 请求入径为/absale/team/merger2Team.action
 public void split2Team() {
   try {
     TeamMixInfoBean teamMixInfoBean = this.entity;
     if (service.split2Team(teamMixInfoBean)) {
       Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(true, "修改成功!")));
     } else {
       Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, "修改失败!")));
     }
   } catch (ServiceException se) {
     logger.error(
         "com.isoftstone.framework.modules.web.team.TZeamMainAction.java.merger2Team():"
             + se.getMessage(),
         se); // 代码走查 add by guojian at 2010-11-5 for log4j
     Struts2Utils.renderJson(
         ExtjsHelper.toJsonObjectResult(new Info(false, "数据验证,服务层异常!" + se.getMessage())));
   } catch (Exception e) {
     logger.error(
         "com.isoftstone.framework.modules.web.team.TZeamMainAction.java.merger2Team():"
             + e.getMessage()); // 代码走查 add by guojian at 2010-11-5 for log4j
     Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, e.getMessage())));
   }
 }
コード例 #4
0
ファイル: TeamMainAction.java プロジェクト: tyxing007/wkspc
 @Action("modifyTeamMixInfo") // 请求入径为/absale/team/modifyTeamMixInfo.action
 public void modifyTeamMixInfo() {
   try {
     TeamMixInfoBean teamMixInfoBean = this.entity;
     // TeamMixInfoBean teamMixInfoBean = test1();
     TeamBaseBean t1 = new TeamBaseBean();
     t1.setTid(teamMixInfoBean.getTid());
     t1.setTeamName(teamMixInfoBean.getTeamName());
     t1.setCreateDate(teamMixInfoBean.getCreateDate());
     TeamNatureBean t2 = new TeamNatureBean();
     t2.setTid(teamMixInfoBean.getTid());
     t2.setAddr(teamMixInfoBean.getAddr());
     t2.setPostalCode(teamMixInfoBean.getPostalCode());
     t2.setPhone(teamMixInfoBean.getPhone());
     t2.setFax(teamMixInfoBean.getFax());
     List<ObjRelationBean> rb = new ArrayList<ObjRelationBean>();
     /** *************** 从入参获取数据,写入到t1,t2,根据业务,如有需要,则添加rb **************** */
     if (service.updateTeamMixInfo(t1, t2, rb.toArray(new ObjRelationBean[0]))) {
       Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(true, "修改成功!")));
     } else {
       Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, "修改失败!")));
     }
   } catch (ServiceException se) {
     logger.error(
         "com.isoftstone.framework.modules.web.team.TZeamMainAction.java.modifyTeamMixInfo():"
             + se.getMessage(),
         se); // 代码走查 add by guojian at 2010-11-5 for log4j
     Struts2Utils.renderJson(
         ExtjsHelper.toJsonObjectResult(new Info(false, "数据验证,服务层异常!" + se.getMessage())));
   } catch (Exception e) {
     logger.error(
         "com.isoftstone.framework.modules.web.team.TeamMainAction.java.modifyTeamMixInfo():"
             + e.getMessage()); // 代码走查 add by guojian at 2010-11-5 for log4j
     Struts2Utils.renderJson(ExtjsHelper.toJsonObjectResult(new Info(false, e.getMessage())));
   }
 }