|  | @@ -1,17 +1,12 @@
 | 
	
		
			
				|  |  |  package com.ym.mec.student.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  | -import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.MusicalNotesPlayStatDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.SysMusicCompareRecord;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.SysMusicCompareRecordService;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.SysUserService;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.controller.BaseController;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.entity.HttpResponseResult;
 | 
	
		
			
				|  |  | -import com.ym.mec.common.exception.BizException;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.ui.ModelMap;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.GetMapping;
 | 
	
	
		
			
				|  | @@ -19,7 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import java.util.List;
 | 
	
		
			
				|  |  |  import java.util.Objects;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
	
		
			
				|  | @@ -32,27 +26,24 @@ import java.util.Objects;
 | 
	
		
			
				|  |  |  public class SysMusicCompareRecordController extends BaseController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    private SysUserFeignService sysUserFeignService;
 | 
	
		
			
				|  |  | +    private SysUserService sysUserService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SysMusicCompareRecordService sysMusicCompareRecordService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "添加记录")
 | 
	
		
			
				|  |  |      @PostMapping("add")
 | 
	
		
			
				|  |  |      public HttpResponseResult add(SysMusicCompareRecord record){
 | 
	
		
			
				|  |  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -        if(sysUser == null){
 | 
	
		
			
				|  |  | -            throw new BizException("请登录");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  |          if(Objects.isNull(record.getFeature())){
 | 
	
		
			
				|  |  |              return failed("请设置功能点");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        record.setUserId(sysUser.getId());
 | 
	
		
			
				|  |  | +        Integer userId = sysUserService.getUserId();
 | 
	
		
			
				|  |  | +        record.setUserId(userId);
 | 
	
		
			
				|  |  |          record.setClientId("student");
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          sysMusicCompareRecordService.insert(record);
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          ModelMap model = new ModelMap();
 | 
	
		
			
				|  |  | -        model.put("totalPlayTimeOfCurrentDate", sysMusicCompareRecordService.queryCurrentDatePlayTimeByUserId(sysUser.getId()));
 | 
	
		
			
				|  |  | +        model.put("totalPlayTimeOfCurrentDate", sysMusicCompareRecordService.queryCurrentDatePlayTimeByUserId(userId));
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          return succeed(model);
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -60,11 +51,7 @@ public class SysMusicCompareRecordController extends BaseController {
 | 
	
		
			
				|  |  |      @ApiOperation(value = "用户最后一次评测数据")
 | 
	
		
			
				|  |  |      @GetMapping("getLastEvaluationMusicalNotesPlayStats")
 | 
	
		
			
				|  |  |      public HttpResponseResult getLastEvaluationMusicalNotesPlayStats(Long recordId){
 | 
	
		
			
				|  |  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -        if(sysUser == null){
 | 
	
		
			
				|  |  | -            throw new BizException("请登录");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return succeed(sysMusicCompareRecordService.getLastEvaluationMusicalNotesPlayStats(sysUser.getId(), recordId));
 | 
	
		
			
				|  |  | +        return succeed(sysMusicCompareRecordService.getLastEvaluationMusicalNotesPlayStats(sysUserService.getUserId(), recordId));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }
 |