|
@@ -4,12 +4,8 @@ import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
-import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
|
|
|
|
|
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderRespVO;
|
|
|
|
|
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotReportInspectOrderRespVO;
|
|
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotmainworkorder.vo.IotMainWorkOrderPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotmainworkorder.vo.IotMainWorkOrderPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.stat.vo.ReportCost;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.stat.vo.ReportCost;
|
|
@@ -22,7 +18,6 @@ import com.google.common.collect.ImmutableMap;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -82,8 +77,7 @@ public class IotRepairController {
|
|
|
.map(fee -> Objects.isNull(fee) ? BigDecimal.ZERO : fee)
|
|
.map(fee -> Objects.isNull(fee) ? BigDecimal.ZERO : fee)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
|
|
- BigDecimal tbByFee = new BigDecimal("0");
|
|
|
|
|
- BigDecimal hbByFee = new BigDecimal("0");
|
|
|
|
|
|
|
+ BigDecimal tbByFee = new BigDecimal("0");BigDecimal hbByFee = new BigDecimal("0");
|
|
|
// 同比 去年同期相同统计数据对比 无数据
|
|
// 同比 去年同期相同统计数据对比 无数据
|
|
|
tbByFee = tbByFee==null?BigDecimal.ZERO:tbByFee;
|
|
tbByFee = tbByFee==null?BigDecimal.ZERO:tbByFee;
|
|
|
//获取环比
|
|
//获取环比
|
|
@@ -174,12 +168,12 @@ public class IotRepairController {
|
|
|
.map(fee -> Objects.isNull(fee) ? BigDecimal.ZERO : fee)
|
|
.map(fee -> Objects.isNull(fee) ? BigDecimal.ZERO : fee)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 查询保养费用
|
|
// 查询保养费用
|
|
|
Map<String, Object> byMap = new HashMap<>();
|
|
Map<String, Object> byMap = new HashMap<>();
|
|
|
byMap.put("total", byFee);
|
|
byMap.put("total", byFee);
|
|
|
byMap.put("hb", hbByFee == null || (hbByFee.compareTo(BigDecimal.ZERO)==0) ? hbByFee :((byFee.subtract(hbByFee)).divide(hbByFee,2, RoundingMode.HALF_UP)));
|
|
byMap.put("hb", hbByFee == null || (hbByFee.compareTo(BigDecimal.ZERO)==0) ? hbByFee :((byFee.subtract(hbByFee)).divide(hbByFee,2, RoundingMode.HALF_UP)));
|
|
|
byMap.put("tb", tbByFee==null||(tbByFee.compareTo(BigDecimal.ZERO)==0)?tbByFee:((byFee.subtract(tbByFee)).divide(tbByFee,2, RoundingMode.HALF_UP)));
|
|
byMap.put("tb", tbByFee==null||(tbByFee.compareTo(BigDecimal.ZERO)==0)?tbByFee:((byFee.subtract(tbByFee)).divide(tbByFee,2, RoundingMode.HALF_UP)));
|
|
|
-
|
|
|
|
|
Map<String, Object> totalMap = new HashMap<>();
|
|
Map<String, Object> totalMap = new HashMap<>();
|
|
|
totalMap.put("total", totalFee);
|
|
totalMap.put("total", totalFee);
|
|
|
totalMap.put("hb", hbTotalFee==null|| hbTotalFee.equals(BigDecimal.ZERO) ? hbTotalFee :((totalFee.subtract(hbTotalFee)).divide(hbTotalFee,2, RoundingMode.HALF_UP)));
|
|
totalMap.put("hb", hbTotalFee==null|| hbTotalFee.equals(BigDecimal.ZERO) ? hbTotalFee :((totalFee.subtract(hbTotalFee)).divide(hbTotalFee,2, RoundingMode.HALF_UP)));
|
|
@@ -188,8 +182,8 @@ public class IotRepairController {
|
|
|
outMap.put("total", outFee);
|
|
outMap.put("total", outFee);
|
|
|
outMap.put("hb", hbOutFee==null||hbOutFee.equals(BigDecimal.ZERO)?hbOutFee:((outFee.subtract(hbOutFee)).divide(hbOutFee,2, RoundingMode.HALF_UP)));
|
|
outMap.put("hb", hbOutFee==null||hbOutFee.equals(BigDecimal.ZERO)?hbOutFee:((outFee.subtract(hbOutFee)).divide(hbOutFee,2, RoundingMode.HALF_UP)));
|
|
|
outMap.put("tb", tbOutFee==null||tbOutFee.equals(BigDecimal.ZERO)?tbOutFee:((outFee.subtract(tbOutFee)).divide(tbOutFee,2, RoundingMode.HALF_UP)));
|
|
outMap.put("tb", tbOutFee==null||tbOutFee.equals(BigDecimal.ZERO)?tbOutFee:((outFee.subtract(tbOutFee)).divide(tbOutFee,2, RoundingMode.HALF_UP)));
|
|
|
- return CommonResult.success(ImmutableMap.of("repair", totalMap,
|
|
|
|
|
- "out", outMap, "byFee", byMap));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.success(ImmutableMap.of("repair", totalMap, "out", outMap, "byFee", byMap));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|