lxw
2023-04-25 c3ef8e0cd1acda0d9efcbc954f91b46e5513619f
国际化最后一次核容终止原因
6个文件已修改
192 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/BatttestdataInfController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/BattTestData.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BatttestdataInfService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/RealTimeWebsocket.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/i18n/message_en_US.properties 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/i18n/message_zh_CN.properties 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/BatttestdataInfController.java
@@ -4,6 +4,7 @@
import com.whyc.dto.paramter.GroupTestCapPar;
import com.whyc.pojo.Battinf;
import com.whyc.service.BatttestdataInfService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@@ -31,7 +32,8 @@
    @PostMapping("/searchBattLastHrDataById")
    @ApiOperation(value = "最后一次核容放电数据")
    public Response searchBattLastHrDataById(@RequestParam int battGroupId, @RequestParam int devId) {
        return service.searchBattLastHrDataById(battGroupId, devId);
        String lang = ActionUtil.getLang();
        return service.searchBattLastHrDataById(battGroupId, devId, lang);
    }
    @PostMapping("/searchBattLife")
src/main/java/com/whyc/dto/BattTestData.java
@@ -688,7 +688,7 @@
        return stop_type;
    }
    // FBO4831放电终止原因
    /*// FBO4831放电终止原因
    public static String getStopType_4831(int stop_type_t) {
        String stop_type = "其他";
        switch (stop_type_t) {
@@ -776,6 +776,95 @@
                break;
        }
        return stop_type;
    }*/
    // FBO4831放电终止原因
    public static String getStopType_4831(int stop_type_t) {
        String stop_type = "NONE";
        switch (stop_type_t) {
            // 放电停止原因
            case 0:
                stop_type = "ManualStop";
                break;
            case 1:
                stop_type = "DischargeTimeTo";
                break;
            case 2:
                stop_type = "DischargeCapacityTo";
                break;
            case 3:
                stop_type = "LowerLimitOfMonomerTo";
                break;
            case 4:
                stop_type = "GroupEndLowerLimitTo";
                break;
            case 5:
                stop_type = "MainsPowerOutage";
                break;
            case 6:
                stop_type = "StorageException";
                break;
            case 7:
                stop_type = "AbnormalTemperature";
                break;
            case 8:
                stop_type = "Discharging";
                break;
            case 9:
                stop_type = "ManualPause";
                break;
            case 10:
                stop_type = "AutoPause";
                break;
            case 11:
                stop_type = "AbnormalCommunication";
                break;
            case 12:
                stop_type = "AbnormalCurrent";
                break;
            case 13:
                stop_type = "UpperLimitOfPressureDifferenceTo";
                break;
            case 14:
                stop_type = "AbnormalGroupTerminalVoltage";
                break;
            case 15:
                stop_type = "FanAbnormal";
                break;
            case 16:
                stop_type = "RectifierVoltageAbnormality";
                break;
            case 17:
                stop_type = "IGBTAbnormality";
                break;
            case 18:
                stop_type = "AbnormalAuxiliaryPowerSupply";
                break;
            case 19:
                stop_type = "CSVFileIsTooLargePleaseDeleteIt";
                break;
            case 20:
                stop_type = "AbnormalSlaveCommunication";
                break;
            case 21:
                stop_type = "AbnormalSlaveState";
                break;
            case 22:
                stop_type = "HostCommunicationAbnormality";
                break;
            case 23:
                stop_type = "EmergencyStop";
                break;
            case 24:
                stop_type = "HardwareParallelFailure";
                break;
            case 25:
                stop_type = "FrequentOperations";
                break;
            case 26:
                stop_type = "NONE";
                break;
        }
        return stop_type;
    }
    // FBO4815放电终止原因
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -10,6 +10,7 @@
import com.whyc.mapper.*;
import com.whyc.pojo.*;
import com.whyc.util.ActionUtil;
import com.whyc.util.MessageUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -69,7 +70,7 @@
                    tinf.setTestStoptypeReason(BattTestData.getStopType_4830(tinf.getTestStoptype()));
                } else if (fbsDeviceId / 100000 == 4831) {
                    //FBO4831设备放电停止原因
                    tinf.setTestStoptypeReason(BattTestData.getStopType_4831(tinf.getTestStoptype()));
                    tinf.setTestStoptypeReason(MessageUtils.getMessage(BattTestData.getStopType_4831(tinf.getTestStoptype())));
                } else if (fbsDeviceId / 100000 == 4815) {
                    //FBO4815设备放电停止原因
                    tinf.setTestStoptypeReason(BattTestData.getStopType_4815(tinf.getTestStoptype()));
@@ -85,7 +86,7 @@
    }
    //最后一次核容放电数据
    public Response searchBattLastHrDataById(int battGroupId, int devId) {
    public Response searchBattLastHrDataById(int battGroupId, int devId, String lang) {
        PageHelper.startPage(1, 1);
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("BattGroupId", battGroupId);
@@ -120,7 +121,7 @@
                tinf.setTestStoptypeReason(BattTestData.getStopType_4830(tinf.getTestStoptype()));
            } else if (devId / 100000 == 4831) {
                // FBO4830设备放电停止原因
                tinf.setTestStoptypeReason(BattTestData.getStopType_4831(tinf.getTestStoptype()));
                tinf.setTestStoptypeReason(MessageUtils.getMessageSocket(BattTestData.getStopType_4831(tinf.getTestStoptype()), lang));
            } else if (devId / 100000 == 4815) {
                //FBO4815设备放电停止原因
                tinf.setTestStoptypeReason(BattTestData.getStopType_4815(tinf.getTestStoptype()));
src/main/java/com/whyc/webSocket/RealTimeWebsocket.java
@@ -1,5 +1,6 @@
package com.whyc.webSocket;
import com.whyc.config.WebSocketConfig;
import com.whyc.dto.DeviceTypeDTO;
import com.whyc.dto.Response;
import com.whyc.dto.paramter.RealTimePar;
@@ -10,6 +11,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpSession;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.util.HashMap;
@@ -17,7 +19,7 @@
import java.util.Map;
@Component
@ServerEndpoint(value = "/RealTime",encoders = WebSocketEncoder.class)
@ServerEndpoint(value = "/RealTime", encoders = WebSocketEncoder.class, configurator = WebSocketConfig.class)
public class RealTimeWebsocket {
    private volatile Thread thread;
@@ -74,6 +76,8 @@
    private static Fbs9140TopologyStateService fbs9140TopologyStateService;
    private Session session;
    private HttpSession httpSession;
    @Autowired
    public void setService(BattRtstateService rtstateservice) {
@@ -179,14 +183,16 @@
    }
    @OnOpen
    public void onOpen(Session session) {
    public void onOpen(Session session, EndpointConfig config) {
        this.session = session;
        this.httpSession = (HttpSession) config.getUserProperties().get("httpSession");
    }
    @OnMessage
    public void onMessage(Session session, String message) {
        RealTimePar realTimePar = ActionUtil.getGson().fromJson(message, RealTimePar.class);
        realTimePar.setDevType(realTimePar.getDevId() / 100000);
        String lang = (String) this.httpSession.getAttribute("lang");
        thread = new Thread("Thread_RealTime") {
            @Override
            public void run() {
@@ -197,7 +203,7 @@
                        Response res = new Response();
                        switch (realTimePar.getPageType()) {
                            case "standard":
                                res = getStandard(realTimePar);
                                res = getStandard(realTimePar, lang);
                                break;
                            case "a059":
                                res = getA059(realTimePar);
@@ -236,10 +242,10 @@
                                res = getKgdy(realTimePar);
                                break;
                            case "paralle":
                                res = getParalle(realTimePar);
                                res = getParalle(realTimePar, lang);
                                break;
                            case "paralle9149":
                                res = getParalle9149(realTimePar);
                                res = getParalle9149(realTimePar, lang);
                                break;
                        }
                        //实时显示调整,增加电池数量,标称单体电压,铅酸还是锂电,放置于返回结果的data2
@@ -386,7 +392,7 @@
    }
    //并联电源的实时页面信息
    public Response getParalle(RealTimePar realTimePar) {
    public Response getParalle(RealTimePar realTimePar, String lang) {
        Map<String, Response> res = new HashMap<>();
        //查询fbs9100信息
        Response f9100stateRes = f9100service.serchContactorState(realTimePar.getDevId());
@@ -407,13 +413,13 @@
        Response rsalarmRes = rsalarmService.getInfo(realTimePar.getBattGroupId());
        res.put("rsalarm", rsalarmRes);
        //最后一次核容放电数据
        Response tinfRes = batttestDataInfService.searchBattLastHrDataById(realTimePar.getBattGroupId(), realTimePar.getDevId());
        Response tinfRes = batttestDataInfService.searchBattLastHrDataById(realTimePar.getBattGroupId(), realTimePar.getDevId(), lang);
        res.put("tinfdata", tinfRes);
        return new Response().set(1, res);
    }
    //并联电源的实时页面信息
    public Response getParalle9149(RealTimePar realTimePar) {
    public Response getParalle9149(RealTimePar realTimePar, String lang) {
        Map<String, Response> res = new HashMap<>();
        //查询fbs9100信息
        Response f9100stateRes = f9100service.serchContactorState(realTimePar.getDevId());
@@ -434,13 +440,13 @@
        Response rsalarmRes = rsalarmService.getInfo(realTimePar.getBattGroupId());
        res.put("rsalarm", rsalarmRes);
        //最后一次核容放电数据
        Response tinfRes = batttestDataInfService.searchBattLastHrDataById(realTimePar.getBattGroupId(), realTimePar.getDevId());
        Response tinfRes = batttestDataInfService.searchBattLastHrDataById(realTimePar.getBattGroupId(), realTimePar.getDevId(), lang);
        res.put("tinfdata", tinfRes);
        return new Response().set(1, res);
    }
    //标准的实时页面信息
    public Response getStandard(RealTimePar realTimePar) {
    public Response getStandard(RealTimePar realTimePar, String lang) {
        Map<String, Response> res = new HashMap<>();
        if (realTimePar.getDevType() == DeviceTypeDTO.DEVICELD94019) {//ld-9
            //ld-9数据
@@ -486,7 +492,7 @@
            res.put("li9130", li9130Res);
        }
        //最后一次核容放电数据
        Response tinfRes = batttestDataInfService.searchBattLastHrDataById(realTimePar.getBattGroupId(), realTimePar.getDevId());
        Response tinfRes = batttestDataInfService.searchBattLastHrDataById(realTimePar.getBattGroupId(), realTimePar.getDevId(), lang);
        res.put("tinfdata", tinfRes);
        return new Response().set(1, res);
    }
src/main/resources/i18n/message_en_US.properties
@@ -34,3 +34,29 @@
HighCapacityReplaceCapacity=High Capacity Replace Capacity
BatteryPositiveElectrodeLeakage=Battery Positive Electrode Leakage
BatteryNegativeElectrodeLeakage=Battery Negative Electrode Leakage
ManualStop=Manual stop
DischargeTimeTo=Discharge time to
DischargeCapacityTo=Discharge capacity to
LowerLimitOfMonomerTo=Lower limit of monomer to
GroupEndLowerLimitTo=Group end lower limit to
MainsPowerOutage=Mains power outage
StorageException=Storage exception
AbnormalTemperature=Abnormal temperature
Discharging=Discharging
ManualPause=Manual pause
AutoPause=Auto pause
AbnormalCommunication=Abnormal communication
AbnormalCurrent=Abnormal current
UpperLimitOfPressureDifferenceTo=Upper limit of pressure difference to
AbnormalGroupTerminalVoltage=Abnormal group terminal voltage
FanAbnormal=Fan abnormal
RectifierVoltageAbnormality=Rectifier voltage abnormality
IGBTAbnormality=IGBT abnormality
AbnormalAuxiliaryPowerSupply=Abnormal auxiliary power supply
CSVFileIsTooLargePleaseDeleteIt=CSV file is too large,Please delete it
AbnormalSlaveCommunication=Abnormal slave communication
AbnormalSlaveState=Abnormal slave state
HostCommunicationAbnormality=Host communication abnormality
EmergencyStop=Emergency stop
HardwareParallelFailure=Hardware parallel failure
FrequentOperations=Frequent operations
src/main/resources/i18n/message_zh_CN.properties
@@ -34,3 +34,39 @@
HighCapacityReplaceCapacity=\u5BB9\u91CF\u66F4\u6362\u5BB9\u91CF\u9AD8
BatteryPositiveElectrodeLeakage=\u7535\u6C60\u6B63\u6781\u6F0F\u6DB2
BatteryNegativeElectrodeLeakage=\u7535\u6C60\u8D1F\u6781\u6F0F\u6DB2
ManualStop=\u624B\u52A8\u505C\u6B62
DischargeTimeTo=\u653E\u7535\u65F6\u95F4\u5230
DischargeCapacityTo=\u653E\u7535\u5BB9\u91CF\u5230
LowerLimitOfMonomerTo=\u5355\u4F53\u4E0B\u9650\u5230
GroupEndLowerLimitTo=\u7EC4\u7AEF\u4E0B\u9650\u5230
MainsPowerOutage=\u5E02\u7535\u4E2D\u65AD
StorageException=\u5B58\u50A8\u5F02\u5E38
AbnormalTemperature=\u6E29\u5EA6\u5F02\u5E38
Discharging=\u6B63\u5728\u653E\u7535
ManualPause=\u624B\u52A8\u6682\u505C
AutoPause=\u81EA\u52A8\u6682\u505C
AbnormalCommunication=\u901A\u4FE1\u5F02\u5E38
AbnormalCurrent=\u7535\u6D41\u5F02\u5E38
UpperLimitOfPressureDifferenceTo=\u538B\u5DEE\u4E0A\u9650\u5230
AbnormalGroupTerminalVoltage=\u7EC4\u7AEF\u7535\u538B\u5F02\u5E38
FanAbnormal=\u98CE\u6247\u5F02\u5E38
RectifierVoltageAbnormality=\u6574\u6D41\u5668\u7535\u538B\u5F02\u5E38
IGBTAbnormality=IGBT\u5F02\u5E38
AbnormalAuxiliaryPowerSupply=\u8F85\u52A9\u7535\u6E90\u5F02\u5E38
CSVFileIsTooLargePleaseDeleteIt=CSV\u6587\u4EF6\u592A\u5927\uFF0C\u8BF7\u5220\u9664
AbnormalSlaveCommunication=\u4ECE\u673A\u901A\u4FE1\u5F02\u5E38
AbnormalSlaveState=\u4ECE\u673A\u72B6\u6001\u5F02\u5E38
HostCommunicationAbnormality=\u4E3B\u673A\u901A\u4FE1\u5F02\u5E38
EmergencyStop=\u7D27\u6025\u505C\u6B62
HardwareParallelFailure=\u786C\u4EF6\u5E76\u673A\u5931\u8D25
FrequentOperations=\u64CD\u4F5C\u9891\u7E41