Organization so = organizationDao.getOrganizationById(Long.parseLong(ssjg));
uo.setSsjg(so);
}
//负责人
User u = null;
if(!StrUtil.isNullStr(jgfzr))
{
u = userDao.findUserByUserName(jgfzr);
if(uo.getJgfzr() != null)
{
if(u.getId() != uo.getJgfzr().getId())
{
u.setUsertype(Long.parseLong(jglx));
}
uo.setJgfzr(u);
}
}
organizationDao.updateOrganization(uo);
if (!StrUtil.isNullStr(posturl)){
return new ModelAndView(posturl).addObject("ErrMsg", "修改成功");
}
return new ModelAndView(new RedirectView("../page/management/organization/list_organization.jsp"));
}
Organization org = new Organization();
org.setJGMC(jgmc);
org.setJGDH(jgdh);
org.setJGSZDZ(jgszdz);
org.setJGSZQY(jgszqy);
org.setJGLX(jglx);
org.setJGTJR(rtUser);
org.setJGTJSJ(new Date());
org.setDELETEFLAG("0");
User u = null;
if(!StrUtil.isNullStr(jgfzr))
{
u = userDao.findUserByUserName(jgfzr);
u.setUsertype(Long.parseLong(jglx));
org.setJgfzr(u);
}
if(!StrUtil.isNullStr(ssjg) && !"0".equals(ssjg))
{
Organization sj = organizationDao.getOrganizationById(Long.parseLong(ssjg));
org.setSsjg(sj);
}
organizationDao.createOrganization(org);
if(u != null)
{
u.setOrganizationid(org.getID());
userDao.updateUser(u);
}
return new ModelAndView(new RedirectView("../page/management/organization/list_organization.jsp"));
}