模具大屏饼状图显示全部模具状态
This commit is contained in:
parent
612795ceec
commit
185c3546cf
@ -53,14 +53,11 @@ public class MoldScreenController extends BaseController {
|
||||
|
||||
/**
|
||||
* 模具状态饼状图
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pie")
|
||||
public AjaxResult MoldStatusPieChart(@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
|
||||
List<Map<String, Object>> list = moldScreenService.MoldStatusPieChart(startTime, endTime);
|
||||
public AjaxResult MoldStatusPieChart() {
|
||||
List<Map<String, Object>> list = moldScreenService.MoldStatusPieChart();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@ -28,11 +28,9 @@ public interface IMoldScreenService {
|
||||
|
||||
/**
|
||||
* 模具状态饼状图
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> MoldStatusPieChart(Date startTime, Date endTime);
|
||||
public List<Map<String, Object>> MoldStatusPieChart();
|
||||
|
||||
/**
|
||||
* 出入库柱状图
|
||||
|
||||
@ -247,12 +247,10 @@ public class MoldScreenServiceImpl implements IMoldScreenService {
|
||||
|
||||
/**
|
||||
* 模具状态饼状图
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> MoldStatusPieChart(Date startTime, Date endTime) {
|
||||
public List<Map<String, Object>> MoldStatusPieChart() {
|
||||
|
||||
List<String> statusList;
|
||||
|
||||
@ -268,20 +266,20 @@ public class MoldScreenServiceImpl implements IMoldScreenService {
|
||||
.select("TRIM(status) as status", "count(*) as value") // 查询去空格,重命名为status
|
||||
.groupBy("TRIM(status)"); // 分组去空格,与select一致
|
||||
|
||||
if (startTime != null) {
|
||||
queryWrapper.and(w -> w
|
||||
.ge("update_time", startTime)
|
||||
.or(w2 -> w2.isNull("update_time").ge("create_time", startTime))
|
||||
);
|
||||
}
|
||||
|
||||
if (endTime != null) {
|
||||
Date adjustedEndTime = getEndOfDay(endTime);
|
||||
queryWrapper.and(w -> w
|
||||
.le("update_time", adjustedEndTime)
|
||||
.or(w2 -> w2.isNull("update_time").le("create_time", adjustedEndTime))
|
||||
);
|
||||
}
|
||||
// if (startTime != null) {
|
||||
// queryWrapper.and(w -> w
|
||||
// .ge("update_time", startTime)
|
||||
// .or(w2 -> w2.isNull("update_time").ge("create_time", startTime))
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// if (endTime != null) {
|
||||
// Date adjustedEndTime = getEndOfDay(endTime);
|
||||
// queryWrapper.and(w -> w
|
||||
// .le("update_time", adjustedEndTime)
|
||||
// .or(w2 -> w2.isNull("update_time").le("create_time", adjustedEndTime))
|
||||
// );
|
||||
// }
|
||||
|
||||
List<Map<String, Object>> statistics = moldInfoMapper.selectMaps(queryWrapper);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user