Search in sources :

Example 36 with ResponseBean

use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.

the class PropertiesImplController method updateErp.

/**
 * 功能描述:修改erp接口信息
 *
 * @param uri
 * @param username
 * @param driver
 * @param password
 * @return
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "修改erp接口信息")
@RequestMapping(value = "/updateErp", method = RequestMethod.PUT)
public ResponseBean updateErp(String uri, String username, String driver, String password) {
    ResponseBean responseBean = new ResponseBean<>();
    pp = new Properties();
    fis = PropertiesImplController.class.getClassLoader().getResourceAsStream("mssql-config.properties");
    try {
        pp.load(fis);
        if (!StringUtil.isEmpty(uri)) {
            String url = "jdbc:sqlserver:" + uri;
            pp.setProperty("url", url);
        }
        if (!StringUtil.isEmpty(username)) {
            pp.setProperty("username", username);
        }
        if (!StringUtil.isEmpty(driver)) {
            pp.setProperty("driver", driver);
        }
        if (!StringUtil.isEmpty(password)) {
            pp.setProperty("password", password);
        }
        URL url = PropertiesImplController.class.getClassLoader().getResource("mssql-config.properties");
        os = new FileOutputStream(new File(url.toURI()));
        pp.store(os, "the primary key of article table");
    } catch (URISyntaxException | IOException e) {
        responseBean.setCode(0);
        responseBean.setMsg(e.getMessage());
    } finally {
        try {
            fis.close();
            os.flush();
            os.close();
        } catch (IOException e) {
            responseBean.setCode(0);
            responseBean.setMsg(e.getMessage());
        }
    }
    return responseBean;
}
Also used : FileOutputStream(java.io.FileOutputStream) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) Properties(java.util.Properties) File(java.io.File) URL(java.net.URL) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 37 with ResponseBean

use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.

the class PropertiesImplController method updateMall.

/**
 * 功能描述:修改商城接口信息
 *
 * @param uri
 *            商城接口路径
 * @param appKey
 *            AIP分配给用户的sessionKey
 * @param appSecret
 *            加密代码
 * @param sessionKey
 *            AIP分配给用户的SessionKey(或 Access Token).
 * @return
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "修改商城接口信息")
@RequestMapping(value = "/updateMall", method = RequestMethod.PUT)
public ResponseBean updateMall(String uri, String appKey, String appSecret, String sessionKey) {
    ResponseBean responseBean = new ResponseBean<>();
    pp = new Properties();
    fis = PropertiesImplController.class.getClassLoader().getResourceAsStream("pmphapi-config.properties");
    try {
        pp.load(fis);
        if (!StringUtil.isEmpty(uri)) {
            pp.setProperty("uri", uri);
        }
        if (!StringUtil.isEmpty(appKey)) {
            pp.setProperty("app_key", appKey);
        }
        if (!StringUtil.isEmpty(appSecret)) {
            pp.setProperty("app_secret", appSecret);
        }
        if (!StringUtil.isEmpty(sessionKey)) {
            pp.setProperty("session_key", sessionKey);
        }
        URL url = PropertiesImplController.class.getClassLoader().getResource("pmphapi-config.properties");
        os = new FileOutputStream(new File(url.toURI()));
        pp.store(os, "the primary key of article table");
    } catch (URISyntaxException | IOException e) {
        responseBean.setCode(0);
        responseBean.setMsg(e.getMessage());
    } finally {
        try {
            fis.close();
            os.flush();
            os.close();
        } catch (IOException e) {
            responseBean.setCode(0);
            responseBean.setMsg(e.getMessage());
        }
    }
    return responseBean;
}
Also used : FileOutputStream(java.io.FileOutputStream) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) Properties(java.util.Properties) File(java.io.File) URL(java.net.URL) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 38 with ResponseBean

use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.

the class SchoolAndTeacherCheckController method writerList.

/**
 * <pre>
 * 功能描述:获取教师审核列表
 * 使用示范:
 *
 * @param pageNumber 当前页
 * @param pageSize 页面大小
 * @param writerUserManagerVO
 * @return 分页数据集
 * </pre>
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "查询系统消息列表")
@RequestMapping(value = "/writerList", method = RequestMethod.GET)
public ResponseBean writerList(@RequestParam(name = "pageNumber", defaultValue = "1") Integer pageNumber, @RequestParam(name = "pageSize") Integer pageSize, @RequestParam("realname") String realname, @RequestParam("orgName") String orgName, @RequestParam("progress") Short progress) {
    PageParameter pageParameter = new PageParameter<>();
    WriterUserManagerVO writerUserManagerVO = new WriterUserManagerVO();
    if (StringUtil.notEmpty(orgName)) {
        // 去除空格
        writerUserManagerVO.setOrgName(orgName.replaceAll(" ", ""));
    }
    if (StringUtil.notEmpty(realname)) {
        writerUserManagerVO.setRealname(realname.replaceAll(" ", ""));
    }
    writerUserManagerVO.setProgress(progress);
    pageParameter.setPageNumber(pageNumber);
    pageParameter.setPageSize(pageSize);
    pageParameter.setParameter(writerUserManagerVO);
    return new ResponseBean(writerUserService.getTeacherCheckList(pageParameter));
}
Also used : WriterUserManagerVO(com.bc.pmpheep.back.vo.WriterUserManagerVO) 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 39 with ResponseBean

use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.

the class SchoolAndTeacherCheckController method orgList.

/**
 * <pre>
 * 功能描述:获取学校管理员审核列表
 * 使用示范:
 *
 * @param pageNumber 当前页
 * @param pageSize 页面大小
 * @param orgVO orgVO
 * @return 分页数据集
 * </pre>
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "查询系统消息列表")
@RequestMapping(value = "/orgList", method = RequestMethod.GET)
public ResponseBean orgList(@RequestParam(name = "pageNumber", defaultValue = "1") Integer pageNumber, @RequestParam("orgName") String orgName, @RequestParam("realname") String realname, @RequestParam("progress") Integer progress, @RequestParam(name = "pageSize") Integer pageSize) {
    PageParameter pageParameter = new PageParameter<>();
    OrgVO orgVO = new OrgVO();
    if (StringUtil.notEmpty(orgName)) {
        orgVO.setOrgName(orgName.replaceAll(" ", ""));
    }
    if (StringUtil.notEmpty(realname)) {
        orgVO.setRealname(realname.replaceAll(" ", ""));
    }
    orgVO.setProgress(progress);
    pageParameter.setPageNumber(pageNumber);
    pageParameter.setPageSize(pageSize);
    pageParameter.setParameter(orgVO);
    return new ResponseBean(orgService.getSchoolAdminCheckList(pageParameter));
}
Also used : OrgVO(com.bc.pmpheep.back.vo.OrgVO) 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 40 with ResponseBean

use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.

the class TopicController method listEditors.

/**
 * Description:部门主任获取部门人员信息列表
 *
 * @author:lyc
 * @date:2017年12月27日下午5:02:46
 * @param
 * @return ResponseBean
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "获取部门编辑列表")
@RequestMapping(value = "/listEditors", method = RequestMethod.GET)
public ResponseBean listEditors(Long departmentId, String realName, Integer pageSize, Integer pageNumber) {
    PageParameter<PmphEditorVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
    PmphEditorVO pmphEditorVO = new PmphEditorVO();
    pmphEditorVO.setDepartmentId(departmentId);
    pmphEditorVO.setRealName(realName);
    pageParameter.setParameter(pmphEditorVO);
    return new ResponseBean(pmphUserService.listEditors(pageParameter));
}
Also used : PageParameter(com.bc.pmpheep.back.plugin.PageParameter) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) PmphEditorVO(com.bc.pmpheep.back.vo.PmphEditorVO) LogDetail(com.bc.pmpheep.annotation.LogDetail) 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