Commit d0c127109499a85d088852ecb123f5260ac8dc23

Authored by 王言钊
1 parent 07228909

开发直播、直播申请service接口

src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
... ... @@ -2,7 +2,7 @@ package com.cnlive.shenhe.api;
2 2  
3 3 import com.alibaba.fastjson.JSONObject;
4 4 import com.cnlive.shenhe.entity.ShyLiveapply;
5   -import com.cnlive.shenhe.service.serviceImpl.LiveApplyServiceImpl;
  5 +import com.cnlive.shenhe.service.LiveApplyService;
6 6 import com.cnlive.shenhe.utils.CommonConst;
7 7 import com.cnlive.shenhe.utils.CommonUtils;
8 8 import org.slf4j.Logger;
... ... @@ -27,7 +27,7 @@ public class LiveApplyControllerApi {
27 27 private static Logger logger = LoggerFactory.getLogger(LiveApplyControllerApi.class);
28 28  
29 29 @Autowired
30   - LiveApplyServiceImpl liveApplyServiceImpl;
  30 + LiveApplyService liveApplyService;
31 31  
32 32 @PostMapping("/import")
33 33 @ResponseBody
... ... @@ -64,7 +64,7 @@ public class LiveApplyControllerApi {
64 64 //得到直播活动id去查询是否已有
65 65 shyliveApply.setActivity_id(activityId);
66 66 //查询一下 存在,更新 没有,插入
67   - List<ShyLiveapply> listshyLiveApply = liveApplyServiceImpl.findshyLiveApply(shyliveApply);
  67 + List<ShyLiveapply> listshyLiveApply = liveApplyService.findShyLiveApply(shyliveApply);
68 68  
69 69 if (listshyLiveApply.size() > 0) {
70 70 ShyLiveapply shyliveApply1 = listshyLiveApply.get(0);
... ... @@ -148,11 +148,11 @@ public class LiveApplyControllerApi {
148 148 //更新时间
149 149 shyliveApply.setUpdated_at(CommonUtils.getCurrentTime());
150 150 //获取审核类型
151   - liveApplyServiceImpl.getShenheType(shyliveApply);
  151 + liveApplyService.getShenheType(shyliveApply);
152 152 if (shyliveApply.getId() == null) {
153   - return liveApplyServiceImpl.impotLiveApply(shyliveApply);
  153 + return liveApplyService.impotLiveApply(shyliveApply);
154 154 } else {
155   - return liveApplyServiceImpl.updateshyLiveApply(shyliveApply);
  155 + return liveApplyService.updateShyLiveApply(shyliveApply);
156 156 }
157 157 }
158 158 }
... ...
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
... ... @@ -2,7 +2,7 @@ package com.cnlive.shenhe.api;
2 2  
3 3 import com.alibaba.fastjson.JSONObject;
4 4 import com.cnlive.shenhe.entity.ShyLive;
5   -import com.cnlive.shenhe.service.serviceImpl.LiveServiceImpl;
  5 +import com.cnlive.shenhe.service.LiveService;
6 6 import com.cnlive.shenhe.utils.CommonConst;
7 7 import com.cnlive.shenhe.utils.CommonConstStates;
8 8 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -29,7 +29,7 @@ public class LiveControllerApi {
29 29 private static Logger logger = LoggerFactory.getLogger(LiveControllerApi.class);
30 30  
31 31 @Autowired
32   - LiveServiceImpl liveService;
  32 + LiveService liveService;
33 33  
34 34 @PostMapping("/import")
35 35 @ResponseBody
... ... @@ -43,30 +43,10 @@ public class LiveControllerApi {
43 43 //获取所有参数
44 44 //直播活动id
45 45 String activityId = json.getString("activityId");
46   - //直播活动名称
47   - String activityName = json.getString("activityName");
48 46 //直播活动状态
49 47 Integer activityStatus = json.getInteger("activityStatus");
50 48 //直播频道id
51 49 String channelId = json.getString("channelId");
52   - //直播频道id
53   - String liveType = json.getString("liveType");
54   - //rtmp直播流
55   - String mp4Url = json.getString("mp4Url");
56   - //m3u8直播流
57   - String hlsUrl = json.getString("hlsUrl");
58   - //spid
59   - Integer spId = json.getInteger("spId");
60   - //回调地址
61   - String callback = json.getString("callback");
62   - //优先级
63   - Integer isHot = json.getInteger("priority");
64   - //封面
65   - String coverImgUrl = json.getString("coverImgUrl");
66   - //活动描述
67   - String activityIntro = json.getString("activityIntro");
68   - //回放地址
69   - String playbackUrl = json.getString("playbackUrl");
70 50 //开始时间
71 51 String startTime = json.getString("startTime");
72 52 Date timestampStart = null;
... ... @@ -95,7 +75,7 @@ public class LiveControllerApi {
95 75 //得到直播活动id去查询是否已有
96 76 shyLive.setActivity_id(activityId);
97 77 //查询一下 存在,更新 没有,插入
98   - List<ShyLive> shyLiveList = liveService.findshyLive(shyLive);
  78 + List<ShyLive> shyLiveList = liveService.findShyLive(shyLive);
99 79 if (shyLiveList.size() > 0) {
100 80 //更新
101 81 ShyLive shyLive1 = shyLiveList.get(0);
... ... @@ -213,7 +193,7 @@ public class LiveControllerApi {
213 193 if (shyLive.getId() == null) {
214 194 return liveService.impotVideo(shyLive);
215 195 } else {
216   - return liveService.updateshyLive(shyLive);
  196 + return liveService.updateShyLive(shyLive);
217 197 }
218 198 }
219 199 }
... ...
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
... ... @@ -9,7 +9,10 @@ import com.cnlive.shenhe.dto.LiveApplyDTO;
9 9 import com.cnlive.shenhe.entity.ShyLiveapply;
10 10 import com.cnlive.shenhe.entity.ShySites;
11 11 import com.cnlive.shenhe.entity.ShyUsers;
12   -import com.cnlive.shenhe.service.serviceImpl.*;
  12 +import com.cnlive.shenhe.service.LiveApplyService;
  13 +import com.cnlive.shenhe.service.LiveService;
  14 +import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl;
  15 +import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl;
13 16 import com.cnlive.shenhe.utils.AuditPass;
14 17 import com.cnlive.shenhe.utils.CommonConst;
15 18 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -51,11 +54,11 @@ public class LiveApplyController extends BaseController {
51 54 @Autowired
52 55 SitesServiceImpl sitesService;
53 56 @Autowired
54   - LiveServiceImpl liveService;
  57 + LiveService liveService;
55 58 @Value("${spring.localhost.url}")
56 59 private String localhost_url;//本机地址
57 60 @Autowired
58   - LiveApplyServiceImpl liveApplyServiceImpl;
  61 + LiveApplyService liveApplyService;
59 62  
60 63  
61 64 /**
... ... @@ -76,7 +79,7 @@ public class LiveApplyController extends BaseController {
76 79 String[] shyLiveApplyIds = ids.split(",");
77 80 String showMsg = "";
78 81 for (String shyLiveApplyId : shyLiveApplyIds) {
79   - ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId));
  82 + ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId));
80 83 JSONObject result = null;
81 84 try {
82 85 result = pass.liveApplyPass(shyLiveapply.getActivity_id(), state + 2, msg, msg, shyLiveapply.getCallback());
... ... @@ -96,7 +99,7 @@ public class LiveApplyController extends BaseController {
96 99 showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " " + result.getString(" errorMessage");
97 100 break;
98 101 }
99   - int i = liveApplyServiceImpl.updateLiveApply(Integer.parseInt(shyLiveApplyId), userId, "", state, msg);
  102 + int i = liveApplyService.updateLiveApply(Integer.parseInt(shyLiveApplyId), userId, "", state, msg);
100 103 if (i == 0) {
101 104 showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 更新失败";
102 105 break;
... ... @@ -138,7 +141,7 @@ public class LiveApplyController extends BaseController {
138 141 } else if (CommonUtils.isEmpty(liveApplyDTO.getSp_desc()) && liveApplyDTO.getSpid() == 0) {
139 142 liveApplyDTO.setSpid(null);
140 143 }
141   - PageInfo<ShyLiveapply> liveApplyPage = liveApplyServiceImpl.getListLiveApply(liveApplyDTO);
  144 + PageInfo<ShyLiveapply> liveApplyPage = liveApplyService.getListLiveApply(liveApplyDTO);
142 145 List<ShyLiveapply> list = liveApplyPage.getList();
143 146 if (!list.isEmpty()) {
144 147 for (ShyLiveapply liveApply : list) {
... ... @@ -182,7 +185,7 @@ public class LiveApplyController extends BaseController {
182 185 */
183 186 @GetMapping("/details")
184 187 public Object getDetailsLiveApply(Model model, Integer id) {
185   - ShyLiveapply shyLiveapply = liveApplyServiceImpl.getDetailsLiveApply(id);
  188 + ShyLiveapply shyLiveapply = liveApplyService.getDetailsLiveApply(id);
186 189  
187 190 //显示spid简称
188 191 ShySites shySites = sitesService.findspidDescByspid(shyLiveapply.getSp_id());
... ... @@ -213,7 +216,7 @@ public class LiveApplyController extends BaseController {
213 216 if (CommonUtils.isNotEmpty(ids)) {
214 217 String[] cids = ids.split(",");
215 218 for (String cid : cids) {
216   - ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(cid));
  219 + ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(cid));
217 220 if (CommonUtils.isNotNull(shyLiveapply)) {
218 221 if (!shyLiveapply.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) {
219 222 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容中有已被领取或者已经被审核,请检查并重试");
... ... @@ -224,7 +227,7 @@ public class LiveApplyController extends BaseController {
224 227 }
225 228 }
226 229 }
227   - Integer n = liveApplyServiceImpl.receive(ids, num, userId, spid);
  230 + Integer n = liveApplyService.receive(ids, num, userId, spid);
228 231 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "认领到" + n + "条内容");
229 232 }
230 233  
... ... @@ -244,12 +247,12 @@ public class LiveApplyController extends BaseController {
244 247 //在退领操作前先判断是否包含已退领或者已经审核的数据,有则退回检查并重新退领
245 248 String[] cids = ids.split(",");
246 249 for (String cid : cids) {
247   - ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(cid));
  250 + ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(cid));
248 251 if (!shyLiveapply.getReceive().equals(CommonConst.RECEIVE_AFTER) || !shyLiveapply.getAuditor().equals(userId) || !shyLiveapply.getShenhe_state().equals(CommonConst.AUDIT_INTT)) {
249 252 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,您选中的内容包含已退领的或已经审核的");
250 253 }
251 254 }
252   - return liveApplyServiceImpl.retReceive(ids, userId);
  255 + return liveApplyService.retReceive(ids, userId);
253 256 }
254 257  
255 258 /**
... ... @@ -269,7 +272,7 @@ public class LiveApplyController extends BaseController {
269 272 String[] shyLiveIds = ids.split(",");
270 273 String showMsg = "";
271 274 for (String shyLiveId : shyLiveIds) {
272   - ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveId));
  275 + ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveId));
273 276 JSONObject result = null;
274 277 try {
275 278 result = pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback());
... ... @@ -320,7 +323,7 @@ public class LiveApplyController extends BaseController {
320 323 } else if (CommonUtils.isEmpty(liveApplyDTO.getSp_desc()) && liveApplyDTO.getSpid() == 0) {
321 324 liveApplyDTO.setSpid(null);
322 325 }
323   - List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findByCondition(liveApplyDTO);
  326 + List<ShyLiveapply> liveApplyList = liveApplyService.findByCondition(liveApplyDTO);
324 327  
325 328 String fileName = "直播申请数据";
326 329  
... ... @@ -450,7 +453,7 @@ public class LiveApplyController extends BaseController {
450 453 ShyLiveapply shyLiveapply = new ShyLiveapply();
451 454 shyLiveapply.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审
452 455 shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT);
453   - List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findshyLiveApply(shyLiveapply);
  456 + List<ShyLiveapply> liveApplyList = liveApplyService.findShyLiveApply(shyLiveapply);
454 457 if (liveApplyList.size() > 0) {
455 458 logger.info("您有" + liveApplyList.size() + "条新的直播申请,请注意查看!");
456 459 map.put("id", "2");// 第二个提示框,避免冲突
... ...
src/main/java/com/cnlive/shenhe/controller/LiveController.java
... ... @@ -9,7 +9,7 @@ import com.cnlive.shenhe.dto.LiveDTO;
9 9 import com.cnlive.shenhe.entity.ShyLive;
10 10 import com.cnlive.shenhe.entity.ShySites;
11 11 import com.cnlive.shenhe.entity.ShyUsers;
12   -import com.cnlive.shenhe.service.serviceImpl.LiveServiceImpl;
  12 +import com.cnlive.shenhe.service.LiveService;
13 13 import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl;
14 14 import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl;
15 15 import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl;
... ... @@ -57,7 +57,7 @@ public class LiveController extends BaseController {
57 57 @Autowired
58 58 SitesServiceImpl sitesService;
59 59 @Autowired
60   - LiveServiceImpl liveService;
  60 + LiveService liveService;
61 61  
62 62 @Value("${qn_domain}")
63 63 String qn_domain;
... ...
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
... ... @@ -5,8 +5,8 @@ import com.cnlive.shenhe.entity.ShyEmail;
5 5 import com.cnlive.shenhe.entity.ShyLiveapply;
6 6 import com.cnlive.shenhe.entity.ShySites;
7 7 import com.cnlive.shenhe.mapper.ShyLiveapplyMapper;
  8 +import com.cnlive.shenhe.service.LiveApplyService;
8 9 import com.cnlive.shenhe.service.serviceImpl.EmailServiceImpl;
9   -import com.cnlive.shenhe.service.serviceImpl.LiveApplyServiceImpl;
10 10 import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl;
11 11 import com.cnlive.shenhe.utils.CommonConst;
12 12 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -52,7 +52,7 @@ public class LiveApplyJob {
52 52 @Autowired
53 53 SitesServiceImpl sitesService;
54 54 @Autowired
55   - LiveApplyServiceImpl liveApplyServiceImpl;
  55 + LiveApplyService liveApplyService;
56 56 @Autowired
57 57 ShyLiveapplyMapper shyLiveApplyMapper;
58 58  
... ... @@ -67,10 +67,10 @@ public class LiveApplyJob {
67 67 // 审核类型为免审
68 68 shyLiveApply.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);
69 69 shyLiveApply.setShenhe_state(CommonConst.AUDIT_INTT);
70   - List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findshyLiveApply(shyLiveApply);
  70 + List<ShyLiveapply> liveApplyList = liveApplyService.findShyLiveApply(shyLiveApply);
71 71 if (liveApplyList.size() > 0) {
72 72 for (ShyLiveapply liveApply : liveApplyList) {
73   - liveApplyServiceImpl.updateLiveApply(liveApply.getId(), "", "白名单", CommonConst.AUDIT_SUCCESS, "白名单通过");
  73 + liveApplyService.updateLiveApply(liveApply.getId(), "", "白名单", CommonConst.AUDIT_SUCCESS, "白名单通过");
74 74 }
75 75 }
76 76 }
... ... @@ -153,7 +153,7 @@ public class LiveApplyJob {
153 153  
154 154 liveApply.setEmail_notice_state(notice_state);
155 155 liveApply.setEmail_notice_msg(notice_msg);
156   - liveApplyServiceImpl.updateshyLiveApply(liveApply);
  156 + liveApplyService.updateShyLiveApply(liveApply);
157 157 }
158 158 }
159 159  
... ... @@ -171,14 +171,14 @@ public class LiveApplyJob {
171 171 liveApply.setShenhe_state(CommonConst.AUDIT_INTT);
172 172 //已领取
173 173 liveApply.setReceive(CommonConst.RECEIVE_AFTER);
174   - List<ShyLiveapply> shyLiveapplyList = liveApplyServiceImpl.findshyLiveApply(liveApply);
  174 + List<ShyLiveapply> shyLiveapplyList = liveApplyService.findShyLiveApply(liveApply);
175 175 if (shyLiveapplyList.size() > 0) {
176 176 for (ShyLiveapply liveapply : shyLiveapplyList) {
177 177 logger.info("自动退领的liveApply_id:" + liveapply.getId());
178 178 //未领取
179 179 liveapply.setReceive(CommonConst.RECEIVE_BEFORE);
180 180 liveapply.setAuditor(null);
181   - liveApplyServiceImpl.updateshyLiveApply(liveApply);
  181 + liveApplyService.updateShyLiveApply(liveApply);
182 182 }
183 183 }
184 184 }
... ...
src/main/java/com/cnlive/shenhe/service/LiveApplyService.java 0 → 100644
  1 +package com.cnlive.shenhe.service;
  2 +
  3 +import com.cnlive.shenhe.bean.ResponseBean;
  4 +import com.cnlive.shenhe.dto.LiveApplyDTO;
  5 +import com.cnlive.shenhe.entity.ShyLiveapply;
  6 +import com.github.pagehelper.PageInfo;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * @Author: yan-zhao-wang
  12 + * @DateTime: 2022-11-02 14:26
  13 + */
  14 +public interface LiveApplyService {
  15 + /**
  16 + * 导入直播申请
  17 + *
  18 + * @param shyLiveApply
  19 + * @return
  20 + */
  21 + boolean impotLiveApply(ShyLiveapply shyLiveApply);
  22 +
  23 + /**
  24 + * 根据主键id查询直播申请对象
  25 + *
  26 + * @param id
  27 + * @return
  28 + */
  29 + ShyLiveapply selectByPrimaryKey(Integer id);
  30 +
  31 + /**
  32 + * 根据条件查询直播申请集合
  33 + *
  34 + * @param shyLiveApply
  35 + * @return
  36 + */
  37 + List<ShyLiveapply> findShyLiveApply(ShyLiveapply shyLiveApply);
  38 +
  39 + /**
  40 + * 修改直播申请对象 返回布尔类型
  41 + *
  42 + * @param shyLiveApply
  43 + * @return
  44 + */
  45 + boolean updateShyLiveApply(ShyLiveapply shyLiveApply);
  46 +
  47 + /**
  48 + * 修改直播申请对象 返回int类型
  49 + *
  50 + * @param id
  51 + * @param auditor_id
  52 + * @param updater
  53 + * @param status
  54 + * @param msg
  55 + * @return
  56 + */
  57 + int updateLiveApply(Integer id, String auditor_id, String updater, Integer status, String msg);
  58 +
  59 + /**
  60 + * 获取分页、条件查询
  61 + *
  62 + * @param liveApplyDTO
  63 + * @return
  64 + */
  65 + PageInfo<ShyLiveapply> getListLiveApply(LiveApplyDTO liveApplyDTO);
  66 +
  67 + /**
  68 + * 获取直播申请详情
  69 + *
  70 + * @param id
  71 + * @return
  72 + */
  73 + ShyLiveapply getDetailsLiveApply(Integer id);
  74 +
  75 + /**
  76 + * 认领
  77 + *
  78 + * @param ids
  79 + * @param num
  80 + * @param userId
  81 + * @param spid
  82 + * @return
  83 + */
  84 + Integer receive(String ids, Integer num, String userId, Integer spid);
  85 +
  86 + /**
  87 + * 退领
  88 + *
  89 + * @param ids
  90 + * @param userId
  91 + * @return
  92 + */
  93 + ResponseBean retReceive(String ids, String userId);
  94 +
  95 + /**
  96 + * 根据条件导出数据excel
  97 + *
  98 + * @param liveApplyDTO
  99 + * @return
  100 + */
  101 + List<ShyLiveapply> findByCondition(LiveApplyDTO liveApplyDTO);
  102 +
  103 + /**
  104 + * 获取审核类型
  105 + *
  106 + * @param shyLiveApply
  107 + */
  108 + void getShenheType(ShyLiveapply shyLiveApply);
  109 +}
... ...
src/main/java/com/cnlive/shenhe/service/LiveService.java 0 → 100644
  1 +package com.cnlive.shenhe.service;
  2 +
  3 +import com.cnlive.shenhe.bean.ResponseBean;
  4 +import com.cnlive.shenhe.dto.LiveDTO;
  5 +import com.cnlive.shenhe.entity.ShyLive;
  6 +import com.github.pagehelper.PageInfo;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * @Author: yan-zhao-wang
  12 + * @DateTime: 2022-11-02 14:25
  13 + */
  14 +public interface LiveService {
  15 + /**
  16 + * 直播导入
  17 + *
  18 + * @param shyLive
  19 + * @return
  20 + */
  21 + boolean impotVideo(ShyLive shyLive);
  22 +
  23 + /**
  24 + * 根据id查询 返回直播对象
  25 + *
  26 + * @param id
  27 + * @return
  28 + */
  29 + ShyLive selectByPrimaryKey(Integer id);
  30 +
  31 + /**
  32 + * 根据条件查询 返回直播对象集合
  33 + *
  34 + * @param shyLive
  35 + * @return
  36 + */
  37 + List<ShyLive> findShyLive(ShyLive shyLive);
  38 +
  39 + /**
  40 + * 修改直播对象 返回boolean类型
  41 + *
  42 + * @param shyLive
  43 + * @return
  44 + */
  45 + boolean updateShyLive(ShyLive shyLive);
  46 +
  47 + /**
  48 + * 根据id查询,修改对象的关键信息 返回int类型
  49 + *
  50 + * @param id
  51 + * @param auditor_id
  52 + * @param updater
  53 + * @param activity_status
  54 + * @param msg
  55 + * @return
  56 + */
  57 + int updateLive(Integer id, String auditor_id, String updater, Integer activity_status, String msg);
  58 +
  59 + /**
  60 + * 分页、条件查询、返回分页结果集合
  61 + *
  62 + * @param liveDTO
  63 + * @return
  64 + */
  65 + PageInfo<ShyLive> getListLive(LiveDTO liveDTO);
  66 +
  67 + /**
  68 + * 根据id获取直播详情信息
  69 + *
  70 + * @param id
  71 + * @return
  72 + */
  73 + ShyLive getDetailsLive(Integer id);
  74 +
  75 + /**
  76 + * 认领
  77 + *
  78 + * @param ids
  79 + * @param num
  80 + * @param userId
  81 + * @param spid
  82 + * @return
  83 + */
  84 + Integer receive(String ids, Integer num, String userId, Integer spid);
  85 +
  86 + /**
  87 + * 退领
  88 + *
  89 + * @param ids
  90 + * @param userId
  91 + * @return
  92 + */
  93 + ResponseBean retReceive(String ids, String userId);
  94 +
  95 + /**
  96 + * 根据条件导出数据excel
  97 + *
  98 + * @param liveDTO
  99 + * @return
  100 + */
  101 + List<ShyLive> findByCondition(LiveDTO liveDTO);
  102 +}
... ...
src/main/java/com/cnlive/shenhe/service/serviceImpl/LiveApplyServiceImpl.java
... ... @@ -9,6 +9,7 @@ import com.cnlive.shenhe.entity.ShyLiveapply;
9 9 import com.cnlive.shenhe.entity.ShyUsers;
10 10 import com.cnlive.shenhe.mapper.ShyLiveapplyMapper;
11 11 import com.cnlive.shenhe.mapper.ShyUsersMapper;
  12 +import com.cnlive.shenhe.service.LiveApplyService;
12 13 import com.cnlive.shenhe.utils.CommonConst;
13 14 import com.cnlive.shenhe.utils.CommonUtils;
14 15 import com.github.pagehelper.PageHelper;
... ... @@ -30,7 +31,7 @@ import java.util.List;
30 31 * @Description:
31 32 */
32 33 @Service
33   -public class LiveApplyServiceImpl {
  34 +public class LiveApplyServiceImpl implements LiveApplyService {
34 35  
35 36 private static Logger logger = LoggerFactory.getLogger(LiveApplyServiceImpl.class);
36 37 @Autowired
... ... @@ -46,6 +47,7 @@ public class LiveApplyServiceImpl {
46 47 * @param shyLiveApply
47 48 * @return
48 49 */
  50 + @Override
49 51 public boolean impotLiveApply(ShyLiveapply shyLiveApply) {
50 52 int result = shyLiveApplyMapper.insertSelective(shyLiveApply);
51 53 if (result == 0) {
... ... @@ -60,6 +62,7 @@ public class LiveApplyServiceImpl {
60 62 * @param id
61 63 * @return
62 64 */
  65 + @Override
63 66 public ShyLiveapply selectByPrimaryKey(Integer id) {
64 67 ShyLiveapply shyLiveApply = shyLiveApplyMapper.selectByPrimaryKey(id);
65 68 return shyLiveApply;
... ... @@ -71,7 +74,8 @@ public class LiveApplyServiceImpl {
71 74 * @param shyLiveApply
72 75 * @return
73 76 */
74   - public List<ShyLiveapply> findshyLiveApply(ShyLiveapply shyLiveApply) {
  77 + @Override
  78 + public List<ShyLiveapply> findShyLiveApply(ShyLiveapply shyLiveApply) {
75 79 List<ShyLiveapply> shyLiveApplylist = shyLiveApplyMapper.selectByRowBounds(shyLiveApply, new RowBounds(0, 100));
76 80 return shyLiveApplylist;
77 81 }
... ... @@ -82,7 +86,8 @@ public class LiveApplyServiceImpl {
82 86 * @param shyLiveApply
83 87 * @return
84 88 */
85   - public boolean updateshyLiveApply(ShyLiveapply shyLiveApply) {
  89 + @Override
  90 + public boolean updateShyLiveApply(ShyLiveapply shyLiveApply) {
86 91 int i = shyLiveApplyMapper.updateByPrimaryKey(shyLiveApply);
87 92 if (i == 0) {
88 93 return false;
... ... @@ -100,6 +105,7 @@ public class LiveApplyServiceImpl {
100 105 * @param msg
101 106 * @return
102 107 */
  108 + @Override
103 109 public int updateLiveApply(Integer id, String auditor_id, String updater, Integer status, String msg) {
104 110 ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id);
105 111 shyLiveapply.setAuditor(auditor_id);
... ... @@ -117,6 +123,7 @@ public class LiveApplyServiceImpl {
117 123 * @param liveApplyDTO
118 124 * @return
119 125 */
  126 + @Override
120 127 public PageInfo<ShyLiveapply> getListLiveApply(LiveApplyDTO liveApplyDTO) {
121 128 logger.info("接参数列表为,LiveApplyDTO:{}", JSON.toJSONString(liveApplyDTO));
122 129 Example example = new Example(ShyLiveapply.class);
... ... @@ -179,6 +186,7 @@ public class LiveApplyServiceImpl {
179 186 * @param id
180 187 * @return
181 188 */
  189 + @Override
182 190 public ShyLiveapply getDetailsLiveApply(Integer id) {
183 191 ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id);
184 192 if (!shyLiveapply.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) {
... ... @@ -206,6 +214,7 @@ public class LiveApplyServiceImpl {
206 214 * @param spid
207 215 * @return
208 216 */
  217 + @Override
209 218 public Integer receive(String ids, Integer num, String userId, Integer spid) {
210 219 Integer n = 0;
211 220 if (CommonUtils.isNotEmpty(ids)) {
... ... @@ -250,6 +259,7 @@ public class LiveApplyServiceImpl {
250 259 * @param userId
251 260 * @return
252 261 */
  262 + @Override
253 263 public ResponseBean retReceive(String ids, String userId) {
254 264 String[] cids = ids.split(",");
255 265 for (String cid : cids) {
... ... @@ -274,6 +284,7 @@ public class LiveApplyServiceImpl {
274 284 *
275 285 * @return
276 286 */
  287 + @Override
277 288 public List<ShyLiveapply> findByCondition(LiveApplyDTO liveApplyDTO) {
278 289 Example example = new Example(ShyLiveapply.class);
279 290 Example.Criteria criteria = example.createCriteria();
... ... @@ -332,6 +343,7 @@ public class LiveApplyServiceImpl {
332 343 *
333 344 * @param shyLiveApply
334 345 */
  346 + @Override
335 347 public void getShenheType(ShyLiveapply shyLiveApply) {
336 348  
337 349 //获取直播频道免审sp
... ...
src/main/java/com/cnlive/shenhe/service/serviceImpl/LiveServiceImpl.java
... ... @@ -8,6 +8,7 @@ import com.cnlive.shenhe.entity.ShyLive;
8 8 import com.cnlive.shenhe.entity.ShyUsers;
9 9 import com.cnlive.shenhe.mapper.ShyLiveMapper;
10 10 import com.cnlive.shenhe.mapper.ShyUsersMapper;
  11 +import com.cnlive.shenhe.service.LiveService;
11 12 import com.cnlive.shenhe.utils.CommonConst;
12 13 import com.cnlive.shenhe.utils.CommonConstStates;
13 14 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -30,7 +31,7 @@ import java.util.List;
30 31 * @Description:
31 32 */
32 33 @Service
33   -public class LiveServiceImpl {
  34 +public class LiveServiceImpl implements LiveService {
34 35  
35 36 private static Logger logger = LoggerFactory.getLogger(LiveServiceImpl.class);
36 37 @Autowired
... ... @@ -45,6 +46,7 @@ public class LiveServiceImpl {
45 46 * @param shyLive
46 47 * @return
47 48 */
  49 + @Override
48 50 public boolean impotVideo(ShyLive shyLive) {
49 51 int result = shyLiveMapper.insertSelective(shyLive);
50 52 if (result == 0) {
... ... @@ -59,6 +61,7 @@ public class LiveServiceImpl {
59 61 * @param id
60 62 * @return
61 63 */
  64 + @Override
62 65 public ShyLive selectByPrimaryKey(Integer id) {
63 66 ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id);
64 67 return shyLive;
... ... @@ -70,7 +73,8 @@ public class LiveServiceImpl {
70 73 * @param shyLive
71 74 * @return
72 75 */
73   - public List<ShyLive> findshyLive(ShyLive shyLive) {
  76 + @Override
  77 + public List<ShyLive> findShyLive(ShyLive shyLive) {
74 78 List<ShyLive> shyLivelist = shyLiveMapper.selectByRowBounds(shyLive, new RowBounds(0, 100));
75 79 return shyLivelist;
76 80 }
... ... @@ -81,7 +85,8 @@ public class LiveServiceImpl {
81 85 * @param shyLive
82 86 * @return
83 87 */
84   - public boolean updateshyLive(ShyLive shyLive) {
  88 + @Override
  89 + public boolean updateShyLive(ShyLive shyLive) {
85 90 int i = shyLiveMapper.updateByPrimaryKey(shyLive);
86 91 if (i == 0) {
87 92 return false;
... ... @@ -99,6 +104,7 @@ public class LiveServiceImpl {
99 104 * @param msg
100 105 * @return
101 106 */
  107 + @Override
102 108 public int updateLive(Integer id, String auditor_id, String updater, Integer activity_status, String msg) {
103 109 ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id);
104 110 shyLive.setAuditor(auditor_id);
... ... @@ -116,6 +122,7 @@ public class LiveServiceImpl {
116 122 * @param liveDTO
117 123 * @return
118 124 */
  125 + @Override
119 126 public PageInfo<ShyLive> getListLive(LiveDTO liveDTO) {
120 127 logger.info("接受参数对象,LiveDTO:{}", JSON.toJSONString(liveDTO));
121 128 Example example = new Example(ShyLive.class);
... ... @@ -174,6 +181,7 @@ public class LiveServiceImpl {
174 181 * @param id
175 182 * @return
176 183 */
  184 + @Override
177 185 public ShyLive getDetailsLive(Integer id) {
178 186 ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id);
179 187 if (!shyLive.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) {
... ... @@ -203,6 +211,7 @@ public class LiveServiceImpl {
203 211 * @param spid
204 212 * @return
205 213 */
  214 + @Override
206 215 public Integer receive(String ids, Integer num, String userId, Integer spid) {
207 216 Integer n = 0;
208 217 if (CommonUtils.isNotEmpty(ids)) {
... ... @@ -243,6 +252,7 @@ public class LiveServiceImpl {
243 252 * @param userId
244 253 * @return
245 254 */
  255 + @Override
246 256 public ResponseBean retReceive(String ids, String userId) {
247 257 String[] cids = ids.split(",");
248 258 for (String cid : cids) {
... ... @@ -266,6 +276,7 @@ public class LiveServiceImpl {
266 276 *
267 277 * @return
268 278 */
  279 + @Override
269 280 public List<ShyLive> findByCondition(LiveDTO liveDTO) {
270 281 Example example = new Example(ShyLive.class);
271 282 Example.Criteria criteria = example.createCriteria();
... ...