Search in sources :

Example 21 with LogDetail

use of com.bc.pmpheep.annotation.LogDetail in project pmph by BCSquad.

the class GroupController method groupMember.

/**
 * 功能描述:添加小组成员
 *
 * @param pmphGroupMembers
 *            需要小组Id 成员Id 是否作家用户
 * @return 是否成功
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "添加小组成员")
@RequestMapping(value = "/add/groupMember", method = RequestMethod.POST)
public ResponseBean groupMember(Long groupId, String pmphGroupMembers, HttpServletRequest request) {
    Gson gson = new Gson();
    Type type = new TypeToken<ArrayList<PmphGroupMember>>() {
    }.getType();
    List<PmphGroupMember> list = gson.fromJson(pmphGroupMembers, type);
    String sessionId = CookiesUtil.getSessionId(request);
    return new ResponseBean(pmphGroupMemberService.addPmphGroupMembers(groupId, list));
}
Also used : Type(java.lang.reflect.Type) PmphGroupMember(com.bc.pmpheep.back.po.PmphGroupMember) ArrayList(java.util.ArrayList) Gson(com.google.gson.Gson) 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 22 with LogDetail

use of com.bc.pmpheep.annotation.LogDetail in project pmph by BCSquad.

the class GroupController method identity.

/**
 * 功能描述:批量修改小组成员权限
 *
 * @param listPar
 *            成员id
 * @return 是否成功
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "批量修改小组成员权限")
@RequestMapping(value = "/update/identity", method = RequestMethod.PUT)
public ResponseBean identity(Long groupId, String pmphGroupMembers, HttpServletRequest request) {
    Gson gson = new Gson();
    Type type = new TypeToken<ArrayList<PmphGroupMember>>() {
    }.getType();
    List<PmphGroupMember> list = gson.fromJson(pmphGroupMembers, type);
    String sessionId = CookiesUtil.getSessionId(request);
    return new ResponseBean(pmphGroupMemberService.updateMemberIdentity(groupId, list, sessionId));
}
Also used : Type(java.lang.reflect.Type) PmphGroupMember(com.bc.pmpheep.back.po.PmphGroupMember) ArrayList(java.util.ArrayList) Gson(com.google.gson.Gson) 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 23 with LogDetail

use of com.bc.pmpheep.annotation.LogDetail 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 24 with LogDetail

use of com.bc.pmpheep.annotation.LogDetail 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 25 with LogDetail

use of com.bc.pmpheep.annotation.LogDetail 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)

Aggregations

LogDetail (com.bc.pmpheep.annotation.LogDetail)83 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)82 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)71 ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)61 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)43 IOException (java.io.IOException)28 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)24 OutputStream (java.io.OutputStream)18 BufferedOutputStream (java.io.BufferedOutputStream)17 Workbook (org.apache.poi.ss.usermodel.Workbook)15 UnsupportedEncodingException (java.io.UnsupportedEncodingException)14 ArrayList (java.util.ArrayList)7 Material (com.bc.pmpheep.back.po.Material)6 TopicLog (com.bc.pmpheep.back.po.TopicLog)5 HashMap (java.util.HashMap)4 Properties (java.util.Properties)4 BookVideo (com.bc.pmpheep.back.po.BookVideo)3 PmphGroupMember (com.bc.pmpheep.back.po.PmphGroupMember)3 Topic (com.bc.pmpheep.back.po.Topic)3 DeclarationResultSchoolVO (com.bc.pmpheep.back.vo.DeclarationResultSchoolVO)3