Exemplo n.º 1
0
  /** 新增 */
  @Override
  protected void onAdd() throws BusinessException {
    // TODO Auto-generated method stub
    // 检查重名
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("schoolName", this.getSchoolName());
    params.put("areaAbb", this.getDaoAbb());
    List<XjSchoolInfo> xjSchool =
        (List<XjSchoolInfo>) MethodAdapter.invoker(this, "qeuryXjSchools", params);
    if (xjSchool != null && xjSchool.size() > 0) throw new BusinessException("此地区已经存在同名学校,不可增加");

    XjSchoolEntry xjSchoolEntry = new XjSchoolEntry();

    xjSchoolEntry.setId(this.getId());
    xjSchoolEntry.setTownId(this.getTownId());
    xjSchoolEntry.setSchoolName(this.getSchoolName());
    xjSchoolEntry.setSchoolType(this.getSchoolType());
    xjSchoolEntry.setEstablishDate(this.getEstablishDate());
    xjSchoolEntry.setSchoolMode(this.getSchoolMode());
    xjSchoolEntry.setAddress(this.getAddress());
    xjSchoolEntry.setSchoolClass(this.getSchoolClass());
    xjSchoolEntry.setSchoolBank(this.getSchoolBank());
    xjSchoolEntry.setSchoolAddr(this.getSchoolAddr());
    xjSchoolEntry.setPostCode(this.getPostCode());
    xjSchoolEntry.setPhone(this.getPhone());
    xjSchoolEntry.setWebsite(this.getWebsite());
    xjSchoolEntry.setEmail(this.getEmail());
    xjSchoolEntry.setSchoolMaster(this.getSchoolMaster());
    xjSchoolEntry.setMobie(this.getMobie());
    xjSchoolEntry.setLearnyear(this.getLearnyear());
    xjSchoolEntry.setAreaId(this.getAreaId());
    xjSchoolEntry.setSection(this.getSection());
    xjSchoolEntry.setCreateTime(this.getCreateTime());
    xjSchoolEntry.setAdcEcCode(this.getAdcEcCode());
    xjSchoolEntry.setSchCode(this.getSchCode());
    xjSchoolEntry.setShortName(this.getShortName());
    xjSchoolEntry.setIsLong(this.getIsLong());
    XjSchoolMapper xjSchoolMapper =
        SpringUtil.getSpringBean(XjSchoolMapper.class, "xjSchoolMapper");
    xjSchoolMapper.insertXjSchool(xjSchoolEntry);
    xjSchoolEntry = null;
  }