Commit 76d28cbd139a64adc41fd692eacea1e3ec78f7c1
1 parent
a1a7e400
update
Showing
15 changed files
with
319 additions
and
421 deletions
src/main/java/com/cnlive/shenhe/api/ChannelControllerApi.java
| ... | ... | @@ -11,24 +11,17 @@ import com.cnlive.shenhe.utils.CommonUtils; |
| 11 | 11 | import org.slf4j.Logger; |
| 12 | 12 | import org.slf4j.LoggerFactory; |
| 13 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | -import org.springframework.beans.factory.annotation.Value; | |
| 15 | 14 | import org.springframework.stereotype.Controller; |
| 16 | -import org.springframework.web.bind.annotation.GetMapping; | |
| 17 | 15 | import org.springframework.web.bind.annotation.PostMapping; |
| 18 | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | 17 | import org.springframework.web.bind.annotation.ResponseBody; |
| 20 | 18 | |
| 21 | -import java.util.HashMap; | |
| 22 | 19 | import java.util.List; |
| 23 | -import java.util.Map; | |
| 24 | 20 | |
| 25 | 21 | @Controller |
| 26 | 22 | @RequestMapping("/api/channel") |
| 27 | 23 | public class ChannelControllerApi { |
| 28 | 24 | private static Logger logger = LoggerFactory.getLogger(ChannelControllerApi.class); |
| 29 | - | |
| 30 | - @Autowired | |
| 31 | - AuditPass Pass; | |
| 32 | 25 | @Autowired |
| 33 | 26 | ChannelServiceImpl channelService; |
| 34 | 27 | |
| ... | ... | @@ -46,51 +39,48 @@ public class ChannelControllerApi { |
| 46 | 39 | ShyChannel shyChannel = new ShyChannel(); |
| 47 | 40 | shyChannel.setChannel_id(json.getString("channelId")); |
| 48 | 41 | List<ShyChannel> channelList = channelService.findshyChannel(shyChannel); |
| 49 | - | |
| 50 | - Integer sp_id=null; | |
| 42 | + | |
| 43 | + Integer spId; | |
| 51 | 44 | try { |
| 52 | - sp_id=json.getInteger("spId"); | |
| 53 | - } catch (Exception e) { | |
| 54 | - sp_id=null; | |
| 55 | - } | |
| 45 | + spId = json.getInteger("spId"); | |
| 46 | + } catch (Exception e) { | |
| 47 | + spId = null; | |
| 48 | + } | |
| 56 | 49 | //存在则更新 |
| 57 | 50 | if (channelList.size() > 0) { |
| 58 | 51 | ShyChannel shyChannel1 = channelList.get(0); |
| 59 | 52 | shyChannel1.setShenhe_status(CommonConst.AUDIT_INTT); |
| 60 | - shyChannel1.setChannel_name(json.getString("channelName")); | |
| 53 | + shyChannel1.setChannel_name(json.getString("channelName")); | |
| 61 | 54 | shyChannel1.setChannel_img(json.getString("face")); |
| 62 | 55 | shyChannel1.setCallback(json.getString("callback")); |
| 63 | - shyChannel1.setSp_id(sp_id); | |
| 64 | -// shyChannel1.setAuditor(null); | |
| 65 | -// shyChannel1.setUpdater(null); | |
| 66 | - shyChannel1.setOffline(0);//是否下线 0表示正常 1表示下线 | |
| 56 | + shyChannel1.setSp_id(spId); | |
| 57 | + //是否下线 0表示正常 1表示下线 | |
| 58 | + shyChannel1.setOffline(0); | |
| 67 | 59 | shyChannel1.setUpdated_at(CommonUtils.getCurrentTime()); |
| 68 | 60 | channelService.getShenheType(shyChannel1); |
| 69 | 61 | boolean YorN = channelService.updateshyChannel(shyChannel1); |
| 70 | - if (YorN == true) { | |
| 71 | - return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(),"审核请求收到成功"); | |
| 72 | - } else { | |
| 73 | - return new ResponseBean(ErrorEnum.ERROR.getErrorCode(),"审核请求收到失败(更新)"); | |
| 62 | + if (YorN) { | |
| 63 | + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功"); | |
| 74 | 64 | } |
| 65 | + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "审核请求收到失败(更新)"); | |
| 75 | 66 | } |
| 76 | 67 | //如果不存在直接插入 |
| 77 | 68 | shyChannel.setShenhe_status(CommonConst.AUDIT_INTT); |
| 78 | - shyChannel.setChannel_name(json.getString("channelName")); | |
| 69 | + shyChannel.setChannel_name(json.getString("channelName")); | |
| 79 | 70 | shyChannel.setChannel_img(json.getString("face")); |
| 80 | 71 | shyChannel.setCallback(json.getString("callback")); |
| 81 | - shyChannel.setSp_id(sp_id); | |
| 82 | - shyChannel.setOffline(0);//是否下线 0表示正常 1表示下线 | |
| 72 | + shyChannel.setSp_id(spId); | |
| 73 | + //是否下线 0表示正常 1表示下线 | |
| 74 | + shyChannel.setOffline(0); | |
| 83 | 75 | shyChannel.setCreated_at(CommonUtils.getCurrentTime()); |
| 84 | 76 | shyChannel.setUpdated_at(CommonUtils.getCurrentTime()); |
| 85 | 77 | channelService.getShenheType(shyChannel); |
| 86 | 78 | boolean YorN = channelService.impotChannel(shyChannel); |
| 87 | - if (YorN == true) { | |
| 88 | - return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(),"审核请求收到成功"); | |
| 89 | - } else { | |
| 90 | - return new ResponseBean(ErrorEnum.ERROR.getErrorCode(),"审核请求收到失败(新增)"); | |
| 79 | + if (YorN) { | |
| 80 | + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功"); | |
| 91 | 81 | } |
| 82 | + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "审核请求收到失败(新增)"); | |
| 92 | 83 | } |
| 93 | - | |
| 94 | - | |
| 84 | + | |
| 95 | 85 | |
| 96 | 86 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/AudioController.java
| ... | ... | @@ -98,7 +98,7 @@ public class AudioController extends BaseController { |
| 98 | 98 | if (CommonUtils.isNotNull(shySite)) { |
| 99 | 99 | spid = shySite.getSpid(); |
| 100 | 100 | } else { |
| 101 | - setmodel_site(model); | |
| 101 | + setmodelSite(model); | |
| 102 | 102 | return "error.html"; |
| 103 | 103 | } |
| 104 | 104 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/BaseController.java
| 1 | 1 | package com.cnlive.shenhe.controller; |
| 2 | 2 | |
| 3 | -import java.io.IOException; | |
| 3 | +import com.cnlive.shenhe.bean.SessionUser; | |
| 4 | +import org.springframework.ui.Model; | |
| 5 | +import org.springframework.web.context.request.RequestContextHolder; | |
| 6 | +import org.springframework.web.context.request.ServletRequestAttributes; | |
| 4 | 7 | |
| 5 | 8 | import javax.servlet.http.HttpServletRequest; |
| 6 | 9 | import javax.servlet.http.HttpServletResponse; |
| 7 | 10 | import javax.servlet.http.HttpSession; |
| 8 | 11 | |
| 9 | -import org.springframework.stereotype.Controller; | |
| 10 | -import org.springframework.ui.Model; | |
| 11 | -import org.springframework.web.bind.annotation.GetMapping; | |
| 12 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 13 | -import org.springframework.web.context.request.RequestContextHolder; | |
| 14 | -import org.springframework.web.context.request.ServletRequestAttributes; | |
| 15 | -import org.springframework.web.servlet.ModelAndView; | |
| 12 | +public class BaseController { | |
| 16 | 13 | |
| 17 | -import com.cnlive.shenhe.bean.SessionUser; | |
| 18 | -import com.cnlive.shenhe.utils.CommonUtils; | |
| 19 | 14 | |
| 20 | -@Controller | |
| 21 | -public class BaseController { | |
| 15 | + /** | |
| 16 | + * 得到request对象 | |
| 17 | + */ | |
| 18 | + public HttpServletRequest getRequest() { | |
| 19 | + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |
| 20 | + return request; | |
| 21 | + } | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 得到response对象 | |
| 25 | + */ | |
| 26 | + public HttpServletResponse getResponse() { | |
| 27 | + HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse(); | |
| 28 | + return response; | |
| 29 | + } | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 得到session对象 | |
| 33 | + */ | |
| 34 | + public HttpSession getsession() { | |
| 35 | + HttpSession session = this.getRequest().getSession(); | |
| 36 | + return session; | |
| 37 | + } | |
| 22 | 38 | |
| 23 | - | |
| 24 | - /** | |
| 25 | - * 得到request对象 | |
| 26 | - */ | |
| 27 | - public HttpServletRequest getRequest() { | |
| 28 | - HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | |
| 29 | - return request; | |
| 30 | - } | |
| 31 | - /** | |
| 32 | - * 得到response对象 | |
| 33 | - */ | |
| 34 | - public HttpServletResponse getResponse() { | |
| 35 | - HttpServletResponse response = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse(); | |
| 36 | - return response; | |
| 37 | - } | |
| 38 | - | |
| 39 | - /** | |
| 40 | - * 得到session对象 | |
| 41 | - */ | |
| 42 | - public HttpSession getsession() { | |
| 43 | - HttpSession session = this.getRequest().getSession(); | |
| 44 | - return session; | |
| 45 | - } | |
| 46 | - | |
| 47 | - | |
| 48 | - /** | |
| 49 | - * 获取session中的用户 | |
| 50 | - * @return | |
| 51 | - */ | |
| 52 | - public SessionUser getSessionUser(){ | |
| 53 | - SessionUser sessionUser = (SessionUser) this.getsession().getAttribute(SessionUser.getSessionKey()); | |
| 54 | - return sessionUser; | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * 获取session中的用户 | |
| 42 | + * | |
| 43 | + * @return | |
| 44 | + */ | |
| 45 | + public SessionUser getSessionUser() { | |
| 46 | + SessionUser sessionUser = (SessionUser) this.getsession().getAttribute(SessionUser.getSessionKey()); | |
| 47 | + return sessionUser; | |
| 55 | 48 | } |
| 56 | - | |
| 49 | + | |
| 57 | 50 | /** |
| 58 | 51 | * 获取session中的用户id |
| 52 | + * | |
| 59 | 53 | * @return |
| 60 | 54 | */ |
| 61 | - public String getSessionUserId(){ | |
| 62 | - SessionUser sessionUser = getSessionUser(); | |
| 63 | - if(sessionUser != null) return sessionUser.getUserId(); | |
| 64 | - return null; | |
| 55 | + public String getSessionUserId() { | |
| 56 | + SessionUser sessionUser = getSessionUser(); | |
| 57 | + if (sessionUser != null) return sessionUser.getUserId(); | |
| 58 | + return null; | |
| 59 | + } | |
| 60 | + | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 设置用户session | |
| 64 | + */ | |
| 65 | + public void setSessionUser(SessionUser sessionUser) { | |
| 66 | + this.getsession().setAttribute("", null); | |
| 67 | + } | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 设置报错页面显示信息——站点查询失败 | |
| 71 | + * | |
| 72 | + * @param model | |
| 73 | + */ | |
| 74 | + public void setmodelSite(Model model) { | |
| 75 | + model.addAttribute("errorMessage", "站点查询失败,不存在此站点,请重新查询!"); | |
| 76 | + model.addAttribute("remindMessage", "提示:站点查询请输入全称,不支持模糊查询"); | |
| 77 | + } | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * 设置报错页面显示信息——参数校验失败 | |
| 81 | + * | |
| 82 | + * @param model | |
| 83 | + * @param value 不能为空的参数 | |
| 84 | + */ | |
| 85 | + public void setmodelParam(Model model, String value) { | |
| 86 | + model.addAttribute("errorMessage", "参数传递不能为空!" + value); | |
| 87 | + model.addAttribute("remindMessage", "提示:请检查所传参数,存在非空参数未赋值"); | |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * 设置报错页面显示信息——入库结果失败 | |
| 92 | + * | |
| 93 | + * @param model | |
| 94 | + */ | |
| 95 | + public void setmodelResult(Model model) { | |
| 96 | + model.addAttribute("errorMessage", "数据入库失败,请重试!"); | |
| 97 | + model.addAttribute("remindMessage", "提示:如连续两次以上入库失败,请联系开发人员"); | |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * 设置报错页面显示信息——权限不足 | |
| 102 | + * | |
| 103 | + * @param model | |
| 104 | + */ | |
| 105 | + public void setmodelLimit(Model model) { | |
| 106 | + model.addAttribute("errorMessage", "您没有此操作的权限,请重试或者联系管理员开通!"); | |
| 65 | 107 | } |
| 66 | - | |
| 67 | - | |
| 68 | - /** | |
| 69 | - * 设置用户session | |
| 70 | - * @param teacher | |
| 71 | - */ | |
| 72 | - public void setSessionUser(SessionUser sessionUser){ | |
| 73 | - this.getsession().setAttribute("",null); | |
| 74 | - } | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * 设置报错页面显示信息——站点查询失败 | |
| 78 | - * @param model | |
| 79 | - */ | |
| 80 | - public void setmodel_site(Model model){ | |
| 81 | - model.addAttribute("errorMessage", "站点查询失败,不存在此站点,请重新查询!"); | |
| 82 | - model.addAttribute("remindMessage", "提示:站点查询请输入全称,不支持模糊查询"); | |
| 83 | - } | |
| 84 | - /** | |
| 85 | - * 设置报错页面显示信息——参数校验失败 | |
| 86 | - * @param model | |
| 87 | - * @param value 不能为空的参数 | |
| 88 | - */ | |
| 89 | - public void setmodel_param(Model model,String value){ | |
| 90 | - model.addAttribute("errorMessage", "参数传递不能为空!"+value); | |
| 91 | - model.addAttribute("remindMessage", "提示:请检查所传参数,存在非空参数未赋值"); | |
| 92 | - } | |
| 93 | - | |
| 94 | - /** | |
| 95 | - * 设置报错页面显示信息——入库结果失败 | |
| 96 | - * @param model | |
| 97 | - */ | |
| 98 | - public void setmodel_result(Model model){ | |
| 99 | - model.addAttribute("errorMessage", "数据入库失败,请重试!"); | |
| 100 | - model.addAttribute("remindMessage", "提示:如连续两次以上入库失败,请联系开发人员"); | |
| 101 | - } | |
| 102 | - /** | |
| 103 | - * 设置报错页面显示信息——权限不足 | |
| 104 | - * @param model | |
| 105 | - */ | |
| 106 | - public void setmodel_limit(Model model){ | |
| 107 | - model.addAttribute("errorMessage", "您没有此操作的权限,请重试或者联系管理员开通!"); | |
| 108 | - } | |
| 109 | - | |
| 108 | + | |
| 110 | 109 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
| ... | ... | @@ -5,12 +5,9 @@ import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | 6 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | 7 | import com.cnlive.shenhe.entity.ShyChannel; |
| 8 | -import com.cnlive.shenhe.entity.ShyContent; | |
| 9 | 8 | import com.cnlive.shenhe.entity.ShySites; |
| 10 | 9 | import com.cnlive.shenhe.entity.ShyUsers; |
| 11 | -import com.cnlive.shenhe.entity.ShyVideos; | |
| 12 | 10 | import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl; |
| 13 | -import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; | |
| 14 | 11 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 15 | 12 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 16 | 13 | import com.cnlive.shenhe.utils.AuditPass; |
| ... | ... | @@ -37,7 +34,7 @@ import java.util.Map; |
| 37 | 34 | public class ChannelController extends BaseController { |
| 38 | 35 | private static Logger logger = LoggerFactory.getLogger(ChannelController.class); |
| 39 | 36 | @Value("${spring.localhost.url}") |
| 40 | - private String localhost_url;//本机地址 | |
| 37 | + private String localhost_url;//本机地址 | |
| 41 | 38 | @Autowired |
| 42 | 39 | AuditPass Pass; |
| 43 | 40 | @Autowired |
| ... | ... | @@ -45,47 +42,43 @@ public class ChannelController extends BaseController { |
| 45 | 42 | |
| 46 | 43 | @Autowired |
| 47 | 44 | UsersServiceImpl usersService; |
| 48 | - | |
| 45 | + | |
| 49 | 46 | @Autowired |
| 50 | 47 | SitesServiceImpl sitesService; |
| 51 | 48 | |
| 52 | - /** | |
| 53 | - * 评论列表页 | |
| 54 | - * | |
| 55 | - * @param model | |
| 56 | - * @param channelId | |
| 57 | - * @param channelName | |
| 58 | - * @param offline | |
| 59 | - * @param start_date | |
| 60 | - * @param end_date | |
| 61 | - * @param state | |
| 62 | - * @param sp_desc | |
| 63 | - * @param page | |
| 64 | - * @param pageSize | |
| 65 | - * @param orderByClause | |
| 66 | - * @param session | |
| 67 | - * @return | |
| 68 | - */ | |
| 49 | + /** | |
| 50 | + * 评论列表页 | |
| 51 | + * | |
| 52 | + * @param model | |
| 53 | + * @param start_date | |
| 54 | + * @param end_date | |
| 55 | + * @param sp_desc | |
| 56 | + * @param page | |
| 57 | + * @param pageSize | |
| 58 | + * @param orderByClause | |
| 59 | + * @param session | |
| 60 | + * @return | |
| 61 | + */ | |
| 69 | 62 | @GetMapping("/page") |
| 70 | 63 | public String getPage(Model model, String channel_id, String channel_name, Integer receive, |
| 71 | - String start_date, String end_date,Integer shenhe_status, String sp_desc, | |
| 64 | + String start_date, String end_date, Integer shenhe_status, String sp_desc, | |
| 72 | 65 | Integer page, Integer pageSize, String orderByClause, HttpSession session) { |
| 73 | 66 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 74 | - if(CommonUtils.isNull(sessionUser)){ | |
| 75 | - return "redirect:/users/login"; | |
| 67 | + if (CommonUtils.isNull(sessionUser)) { | |
| 68 | + return "redirect:/users/login"; | |
| 76 | 69 | } |
| 77 | 70 | Integer spid = sessionUser.getSpid(); |
| 78 | 71 | String userId = sessionUser.getUserId(); |
| 79 | 72 | if (CommonUtils.isNull(page)) page = 1; |
| 80 | 73 | if (CommonUtils.isNull(pageSize)) pageSize = 10; |
| 81 | 74 | if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { |
| 82 | - ShySites shySite=sitesService.findspidBySpdesc(sp_desc); | |
| 83 | - if(CommonUtils.isNotNull(shySite)){ | |
| 84 | - spid = shySite.getSpid(); | |
| 85 | - }else{ | |
| 86 | - setmodel_site(model); | |
| 87 | - return "error.html"; | |
| 88 | - } | |
| 75 | + ShySites shySite = sitesService.findspidBySpdesc(sp_desc); | |
| 76 | + if (CommonUtils.isNotNull(shySite)) { | |
| 77 | + spid = shySite.getSpid(); | |
| 78 | + } else { | |
| 79 | + setmodelSite(model); | |
| 80 | + return "error.html"; | |
| 81 | + } | |
| 89 | 82 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { |
| 90 | 83 | spid = null; |
| 91 | 84 | } |
| ... | ... | @@ -108,31 +101,31 @@ public class ChannelController extends BaseController { |
| 108 | 101 | List<ShyChannel> list = channelPage.getList(); |
| 109 | 102 | if (!list.isEmpty()) { |
| 110 | 103 | for (ShyChannel channel : list) { |
| 111 | - if (channel.getShenhe_status() != CommonConst.AUDIT_INTT) { | |
| 112 | - String updater = CommonUtils.isEmpty(channel.getUpdater()) || "null".equals(channel.getUpdater())? "白名单":channel.getUpdater(); | |
| 104 | + if (!channel.getShenhe_status().equals(CommonConst.AUDIT_INTT)) { | |
| 105 | + String updater = CommonUtils.isEmpty(channel.getUpdater()) || "null".equals(channel.getUpdater()) ? "白名单" : channel.getUpdater(); | |
| 113 | 106 | String auditor_id = channel.getAuditor(); |
| 114 | 107 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 115 | 108 | ShyUsers user = new ShyUsers(); |
| 116 | 109 | user.setUser_id(auditor_id); |
| 117 | 110 | user = usersService.select(user); |
| 118 | 111 | if (CommonUtils.isNotNull(user)) { |
| 119 | - String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 112 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 120 | 113 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| 121 | - updater = userName ; | |
| 114 | + updater = userName; | |
| 122 | 115 | } |
| 123 | 116 | } |
| 124 | 117 | channel.setUpdater(updater); |
| 125 | 118 | } |
| 126 | - if(null!=channel.getSp_id()){ | |
| 127 | - //显示spid简称 | |
| 128 | - ShySites shySites = sitesService.findspidDescByspid(channel.getSp_id()); | |
| 129 | - if (CommonUtils.isNotNull(shySites)) { | |
| 130 | - channel.setSp_desc(shySites.getName()); | |
| 131 | - } | |
| 132 | - }else{ | |
| 133 | - channel.setSp_desc("sp无法显示"); | |
| 119 | + if (null != channel.getSp_id()) { | |
| 120 | + //显示spid简称 | |
| 121 | + ShySites shySites = sitesService.findspidDescByspid(channel.getSp_id()); | |
| 122 | + if (CommonUtils.isNotNull(shySites)) { | |
| 123 | + channel.setSp_desc(shySites.getName()); | |
| 124 | + } | |
| 125 | + } else { | |
| 126 | + channel.setSp_desc("sp无法显示"); | |
| 134 | 127 | } |
| 135 | - | |
| 128 | + | |
| 136 | 129 | } |
| 137 | 130 | } |
| 138 | 131 | /* 获取参数值给前台 用来判断是否需要把查看显示出来 state recive*/ |
| ... | ... | @@ -168,7 +161,7 @@ public class ChannelController extends BaseController { |
| 168 | 161 | public ResponseBean pass(String ids, HttpSession session) { |
| 169 | 162 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 170 | 163 | String userId = sessionUser.getUserId(); |
| 171 | - boolean success = channelService.updateState(ids, CommonConst.AUDIT_SUCCESS, userId,"","审核通过"); | |
| 164 | + boolean success = channelService.updateState(ids, CommonConst.AUDIT_SUCCESS, userId, "", "审核通过"); | |
| 172 | 165 | if (success) { |
| 173 | 166 | return new ResponseBean(); |
| 174 | 167 | } else { |
| ... | ... | @@ -187,7 +180,7 @@ public class ChannelController extends BaseController { |
| 187 | 180 | public ResponseBean refuse(String ids, String msg, HttpSession session) { |
| 188 | 181 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 189 | 182 | String userId = sessionUser.getUserId(); |
| 190 | - boolean success = channelService.updateState(ids, CommonConst.AUDIT_REFUSE, userId,"",msg); | |
| 183 | + boolean success = channelService.updateState(ids, CommonConst.AUDIT_REFUSE, userId, "", msg); | |
| 191 | 184 | if (success) { |
| 192 | 185 | return new ResponseBean(); |
| 193 | 186 | } else { |
| ... | ... | @@ -255,8 +248,8 @@ public class ChannelController extends BaseController { |
| 255 | 248 | } |
| 256 | 249 | return responseBean; |
| 257 | 250 | } |
| 258 | - | |
| 259 | - | |
| 251 | + | |
| 252 | + | |
| 260 | 253 | /** |
| 261 | 254 | * @Auther: liwei |
| 262 | 255 | * @Date: 2019/08/17 11:17 |
| ... | ... | @@ -264,20 +257,20 @@ public class ChannelController extends BaseController { |
| 264 | 257 | */ |
| 265 | 258 | @GetMapping("/channelNotice") |
| 266 | 259 | @ResponseBody |
| 267 | - public Map<String,Object> channelNotice() { | |
| 268 | - Map<String,Object> map=new HashMap<>(); | |
| 269 | - ShyChannel shyChannel = new ShyChannel(); | |
| 260 | + public Map<String, Object> channelNotice() { | |
| 261 | + Map<String, Object> map = new HashMap<>(); | |
| 262 | + ShyChannel shyChannel = new ShyChannel(); | |
| 270 | 263 | shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审 |
| 271 | 264 | shyChannel.setShenhe_status(CommonConst.AUDIT_INTT); |
| 272 | 265 | List<ShyChannel> channelList = channelService.findshyChannel(shyChannel); |
| 273 | 266 | if (channelList.size() > 0) { |
| 274 | - logger.info("您有"+channelList.size()+"条新的频道审核申请,请注意查看!"); | |
| 275 | - map.put("id", "1");//第一个提示框,避免冲突 | |
| 276 | - map.put("title", "新频道审核通知"); | |
| 277 | - map.put("content","您有"+channelList.size()+"条新的频道审核申请,请注意查看!" ); | |
| 278 | - map.put("url",localhost_url+"/channel/page?shenhe_status=0&receive=0" ); | |
| 279 | - return map; | |
| 267 | + logger.info("您有" + channelList.size() + "条新的频道审核申请,请注意查看!"); | |
| 268 | + map.put("id", "1");//第一个提示框,避免冲突 | |
| 269 | + map.put("title", "新频道审核通知"); | |
| 270 | + map.put("content", "您有" + channelList.size() + "条新的频道审核申请,请注意查看!"); | |
| 271 | + map.put("url", localhost_url + "/channel/page?shenhe_status=0&receive=0"); | |
| 272 | + return map; | |
| 280 | 273 | } |
| 281 | - return null; | |
| 282 | - } | |
| 274 | + return null; | |
| 275 | + } | |
| 283 | 276 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/ContentController.java
| 1 | 1 | package com.cnlive.shenhe.controller; |
| 2 | 2 | |
| 3 | -import com.alibaba.fastjson.JSONObject; | |
| 4 | 3 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | 4 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | 5 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | -import com.cnlive.shenhe.entity.ShyComments; | |
| 8 | 6 | import com.cnlive.shenhe.entity.ShyContent; |
| 9 | -import com.cnlive.shenhe.entity.ShyLive; | |
| 10 | 7 | import com.cnlive.shenhe.entity.ShySites; |
| 11 | 8 | import com.cnlive.shenhe.entity.ShyUsers; |
| 12 | -import com.cnlive.shenhe.entity.ShyVideos; | |
| 13 | -import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | |
| 14 | 9 | import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; |
| 15 | 10 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 16 | 11 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 17 | -import com.cnlive.shenhe.utils.AuditPass; | |
| 18 | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 19 | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| 20 | 14 | import com.github.pagehelper.PageInfo; |
| 21 | - | |
| 22 | 15 | import org.apache.poi.xssf.usermodel.XSSFCell; |
| 23 | 16 | import org.apache.poi.xssf.usermodel.XSSFRow; |
| 24 | 17 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 25 | 18 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| 26 | -import org.slf4j.Logger; | |
| 27 | -import org.slf4j.LoggerFactory; | |
| 28 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 29 | 20 | import org.springframework.stereotype.Controller; |
| 30 | 21 | import org.springframework.ui.Model; |
| ... | ... | @@ -33,12 +24,7 @@ import org.springframework.web.bind.annotation.*; |
| 33 | 24 | import javax.servlet.ServletOutputStream; |
| 34 | 25 | import javax.servlet.http.HttpServletResponse; |
| 35 | 26 | import javax.servlet.http.HttpSession; |
| 36 | - | |
| 37 | -import java.io.BufferedInputStream; | |
| 38 | -import java.io.BufferedOutputStream; | |
| 39 | -import java.io.ByteArrayInputStream; | |
| 40 | -import java.io.ByteArrayOutputStream; | |
| 41 | -import java.io.InputStream; | |
| 27 | +import java.io.*; | |
| 42 | 28 | import java.util.Date; |
| 43 | 29 | import java.util.List; |
| 44 | 30 | |
| ... | ... | @@ -46,11 +32,6 @@ import java.util.List; |
| 46 | 32 | @Controller |
| 47 | 33 | @RequestMapping("/content") |
| 48 | 34 | public class ContentController extends BaseController { |
| 49 | - private static Logger logger = LoggerFactory.getLogger(ContentController.class); | |
| 50 | - @Autowired | |
| 51 | - AuditPass Pass; | |
| 52 | - @Autowired | |
| 53 | - CommentsServiceImpl commentsService; | |
| 54 | 35 | @Autowired |
| 55 | 36 | ContentServiceImpl contentService; |
| 56 | 37 | @Autowired |
| ... | ... | @@ -79,25 +60,25 @@ public class ContentController extends BaseController { |
| 79 | 60 | * @return |
| 80 | 61 | */ |
| 81 | 62 | @GetMapping("/page") |
| 82 | - public String getPage(Model model, String title,String contentId, String content_tag, | |
| 83 | - String start_date, String end_date, Integer receive_status, String sp_desc,String source,String author, | |
| 63 | + public String getPage(Model model, String title, String contentId, String content_tag, | |
| 64 | + String start_date, String end_date, Integer receive_status, String sp_desc, String source, String author, | |
| 84 | 65 | Integer page, Integer pageSize, String orderByClause, HttpSession session) { |
| 85 | 66 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 86 | - if(CommonUtils.isNull(sessionUser)){ | |
| 87 | - return "redirect:/users/login"; | |
| 67 | + if (CommonUtils.isNull(sessionUser)) { | |
| 68 | + return "redirect:/users/login"; | |
| 88 | 69 | } |
| 89 | 70 | Integer spid = sessionUser.getSpid(); |
| 90 | 71 | String userId = sessionUser.getUserId(); |
| 91 | 72 | if (CommonUtils.isNull(page)) page = 1; |
| 92 | 73 | if (CommonUtils.isNull(pageSize)) pageSize = 10; |
| 93 | 74 | if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { |
| 94 | - ShySites shySite=sitesService.findspidBySpdesc(sp_desc); | |
| 95 | - if(CommonUtils.isNotNull(shySite)){ | |
| 96 | - spid = shySite.getSpid(); | |
| 97 | - }else{ | |
| 98 | - setmodel_site(model); | |
| 99 | - return "error.html"; | |
| 100 | - } | |
| 75 | + ShySites shySite = sitesService.findspidBySpdesc(sp_desc); | |
| 76 | + if (CommonUtils.isNotNull(shySite)) { | |
| 77 | + spid = shySite.getSpid(); | |
| 78 | + } else { | |
| 79 | + setmodelSite(model); | |
| 80 | + return "error.html"; | |
| 81 | + } | |
| 101 | 82 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { |
| 102 | 83 | spid = null; |
| 103 | 84 | } |
| ... | ... | @@ -116,20 +97,20 @@ public class ContentController extends BaseController { |
| 116 | 97 | } catch (Exception e) { |
| 117 | 98 | } |
| 118 | 99 | } |
| 119 | - PageInfo<ShyContent> contentPage = contentService.getPage( title,source,author,content_tag,contentId, sDate, eDate, receive_status, null, page, pageSize, orderByClause, spid, userId); | |
| 100 | + PageInfo<ShyContent> contentPage = contentService.getPage(title, source, author, content_tag, contentId, sDate, eDate, receive_status, null, page, pageSize, orderByClause, spid, userId); | |
| 120 | 101 | List<ShyContent> list = contentPage.getList(); |
| 121 | 102 | if (!list.isEmpty()) { |
| 122 | 103 | for (ShyContent content : list) { |
| 123 | 104 | if (content.getReceive_status() == CommonConst.RECEIVE_AUDIT) { |
| 124 | - String auditor_id = content.getAuditor_id(); | |
| 125 | - String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater())? "白名单":content.getUpdater(); | |
| 126 | - updater =sitesService.getUpdater(updater,auditor_id); | |
| 105 | + String auditor_id = content.getAuditor_id(); | |
| 106 | + String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); | |
| 107 | + updater = sitesService.getUpdater(updater, auditor_id); | |
| 127 | 108 | content.setUpdater(updater); |
| 128 | 109 | } |
| 129 | 110 | //显示spid简称 |
| 130 | 111 | ShySites shySites = sitesService.findspidDescByspid(content.getSp_id()); |
| 131 | 112 | if (CommonUtils.isNotNull(shySites)) { |
| 132 | - content.setSp_desc(shySites.getName()); | |
| 113 | + content.setSp_desc(shySites.getName()); | |
| 133 | 114 | } |
| 134 | 115 | } |
| 135 | 116 | } |
| ... | ... | @@ -146,20 +127,20 @@ public class ContentController extends BaseController { |
| 146 | 127 | */ |
| 147 | 128 | @GetMapping("/details/{id}") |
| 148 | 129 | public String getDetailsComments(@PathVariable Integer id, Model model) { |
| 149 | - ShyContent content = contentService.getDetailsContent(id); | |
| 150 | - if (content.getReceive_status() != CommonConst.RECEIVE_BEFORE) { | |
| 151 | - String auditor_id = content.getAuditor_id(); | |
| 152 | - String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater())? "白名单":content.getUpdater(); | |
| 153 | - updater =sitesService.getUpdater(updater,auditor_id); | |
| 130 | + ShyContent content = contentService.getDetailsContent(id); | |
| 131 | + if (content.getReceive_status() != CommonConst.RECEIVE_BEFORE) { | |
| 132 | + String auditor_id = content.getAuditor_id(); | |
| 133 | + String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); | |
| 134 | + updater = sitesService.getUpdater(updater, auditor_id); | |
| 154 | 135 | content.setUpdater(updater); |
| 155 | 136 | } |
| 156 | - //朋友圈内容切割内容图片或者视频地址 | |
| 157 | - if(content.getContent_tag().equals("moment")){ | |
| 158 | - String[] contentImageUrlList=null; | |
| 159 | - if(content.getContent_pc_url()!=null){ | |
| 160 | - contentImageUrlList=content.getContent_pc_url().split(","); | |
| 161 | - } | |
| 162 | - model.addAttribute("contentImageUrlList", contentImageUrlList); | |
| 137 | + //朋友圈内容切割内容图片或者视频地址 | |
| 138 | + if (content.getContent_tag().equals("moment")) { | |
| 139 | + String[] contentImageUrlList = null; | |
| 140 | + if (content.getContent_pc_url() != null) { | |
| 141 | + contentImageUrlList = content.getContent_pc_url().split(","); | |
| 142 | + } | |
| 143 | + model.addAttribute("contentImageUrlList", contentImageUrlList); | |
| 163 | 144 | } |
| 164 | 145 | model.addAttribute("content", content); |
| 165 | 146 | return "page/contentDetail.html"; |
| ... | ... | @@ -177,11 +158,11 @@ public class ContentController extends BaseController { |
| 177 | 158 | public ResponseBean pass(String ids, HttpSession session) { |
| 178 | 159 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 179 | 160 | String userId = sessionUser.getUserId(); |
| 180 | - boolean success =false; | |
| 161 | + boolean success = false; | |
| 181 | 162 | String[] contentIds = ids.split(","); |
| 182 | - for (String contentId : contentIds) { | |
| 183 | - success = contentService.callback(contentId,"审核通过", CommonConst.AUDIT_SUCCESS, userId,""); | |
| 184 | - } | |
| 163 | + for (String contentId : contentIds) { | |
| 164 | + success = contentService.callback(contentId, "审核通过", CommonConst.AUDIT_SUCCESS, userId, ""); | |
| 165 | + } | |
| 185 | 166 | if (success) { |
| 186 | 167 | return new ResponseBean(); |
| 187 | 168 | } else { |
| ... | ... | @@ -197,14 +178,14 @@ public class ContentController extends BaseController { |
| 197 | 178 | */ |
| 198 | 179 | @PostMapping("/refuse") |
| 199 | 180 | @ResponseBody |
| 200 | - public ResponseBean refuse(String ids,String msg, HttpSession session) { | |
| 181 | + public ResponseBean refuse(String ids, String msg, HttpSession session) { | |
| 201 | 182 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 202 | 183 | String userId = sessionUser.getUserId(); |
| 203 | - boolean success =false; | |
| 184 | + boolean success = false; | |
| 204 | 185 | String[] contentIds = ids.split(","); |
| 205 | - for (String contentId : contentIds) { | |
| 206 | - success = contentService.callback(contentId,msg, CommonConst.AUDIT_REFUSE, userId,""); | |
| 207 | - } | |
| 186 | + for (String contentId : contentIds) { | |
| 187 | + success = contentService.callback(contentId, msg, CommonConst.AUDIT_REFUSE, userId, ""); | |
| 188 | + } | |
| 208 | 189 | if (success) { |
| 209 | 190 | return new ResponseBean(); |
| 210 | 191 | } else { |
| ... | ... | @@ -246,20 +227,19 @@ public class ContentController extends BaseController { |
| 246 | 227 | * 根据条件导出excel |
| 247 | 228 | */ |
| 248 | 229 | @GetMapping("excel") |
| 249 | - public void getExcel( String title,String contentId, String content_tag, | |
| 250 | - String start_date, String end_date, Integer receive_status, String sp_desc, | |
| 251 | - Integer page, Integer pageSize, String orderByClause, HttpSession session,HttpServletResponse response) { | |
| 230 | + public void getExcel(String title, String contentId, String content_tag, | |
| 231 | + String start_date, String end_date, Integer receive_status, String sp_desc, | |
| 232 | + Integer page, Integer pageSize, String orderByClause, HttpSession session, HttpServletResponse response) { | |
| 252 | 233 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 253 | 234 | Integer spid = sessionUser.getSpid(); |
| 254 | - String userId = sessionUser.getUserId(); | |
| 255 | 235 | if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { |
| 256 | - ShySites shySite=sitesService.findspidBySpdesc(sp_desc); | |
| 257 | - if(CommonUtils.isNotNull(shySite)){ | |
| 258 | - spid = shySite.getSpid(); | |
| 259 | - } | |
| 260 | - }else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { | |
| 236 | + ShySites shySite = sitesService.findspidBySpdesc(sp_desc); | |
| 237 | + if (CommonUtils.isNotNull(shySite)) { | |
| 238 | + spid = shySite.getSpid(); | |
| 239 | + } | |
| 240 | + } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { | |
| 261 | 241 | spid = null; |
| 262 | - } | |
| 242 | + } | |
| 263 | 243 | Date sDate = null; |
| 264 | 244 | Date eDate = null; |
| 265 | 245 | |
| ... | ... | @@ -275,10 +255,10 @@ public class ContentController extends BaseController { |
| 275 | 255 | } catch (Exception e) { |
| 276 | 256 | } |
| 277 | 257 | } |
| 278 | - List<ShyContent> contentList = contentService.findByCondition(title,content_tag,contentId, sDate, eDate, receive_status, page, pageSize, orderByClause, spid); | |
| 279 | - | |
| 258 | + List<ShyContent> contentList = contentService.findByCondition(title, content_tag, contentId, sDate, eDate, receive_status, page, pageSize, orderByClause, spid); | |
| 259 | + | |
| 280 | 260 | String fileName = "图文数据"; |
| 281 | - | |
| 261 | + | |
| 282 | 262 | XSSFWorkbook wb = new XSSFWorkbook(); |
| 283 | 263 | ServletOutputStream out = null; |
| 284 | 264 | BufferedInputStream bis = null; |
| ... | ... | @@ -316,7 +296,7 @@ public class ContentController extends BaseController { |
| 316 | 296 | cell.setCellValue("作者(sid)"); |
| 317 | 297 | cell = row.createCell(14);//列 |
| 318 | 298 | cell.setCellValue("图文url"); |
| 319 | - | |
| 299 | + | |
| 320 | 300 | for (int i = 0; i < contentList.size(); i++) { |
| 321 | 301 | row = sheetlist.createRow((short) (i + 1));//行 |
| 322 | 302 | cell = row.createCell(0);//列 |
| ... | ... | @@ -329,10 +309,10 @@ public class ContentController extends BaseController { |
| 329 | 309 | cell.setCellValue(contentList.get(i).getTitle()); |
| 330 | 310 | /*状态需要处理成用户可读*/ |
| 331 | 311 | String contentTag = "";//图文标签 content:图文发布,moment:朋友圈 |
| 332 | - if (contentList.get(i).getContent_tag().equals("content") ) { | |
| 333 | - contentTag = "图文发布"; | |
| 312 | + if (contentList.get(i).getContent_tag().equals("content")) { | |
| 313 | + contentTag = "图文发布"; | |
| 334 | 314 | } else if (contentList.get(i).getContent_tag().equals("moment")) { |
| 335 | - contentTag = "朋友圈"; | |
| 315 | + contentTag = "朋友圈"; | |
| 336 | 316 | } |
| 337 | 317 | cell = row.createCell(4);//列 |
| 338 | 318 | cell.setCellValue(contentTag); |
| ... | ... | @@ -340,11 +320,11 @@ public class ContentController extends BaseController { |
| 340 | 320 | /*状态需要处理成用户可读*/ |
| 341 | 321 | String shenheType = "";//审核类型,1:免审,2:机审,3:人工审 |
| 342 | 322 | if (contentList.get(i).getShenhe_type() == 1) { |
| 343 | - shenheType = "免审"; | |
| 323 | + shenheType = "免审"; | |
| 344 | 324 | } else if (contentList.get(i).getShenhe_type() == 2) { |
| 345 | - shenheType = "机审"; | |
| 325 | + shenheType = "机审"; | |
| 346 | 326 | } else { |
| 347 | - shenheType = "人工审"; | |
| 327 | + shenheType = "人工审"; | |
| 348 | 328 | } |
| 349 | 329 | cell = row.createCell(5);//列 |
| 350 | 330 | cell.setCellValue(shenheType); |
| ... | ... | @@ -352,56 +332,55 @@ public class ContentController extends BaseController { |
| 352 | 332 | /*状态需要处理成用户可读*/ |
| 353 | 333 | String contentStatus = "";//内容状态:0:待发布,1:已发布,2:已下线,3:已删除 |
| 354 | 334 | if (contentList.get(i).getContent_status() == 0) { |
| 355 | - contentStatus = "待发布"; | |
| 335 | + contentStatus = "待发布"; | |
| 356 | 336 | } else if (contentList.get(i).getContent_status() == 1) { |
| 357 | - contentStatus = "已发布"; | |
| 358 | - } else if(contentList.get(i).getContent_status() == 2){ | |
| 359 | - contentStatus = "已下线"; | |
| 360 | - }else if(contentList.get(i).getContent_status() == 3){ | |
| 361 | - contentStatus = "已删除"; | |
| 337 | + contentStatus = "已发布"; | |
| 338 | + } else if (contentList.get(i).getContent_status() == 2) { | |
| 339 | + contentStatus = "已下线"; | |
| 340 | + } else if (contentList.get(i).getContent_status() == 3) { | |
| 341 | + contentStatus = "已删除"; | |
| 362 | 342 | } |
| 363 | - | |
| 343 | + | |
| 364 | 344 | cell = row.createCell(6);//列 |
| 365 | 345 | cell.setCellValue(contentStatus); |
| 366 | 346 | cell = row.createCell(7);//列 |
| 367 | - cell.setCellValue(contentList.get(i).getContent_time()==null?"":CommonUtils.formatDate(contentList.get(i).getContent_time(), "yyyy-MM-dd HH:mm:ss")); | |
| 347 | + cell.setCellValue(contentList.get(i).getContent_time() == null ? "" : CommonUtils.formatDate(contentList.get(i).getContent_time(), "yyyy-MM-dd HH:mm:ss")); | |
| 368 | 348 | cell = row.createCell(8);//列 |
| 369 | - cell.setCellValue(contentList.get(i).getCreate_date()==null?"":CommonUtils.formatDate(contentList.get(i).getCreate_date(), "yyyy-MM-dd HH:mm:ss")); | |
| 349 | + cell.setCellValue(contentList.get(i).getCreate_date() == null ? "" : CommonUtils.formatDate(contentList.get(i).getCreate_date(), "yyyy-MM-dd HH:mm:ss")); | |
| 370 | 350 | |
| 371 | 351 | /*状态需要处理成用户可读*/ |
| 372 | 352 | String receiveStatus = "";//领取状态。0:未领取;1:已领取,2:已审核 |
| 373 | 353 | if (contentList.get(i).getReceive_status() == 1) { |
| 374 | - receiveStatus = "已领取"; | |
| 354 | + receiveStatus = "已领取"; | |
| 375 | 355 | } else if (contentList.get(i).getReceive_status() == 2) { |
| 376 | - receiveStatus = "已审核"; | |
| 356 | + receiveStatus = "已审核"; | |
| 377 | 357 | } else { |
| 378 | - receiveStatus = "未领取"; | |
| 358 | + receiveStatus = "未领取"; | |
| 379 | 359 | } |
| 380 | - | |
| 360 | + | |
| 381 | 361 | cell = row.createCell(9);//列 |
| 382 | 362 | cell.setCellValue(receiveStatus); |
| 383 | 363 | |
| 384 | 364 | /* 审核员需要做处理*/ |
| 385 | 365 | String updater = "";//审核员名字 |
| 386 | 366 | if (contentList.get(i).getReceive_status() != CommonConst.RECEIVE_BEFORE) { |
| 387 | - updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater())? "自动通过":contentList.get(i).getUpdater(); | |
| 367 | + updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater()) ? "自动通过" : contentList.get(i).getUpdater(); | |
| 388 | 368 | String auditor_id = contentList.get(i).getAuditor_id(); |
| 389 | 369 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 390 | 370 | ShyUsers user = new ShyUsers(); |
| 391 | 371 | user.setUser_id(auditor_id); |
| 392 | 372 | user = usersService.select(user); |
| 393 | 373 | if (CommonUtils.isNotNull(user)) { |
| 394 | - String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 374 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 395 | 375 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| 396 | - updater = userName ; | |
| 376 | + updater = userName; | |
| 397 | 377 | } |
| 398 | 378 | } |
| 399 | 379 | } |
| 400 | 380 | cell = row.createCell(10);//列 |
| 401 | 381 | cell.setCellValue(updater); |
| 402 | - | |
| 403 | - | |
| 404 | - | |
| 382 | + | |
| 383 | + | |
| 405 | 384 | cell = row.createCell(11);//列 |
| 406 | 385 | cell.setCellValue(contentList.get(i).getShenhe_msg()); |
| 407 | 386 | cell = row.createCell(12);//列 | ... | ... |
src/main/java/com/cnlive/shenhe/controller/EmailController.java
| ... | ... | @@ -5,9 +5,7 @@ import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | 6 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | 7 | import com.cnlive.shenhe.entity.ShyEmail; |
| 8 | -import com.cnlive.shenhe.entity.ShySites; | |
| 9 | 8 | import com.cnlive.shenhe.entity.ShyUsers; |
| 10 | -import com.cnlive.shenhe.entity.ShyUsersfree; | |
| 11 | 9 | import com.cnlive.shenhe.serviceImpl.EmailServiceImpl; |
| 12 | 10 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 13 | 11 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| ... | ... | @@ -15,22 +13,16 @@ import com.cnlive.shenhe.utils.CommonConst; |
| 15 | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| 16 | 14 | import com.github.pagehelper.PageInfo; |
| 17 | 15 | |
| 18 | -import org.jasig.cas.client.authentication.AttributePrincipal; | |
| 19 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | 17 | import org.springframework.stereotype.Controller; |
| 21 | 18 | import org.springframework.ui.Model; |
| 22 | 19 | import org.springframework.web.bind.annotation.GetMapping; |
| 23 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 24 | 20 | import org.springframework.web.bind.annotation.PostMapping; |
| 25 | 21 | import org.springframework.web.bind.annotation.RequestMapping; |
| 26 | 22 | import org.springframework.web.bind.annotation.ResponseBody; |
| 27 | 23 | |
| 28 | -import java.util.HashMap; | |
| 29 | 24 | import java.util.List; |
| 30 | -import java.util.Map; | |
| 31 | 25 | |
| 32 | -import javax.print.attribute.HashAttributeSet; | |
| 33 | -import javax.servlet.http.HttpServletRequest; | |
| 34 | 26 | import javax.servlet.http.HttpSession; |
| 35 | 27 | |
| 36 | 28 | /** |
| ... | ... | @@ -123,7 +115,7 @@ public class EmailController extends BaseController { |
| 123 | 115 | @PostMapping(value = "/write") |
| 124 | 116 | public String write(Model model,Integer id,String email,String remark, String[] write_business, HttpSession session, String redirect_url) { |
| 125 | 117 | if(CommonUtils.isEmpty(email)&&CommonUtils.isEmpty(remark)){ |
| 126 | - setmodel_param(model,"email,remark不能为空"); | |
| 118 | + setmodelParam(model,"email,remark不能为空"); | |
| 127 | 119 | return "error.html"; |
| 128 | 120 | } |
| 129 | 121 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| ... | ... | @@ -138,7 +130,7 @@ public class EmailController extends BaseController { |
| 138 | 130 | if (success) { |
| 139 | 131 | return "redirect:" + redirect_url; |
| 140 | 132 | } else { |
| 141 | - setmodel_result(model); | |
| 133 | + setmodelResult(model); | |
| 142 | 134 | return "error.html"; |
| 143 | 135 | } |
| 144 | 136 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
| ... | ... | @@ -4,17 +4,13 @@ import org.apache.poi.xssf.usermodel.XSSFCell; |
| 4 | 4 | import org.apache.poi.xssf.usermodel.XSSFRow; |
| 5 | 5 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 6 | 6 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| 7 | -import com.alibaba.fastjson.JSON; | |
| 8 | 7 | import com.alibaba.fastjson.JSONObject; |
| 9 | 8 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 10 | 9 | import com.cnlive.shenhe.bean.ResponseBean; |
| 11 | 10 | import com.cnlive.shenhe.bean.SessionUser; |
| 12 | -import com.cnlive.shenhe.entity.ShyChannel; | |
| 13 | -import com.cnlive.shenhe.entity.ShyLive; | |
| 14 | 11 | import com.cnlive.shenhe.entity.ShyLiveapply; |
| 15 | 12 | import com.cnlive.shenhe.entity.ShySites; |
| 16 | 13 | import com.cnlive.shenhe.entity.ShyUsers; |
| 17 | -import com.cnlive.shenhe.entity.ShyVideos; | |
| 18 | 14 | import com.cnlive.shenhe.serviceImpl.LiveApplyServiceImpl; |
| 19 | 15 | import com.cnlive.shenhe.serviceImpl.LiveServiceImpl; |
| 20 | 16 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| ... | ... | @@ -147,7 +143,7 @@ public class LiveApplyController extends BaseController { |
| 147 | 143 | if(CommonUtils.isNotNull(shySite)){ |
| 148 | 144 | spid = shySite.getSpid(); |
| 149 | 145 | }else{ |
| 150 | - setmodel_site(model); | |
| 146 | + setmodelSite(model); | |
| 151 | 147 | return "error.html"; |
| 152 | 148 | } |
| 153 | 149 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| ... | ... | @@ -5,7 +5,6 @@ import org.apache.poi.xssf.usermodel.XSSFCell; |
| 5 | 5 | import org.apache.poi.xssf.usermodel.XSSFRow; |
| 6 | 6 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 7 | 7 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| 8 | -import com.alibaba.fastjson.JSON; | |
| 9 | 8 | import com.alibaba.fastjson.JSONObject; |
| 10 | 9 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 11 | 10 | import com.cnlive.shenhe.bean.ResponseBean; |
| ... | ... | @@ -13,7 +12,6 @@ import com.cnlive.shenhe.bean.SessionUser; |
| 13 | 12 | import com.cnlive.shenhe.entity.ShyLive; |
| 14 | 13 | import com.cnlive.shenhe.entity.ShySites; |
| 15 | 14 | import com.cnlive.shenhe.entity.ShyUsers; |
| 16 | -import com.cnlive.shenhe.entity.ShyVideos; | |
| 17 | 15 | import com.cnlive.shenhe.serviceImpl.LiveServiceImpl; |
| 18 | 16 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 19 | 17 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| ... | ... | @@ -144,7 +142,7 @@ public class LiveController extends BaseController { |
| 144 | 142 | if (CommonUtils.isNotNull(shySite)) { |
| 145 | 143 | spid = shySite.getSpid(); |
| 146 | 144 | } else { |
| 147 | - setmodel_site(model); | |
| 145 | + setmodelSite(model); | |
| 148 | 146 | return "error.html"; |
| 149 | 147 | } |
| 150 | 148 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/SitesController.java
| ... | ... | @@ -50,7 +50,7 @@ public class SitesController extends BaseController { |
| 50 | 50 | } |
| 51 | 51 | Integer spid = sessionUser.getSpid(); |
| 52 | 52 | if (!sessionUser.isMaster() && spid != 0) { |
| 53 | - setmodel_site(model); | |
| 53 | + setmodelSite(model); | |
| 54 | 54 | return "error.html"; |
| 55 | 55 | } |
| 56 | 56 | if (spid == 0) spid = null; |
| ... | ... | @@ -98,7 +98,7 @@ public class SitesController extends BaseController { |
| 98 | 98 | if (success) { |
| 99 | 99 | return "redirect:" + redirect_url; |
| 100 | 100 | } else { |
| 101 | - setmodel_result(model); | |
| 101 | + setmodelResult(model); | |
| 102 | 102 | return "error.html"; |
| 103 | 103 | } |
| 104 | 104 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/TopicController.java
| 1 | 1 | package com.cnlive.shenhe.controller; |
| 2 | 2 | |
| 3 | -import com.alibaba.fastjson.JSONObject; | |
| 4 | 3 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | 4 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | 5 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | 6 | import com.cnlive.shenhe.entity.*; |
| 8 | 7 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 9 | -import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; | |
| 10 | 8 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 11 | 9 | import com.cnlive.shenhe.serviceImpl.TopicServiceImpl; |
| 12 | 10 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 13 | 11 | import com.cnlive.shenhe.utils.AuditPass; |
| 14 | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 15 | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| 16 | -import com.cnlive.shenhe.utils.InfoUtil; | |
| 17 | 14 | import com.github.pagehelper.PageInfo; |
| 18 | 15 | |
| 19 | -import org.apache.poi.xssf.usermodel.XSSFCell; | |
| 20 | -import org.apache.poi.xssf.usermodel.XSSFRow; | |
| 21 | -import org.apache.poi.xssf.usermodel.XSSFSheet; | |
| 22 | -import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |
| 23 | 16 | import org.slf4j.Logger; |
| 24 | 17 | import org.slf4j.LoggerFactory; |
| 25 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -28,15 +21,8 @@ import org.springframework.stereotype.Controller; |
| 28 | 21 | import org.springframework.ui.Model; |
| 29 | 22 | import org.springframework.web.bind.annotation.*; |
| 30 | 23 | |
| 31 | -import javax.servlet.ServletOutputStream; | |
| 32 | -import javax.servlet.http.HttpServletResponse; | |
| 33 | 24 | import javax.servlet.http.HttpSession; |
| 34 | 25 | |
| 35 | -import java.io.BufferedInputStream; | |
| 36 | -import java.io.BufferedOutputStream; | |
| 37 | -import java.io.ByteArrayInputStream; | |
| 38 | -import java.io.ByteArrayOutputStream; | |
| 39 | -import java.io.InputStream; | |
| 40 | 26 | import java.util.Date; |
| 41 | 27 | import java.util.HashMap; |
| 42 | 28 | import java.util.List; |
| ... | ... | @@ -94,7 +80,7 @@ public class TopicController extends BaseController { |
| 94 | 80 | if(CommonUtils.isNotNull(shySite)){ |
| 95 | 81 | spid = shySite.getSpid(); |
| 96 | 82 | }else{ |
| 97 | - setmodel_site(model); | |
| 83 | + setmodelSite(model); | |
| 98 | 84 | return "error.html"; |
| 99 | 85 | } |
| 100 | 86 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| 1 | 1 | package com.cnlive.shenhe.controller; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | -import com.cnlive.shenhe.bean.ErrorEnum; | |
| 5 | -import com.cnlive.shenhe.bean.ResponseBean; | |
| 6 | 4 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | 5 | import com.cnlive.shenhe.entity.ShySites; |
| 8 | 6 | import com.cnlive.shenhe.entity.ShyUsers; |
| 9 | -import com.cnlive.shenhe.entity.ShyUsersfree; | |
| 10 | 7 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 11 | 8 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 12 | 9 | import com.cnlive.shenhe.utils.CommonConst; |
| ... | ... | @@ -27,7 +24,6 @@ import java.util.HashMap; |
| 27 | 24 | import java.util.List; |
| 28 | 25 | import java.util.Map; |
| 29 | 26 | |
| 30 | -import javax.print.attribute.HashAttributeSet; | |
| 31 | 27 | import javax.servlet.http.HttpServletRequest; |
| 32 | 28 | import javax.servlet.http.HttpSession; |
| 33 | 29 | |
| ... | ... | @@ -166,7 +162,7 @@ public class UsersController extends BaseController { |
| 166 | 162 | if (success) { |
| 167 | 163 | return "redirect:" + redirect_url; |
| 168 | 164 | } else { |
| 169 | - setmodel_result(model); | |
| 165 | + setmodelResult(model); | |
| 170 | 166 | return "error.html"; |
| 171 | 167 | } |
| 172 | 168 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
| ... | ... | @@ -5,28 +5,23 @@ import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | 6 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | 7 | import com.cnlive.shenhe.entity.ShySites; |
| 8 | -import com.cnlive.shenhe.entity.ShyUsers; | |
| 9 | 8 | import com.cnlive.shenhe.entity.ShyUsersfree; |
| 10 | 9 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 11 | -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | |
| 12 | 10 | import com.cnlive.shenhe.serviceImpl.UsersfreeServiceImpl; |
| 13 | 11 | import com.cnlive.shenhe.utils.CommonConst; |
| 14 | 12 | import com.cnlive.shenhe.utils.CommonUtils; |
| 15 | 13 | import com.github.pagehelper.PageInfo; |
| 16 | 14 | |
| 17 | -import org.jasig.cas.client.authentication.AttributePrincipal; | |
| 18 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | 16 | import org.springframework.stereotype.Controller; |
| 20 | 17 | import org.springframework.ui.Model; |
| 21 | 18 | import org.springframework.web.bind.annotation.GetMapping; |
| 22 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 23 | 19 | import org.springframework.web.bind.annotation.PostMapping; |
| 24 | 20 | import org.springframework.web.bind.annotation.RequestMapping; |
| 25 | 21 | import org.springframework.web.bind.annotation.ResponseBody; |
| 26 | 22 | |
| 27 | 23 | import java.util.List; |
| 28 | 24 | |
| 29 | -import javax.servlet.http.HttpServletRequest; | |
| 30 | 25 | import javax.servlet.http.HttpSession; |
| 31 | 26 | |
| 32 | 27 | /** |
| ... | ... | @@ -102,7 +97,7 @@ public class UsersFreeController extends BaseController { |
| 102 | 97 | @PostMapping(value = "/write") |
| 103 | 98 | public String write(Model model,String userId,String userMobile,Integer spId, String[] write_business, HttpSession session, String redirect_url) { |
| 104 | 99 | if(CommonUtils.isEmpty(userId)&&CommonUtils.isEmpty(userMobile)){ |
| 105 | - setmodel_param(model,"userId,userMobile不能为空!"); | |
| 100 | + setmodelParam(model,"userId,userMobile不能为空!"); | |
| 106 | 101 | return "error.html"; |
| 107 | 102 | } |
| 108 | 103 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| ... | ... | @@ -117,7 +112,7 @@ public class UsersFreeController extends BaseController { |
| 117 | 112 | if (success) { |
| 118 | 113 | return "redirect:" + redirect_url; |
| 119 | 114 | } else { |
| 120 | - setmodel_result(model); | |
| 115 | + setmodelResult(model); | |
| 121 | 116 | return "error.html"; |
| 122 | 117 | } |
| 123 | 118 | } | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/ChannelServiceImpl.java
| ... | ... | @@ -2,14 +2,8 @@ package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | 4 | import com.cnlive.shenhe.entity.ShyChannel; |
| 5 | -import com.cnlive.shenhe.entity.ShyChannel; | |
| 6 | -import com.cnlive.shenhe.entity.ShySites; | |
| 7 | 5 | import com.cnlive.shenhe.entity.ShyUsers; |
| 8 | -import com.cnlive.shenhe.entity.ShyUsersfree; | |
| 9 | -import com.cnlive.shenhe.entity.ShyVideos; | |
| 10 | -import com.cnlive.shenhe.mapper.ShyChannelMapper; | |
| 11 | 6 | import com.cnlive.shenhe.mapper.ShyChannelMapper; |
| 12 | -import com.cnlive.shenhe.mapper.ShySitesMapper; | |
| 13 | 7 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 14 | 8 | import com.cnlive.shenhe.utils.AuditPass; |
| 15 | 9 | import com.cnlive.shenhe.utils.CommonConst; |
| ... | ... | @@ -23,8 +17,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 23 | 17 | import org.springframework.stereotype.Service; |
| 24 | 18 | import tk.mybatis.mapper.entity.Example; |
| 25 | 19 | |
| 26 | -import java.sql.Timestamp; | |
| 27 | -import java.text.ParseException; | |
| 28 | 20 | import java.util.Date; |
| 29 | 21 | import java.util.List; |
| 30 | 22 | |
| ... | ... | @@ -40,24 +32,17 @@ public class ChannelServiceImpl { |
| 40 | 32 | @Autowired |
| 41 | 33 | ShyChannelMapper shyChannelMapper; |
| 42 | 34 | @Autowired |
| 43 | - ShySitesMapper shySitesMapper; | |
| 44 | - @Autowired | |
| 45 | 35 | ShyUsersMapper shyUsersMapper; |
| 46 | 36 | @Autowired |
| 47 | 37 | AuditPass Pass; |
| 48 | - | |
| 38 | + | |
| 49 | 39 | @Autowired |
| 50 | 40 | SitesServiceImpl sitesService; |
| 51 | 41 | |
| 52 | - public List<ShySites> getBusiness(ShySites shySites) { | |
| 53 | - List<ShySites> sitesList = shySitesMapper.select(shySites); | |
| 54 | - return sitesList; | |
| 55 | - } | |
| 56 | 42 | |
| 57 | 43 | //************************************** |
| 58 | 44 | public List<ShyChannel> findshyChannel(ShyChannel shyChannel) { |
| 59 | - List<ShyChannel> channelList = shyChannelMapper.selectByRowBounds(shyChannel, new RowBounds(0, 100)); | |
| 60 | - return channelList; | |
| 45 | + return shyChannelMapper.selectByRowBounds(shyChannel, new RowBounds(0, 100)); | |
| 61 | 46 | } |
| 62 | 47 | |
| 63 | 48 | public boolean updateshyChannel(ShyChannel shyChannel) { |
| ... | ... | @@ -76,13 +61,6 @@ public class ChannelServiceImpl { |
| 76 | 61 | return true; |
| 77 | 62 | } |
| 78 | 63 | |
| 79 | - public int updateChannel(Integer id, Integer state, String msg) { | |
| 80 | - ShyChannel shyChannel = shyChannelMapper.selectByPrimaryKey(id); | |
| 81 | - shyChannel.setShenhe_status(state); | |
| 82 | - shyChannel.setShenhe_msg(msg); | |
| 83 | - return shyChannelMapper.updateByPrimaryKeySelective(shyChannel); | |
| 84 | - } | |
| 85 | - | |
| 86 | 64 | public PageInfo<ShyChannel> getPage(String channelId, String channelName, Integer receive, Date start_date, Date end_date, Integer shenhe_status, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId) { |
| 87 | 65 | Example example = new Example(ShyChannel.class); |
| 88 | 66 | Example.Criteria criteria = example.createCriteria(); |
| ... | ... | @@ -91,11 +69,11 @@ public class ChannelServiceImpl { |
| 91 | 69 | } else { |
| 92 | 70 | example.setOrderByClause("created_at desc"); |
| 93 | 71 | } |
| 94 | - if (CommonUtils.isNotNull(start_date) ) { | |
| 72 | + if (CommonUtils.isNotNull(start_date)) { | |
| 95 | 73 | criteria.andGreaterThanOrEqualTo("created_at", start_date); |
| 96 | 74 | } |
| 97 | 75 | if (CommonUtils.isNotNull(end_date)) { |
| 98 | - criteria.andLessThanOrEqualTo("created_at", end_date); | |
| 76 | + criteria.andLessThanOrEqualTo("created_at", end_date); | |
| 99 | 77 | } |
| 100 | 78 | if (CommonUtils.isNotEmpty(channelName)) { |
| 101 | 79 | criteria.andLike("channel_name", "%" + channelName + "%"); |
| ... | ... | @@ -106,21 +84,24 @@ public class ChannelServiceImpl { |
| 106 | 84 | if (CommonUtils.isNotNull(spid)) { |
| 107 | 85 | criteria.andEqualTo("sp_id", spid); |
| 108 | 86 | } |
| 109 | - | |
| 87 | + | |
| 110 | 88 | if (CommonUtils.isNotEmpty(channelId)) { |
| 111 | 89 | criteria.andLike("channel_id", "%" + channelId + "%"); |
| 112 | 90 | } |
| 113 | - | |
| 114 | - if (CommonUtils.isNotNull(receive)&& receive==1) {//已认领 加上用户id | |
| 115 | - criteria.andEqualTo("auditor", userId); | |
| 91 | + | |
| 92 | + //已认领 加上用户id | |
| 93 | + if (CommonUtils.isNotNull(receive) && receive == 1) { | |
| 94 | + criteria.andEqualTo("auditor", userId); | |
| 116 | 95 | } |
| 117 | - if (CommonUtils.isNotNull(shenhe_status) && shenhe_status != 3) {//不是 我的已审 进来的,只查一种状态 | |
| 96 | + //不是 我的已审 进来的,只查一种状态 | |
| 97 | + if (CommonUtils.isNotNull(shenhe_status) && shenhe_status != 3) { | |
| 118 | 98 | criteria.andEqualTo("shenhe_status", shenhe_status); |
| 119 | - } else if (CommonUtils.isNotNull(shenhe_status) && shenhe_status == 3) {//是 我的已审,查通过和拒绝的两种状态 | |
| 120 | - Example.Criteria criteria1 = example.createCriteria(); | |
| 121 | - criteria1.orEqualTo("shenhe_status", 1); | |
| 122 | - criteria1.orEqualTo("shenhe_status", 2); | |
| 123 | - example.and(criteria1); | |
| 99 | + //是 我的已审,查通过和拒绝的两种状态 | |
| 100 | + } else if (CommonUtils.isNotNull(shenhe_status) && shenhe_status == 3) { | |
| 101 | + Example.Criteria criteria1 = example.createCriteria(); | |
| 102 | + criteria1.orEqualTo("shenhe_status", 1); | |
| 103 | + criteria1.orEqualTo("shenhe_status", 2); | |
| 104 | + example.and(criteria1); | |
| 124 | 105 | } |
| 125 | 106 | |
| 126 | 107 | PageHelper.startPage(page, pageSize, true); |
| ... | ... | @@ -131,23 +112,23 @@ public class ChannelServiceImpl { |
| 131 | 112 | |
| 132 | 113 | public ShyChannel getDetailsComment(Integer id) { |
| 133 | 114 | ShyChannel comment = shyChannelMapper.selectByPrimaryKey(id); |
| 134 | - if (comment.getShenhe_status() != CommonConst.AUDIT_INTT) { | |
| 135 | - String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater())? "白名单":comment.getUpdater(); | |
| 136 | - String auditor_id = comment.getAuditor(); | |
| 137 | - if (CommonUtils.isNotEmpty(auditor_id)) { | |
| 115 | + if (!comment.getShenhe_status().equals(CommonConst.AUDIT_INTT)) { | |
| 116 | + String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater()) ? "白名单" : comment.getUpdater(); | |
| 117 | + String auditorId = comment.getAuditor(); | |
| 118 | + if (CommonUtils.isNotEmpty(auditorId)) { | |
| 138 | 119 | ShyUsers user = new ShyUsers(); |
| 139 | - user.setUser_id(auditor_id); | |
| 120 | + user.setUser_id(auditorId); | |
| 140 | 121 | user = shyUsersMapper.selectOne(user); |
| 141 | - String email = CommonUtils.isEmpty(user.getEmail())|| "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 122 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 142 | 123 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| 143 | - updater = userName ; | |
| 124 | + updater = userName; | |
| 144 | 125 | } |
| 145 | 126 | comment.setUpdater(updater); |
| 146 | 127 | } |
| 147 | 128 | return comment; |
| 148 | 129 | } |
| 149 | 130 | |
| 150 | - public boolean updateState(String ids, Integer state, String userId,String updater,String msg) { | |
| 131 | + public boolean updateState(String ids, Integer state, String userId, String updater, String msg) { | |
| 151 | 132 | boolean success = true; |
| 152 | 133 | String[] channelIds = ids.split(","); |
| 153 | 134 | for (String channelId : channelIds) { |
| ... | ... | @@ -157,16 +138,16 @@ public class ChannelServiceImpl { |
| 157 | 138 | json.put("state", state + 2); |
| 158 | 139 | json.put("channel_id", channel.getChannel_id()); |
| 159 | 140 | json.put("msg", msg); |
| 160 | - JSONObject result = new JSONObject(); | |
| 141 | + JSONObject result; | |
| 161 | 142 | try { |
| 162 | 143 | result = Pass.channelPass(json, channel.getCallback()); |
| 163 | 144 | } catch (Exception e) { |
| 164 | - logger.error("频道回调失败,id:{},channel_id:{}",channel.getId(), channel.getChannel_id()); | |
| 145 | + logger.error("频道回调失败,id:{},channel_id:{}", channel.getId(), channel.getChannel_id()); | |
| 165 | 146 | success = false; |
| 166 | 147 | break; |
| 167 | 148 | } |
| 168 | 149 | if (result == null) { |
| 169 | - logger.error("频道回调错误,且无返回信息。id:{},channel_id:{}",channel.getId(), channel.getChannel_id()); | |
| 150 | + logger.error("频道回调错误,且无返回信息。id:{},channel_id:{}", channel.getId(), channel.getChannel_id()); | |
| 170 | 151 | success = false; |
| 171 | 152 | break; |
| 172 | 153 | } else { |
| ... | ... | @@ -178,12 +159,12 @@ public class ChannelServiceImpl { |
| 178 | 159 | } |
| 179 | 160 | channel.setShenhe_status(state); |
| 180 | 161 | channel.setShenhe_msg(msg); |
| 181 | - if(CommonUtils.isEmpty(userId)){ | |
| 182 | - channel.setUpdater(updater); | |
| 183 | - channel.setAuditor(null); | |
| 184 | - }else{ | |
| 185 | - channel.setAuditor(userId); | |
| 186 | - channel.setUpdater(null); | |
| 162 | + if (CommonUtils.isEmpty(userId)) { | |
| 163 | + channel.setUpdater(updater); | |
| 164 | + channel.setAuditor(null); | |
| 165 | + } else { | |
| 166 | + channel.setAuditor(userId); | |
| 167 | + channel.setUpdater(null); | |
| 187 | 168 | } |
| 188 | 169 | int i = shyChannelMapper.updateByPrimaryKey(channel); |
| 189 | 170 | if (i != 1) { |
| ... | ... | @@ -199,26 +180,30 @@ public class ChannelServiceImpl { |
| 199 | 180 | ShyChannel shyChannel = shyChannelMapper.selectByPrimaryKey(id); |
| 200 | 181 | return shyChannel; |
| 201 | 182 | } |
| 183 | + | |
| 202 | 184 | public int updateByPrimaryKeySelective(ShyChannel channel) { |
| 203 | 185 | return shyChannelMapper.updateByPrimaryKeySelective(channel); |
| 204 | 186 | } |
| 205 | - | |
| 187 | + | |
| 206 | 188 | /** |
| 207 | 189 | * 获得审核类型 |
| 190 | + * | |
| 208 | 191 | * @param shyChannel |
| 209 | 192 | */ |
| 210 | - public void getShenheType(ShyChannel shyChannel){ | |
| 211 | - | |
| 212 | - //获取直播频道免审sp | |
| 193 | + public void getShenheType(ShyChannel shyChannel) { | |
| 194 | + | |
| 195 | + //获取直播频道免审sp | |
| 213 | 196 | List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_CHANNEL); |
| 214 | 197 | //初始化一个审核状态 |
| 215 | - Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审 | |
| 198 | + //审核类型,1:免审,2:机审,3:人工审 | |
| 199 | + Integer shenheType = 3; | |
| 216 | 200 | //如果当前sp是免审sp |
| 217 | - if(sites.contains(shyChannel.getSp_id())){ | |
| 218 | - shenheType=1;//免审 | |
| 201 | + if (sites.contains(shyChannel.getSp_id())) { | |
| 202 | + //免审 | |
| 203 | + shenheType = 1; | |
| 219 | 204 | } |
| 220 | 205 | shyChannel.setShenhe_type(shenheType); |
| 221 | - } | |
| 206 | + } | |
| 222 | 207 | |
| 223 | 208 | } |
| 224 | 209 | ... | ... |
src/main/java/com/cnlive/shenhe/utils/CommonUtils.java
| ... | ... | @@ -42,14 +42,10 @@ public class CommonUtils { |
| 42 | 42 | public static Timestamp getCurrentTime() { |
| 43 | 43 | return new Timestamp(new Date().getTime()); |
| 44 | 44 | } |
| 45 | + | |
| 45 | 46 | //获取当前时间加上一个时间(分钟算) |
| 46 | 47 | public static Timestamp getAddTime(Integer addTime) { |
| 47 | - return new Timestamp(new Date().getTime()+addTime*60*1000); | |
| 48 | - } | |
| 49 | - | |
| 50 | - public static String getRandowUUID() { | |
| 51 | - UUID uuid = UUID.randomUUID(); | |
| 52 | - return uuid.toString().replaceAll("-", ""); | |
| 48 | + return new Timestamp(new Date().getTime() + addTime * 60 * 1000); | |
| 53 | 49 | } |
| 54 | 50 | |
| 55 | 51 | public static boolean isEmpty(String str) { | ... | ... |
src/main/resources/application.properties
| ... | ... | @@ -2,13 +2,6 @@ spring.datasource.url=jdbc:mysql://120.92.102.31:3306/new_shy?serverTimezone=Asi |
| 2 | 2 | spring.datasource.username=root |
| 3 | 3 | spring.datasource.password=M345sdfss4! |
| 4 | 4 | |
| 5 | -#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 6 | -#spring.datasource.username=root | |
| 7 | -#spring.datasource.password=nbLdyO.79 | |
| 8 | - | |
| 9 | -#spring.datasource.url=jdbc:mysql://10.137.192.2:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 10 | -#spring.datasource.username=admin | |
| 11 | -#spring.datasource.password=Sre#45iU7kJ | |
| 12 | 5 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
| 13 | 6 | |
| 14 | 7 | server.tomcat.protocol_header=x-forwarded-proto |
| ... | ... | @@ -26,72 +19,72 @@ spring.http.encoding.force=true |
| 26 | 19 | spring.thymeleaf.mode=LEGACYHTML5 |
| 27 | 20 | #spring.thymeleaf.encoding=UTF-8 |
| 28 | 21 | #spring.thymeleaf.content-type=text/html |
| 29 | -#\u5f00\u53d1\u65f6\u5173\u95ed\u7f13\u5b58,\u4e0d\u7136\u6ca1\u6cd5\u770b\u5230\u5b9e\u65f6\u9875\u9762 | |
| 22 | +#\u5F00\u53D1\u65F6\u5173\u95ED\u7F13\u5B58,\u4E0D\u7136\u6CA1\u6CD5\u770B\u5230\u5B9E\u65F6\u9875\u9762 | |
| 30 | 23 | spring.thymeleaf.cache=false |
| 31 | 24 | |
| 32 | -#\u6253\u5370\u8fd0\u884c\u65f6\u7684sql | |
| 25 | +#\u6253\u5370\u8FD0\u884C\u65F6\u7684sql | |
| 33 | 26 | #logging.level.com.cnlive.shenhe.mapper=debug |
| 34 | 27 | |
| 35 | 28 | mybatis.mapper-locations=classpath:mapper/*.xml |
| 36 | 29 | mybatis.type-aliases-package=com.cnlive.shenhe.entity |
| 37 | -server.port=88 | |
| 30 | +server.port=82 | |
| 38 | 31 | |
| 39 | -#rabbitmq\u76f8\u5173\u914d\u7f6e | |
| 32 | +#rabbitmq\u76F8\u5173\u914D\u7F6E | |
| 40 | 33 | spring.rabbitmq.host=10.254.174.131 |
| 41 | 34 | spring.rabbitmq.port=5672 |
| 42 | 35 | spring.rabbitmq.username=test |
| 43 | 36 | spring.rabbitmq.password=p3~amKKt9 |
| 44 | -# \u5f00\u542f\u53d1\u9001\u786e\u8ba4 | |
| 37 | +# \u5F00\u542F\u53D1\u9001\u786E\u8BA4 | |
| 45 | 38 | spring.rabbitmq.publisher-confirms=true |
| 46 | -# \u5f00\u542f\u53d1\u9001\u5931\u8d25\u9000\u56de | |
| 39 | +# \u5F00\u542F\u53D1\u9001\u5931\u8D25\u9000\u56DE | |
| 47 | 40 | spring.rabbitmq.publisher-returns=true |
| 48 | -# \u5f00\u542fACK | |
| 41 | +# \u5F00\u542FACK | |
| 49 | 42 | spring.rabbitmq.listener.direct.acknowledge-mode=manual |
| 50 | 43 | spring.rabbitmq.listener.simple.acknowledge-mode=manual |
| 51 | 44 | |
| 52 | -#\u8bdd\u9898\u8bc4\u8bba\u5206\u4eabh5 | |
| 45 | +#\u8BDD\u9898\u8BC4\u8BBA\u5206\u4EABh5 | |
| 53 | 46 | #topic_comment_shareH5=http://wjjh5test.cnlive.com/cnShareTopic.html?tid= |
| 54 | 47 | |
| 55 | -#\u5173\u95edspringboot\u63d0\u4f9b\u7684\u9ed8\u8ba4ico | |
| 48 | +#\u5173\u95EDspringboot\u63D0\u4F9B\u7684\u9ED8\u8BA4ico | |
| 56 | 49 | spring.mvc.favicon.enabled = false |
| 57 | 50 | |
| 58 | -#\u8bc4\u8bba\u7981\u8a00\u548c\u89e3\u7981\u4f7f\u7528API | |
| 51 | +#\u8BC4\u8BBA\u7981\u8A00\u548C\u89E3\u7981\u4F7F\u7528API | |
| 59 | 52 | speak_comment=http://comment.cnlive.com/services/commentForTopic/muted |
| 60 | 53 | |
| 61 | -#logback\u65e5\u5fd7\u4e2d\u4f7f\u7528 | |
| 54 | +#logback\u65E5\u5FD7\u4E2D\u4F7F\u7528 | |
| 62 | 55 | spring.application.name=cnlive_shenhe_test |
| 63 | 56 | spring.application.home=/usr/local/test_cnlive_shenhe/cnlive_shenhe/log |
| 64 | 57 | |
| 65 | 58 | sync_users_api=http://api.cnlive.com/open/api2/inner2/shenhe/getuser |
| 66 | 59 | sync_users_app_key=314a9dd4-a9b7-4c12-bbbe-1150a36491ae |
| 67 | 60 | |
| 68 | -#\u7528\u6237\u4e91\u8bf7\u6c42\u67e5\u8be2\u7528\u6237\u4fe1\u606f | |
| 61 | +#\u7528\u6237\u4E91\u8BF7\u6C42\u67E5\u8BE2\u7528\u6237\u4FE1\u606F | |
| 69 | 62 | queryUserByMobile=http://user.api.cnlive.com/CnliveM2/user/readUserByUserName.action?userName= |
| 70 | 63 | queryUserByUserId=http://user.api.cnlive.com/CnliveM2/user/readUserByUid.action?uid= |
| 71 | 64 | |
| 72 | -#\u70b9\u64ad\u4e91\u9700\u8981\u7684\u5e38\u91cf | |
| 65 | +#\u70B9\u64AD\u4E91\u9700\u8981\u7684\u5E38\u91CF | |
| 73 | 66 | url=http://mam.innerapi.cnlive.com/v1/inner/ShenHeInfo/shenheNotify |
| 74 | 67 | platformKey =AUDIT |
| 75 | 68 | platformValue=10011438 |
| 76 | 69 | |
| 77 | -#\u672c\u673a\u5730\u5740 | |
| 70 | +#\u672C\u673A\u5730\u5740 | |
| 78 | 71 | spring.localhost.url=http://test.shen.cnlive.com |
| 79 | 72 | |
| 80 | -#\u62bd\u5e27\u5e38\u91cf | |
| 73 | +#\u62BD\u5E27\u5E38\u91CF | |
| 81 | 74 | avsmple_appKey=1eac30dfbee311e7a2f0fa163e771cf9 |
| 82 | 75 | avsmple_appSecret=28ce1e1fbee311e7a2f0fa163e771cf92ea58ebfbee311e7a2f0fa163e771cf9 |
| 83 | 76 | avsmple_url=http://test.transcode.cnlive.com/api/request |
| 84 | 77 | avsmple_callback=http://test.shen.cnlive.com/api/avsample/callback |
| 85 | 78 | |
| 86 | -#\u540c\u6b65\u76f4\u64ad\u4e91\u4fe1\u606f | |
| 79 | +#\u540C\u6B65\u76F4\u64AD\u4E91\u4FE1\u606F | |
| 87 | 80 | live_url=http://test.bc.cnlive.com/bokong/activity/activityShenHe |
| 88 | 81 | |
| 89 | -#\u90ae\u4ef6\u4f7f\u7528\u5e38\u91cf | |
| 82 | +#\u90AE\u4EF6\u4F7F\u7528\u5E38\u91CF | |
| 90 | 83 | email_app_id=769_jetja50p18 |
| 91 | 84 | email_app_key=ad101b9152817a79b5c33c3617b96ff91385096ff3b4ba |
| 92 | 85 | email_send_URL=http://sms.cnlive.com/CnliveM3/email/sendMoreVarEmail.action |
| 93 | 86 | |
| 94 | -#\u62bd\u5e27\u5b58\u653ebucket\u548c\u57df\u540d | |
| 87 | +#\u62BD\u5E27\u5B58\u653Ebucket\u548C\u57DF\u540D | |
| 95 | 88 | qn_bucket=cnlivetest |
| 96 | 89 | qn_domain=http://test.qnvod.cnlive.com |
| 97 | 90 | ks_bucket=cnlive-test |
| ... | ... | @@ -102,7 +95,7 @@ ks_domain=http://test.wideo.cnlive.com |
| 102 | 95 | #ks_bucket=mam-sxzg-82 |
| 103 | 96 | #ks_domain=http://sxzg.ys1.cnliveimg.com |
| 104 | 97 | |
| 105 | -#\u56fe\u7247\u5b58\u653e\u6839\u8def\u5f84 | |
| 98 | +#\u56FE\u7247\u5B58\u653E\u6839\u8DEF\u5F84 | |
| 106 | 99 | desdir=shen |
| 107 | 100 | yiDun_audio_callback=http://test.shen.cnlive.com/api/audio/callbackAudio |
| 108 | 101 | cms_getVideoAndLiveId=http://cmstest.cnlive.com:8768/contentApi/getBeanById | ... | ... |