大屏二级页面
This commit is contained in:
parent
277e8916c6
commit
8c7454d22f
|
|
@ -28,6 +28,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
|
|
@ -331,6 +333,49 @@ public class LargeScreenController extends BaseController {
|
|||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 总应答率二级页面
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("总应答率二级页面")
|
||||
@GetMapping("/getTotalLeaseAnswerRate")
|
||||
public AjaxResult getTotalLeaseAnswerRate(MaLeaseAnswerInfo dto) {
|
||||
List<MaLeaseAnswerInfo> list = leaseInfoMapper.getLeaseAnswerRate(dto);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (MaLeaseAnswerInfo maLeaseAnswerInfo : list) {
|
||||
// 根据 typeId 查询设备名称
|
||||
if (maLeaseAnswerInfo.getTypeId() != null) {
|
||||
// 获取list集合
|
||||
List<String> typeIds = Arrays.asList(maLeaseAnswerInfo.getTypeId().split(","));
|
||||
// 查询类型名称
|
||||
String typeName = leaseInfoMapper.selectMaTypeList(typeIds);
|
||||
maLeaseAnswerInfo.setTypeName(typeName);
|
||||
}
|
||||
}
|
||||
if (!StringUtils.isBlank(dto.getKeyWord())) {
|
||||
list = list.stream()
|
||||
.filter(item -> containsKeyword(item, dto.getKeyWord()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
Integer publishCount = 0;
|
||||
Integer orderCount = 0;
|
||||
MaLeaseAnswerInfo info = new MaLeaseAnswerInfo();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (MaLeaseAnswerInfo maLeaseAnswerInfo : list) {
|
||||
publishCount += maLeaseAnswerInfo.getPublishCount();
|
||||
orderCount += maLeaseAnswerInfo.getOrderCount();
|
||||
}
|
||||
info.setPublishCount(publishCount);
|
||||
info.setOrderCount(orderCount);
|
||||
// 计算装备利用率,保持2位小数百分比(leaseTotal/leaseTotal + upTotal)
|
||||
BigDecimal result = MathUtil.calculatePercentage(orderCount, publishCount);
|
||||
info.setAnswerRate(result.setScale(2, RoundingMode.HALF_UP).toString());
|
||||
}
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断关键字
|
||||
* @param item
|
||||
|
|
@ -439,6 +484,27 @@ public class LargeScreenController extends BaseController {
|
|||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
@ApiOperation("装备总利用率")
|
||||
@GetMapping("/getTotalDevRate")
|
||||
public AjaxResult getTotalDevRate(MaDevRateInfo dto) {
|
||||
List<MaDevRateInfo> list = leaseInfoMapper.getDevRate(dto);
|
||||
MaDevRateInfo info = new MaDevRateInfo();
|
||||
Integer upTotal = 0;
|
||||
Integer leaseTotal = 0;
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (MaDevRateInfo maDevRateInfo : list) {
|
||||
upTotal += maDevRateInfo.getUpTotal();
|
||||
leaseTotal += maDevRateInfo.getLeaseTotal();
|
||||
}
|
||||
info.setUpTotal(upTotal);
|
||||
info.setLeaseTotal(leaseTotal);
|
||||
// 计算装备利用率,保持2位小数百分比(leaseTotal/leaseTotal + upTotal)
|
||||
BigDecimal result = MathUtil.calculatePercentage(leaseTotal, leaseTotal + upTotal);
|
||||
info.setRate(result.setScale(2, RoundingMode.HALF_UP).toString());
|
||||
}
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退租装备
|
||||
* @param dto
|
||||
|
|
|
|||
Loading…
Reference in New Issue