sunkean пре 2 година
родитељ
комит
ed9aaf96ae
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      src/main/java/com/izouma/nineth/web/MetaTaskToUserNewController.java

+ 5 - 4
src/main/java/com/izouma/nineth/web/MetaTaskToUserNewController.java

@@ -6,6 +6,7 @@ import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.enums.MetaTaskStatus;
 import com.izouma.nineth.repo.MetaTaskToUserNewRepo;
 import com.izouma.nineth.service.MetaTaskToUserNewService;
+import com.izouma.nineth.utils.SecurityUtils;
 import com.izouma.nineth.utils.excel.ExcelUtils;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
@@ -39,11 +40,11 @@ public class MetaTaskToUserNewController {
         return metaTaskToUserNewService.receiveTask(metaTaskToUserNew, true);
     }
 
-    @GetMapping("/{id}/findProgress")
-    public MetaRestResult<MetaTaskToUserNew> findProgress(@PathVariable Long id) {
-        MetaTaskToUserNew metaTaskToUserNew = metaTaskToUserNewRepo.findByIdAndDel(id, false);
+    @GetMapping("/{taskId}/{atomTaskId}/findProgress")
+    public MetaRestResult<MetaTaskToUserNew> findProgress(@PathVariable Long taskId, @PathVariable Long atomTaskId) {
+        MetaTaskToUserNew metaTaskToUserNew = metaTaskToUserNewRepo.findByUserIdAndTaskIdAndAtomTaskIdAndDel(SecurityUtils.getAuthenticatedUser().getId(), taskId, atomTaskId, false);
         if (Objects.isNull(metaTaskToUserNew)) {
-            return MetaRestResult.returnError(String.format("根据id[%S]查询不到用户领取记录", id));
+            return MetaRestResult.returnError(String.format("根据任务id[%S]+基础任务id[%S]查询不到用户领取记录", taskId, atomTaskId));
         }
         return metaTaskToUserNewService.setSingleProgress(metaTaskToUserNew);
     }