whycrzg
2021-01-29 0f24731e84183146193ed19d1a51f7f63a98cd1a
update
21个文件已修改
493 ■■■■■ 已修改文件
src/main/java/com/fgkj/controller/Batt_dischargeController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_electricityController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_historyController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_maint_processController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_param_lowController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_realdataController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_rtController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_rtdataController.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_rtstateController.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/dto/Batt_realdata.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/dto/Batt_rtdata.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/dto/Batt_rtstate.java 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/mapper/impl/Batt_dischargeMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/mapper/impl/Batt_rtMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/Batt_dischargeService.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/Batt_maint_processService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/Batt_maintenance_infService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/Batt_rtService.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/history/Batt_realdataService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattDischargeMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattRtMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Batt_dischargeController.java
@@ -1,5 +1,6 @@
package com.fgkj.controller;
import com.fgkj.dto.User_inf;
import com.fgkj.util.*;
import com.fgkj.dto.Batt_discharge;
@@ -16,18 +17,19 @@
@RequestMapping("battDischarge")
@RestController
@Api(tags = "battDischarge接口")
@Api(tags = "battDischarge接口 Deprecated")
@Deprecated
public class Batt_dischargeController{
    @Resource
    private Batt_dischargeService service;
     //批量添加
    @PostMapping("/")
    @ApiOperation(notes = "",value="批量添加")
    @ApiOperation(notes = "[{ \"uid\": 12, \"dev_id\": 91100013, \"record_time\": \"2021-01-28 14:53:21\" }]",value="批量添加")
    public ServiceModel  add(@RequestBody List<Batt_discharge> list) {
        // List<Batt_discharge> list=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, new TypeToken<List<Batt_discharge>>(){}.getType());
//        User_inf user = (User_inf) ActionUtil.getUser();
        ServiceModel model=service.add(list);
        return model;
src/main/java/com/fgkj/controller/Batt_electricityController.java
@@ -9,9 +9,11 @@
import com.fgkj.services.User_logService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@RequestMapping("battElectricity")
@@ -25,7 +27,7 @@
    private User_logService uservice;
    @PostMapping("/")
    @ApiOperation(notes = "",value="新增")
    @ApiOperation(notes = "{ \"dev_id\": 12112, \"dev_name\": \"91000012\", \"dev_recordtime\": \"2020-12-28 08:18:11\", \"dev_electricity_CM\": 0.0, \"dev_electricity_CT\": 0.0, \"dev_electricity_CU\": 0.0, \"note\": \"test\" }",value="新增")
    public ServiceModel add(@RequestBody Batt_electricity be){
        // Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
        ServiceModel model = service.add(be);
@@ -36,8 +38,9 @@
        }
        return model;
    }
    @PutMapping("/")
    @ApiOperation(notes = "",value="修改")
    @ApiOperation(notes = "{ \"num\": 39284, \"dev_id\": 0, \"dev_name\": \"\", \"dev_recordtime\": \"2020-12-29 08:21:43\", \"dev_electricity_CM\": 0.0, \"dev_electricity_CT\": 0.0, \"dev_electricity_CU\": 0.0, \"note\": \"uu\" }",value="修改")
    public ServiceModel update(@RequestBody Batt_electricity be){
        // Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
        ServiceModel model  = service.update(be);
@@ -46,8 +49,9 @@
    }
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除")
    public ServiceModel del(@RequestBody Batt_electricity be){
        // Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
    public ServiceModel del(@RequestParam Integer num) {
        Batt_electricity be = new Batt_electricity();
        be.setNum(num);
        ServiceModel model = service.del(be);
        return model;
@@ -66,20 +70,26 @@
     * 记录时间放在battinf的battproducer
     * 统计方式放在battinf  的signalname  中       1 - 月       2-季度    3-年份
     * */
    @GetMapping("byCondition")
    @ApiOperation(notes = "根据设备id连battinf和batt_devdischarge表",value="查询电度")
    public List serchByCondition(@RequestBody BattInf binf){
        // BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
    @PostMapping("byCondition")
    @ApiOperation(notes = "根据设备id连battinf和batt_devdischarge表 ",value="查询电度")
    public List serchByCondition(@ApiParam(value = "设备id 42010007" ,required = true)@RequestParam String stationId, @ApiParam(value = "生产日期 格式2016/12/29 08:21:43" ,required = true)@RequestParam Date battProductDate,@ApiParam(value = "生产日期" ,required = true)@RequestParam Date battProductDate1){
        BattInf binf = new BattInf();
        binf.setStationId(stationId);
        binf.setBattProductDate(battProductDate);
        binf.setBattProductDate1(battProductDate1);
        List list = service.serchByCondition(binf);
        //System.out.println(result);
        return list;
    }
    
    //9.1机房主控中用电量的统计的折线图
    @GetMapping("byInfo")
    @PostMapping("byInfo")
    @ApiOperation(notes = "",value="机房主控中用电量的统计的折线图")
    public ServiceModel  serchByInfo(@RequestBody BattInf binf){
        // BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
    public ServiceModel  serchByInfo(@ApiParam(value = "设备id 42010007" ,required = true)@RequestParam String stationId, @ApiParam(value = "生产日期 格式2016/12/29 08:21:43" ,required = true)@RequestParam Date battProductDate,@ApiParam(value = "生产日期" ,required = true)@RequestParam Date battProductDate1){
        BattInf binf = new BattInf();
        binf.setStationId(stationId);
        binf.setBattProductDate(battProductDate);
        binf.setBattProductDate1(battProductDate1);
        //System.out.println(binf);
        ServiceModel model = service.serchByInfo(binf);
src/main/java/com/fgkj/controller/Batt_historyController.java
@@ -6,28 +6,31 @@
import com.fgkj.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
@RequestMapping("battHistory")
@RestController
@Api(tags = "battHistory接口")
@Api(tags = "battHistory接口 TODO")
public class Batt_historyController{
    @Resource
    private Batt_historyService service;
    //查询所有的历史实时数据
        //TODO 数据库不同,使用这个表名测试 db_batt_history.tb_batt_910000001_2017_12
    @GetMapping("serchByCondition")
    @ApiOperation(notes = "TODO 数据库不同表,待测",value="查询所有的历史实时数据")
    public ServiceModel serchByCondition(@RequestBody Batt_history batt_his){
//         Batt_history batt_his= ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_history.class);
        ServiceModel model=service.serchByCondition(batt_his);
    //TODO 数据库不同,使用这个表名测试 db_batt_history.tb_batt_910000001_2017_12
    @PostMapping("serchByCondition")
    @ApiOperation(notes = "TODO 数据库不同表字段不同,待测 db_batt_history.tb_batt_910000001_2017_12", value = "查询所有的历史实时数据")
    public ServiceModel serchByCondition(@ApiParam(value = "设备id 910000001", required = true) @RequestParam Integer dev_id, @ApiParam(value = "battGroupId 1005059", required = true) @RequestParam Integer battGroupId, @ApiParam(value = "日期 格式2017/12/29 09:28:31", required = true) @RequestParam Date rec_datetime, @ApiParam(value = "日期 2018/12/29 09:28:31", required = true) @RequestParam Date rec_datetime1) {
        Batt_history batt_his = new Batt_history();
        batt_his.setDev_id(dev_id);
        batt_his.setBattGroupId(battGroupId);
        batt_his.setRec_datetime(rec_datetime);
        batt_his.setRec_datetime1(rec_datetime1);
        ServiceModel model = service.serchByCondition(batt_his);
        return model;
    }
src/main/java/com/fgkj/controller/Batt_maint_processController.java
@@ -5,10 +5,7 @@
import com.fgkj.services.Batt_maint_processService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -23,10 +20,11 @@
    // private Batt_maint_process bmp;
    //3.1根据id查所有编辑信息
    @GetMapping("serchByCondition")
    @PostMapping("serchByCondition")
    @ApiOperation(notes = "",value="根据id查所有编辑信息")
    public ServiceModel serchByCondition(@RequestBody Batt_maint_process bmp){
        // bmp=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_maint_process.class);
    public ServiceModel serchByCondition(@RequestParam Integer batt_maint_rec_id){
        Batt_maint_process bmp= new Batt_maint_process();
        bmp.setBatt_maint_rec_id(batt_maint_rec_id);
        ServiceModel model=service.serchByCondition(bmp);        
        return model;
    }
src/main/java/com/fgkj/controller/Batt_param_lowController.java
@@ -38,7 +38,7 @@
    }
    @PutMapping("updateAll")
    @ApiOperation(notes = "",value="全部更新")
    @ApiOperation(notes = "[{ \"low_type\": 1, \"low_nametype\": 1, \"low_value\": 0.0, \"low_method\": 0 }]",value="全部更新")
    public ServiceModel updateAll(@RequestBody List<Batt_param_low> list){
        Gson gson=new Gson();
        UserRole u=new UserRole();
src/main/java/com/fgkj/controller/Batt_realdataController.java
@@ -5,12 +5,11 @@
import com.fgkj.services.history.Batt_realdataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
@RequestMapping("battRealData")
@RestController
@@ -21,11 +20,14 @@
    private Batt_realdataService service;
     //按照时间倒序查出具体电池组的所有信息
    @GetMapping("byCondition")
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="按照时间倒序查出具体电池组的所有信息")
    public ServiceModel serchByCondition(@RequestBody Batt_realdata realData) {
        // Batt_realdata breal=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_realdata.class);
        ServiceModel model=service.serchByCondition(realData);
    public ServiceModel serchByCondition(@ApiParam(value = "battGroupId 1000002", required = true) @RequestParam Integer battGroupId, @ApiParam(value = "前一时间 格式2017/12/29 09:28:31", required = true) @RequestParam Date record_time, @ApiParam(value = "后一时间", required = true) @RequestParam Date record_time1,@RequestParam Integer pageNum,@RequestParam Integer pageSize) {
        Batt_realdata realData = new Batt_realdata();
        realData.setBattGroupId(battGroupId);
        realData.setRecord_time(record_time);
        realData.setRecord_time1(record_time1);
        ServiceModel model = service.serchByCondition(realData,pageNum,pageSize);
        return model;
    }
src/main/java/com/fgkj/controller/Batt_rtController.java
@@ -1,22 +1,14 @@
package com.fgkj.controller;
import com.fgkj.util.*;
import com.fgkj.dto.Batt_rtstate;
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.Batt_rtService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
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;
/**
 * @Description :电池实时数据,同时需要电池组/电池时使用
 * @date 2020/09/04
 **/
import javax.annotation.Resource;
@RequestMapping("battRt")
@@ -24,19 +16,18 @@
@Api(tags = "battRt接口")
public class Batt_rtController {
    private ServiceModel serviceModel;
    @Resource
    private Batt_rtService batt_rtService;
    /**根据电池组id查询电池组实时状态和电池单体实时数据*/
    @GetMapping("byGroupId")
    @ApiOperation(notes = "",value="电池组id查询电池组实时状态和电池单体实时数据")
    public ServiceModel searchByGroupId(@RequestBody Batt_rtstate rtState){
        // Batt_rtstate rtState = getGson().fromJson(json, Batt_rtstate.class);
        serviceModel =batt_rtService.searchByGroupId(rtState.getBattGroupId());
        return serviceModel;
    /**
     * 根据电池组id查询电池组实时状态和电池单体实时数据
     */
    @PostMapping("byGroupId")
    @ApiOperation(notes = "", value = "电池组id查询电池组实时状态和电池单体实时数据")
    public ServiceModel searchByGroupId(@RequestParam Integer battGroupId) {
        return batt_rtService.searchByGroupId(battGroupId);
    }
}
src/main/java/com/fgkj/controller/Batt_rtdataController.java
@@ -8,10 +8,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -23,30 +20,32 @@
    @Resource
    private Batt_rtdataService service;
    @GetMapping("byCondition")
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="实时监测")
    public ServiceModel serchByCondition(@RequestBody Batt_rtdata rtdata){
        // Batt_rtdata rtdata=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_rtdata.class);
    public ServiceModel serchByCondition(@RequestParam Integer battGroupId){
        Batt_rtdata rtdata= new Batt_rtdata();
        rtdata.setBattGroupId(battGroupId);
        ServiceModel model=service.serchByCondition(rtdata);
        return model;
    }
    //历史监测中查询出电池组的实时内阻并将其导出报表
    @GetMapping("resById")
    @PostMapping("resById")
    @ApiOperation(notes = "",value="历史监测中查询出电池组的实时内阻并将其导出报表")
    public ServiceModel serchResById(@RequestBody Batt_rtdata rtdata){
        // Batt_rtdata rtdata=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_rtdata.class);
    public ServiceModel serchResById(@RequestParam Integer battGroupId){
        Batt_rtdata rtdata= new Batt_rtdata();
        rtdata.setBattGroupId(battGroupId);
        ServiceModel model=service.serchResById(rtdata);
        return model;
    }
    //跨域访问查询电池组的单体数据            < ! ---- ----  跨域访问  ------------>
    @GetMapping("byCondition_ky")
    @PostMapping("byCondition_ky")
    @ApiOperation(tags = "跨域", notes = "跨域访问",value="跨域访问查询电池组的单体数据 跨域访问")
    public ServiceModel serchByCondition_ky(@RequestBody Batt_rtdata rtdata){
    public ServiceModel serchByCondition_ky(@RequestParam Integer battGroupId){
        Batt_rtdata rtdata= new Batt_rtdata();
        rtdata.setBattGroupId(battGroupId);
        //ActionUtil.isAllowHeaders();
        ServiceModel model = new ServiceModel();
        // Batt_rtdata rtdata=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_rtdata.class);
        model=service.serchByCondition_ky(rtdata);
        ServiceModel model=service.serchByCondition_ky(rtdata);
        return model;
    }
src/main/java/com/fgkj/controller/Batt_rtstateController.java
@@ -5,10 +5,7 @@
import com.fgkj.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -20,35 +17,33 @@
    @Resource
    private Batt_rtstateService service;
    ServiceModel model = new ServiceModel();
    // private Batt_rtstate rtstate;
    //实时监测中的查询实时组端信息
    @GetMapping("byCondition")
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="实时监测中的查询实时组端信息")
    public ServiceModel serchByCondition(@RequestBody Batt_rtstate rtstate){
        //System.out.println("开始查询rtstate");
    public ServiceModel serchByCondition(@RequestParam Integer battGroupId) {
        Batt_rtstate rtstate= new Batt_rtstate();
        rtstate.setBattGroupId(battGroupId);
        ServiceModel model=service.serchByCondition(rtstate);
        //System.out.println(model);
        // result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
        return model;
    }
    
    //9.1根据查询电池组单体的实时数据(电池单体实时信息)
    @GetMapping("byMons")
    @PostMapping("byMons")
    @ApiOperation(notes = "",value="查询电池组单体的实时数据(电池单体实时信息)")
    public ServiceModel serchByMons(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
    public ServiceModel serchByMons(@RequestParam Integer battGroupId,@RequestParam Integer monNum) {
        BattInf binf = new BattInf();
        binf.setBattGroupId(battGroupId);
        binf.setMonNum(monNum);
        ServiceModel model = service.serchByMons(binf);
        return model;
    }
    
    //根据电池组id查询该电池组/单体的实时情况(电池续航能力)
    @GetMapping("byInfo")
    @PostMapping("byInfo")
    @ApiOperation(notes = "",value="电池组id查询该电池组/单体的实时情况(电池续航能力)")
    public ServiceModel serchByInfo(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
    public ServiceModel serchByInfo(@RequestParam Integer battGroupId) {
        BattInf binf = new BattInf();
        binf.setBattGroupId(battGroupId);
        ServiceModel model = service.serchByInfo(binf);
        return model;
    }
@@ -68,13 +63,12 @@
        ServiceModel model = service.serchBattStateRate(uinf);
        return model;
    }
    //电池组实时情况+实时电池续航能力查询
    @GetMapping("battLife")
    @ApiOperation(notes = "",value="电池组实时情况+实时电池续航能力查询")
    @PostMapping("battLife")
    @ApiOperation(notes = "{ \"binf\": { \"num\": 1, \"stationId\": \"\", \"stationName\": \"\", \"stationName1\": \"\", \"battGroupId\": 0 },\"pageBean\": { \"pageNum\": 0, \"pageSize\": 22 } }",value="电池组实时情况+实时电池续航能力查询")
    public ServiceModel serchBattLife(@RequestBody Batt_Maint_Dealarm bmd){
        System.out.println("bmd = " + bmd);
        // Batt_Maint_Dealarm bmd = ActionUtil.getGson().fromJson(json, Batt_Maint_Dealarm.class);
        User_inf uinf=(User_inf) ActionUtil.getUser();
        bmd.setUinf(uinf);
        ServiceModel model = service.serchBattLife(bmd);
@@ -83,7 +77,8 @@
    
    //测试数据——实时查询中左下角的充放电统计(旧)
    @GetMapping("disOrCharge")
    @ApiOperation(notes = "",value="测试数据——实时查询中左下角的充放电统计(旧)")
    @Deprecated
    @ApiOperation(notes = "Deprecated",value="测试数据——实时查询中左下角的充放电统计(旧)")
    public ServiceModel serchDisOrChargr(){
        ServiceModel model = service.serchDisOrChargr();
        return model;
@@ -98,9 +93,11 @@
        return model;
    }
    //实时监测中的查询实时组端信息        <!--   跨域访问 --->
    @GetMapping("byCondition_ky")
    @PostMapping("byCondition_ky")
    @ApiOperation(tags = "跨域", notes = "",value="实时监测中的查询实时组端信息 跨域访问")
    public ServiceModel serchByCondition_ky(@RequestBody Batt_rtstate rtstate){
    public ServiceModel serchByCondition_ky(@RequestParam Integer battGroupId){
        Batt_rtstate rtstate= new Batt_rtstate();
        rtstate.setBattGroupId(battGroupId);
        //ActionUtil.isAllowHeaders();                //允许跨域访问
        // rtstate = ActionUtil.getGson().fromJson(json, Batt_rtstate.class);
        ServiceModel model=service.serchByCondition_ky(rtstate);
src/main/java/com/fgkj/dto/Batt_realdata.java
@@ -48,6 +48,22 @@
        this.battGroupId = battGroupId;
    }
    public Date getRecord_time() {
        return record_time;
    }
    public void setRecord_time(Date record_time) {
        this.record_time = record_time;
    }
    public Date getRecord_time1() {
        return record_time1;
    }
    public void setRecord_time1(Date record_time1) {
        this.record_time1 = record_time1;
    }
    public float getGroup_vol() {
        return group_vol;
    }
@@ -157,4 +173,31 @@
        this.note = note;
    }
    @Override
    public String toString() {
        return "Batt_realdata{" +
                "num=" + num +
                ", battGroupId=" + battGroupId +
                ", record_time=" + record_time +
                ", record_time1=" + record_time1 +
                ", group_vol=" + group_vol +
                ", online_vol=" + online_vol +
                ", group_curr=" + group_curr +
                ", group_tmp=" + group_tmp +
                ", batt_state=" + batt_state +
                ", batt_test_type=" + batt_test_type +
                ", batt_test_starttime=" + batt_test_starttime +
                ", batt_test_tlong=" + batt_test_tlong +
                ", batt_test_cap=" + batt_test_cap +
                ", mon_num=" + mon_num +
                ", mon_vol=" + mon_vol +
                ", mon_tmp=" + mon_tmp +
                ", mon_res=" + mon_res +
                ", mon_ser=" + mon_ser +
                ", mon_conn_res=" + mon_conn_res +
                ", mon_cap=" + mon_cap +
                ", mon_JH_curr=" + mon_JH_curr +
                ", note='" + note + '\'' +
                '}';
    }
}
src/main/java/com/fgkj/dto/Batt_rtdata.java
@@ -4,6 +4,8 @@
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.Column;
@@ -104,6 +106,19 @@
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Batt_rtdata that = (Batt_rtdata) o;
        return Float.compare(that.mon_JH_curr, mon_JH_curr) == 0 && Float.compare(that.mon_LY_vol, mon_LY_vol) == 0 && Objects.equals(num, that.num) && Objects.equals(battGroupId, that.battGroupId) && Objects.equals(rec_datetime, that.rec_datetime) && Objects.equals(mon_num, that.mon_num) && Objects.equals(mon_vol, that.mon_vol) && Objects.equals(mon_tmp, that.mon_tmp) && Objects.equals(mon_res, that.mon_res) && Objects.equals(mon_ser, that.mon_ser) && Objects.equals(mon_conn_res, that.mon_conn_res) && Objects.equals(mon_cap, that.mon_cap);
    }
    @Override
    public int hashCode() {
        return Objects.hash(battGroupId, rec_datetime, mon_num, mon_vol, mon_tmp, mon_res, mon_ser, mon_conn_res, mon_cap, mon_JH_curr, mon_LY_vol);
    }
    @Override
    public String toString() {
        return "Batt_rtdata{" +
                "num=" + num +
src/main/java/com/fgkj/dto/Batt_rtstate.java
@@ -4,6 +4,8 @@
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonFormat;
@Alias("Batt_rtstate")
public class Batt_rtstate implements Serializable{
@@ -37,10 +39,11 @@
    private String stationName4;
    private String stationName5;
    private String stationId;
    public Integer getNum() {
        return num;
    }
    public void setNum(Integer num) {
        this.num = num;
    }
@@ -56,161 +59,228 @@
    public Integer getBatt_count() {
        return batt_count;
    }
    public void setBatt_count(Integer batt_count) {
        this.batt_count = batt_count;
    }
    public Date getRec_datetime() {
        return rec_datetime;
    }
    public void setRec_datetime(Date rec_datetime) {
        this.rec_datetime = rec_datetime;
    }
    public Float getOnline_vol() {
        return online_vol;
    }
    public void setOnline_vol(Float online_vol) {
        this.online_vol = online_vol;
    }
    public Float getGroup_vol() {
        return group_vol;
    }
    public void setGroup_vol(Float group_vol) {
        this.group_vol = group_vol;
    }
    public Float getGroup_curr() {
        return group_curr;
    }
    public void setGroup_curr(Float group_curr) {
        this.group_curr = group_curr;
    }
    public Integer getBatt_state() {
        return batt_state;
    }
    public void setBatt_state(Integer batt_state) {
        this.batt_state = batt_state;
    }
    public Integer getBatt_test_type() {
        return batt_test_type;
    }
    public void setBatt_test_type(Integer batt_test_type) {
        this.batt_test_type = batt_test_type;
    }
    public Date getBatt_test_starttime() {
        return batt_test_starttime;
    }
    public void setBatt_test_starttime(Date batt_test_starttime) {
        this.batt_test_starttime = batt_test_starttime;
    }
    public Date getBatt_test_recordtime() {
        return batt_test_recordtime;
    }
    public void setBatt_test_recordtime(Date batt_test_recordtime) {
        this.batt_test_recordtime = batt_test_recordtime;
    }
    public Integer getBatt_test_tlong() {
        return batt_test_tlong;
    }
    public void setBatt_test_tlong(Integer batt_test_tlong) {
        this.batt_test_tlong = batt_test_tlong;
    }
    public Float getBatt_test_cap() {
        return batt_test_cap;
    }
    public void setBatt_test_cap(Float batt_test_cap) {
        this.batt_test_cap = batt_test_cap;
    }
    public Float getBatt_real_cap() {
        return batt_real_cap;
    }
    public void setBatt_real_cap(Float batt_real_cap) {
        this.batt_real_cap = batt_real_cap;
    }
    public Float getBatt_rest_cap() {
        return batt_rest_cap;
    }
    public void setBatt_rest_cap(Float batt_rest_cap) {
        this.batt_rest_cap = batt_rest_cap;
    }
    public Integer getBatt_rest_power1_time() {
        return batt_rest_power1_time;
    }
    public void setBatt_rest_power1_time(Integer batt_rest_power1_time) {
        this.batt_rest_power1_time = batt_rest_power1_time;
    }
    public Integer getBatt_rest_power2_time() {
        return batt_rest_power2_time;
    }
    public void setBatt_rest_power2_time(Integer batt_rest_power2_time) {
        this.batt_rest_power2_time = batt_rest_power2_time;
    }
    public String getNote() {
        return note;
    }
    public void setNote(String note) {
        this.note = note;
    }
    public String getStationName() {
        return stationName;
    }
    public void setStationName(String stationName) {
        this.stationName = stationName;
    }
    public String getStationName1() {
        return stationName1;
    }
    public void setStationName1(String stationName1) {
        this.stationName1 = stationName1;
    }
    public String getStationName2() {
        return stationName2;
    }
    public void setStationName2(String stationName2) {
        this.stationName2 = stationName2;
    }
    public String getStationName3() {
        return stationName3;
    }
    public void setStationName3(String stationName3) {
        this.stationName3 = stationName3;
    }
    public String getStationName4() {
        return stationName4;
    }
    public void setStationName4(String stationName4) {
        this.stationName4 = stationName4;
    }
    public String getStationName5() {
        return stationName5;
    }
    public void setStationName5(String stationName5) {
        this.stationName5 = stationName5;
    }
    public String getStationId() {
        return stationId;
    }
    public void setStationId(String stationId) {
        this.stationId = stationId;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Batt_rtstate that = (Batt_rtstate) o;
        return Objects.equals(battGroupId, that.battGroupId) && Objects.equals(batt_count, that.batt_count) && Objects.equals(rec_datetime, that.rec_datetime) && Objects.equals(online_vol, that.online_vol) && Objects.equals(group_vol, that.group_vol) && Objects.equals(group_curr, that.group_curr) && Objects.equals(batt_state, that.batt_state) && Objects.equals(batt_test_type, that.batt_test_type) && Objects.equals(batt_test_starttime, that.batt_test_starttime) && Objects.equals(batt_test_recordtime, that.batt_test_recordtime) && Objects.equals(batt_test_tlong, that.batt_test_tlong) && Objects.equals(batt_test_cap, that.batt_test_cap) && Objects.equals(batt_real_cap, that.batt_real_cap) && Objects.equals(batt_rest_cap, that.batt_rest_cap) && Objects.equals(batt_rest_power1_time, that.batt_rest_power1_time) && Objects.equals(batt_rest_power2_time, that.batt_rest_power2_time) && Objects.equals(note, that.note) && Objects.equals(stationName, that.stationName) && Objects.equals(stationName1, that.stationName1) && Objects.equals(stationName2, that.stationName2) && Objects.equals(stationName3, that.stationName3) && Objects.equals(stationName4, that.stationName4) && Objects.equals(stationName5, that.stationName5) && Objects.equals(stationId, that.stationId);
    }
    @Override
    public int hashCode() {
        return Objects.hash(battGroupId, batt_count, rec_datetime, online_vol, group_vol, group_curr, batt_state, batt_test_type, batt_test_starttime, batt_test_recordtime, batt_test_tlong, batt_test_cap, batt_real_cap, batt_rest_cap, batt_rest_power1_time, batt_rest_power2_time, note, stationName, stationName1, stationName2, stationName3, stationName4, stationName5, stationId);
    }
    @Override
    public String toString() {
        return "Batt_rtstate [num=" + num + ",  battGroupId=" +  battGroupId
                + ", batt_count=" + batt_count + ", rec_datetime="
                + rec_datetime + ", online_vol=" + online_vol + ", group_vol="
                + group_vol + ", group_curr=" + group_curr + ", batt_state="
                + batt_state + ", batt_test_type=" + batt_test_type
                + ", batt_test_starttime=" + batt_test_starttime
                + ", batt_test_recordtime=" + batt_test_recordtime
                + ", batt_test_tlong=" + batt_test_tlong + ", batt_test_cap="
                + batt_test_cap + ", batt_real_cap=" + batt_real_cap
                + ", batt_rest_cap=" + batt_rest_cap
                + ", batt_rest_power1_time=" + batt_rest_power1_time
                + ", batt_rest_power2_time=" + batt_rest_power2_time
                + ", note=" + note + ", stationName=" + stationName
                + ", stationName1=" + stationName1 + ", stationName2="
                + stationName2 + ", stationName3=" + stationName3
                + ", stationName4=" + stationName4 + ", stationName5="
                + stationName5 + ", stationId=" + stationId + "]";
        return "Batt_rtstate{" +
                "num=" + num +
                ", battGroupId=" + battGroupId +
                ", batt_count=" + batt_count +
                ", rec_datetime=" + rec_datetime +
                ", online_vol=" + online_vol +
                ", group_vol=" + group_vol +
                ", group_curr=" + group_curr +
                ", batt_state=" + batt_state +
                ", batt_test_type=" + batt_test_type +
                ", batt_test_starttime=" + batt_test_starttime +
                ", batt_test_recordtime=" + batt_test_recordtime +
                ", batt_test_tlong=" + batt_test_tlong +
                ", batt_test_cap=" + batt_test_cap +
                ", batt_real_cap=" + batt_real_cap +
                ", batt_rest_cap=" + batt_rest_cap +
                ", batt_rest_power1_time=" + batt_rest_power1_time +
                ", batt_rest_power2_time=" + batt_rest_power2_time +
                ", note='" + note + '\'' +
                ", stationName='" + stationName + '\'' +
                ", stationName1='" + stationName1 + '\'' +
                ", stationName2='" + stationName2 + '\'' +
                ", stationName3='" + stationName3 + '\'' +
                ", stationName4='" + stationName4 + '\'' +
                ", stationName5='" + stationName5 + '\'' +
                ", stationId='" + stationId + '\'' +
                '}';
    }
}
src/main/java/com/fgkj/mapper/impl/Batt_dischargeMapper.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.fgkj.dto.Batt_discharge;
import com.fgkj.dto.User_inf;
import com.fgkj.util.ActionUtil;
import org.apache.ibatis.annotations.Insert;
import org.springframework.stereotype.Repository;
src/main/java/com/fgkj/mapper/impl/Batt_rtMapper.java
@@ -1,15 +1,23 @@
package com.fgkj.mapper.impl;
import java.util.LinkedList;
import java.util.Map;
/**
 * @Description :电池实时数据,同时需要电池组/电池时使用
 * @date 2020/09/04
 **/
import com.fgkj.dto.Batt_rtdata;
import com.fgkj.dto.Batt_rtstate;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
public interface Batt_rtMapper {
    public Map searchByGroupId(int groupId);
    @Select("select num,BattGroupId,batt_test_type,batt_state,online_vol,group_vol,group_curr,rec_datetime,batt_test_tlong,batt_test_cap,batt_real_cap,batt_rest_cap,batt_rest_power1_time,batt_rest_power2_time " +
            "from db_ram_db.tb_batt_rtstate where BattGroupId=#{battGroupId}")
    public LinkedList<Batt_rtstate> searchByGroupId(int groupId);
    @Select("select mon_num,mon_vol,mon_res,mon_tmp,mon_ser,mon_JH_curr from db_ram_db.tb_batt_rtdata where BattGroupId=#{battGroupId}")
    LinkedList<Batt_rtdata> searchByGroupId2(int groupId);
}
src/main/java/com/fgkj/services/Batt_dischargeService.java
@@ -2,9 +2,14 @@
import com.fgkj.dto.Batt_discharge;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_log;
import com.fgkj.mapper.UinfDaoFactory;
import com.fgkj.mapper.impl.Batt_dischargeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import java.util.List;
@@ -14,19 +19,41 @@
    @Resource
    private Batt_dischargeMapper mapper;
    @Resource
    private User_logService uservice;
    @Autowired
    DataSourceTransactionManager dataSourceTransactionManager;
    @Autowired
    TransactionDefinition transactionDefinition;
    ServiceModel model = new ServiceModel();
    
     //批量添加
    public ServiceModel add(List<Batt_discharge> listdischarge) {
        boolean bl = false;
        boolean bl = true;
        ServiceModel model = new ServiceModel();
        TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
        for (int i = 0; i < listdischarge.size(); i++) {
            bl = mapper.add(listdischarge.get(i));
            if (!bl) {
                continue;
            }
            Batt_discharge bdischarge = listdischarge.get(i);
            try {
                bl = mapper.add(bdischarge);
            } catch (Exception e) {
                e.printStackTrace();
                bl=false;
            }
            String msg = "添加" + bdischarge.getDev_id() + "机房至放电黑名单!";
            User_log ulog = UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
            uservice.add(ulog);
        }
        if(bl){
        if (bl) {
            dataSourceTransactionManager.commit(transactionStatus);
            model.setCode(1);
            model.setMsg("添加成功!");
        }else{
        } else {
            dataSourceTransactionManager.rollback(transactionStatus);
            model.setCode(0);
            model.setMsg("添加失败!");
        }
@@ -35,6 +62,7 @@
    //移除黑名单
    public ServiceModel del(List<Batt_discharge> listdischarge) {
        boolean bl = false;
        ServiceModel model = new ServiceModel();
        for (int i = 0; i < listdischarge.size(); i++) {
            bl = mapper.del(listdischarge.get(i));
        }
src/main/java/com/fgkj/services/Batt_maint_processService.java
@@ -54,7 +54,7 @@
    
    //3.1根据usr_id查所有的信息
    public ServiceModel serchByCondition(Batt_maint_process obj) {
        model=new ServiceModel();
        ServiceModel model=new ServiceModel();
        List<Batt_maint_process> list = mapper.serchByCondition(obj);
        /*for (Batt_maint_process u : list) {
            System.out.println(u);
src/main/java/com/fgkj/services/Batt_maintenance_infService.java
@@ -19,6 +19,7 @@
    private Batt_maintenance_infMapper mapper;;
    
    public ServiceModel searchAll(){
        ServiceModel model = new ServiceModel();
        List list =mapper.searchAll();
        if(list!=null && list.size()>0){
            model.setCode(1);
src/main/java/com/fgkj/services/Batt_rtService.java
@@ -1,32 +1,40 @@
package com.fgkj.services;
import com.fgkj.dto.Batt_rtdata;
import com.fgkj.dto.Batt_rtstate;
import com.fgkj.dto.ServiceModel;
import com.fgkj.mapper.impl.Batt_rtMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
 * @Description :电池实时数据,同时需要电池组/电池时使用
 * @date 2020/09/04
 **/
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
@Service
public class Batt_rtService {
    @Resource
    private Batt_rtMapper battRtDao;
    private ServiceModel serviceModel;
    public ServiceModel searchByGroupId(int groupId) {
        Map map =battRtDao.searchByGroupId(groupId);
        if(map!=null && !map.isEmpty()){
            serviceModel.code=1;
            serviceModel.data=map;
    public ServiceModel searchByGroupId(int battGroupId) {
        ServiceModel model = new ServiceModel();
        Map map = new HashMap();
        LinkedList<Batt_rtstate> listbt = battRtDao.searchByGroupId(battGroupId);
        if (listbt != null && !listbt.isEmpty()) {
            listbt.get(0);
            map.put("rtState", listbt);
//            System.out.println("listbt = " + listbt);
        }
        return serviceModel;
        LinkedList<Batt_rtdata> listbd = battRtDao.searchByGroupId2(battGroupId);
        if (listbd != null && !listbd.isEmpty()) {
            map.put("rtDatas", listbd);
//            System.out.println("listbd = " + listbd);
        }
        //将两个数据结果放置到map中
        if (!map.isEmpty()) {
            model.setCode(1);
            model.setData(map);
        }
        return model;
    }
}
src/main/java/com/fgkj/services/history/Batt_realdataService.java
@@ -1,8 +1,12 @@
package com.fgkj.services.history;
import com.fgkj.dto.Batt_Maint_Dealarm;
import com.fgkj.dto.Batt_realdata;
import com.fgkj.dto.PageBean;
import com.fgkj.dto.ServiceModel;
import com.fgkj.mapper.impl.history.Batt_realdataMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -14,14 +18,20 @@
    private Batt_realdataMapper mapper;
    
     //按照时间倒序查出具体电池组的所有信息
    public ServiceModel serchByCondition(Batt_realdata realData) {
         ServiceModel model=new ServiceModel();
        List list=mapper.serchByCondition(realData);
        if(list!=null&&list.size()>0){
    public ServiceModel serchByCondition(Batt_realdata realData,int pageNum,int pageSize) {
        //分页
        PageBean pageBean = new PageBean();
        pageBean.setPageSize(pageSize);
        pageBean.setPageNum(pageNum);
        PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize(), true);
        ServiceModel model = new ServiceModel();
        List<Batt_realdata> list = mapper.serchByCondition(realData);
        if (list != null && list.size() > 0) {
            PageInfo<Batt_realdata> pageInfo = new PageInfo<>(list);
            model.setCode(1);
            model.setData(list);
            model.setData(pageInfo);
            model.setMsg("查询成功!");
        }else{
        } else {
            model.setCode(0);
            model.setMsg("查询失败!");
        }
src/main/resources/mapper/BattDischargeMapper.xml
@@ -138,7 +138,9 @@
    }
    -->
    <insert id="add"></insert>
    <insert id="add">
        insert into web_site.tb_batt_discharge(uid,dev_id,record_time) values(#{uid},#{dev_id},#{record_time})
    </insert>
    <update id="update"></update>
    <delete id="del"></delete>
    <select id="searchAll" resultType="java.util.List"></select>
src/main/resources/mapper/BattRtMapper.xml
@@ -71,5 +71,5 @@
    }
    -->
    <select id="searchByGroupId" resultType="java.util.Map"></select>
<!--    <select id="searchByGroupId" resultType="java.util.Map"></select>-->
</mapper>