فهرست منبع

chore: auto bump version and changelog [skip ci]

iwt 2 ماه پیش
والد
کامیت
75bd922a6d

+ 18 - 0
cfc-backend/src/main/java/com/etotem/cfc/controller/HealthReportController.java

@@ -1592,6 +1592,14 @@ public class HealthReportController {
 
 
         try {
         try {
             Map<String, Object> result = healthReportService.auditConfirm(draftId, subjectId, auditorId);
             Map<String, Object> result = healthReportService.auditConfirm(draftId, subjectId, auditorId);
+            Long confirmedSubjectId = ParamUtils.getLong(result.get("subjectId"));
+            if (confirmedSubjectId != null) {
+                try {
+                    foodRecommendService.recalculateForUser(confirmedSubjectId);
+                } catch (Exception e) {
+                    log.warn("审核确认后刷新食材推荐失败: {}", e.getMessage());
+                }
+            }
             return Result.success(result);
             return Result.success(result);
         } catch (Exception e) {
         } catch (Exception e) {
             log.error("审核确认失败", e);
             log.error("审核确认失败", e);
@@ -2214,6 +2222,16 @@ public class HealthReportController {
             Map<String, Object> result = healthReportService.auditConfirm(draftId, subjectId, userId);
             Map<String, Object> result = healthReportService.auditConfirm(draftId, subjectId, userId);
             Long reportId = (Long) result.get("reportId");
             Long reportId = (Long) result.get("reportId");
 
 
+            // 维护"当前食材"推荐(有则更新,无则添加)
+            Long confirmedSubjectId = ParamUtils.getLong(result.get("subjectId"));
+            if (confirmedSubjectId != null) {
+                try {
+                    foodRecommendService.recalculateForUser(confirmedSubjectId);
+                } catch (Exception e) {
+                    log.warn("代确认后刷新食材推荐失败: {}", e.getMessage());
+                }
+            }
+
             // 设置代上传信息
             // 设置代上传信息
             if (reportId != null) {
             if (reportId != null) {
                 healthReportService.setProxyUploader(reportId, userId);
                 healthReportService.setProxyUploader(reportId, userId);

+ 1 - 0
cfc-backend/src/main/java/com/etotem/cfc/service/FoodRecommendService.java

@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-cc11a036271a0fe74be085e9b17b4dd460dee0e6
+47983024686ab29a664a91fe3df91e381444e6ac