Prechádzať zdrojové kódy

fix 镜像车队分数

zoujiajian 2 rokov pred
rodič
commit
74c1f8cab6

+ 6 - 0
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -28,6 +28,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.time.LocalDateTime;
 import java.util.Set;
 
@@ -187,6 +189,10 @@ public class MirrorController {
             throw BusinessRuntimeException.getInstance("您还未购买车票");
         }
         Set<ChatgptCarInfoView> carInfoList = chatGptAccountService.getCarInfoList(carChatGptUser.getUserToken(),10, isPlus);
+        for (ChatgptCarInfoView chatgptCarInfoView : carInfoList) {
+            Double score = BigDecimal.valueOf(chatgptCarInfoView.getScore()).multiply(BigDecimal.valueOf(0.5)).setScale(0, RoundingMode.DOWN).doubleValue();
+            chatgptCarInfoView.setScore(score);
+        }
         return GatewayResponse.SUCCESS.newBuilder().toResult(carInfoList);
     }