Search in sources :

Example 16 with ResponseBean

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));
}
Also used : PmphGroup(com.bc.pmpheep.back.po.PmphGroup) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) LogDetail(com.bc.pmpheep.annotation.LogDetail) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 17 with ResponseBean

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;
    }
}
Also used : ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) IOException(java.io.IOException) IOException(java.io.IOException) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 18 with 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));
}
Also used : MaterialListVO(com.bc.pmpheep.back.vo.MaterialListVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 19 with ResponseBean

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));
}
Also used : OrgAndOrgUserVO(com.bc.pmpheep.back.vo.OrgAndOrgUserVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) LogDetail(com.bc.pmpheep.annotation.LogDetail) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 20 with ResponseBean

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();
}
Also used : HttpSession(javax.servlet.http.HttpSession) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)67 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)67 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)65 LogDetail (com.bc.pmpheep.annotation.LogDetail)61 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)37 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)11 IOException (java.io.IOException)11 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 TopicLog (com.bc.pmpheep.back.po.TopicLog)5 DesRun (com.bc.pmpheep.back.util.DesRun)4 Properties (java.util.Properties)4 BookVideo (com.bc.pmpheep.back.po.BookVideo)3 PmphGroupMember (com.bc.pmpheep.back.po.PmphGroupMember)3 PmphUser (com.bc.pmpheep.back.po.PmphUser)3 Topic (com.bc.pmpheep.back.po.Topic)3 PmphGroup (com.bc.pmpheep.back.po.PmphGroup)2 PmphRole (com.bc.pmpheep.back.po.PmphRole)2 WriterUser (com.bc.pmpheep.back.po.WriterUser)2 DeclarationResultSchoolVO (com.bc.pmpheep.back.vo.DeclarationResultSchoolVO)2