|  | @@ -4,12 +4,15 @@ import java.util.List;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.fs.common.core.domain.R;
 | 
	
		
			
				|  |  |  import com.fs.course.domain.FsUserCoursePeriodDays;
 | 
	
		
			
				|  |  | +import com.fs.course.domain.FsUserCourseVideoRedPackage;
 | 
	
		
			
				|  |  | +import com.fs.course.param.CompanyRedPacket;
 | 
	
		
			
				|  |  |  import com.fs.course.service.IFsUserCoursePeriodDaysService;
 | 
	
		
			
				|  |  | +import com.fs.course.service.IFsUserCourseVideoRedPackageService;
 | 
	
		
			
				|  |  |  import com.fs.course.vo.FsUserCoursePeriodVO;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  |  import lombok.AllArgsConstructor;
 | 
	
		
			
				|  |  | +import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  |  import org.springframework.security.access.prepost.PreAuthorize;
 | 
	
		
			
				|  |  | -import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.GetMapping;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.PutMapping;
 | 
	
	
		
			
				|  | @@ -36,9 +39,11 @@ import com.fs.common.core.page.TableDataInfo;
 | 
	
		
			
				|  |  |  @RestController
 | 
	
		
			
				|  |  |  @AllArgsConstructor
 | 
	
		
			
				|  |  |  @RequestMapping("/course/period")
 | 
	
		
			
				|  |  | +@Slf4j
 | 
	
		
			
				|  |  |  public class FsUserCoursePeriodController extends BaseController {
 | 
	
		
			
				|  |  |      private final IFsUserCoursePeriodService fsUserCoursePeriodService;
 | 
	
		
			
				|  |  |      private final IFsUserCoursePeriodDaysService fsUserCoursePeriodDaysService;
 | 
	
		
			
				|  |  | +    private final IFsUserCourseVideoRedPackageService fsUserCourseVideoRedPackageService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 查询会员营期列表
 | 
	
	
		
			
				|  | @@ -132,4 +137,30 @@ public class FsUserCoursePeriodController extends BaseController {
 | 
	
		
			
				|  |  |      public R updateListCourseData(@RequestBody List<FsUserCoursePeriodDays> entity){
 | 
	
		
			
				|  |  |          return fsUserCoursePeriodDaysService.updateListCourseData(entity);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation("根据营期id获取公司红包金额列表")
 | 
	
		
			
				|  |  | +    @GetMapping("/companyList")
 | 
	
		
			
				|  |  | +    public R getCompanyByPeriod(Long periodId, Long videoId) {
 | 
	
		
			
				|  |  | +        List<CompanyRedPacket> companyList = fsUserCoursePeriodDaysService.getCompanyByPeriod(periodId, videoId);
 | 
	
		
			
				|  |  | +        return R.ok().put("data", companyList);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation("批量保存设置红包金额")
 | 
	
		
			
				|  |  | +    @PostMapping("/batchRedPacket")
 | 
	
		
			
				|  |  | +    public R batchRedPacketMoney(@RequestBody List<FsUserCourseVideoRedPackage> videoRedPackageList) {
 | 
	
		
			
				|  |  | +        //查询该公司红包金额数据是否存在,如果存在,则修改
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            fsUserCourseVideoRedPackageService.batchDeleteParams(videoRedPackageList);
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  | +            log.info("删除数据失败,参数:{}", videoRedPackageList);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        int i = fsUserCourseVideoRedPackageService.batchSaveFsUserCourseVideoRedPackage(videoRedPackageList);
 | 
	
		
			
				|  |  | +        if (i <= 0) {
 | 
	
		
			
				|  |  | +            return R.error("保存失败!");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return R.ok();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  }
 |