no message

main
HUOJIN\92525 2026-01-19 17:00:58 +08:00
parent fa5ae61571
commit fc6417acd2
1 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
@ -79,11 +81,15 @@ public class DashBoardController {
outObj.put("color", "orange");
jsonArray.add(outObj);
//turnoverTotal四舍五入保留两位小数
double turnoverTotal = outTotal / (double) invTotal;
BigDecimal bd = new BigDecimal(turnoverTotal);
bd = bd.setScale(2, RoundingMode.HALF_UP);
double roundedValue = bd.doubleValue();
JSONObject turnoverObj = new JSONObject(true);
turnoverObj.put("title", "库存周转率(次/天)");
turnoverObj.put("icon", "transaction|svg");
turnoverObj.put("total", turnoverTotal);
turnoverObj.put("total", roundedValue);
jsonArray.add(turnoverObj);
result.setResult(jsonArray);