| | |
| | | |
| | | import com.dsh.course.feignClient.activity.BenefitsVideoClient; |
| | | import com.dsh.course.feignClient.activity.PointMercharsClient; |
| | | import com.dsh.course.feignClient.activity.model.BenefitsVedioChangeStateVO; |
| | | import com.dsh.course.feignClient.activity.model.BenefitsVideoClassification; |
| | | import com.dsh.course.feignClient.activity.model.BenefitsVideos; |
| | | import com.dsh.course.feignClient.activity.model.QueryBenefitsVedioVO; |
| | | import com.dsh.course.feignClient.activity.model.*; |
| | | import com.dsh.course.feignClient.course.CourseClient; |
| | | import com.dsh.course.feignClient.course.model.CourseChangeStateDTO; |
| | | import com.dsh.guns.config.UserExt; |
| | |
| | | import com.dsh.guns.modular.system.model.TQueryBenefitsVO; |
| | | import com.dsh.guns.modular.system.model.TQueryBenefitsVideosDTO; |
| | | import com.dsh.guns.modular.system.model.TQueryBenefitsVideosVO; |
| | | import com.dsh.guns.modular.system.model.dto.GetBenefitVideoById; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @RequestMapping("/addBenefitsVideos/{id}") |
| | | public String addBenefitsVideos(Model model,@PathVariable("id")Integer id) { |
| | | model.addAttribute("id",id); |
| | | List<BenefitsVideos> benefitVideoById = benefitsVideoClient.getBenefitVideoById(id); |
| | | // // 所选福利视频分类下的视频的courseId集合 |
| | | // List<Integer> list = new ArrayList<>(); |
| | | // for (BenefitsVideos benefitsVideos : benefitVideoById) { |
| | | // list.add(benefitsVideos.getCourseId()); |
| | | // } |
| | | TQueryBenefitsVideosDTO dto = new TQueryBenefitsVideosDTO(); |
| | | // dto.setCoursIds(list); |
| | | List<TQueryBenefitsVideosVO> courseByCourseIds = courseClient.getCourseByCourseIds(dto); |
| | | List<TQueryBenefitsVideosVO> tQueryBenefitsVideosVOS = new ArrayList<>(); |
| | | for (TQueryBenefitsVideosVO courseByCourseId : courseByCourseIds) { |
| | |
| | | @ResponseBody |
| | | public List<TQueryBenefitsVideosVO> listBenefitsVideos(@PathVariable("id")Integer bId, String name, Integer type, Integer state) { |
| | | TQueryBenefitsVideosDTO vo = new TQueryBenefitsVideosDTO(); |
| | | List<BenefitsVideos> benefitVideoById = benefitsVideoClient.getBenefitVideoById(bId); |
| | | GetBenefitVideoById getBenefitVideoById = new GetBenefitVideoById(); |
| | | getBenefitVideoById.setBenefitsVideoClassificationId(bId); |
| | | getBenefitVideoById.setState(state); |
| | | List<BenefitsVideos> benefitVideoById = benefitsVideoClient.getBenefitVideoById(getBenefitVideoById); |
| | | vo.setCoursIds(new ArrayList<>()); |
| | | for (BenefitsVideos benefitsVideos : benefitVideoById) { |
| | | // 获取课程id集合 |
| | |
| | | for (BenefitsVideos benefitsVideos : benefitVideoById) { |
| | | for (TQueryBenefitsVideosVO courseByCourseId : courseByCourseIds) { |
| | | if (benefitsVideos.getCourseId().equals(courseByCourseId.getId())){ |
| | | courseByCourseId.setId(benefitsVideos.getId()); |
| | | courseByCourseId.setIntegral(benefitsVideos.getIntegral()); |
| | | courseByCourseId.setBenefitsVideosId(benefitsVideos.getId()); |
| | | courseByCourseId.setState(benefitsVideos.getState()); |
| | | courseByCourseId.setInsertTime(benefitsVideos.getInsertTime()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return courseByCourseIds; |
| | | } |
| | | /** |
| | |
| | | @RequestMapping("/changeCourseState") |
| | | @ResponseBody |
| | | public Object changeCourseState(@RequestBody CourseChangeStateDTO dto){ |
| | | |
| | | courseClient.changeState(dto); |
| | | mercharsClient.changeState(dto); |
| | | |
| | | ChangeBenefitsVedioState changeBenefitsVedioState = new ChangeBenefitsVedioState(); |
| | | changeBenefitsVedioState.setId(dto.getIds().get(0)); |
| | | changeBenefitsVedioState.setState(dto.getState()); |
| | | benefitsVideoClient.changeBenefitsVedioState(changeBenefitsVedioState); |
| | | return ResultUtil.success(); |
| | | } |
| | | |