whyclxw
2025-05-08 4c0f551e508bce3e853737a57a7cb09c0fbbb56f
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.whyc.service;
 
import com.whyc.dto.BattMaintDealarm;
import com.whyc.dto.Response;
import com.whyc.dto.ServiceModel;
import com.whyc.mapper.BattMaintDealarmMapper;
import com.whyc.mapper.BattParamLowMapper;
import com.whyc.pojo.BattParamLow;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
@Service
public class BattMaintService {
 
    @Resource
    private BattMaintDealarmMapper mapper;
 
    @Resource
    private BattParamLowMapper battParamLowMapper;
 
    /**
     * 1.3根据battgroupid和mon_num的值查出测试信息
     * 或者根据battgroupid和mon_num得到内阻信息(新)
     *
     * @param bmd
     * @return
     */
    public Response<Object> serchMonNum(BattMaintDealarm bmd) {
 
        List<BattMaintDealarm> list = null;   //TODO dao.serchByCondition(bmd) 对应 实现
//        dao.serchByCondition(bmd);
//
        BattParamLow lowCA=new BattParamLow();
        lowCA.setLowType(2);
        lowCA.setLowNametype(2);//电容告警
        BattParamLow lowCH=new BattParamLow();
        lowCH.setLowType(2);
        lowCH.setLowNametype(3);//电容更换
        List<BattParamLow> listCA = battParamLowMapper.serchByLow(lowCA);
        List<BattParamLow> listCH = battParamLowMapper.serchByLow(lowCH);
        Float percentCA = listCA.get(0).getLowValue();
        Float percentCH = listCH.get(0).getLowValue();
        //电导基准/维护建议/电导分析值
        BattParamLow lowRA=new BattParamLow();
        lowRA.setLowType(3);
        lowRA.setLowNametype(2);//电导告警
        BattParamLow lowRH=new BattParamLow();
        lowRH.setLowType(3);
        lowRH.setLowNametype(3);//电导更换
 
        //电导
        List<BattParamLow> listRA = battParamLowMapper.serchByLow(lowRA);
        List<BattParamLow> listRH = battParamLowMapper.serchByLow(lowRH);
        Float percentRA = listRA.get(0).getLowValue();
        Float percentRH = listRH.get(0).getLowValue();
        int methodRM=listRA.get(0).getLowMethod();  //分析方式
        ServiceModel model=new ServiceModel();
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setMsg("查询成功!");
            model.setData(list);
            model.setLowCA(percentCA);
            model.setLowCH(percentCH);
            model.setLowRA(percentRA);
            model.setLowRH(percentRH);
            model.setNewsum(methodRM);//分析方式1:平均值;0:标称值
        }else{
            model.setMsg("查询失败!");
            model.setCode(0);
        }
 
        model.setCode(1);
        model.setMsg("查询成功!");
        model.setLowCA(percentCA);
        model.setLowCH(percentCH);
        model.setLowRA(percentRA);
        model.setLowRH(percentRH);
        return new Response().set(1,model);
    }
}