Pu Zhibing
2025-01-23 792cbb986fb8c32f6bbc1638c4ae264372e7a28f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.ruoyi.integration.controller;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation;
import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData;
import com.ruoyi.integration.mongodb.service.BmsDemandAndChargerExportationService;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * @author zhibing.pu
 * @Date 2024/11/1 15:52
 */
@RestController
@RequestMapping("/bmsDemandAndChargerExportation")
public class BmsDemandAndChargerExportationController {
    
    @Resource
    private BmsDemandAndChargerExportationService bmsDemandAndChargerExportationService;
    
    /**
     * 获取充电中bms数据
     * @param orderCode
     * @return
     */
    @PostMapping("/getBmsDemandAndChargerExportation")
    public R<BmsDemandAndChargerExportation> getBmsDemandAndChargerExportation(@RequestParam("orderCode") String orderCode){
        List<BmsDemandAndChargerExportation> bmsDemandAndChargerExportation = bmsDemandAndChargerExportationService.getBmsDemandAndChargerExportation(orderCode);
        if(bmsDemandAndChargerExportation.size() > 0){
            BmsDemandAndChargerExportation uploadRealTimeMonitoringData = bmsDemandAndChargerExportation.get(0);
            return R.ok(uploadRealTimeMonitoringData);
        }
        return R.ok();
    }
    
    
}