use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class GroupController method pmphGroup.
/**
* 根据小组名称模糊查询获取当前用户的小组
*
* @author Mryang
* @param pmphGroup
* @return
* @createDate 2017年9月21日 下午4:02:57
*/
@RequestMapping(value = "/list/pmphGroup", method = RequestMethod.GET)
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "根据小组名称模糊查询获取当前用户的小组")
@ResponseBody
public ResponseBean pmphGroup(@RequestParam(name = "groupName", defaultValue = "") String groupName, HttpServletRequest request) {
/*
* --------- 以下是正确的示例 ---------
*
* 在ResponseBean初始化时,通过ResponseBeanAop对其构造函数进行切面编程,
* 因此返回时<务必>要使用ResponseBean的构造函数即 new ResponseBean(anything)
*/
PmphGroup pmphGroup = new PmphGroup();
if (StringUtil.isEmpty(groupName)) {
pmphGroup.setGroupName(groupName.trim());
}
String sessionId = CookiesUtil.getSessionId(request);
return new ResponseBean(pmphGroupService.listPmphGroup(pmphGroup, sessionId));
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class MaterialController method add.
/**
* 新建遴选公告
*
* @param sessionId
* @param material
* 教材对象
* @param materialContacts
* 多个教材联系人
* @param materialExtensions
* 多个教材扩展项
* @param MaterialProjectEditors
* 多个教材扩项目编辑
* @param materialExtra
* 教材通知备
* @param materialNoticeAttachments
* 多个教材通知
* @param noticeFiles
* 通知文件
* @param materialNoteAttachments
* 多个教材备注
* @param noteFiles
* 备注文件
* @return
*/
@ResponseBody
@LogDetail(businessType = Business_Type, logRemark = "新建遴选公告")
@RequestMapping(value = "/add", method = RequestMethod.POST)
public ResponseBean add(HttpServletRequest request, MaterialVO materialVO, // MultipartFile[] noteFiles,
String deadline, String actualDeadline, String ageDeadline) {
try {
materialVO.getMaterial().setDeadline(DateUtil.str3Date(deadline));
materialVO.getMaterial().setActualDeadline(DateUtil.str3Date(actualDeadline));
materialVO.getMaterial().setAgeDeadline(DateUtil.str3Date(ageDeadline));
return new ResponseBean(materialService.addOrUpdateMaterial(request, materialVO, // noteFiles,
false));
} catch (IOException e) {
ResponseBean responseBean = new ResponseBean(e);
responseBean.setData("上传文件失败");
return responseBean;
} catch (Exception e) {
ResponseBean responseBean = new ResponseBean(e);
responseBean.setData(e.getMessage());
return responseBean;
}
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class MaterialController method list.
/**
* 功能描述:初始化/条件查询教材列表
*
* @param request
* @param pageSize
* 当前页条数
* @param pageNumber
* 当前页数
* @param isMy
* 是否我的
* @param state
* 当前状态
* @param materialName
* 教材名称
* @param contactUserName
* 联系人名称
* @return
*/
@ResponseBody
@LogDetail(businessType = Business_Type, logRemark = "查询教材公告列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ResponseBean list(HttpServletRequest request, Integer pageSize, Integer pageNumber, Boolean isMy, String state, String materialName, String contactUserName) {
String sessionId = CookiesUtil.getSessionId(request);
PageParameter<MaterialListVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
MaterialListVO materialListVO = new MaterialListVO();
materialListVO.setIsMy(isMy);
materialListVO.setState(state);
materialListVO.setContactUserName(contactUserName);
materialListVO.setMaterialName(materialName);
pageParameter.setParameter(materialListVO);
return new ResponseBean(materialService.listMaterials(pageParameter, sessionId));
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class OrgUserController method allOrgUser.
/**
* Description:分页查询机构用户
*
* @author:lyc
* @date:2017年9月26日下午5:43:59
* @Param: OrgUserManagerVO
* @Return:分页数据集
*/
@RequestMapping(value = "/list/allOrgUser", method = RequestMethod.GET)
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "分页查询机构用户")
@ResponseBody
public ResponseBean allOrgUser(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("name") String name, @RequestParam("orgName") String orgName) {
PageParameter pageParameter = new PageParameter<>();
OrgAndOrgUserVO orgAndOrgUserVO = new OrgAndOrgUserVO();
if (StringUtil.notEmpty(orgName)) {
orgAndOrgUserVO.setOrgName(StringUtil.toAllCheck(orgName));
}
if (StringUtil.notEmpty(name)) {
// 去除空格
orgAndOrgUserVO.setName(StringUtil.toAllCheck(name));
}
pageParameter.setPageNumber(pageNumber);
pageParameter.setPageSize(pageSize);
pageParameter.setParameter(orgAndOrgUserVO);
return new ResponseBean(orgUserService.getListAllOrgUser(pageParameter));
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class PmphLoginController method logout.
/**
* <pre>
* 功能描述:退出
* 使用示范:
*
* @param model
* @return
* </pre>
*/
@ResponseBody
@RequestMapping(value = "/logout", method = RequestMethod.GET)
public ResponseBean logout(HttpServletRequest request, HttpServletResponse response, @RequestParam("loginType") Short loginType) {
// HttpSingleSignOnService service = new HttpSingleSignOnService();
String sessionId = CookiesUtil.getSessionId(request);
HttpSession session = SessionContext.getSession(sessionId);
if (ObjectUtil.notNull(session)) {
if (Const.LOGIN_TYPE_PMPH == loginType) {
session.invalidate();
}
// try {
// response.sendRedirect(service.getSingleSignOutURL());
// } catch (IOException e) {
// return new ResponseBean(e);
// }
}
return new ResponseBean();
}
Aggregations